* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Gradient on the root so it paints behind the canvas, not over it. */
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0b0b14 100%);
}

html,
body {
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #f5f5f7;
  scroll-behavior: smooth;
}

/* Fixed full-screen canvas that stays behind every section as you scroll. */
#cube-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---- Top navigation / brand ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid transparent;
  transition: padding 0.3s ease, background 0.3s ease,
    backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Glass background once the page is scrolled away from the top. */
.nav.scrolled {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  background: rgba(13, 13, 22, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f5f5f7;
  text-decoration: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

/* Abstracted cube mark (the logo) next to the wordmark. */
.brand-mark {
  width: 26px;
  height: 26px;
  background: url("favicon.svg") center / contain no-repeat;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.nav-links a {
  color: #f5f5f7;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.75;
  transition: opacity 0.2s ease;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.nav-links a:hover {
  opacity: 1;
}

/* Hamburger button — hidden on desktop, shown on small screens. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #f5f5f7;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate bars into an X when the menu is open. */
.nav.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* main sits above the fixed cube canvas */
main {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.7;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.hero .tagline {
  margin-top: 1rem;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  opacity: 0.85;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.cta {
  margin-top: 2.25rem;
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #f5f5f7;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

/* ---- Generic section + floating panel ---- */
.section {
  padding: clamp(4rem, 10vw, 8rem) 1.5rem;
  display: flex;
  justify-content: center;
}

.section-inner {
  width: min(1100px, 100%);
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 24px;
  background: rgba(13, 13, 22, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.section-inner h2 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-lead {
  max-width: 620px;
  margin: 1rem auto 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  opacity: 0.8;
}

/* ---- Service cards ---- */
.cards {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  text-align: left;
}

.card {
  padding: 1.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
  /* Lay out icon + title on one row; the description wraps to a full row below. */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.7rem;
}

.card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
}

.card-icon {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: #f5f5f7;
  opacity: 0.85;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  /* Fill the row beside the icon and wrap the title text instead of bumping
     the whole heading onto its own flex line. */
  flex: 1 1 0;
  min-width: 0;
}

.card p {
  flex-basis: 100%;
  margin-top: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.78;
}

/* ---- Work cards ---- */
.card-client {
  font-size: 0.75rem !important;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55 !important;
  margin-bottom: 0.6rem;
}

/* ---- Tag pills (work + tech) ---- */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.tags li {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.9;
}

/* ---- Tech stack groups ---- */
.tech-groups {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.75rem;
  text-align: left;
}

.tech-group h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.9rem;
}

.tech-group .tags {
  margin-top: 0;
}

/* ---- About ---- */
.about-inner {
  text-align: center;
}

.about-inner .section-lead + .section-lead {
  margin-top: 1.25rem;
}

/* ---- Contact ---- */
.cta--solid {
  margin-top: 2rem;
  background: #f5f5f7;
  color: #0b0b14;
  border-color: transparent;
  font-size: 1.05rem;
}

.cta--solid:hover {
  background: #ffffff;
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 11, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
}

.footer-legal {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  /* Swap the inline links for a hamburger-triggered dropdown. */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: clamp(1.25rem, 4vw, 3rem);
    right: clamp(1.25rem, 4vw, 3rem);
    margin-top: 0.6rem;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem;
    border-radius: 16px;
    background: rgba(13, 13, 22, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    /* Hidden until .nav.open; animates in. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease,
      visibility 0.25s ease;
  }

  .nav.open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 1.05rem;
    opacity: 0.9;
    text-shadow: none;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  /* A touch more breathing room inside panels on small screens. */
  .section {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .section-inner {
    padding: 1.6rem 1.35rem;
    border-radius: 20px;
  }

  /* Stack and center the footer rather than spreading it edge to edge. */
  .footer {
    justify-content: center;
    text-align: center;
  }
}
