/* ============================================================================
   layout.css — sections, components and responsive rules.
   Desktop matches Figma frame 40-3 (1440). At <=768px the mobile block takes
   over and matches frame 204-431 (390).
   ========================================================================= */

.wrap {
  position: relative; z-index: 2;
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-4xl); }

.section__head { max-width: 52ch; }
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: calc(var(--lh-h2) / var(--fs-h2));
  letter-spacing: var(--ls-h2);
  margin-top: var(--space-sm);
}
.section__sub {
  color: var(--text-muted);
  margin-top: var(--space-sm);
  max-width: 56ch;
}

/* ── buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  line-height: calc(var(--lh-label) / var(--fs-label));
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 11px 11px 11px var(--space-md);
  transition:
    transform    var(--dur-base) var(--ease),
    background   var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease),
    box-shadow   var(--dur-base) var(--ease);
}
.btn:active { transform: scale(0.98); }

/* Circular arrow chip inside a button. */
.btn__dot {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--radius-full);
  display: grid; place-items: center;
  font-size: 15px; line-height: 1;
  transition: transform var(--dur-base) var(--ease);
}
.btn:hover .btn__dot { transform: translateX(3px); }

.btn--primary { background: var(--text-primary); color: var(--text-inverse); }
.btn--primary:hover { background: #fff; box-shadow: var(--glow-cta); }
.btn--primary .btn__dot { background: var(--text-inverse); color: var(--text-primary); }

.btn--ghost {
  background: var(--surface-glass-shell);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(45,226,230,0.45);
  box-shadow: var(--glow-cta);            /* cyan glow on hover, per brief */
}
.btn--ghost .btn__dot { background: var(--surface-glass-core); color: var(--text-primary); }

/* ── fixed frosted-glass nav ──────────────────────────────────────────── */

.nav {
  position: fixed; inset: 22px 0 auto; z-index: 40;
  display: flex; justify-content: center;
  pointer-events: none;                    /* only the pill is clickable */
}
.nav__pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--space-md);
  padding: 9px 9px 9px var(--space-md);
  border-radius: var(--radius-full);
  background: rgba(12,12,18,0.55);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--inset-top-hairline), var(--shadow-pill);
}
.nav__brand {
  font-family: var(--font-mono);
  font-size: var(--fs-nav);
  letter-spacing: var(--ls-nav);
  color: var(--text-primary);
  text-decoration: none;
}
.nav__brand b { color: var(--accent-cyan); }

.nav__links { display: flex; gap: var(--space-md); }
.nav__links a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  padding-block: 2px;
  transition: color var(--dur-fast) var(--ease);
}
.nav__links a:hover,
.nav__links a[aria-current="true"] { color: var(--text-primary); }
/* underline grows from the left on hover / when the section is in view */
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 1px; width: 100%;
  background: var(--accent-cyan);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.nav__links a:hover::after,
.nav__links a[aria-current="true"]::after { transform: scaleX(1); }

.nav__cta {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  padding: 8px 8px 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-strong);
  color: var(--text-primary); text-decoration: none;
  font-size: var(--fs-body-sm); font-weight: 600;
  transition: background var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              transform  var(--dur-base) var(--ease);
}
.nav__cta:hover { background: rgba(255,255,255,0.10); box-shadow: var(--glow-cta); }
.nav__cta:active { transform: scale(0.97); }
.nav__cta .btn__dot {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  color: var(--text-inverse);
}
.nav__cta:hover .btn__dot { transform: translateX(2px); }

/* ── hero ─────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 445px;   /* Figma: reel is 445px wide */
  align-items: center;
  gap: var(--space-2xl);
  padding-top: 140px;
  padding-bottom: var(--space-2xl);
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  width: fit-content;
  padding: 7px var(--space-sm);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-hairline);
  background: var(--surface-glass-shell);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-top: var(--space-md);
  /* brushed-chrome fill, drifting slowly */
  background: linear-gradient(180deg, #fff 0%, #c8c8d4 32%, #6f6f7e 55%, #f2f2f7 72%, #9a9aa8 100%);
  background-size: 100% 220%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 30px rgba(139,92,246,0.18));
  animation: chrome 7s var(--ease) infinite alternate;
}
@keyframes chrome { to { background-position: 0 100% } }

.hero__lead { max-width: 40ch; margin-top: var(--space-lg); }

.hero__actions {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.hero__proof {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: var(--space-xl);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-hairline);
}
.proof__k {
  display: block;
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-h3); line-height: 1.1;
  letter-spacing: var(--ls-h3);
}
.proof__l { display: block; margin-top: var(--space-3xs); }

/* ── hero showreel ────────────────────────────────────────────────────
   One markup, two behaviours. Desktop: absolutely-stacked crossfade with
   Ken Burns. Mobile (.is-mobile): the track becomes a flex row that slides
   horizontally and loops. showreel.js flips the class on a media query.  */

.reel {
  position: relative;
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: var(--radius-2xl);
  background: var(--bg-raised);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-reel);
}
/* violet-to-cyan gradient hairline border */
.reel::after {
  content: ""; position: absolute; inset: 0; z-index: 5;
  border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(140deg, var(--accent-violet), var(--accent-cyan) 55%, var(--border-hairline));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* Label sits left; counter + pause button group to the right. */
.reel__top {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: 18px var(--space-md) var(--space-xs);
  z-index: 4;
}
.reel__top .reel__label { margin-right: auto; }
.reel__label {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em; color: var(--text-secondary);
}
.reel__counter {
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  letter-spacing: 0.1em; color: var(--text-muted);
}
/* WCAG 2.2.2 pause/play control — injected by showreel.js */
.reel__pause {
  margin-left: var(--space-2xs);
  width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 8px; line-height: 1; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.reel__pause:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

.reel__slot {
  position: relative; flex: 1;
  margin-inline: 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-inset);
}

.reel__track { position: absolute; inset: 0; }

.reel__slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--fade-seconds) var(--ease);
  will-change: opacity;
  /* gradient stand-in shows through wherever a real screenshot is missing */
  background: linear-gradient(140deg, #2a1f4d, #0b2b30);
}
.reel__slide:nth-child(2n) { background: linear-gradient(140deg, #102a2e, #241844); }
.reel__slide:nth-child(3n) { background: linear-gradient(140deg, #2b1d46, #0e2a2f); }
.reel__slide.is-active { opacity: 1; }

.reel__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.06);
}
/* Ken Burns runs only on the visible desktop slide */
.reel__slide.is-active .reel__img { animation: ken var(--slide-seconds) linear forwards; }
@keyframes ken {
  from { transform: scale(1.06) translate(0, 0) }
  to   { transform: scale(1.15) translate(-2%, -2%) }
}

.reel__scrim {
  position: absolute; inset: auto 0 0; height: 52%;
  background: linear-gradient(transparent, var(--bg-base));
  z-index: 2; pointer-events: none;
}
.reel__caption { position: absolute; inset: auto 0 0; z-index: 3; padding: var(--space-md); }
.reel__type {
  font-family: var(--font-mono); font-size: var(--fs-tag);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-cyan); margin-bottom: var(--space-3xs);
}
.reel__name {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-title); line-height: calc(var(--lh-title) / var(--fs-title));
  letter-spacing: var(--ls-title); color: var(--text-primary);
}
.reel__meta {
  font-family: var(--font-mono); font-size: var(--fs-tag);
  color: var(--text-muted); margin-top: 5px;
}
.reel__type, .reel__name, .reel__meta { transition: opacity var(--dur-base) var(--ease); }
.reel__caption.is-swapping .reel__type,
.reel__caption.is-swapping .reel__name,
.reel__caption.is-swapping .reel__meta { opacity: 0; }

.reel__bars { display: flex; gap: 6px; padding: 14px var(--space-md) var(--space-md); z-index: 4; }
.reel__bar {
  flex: 1; height: 3px; padding: 0;
  border: 0; border-radius: 2px;
  background: var(--border-strong);
  overflow: hidden; cursor: pointer;
}
.reel__fill {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan));
}
.reel__bar.is-done .reel__fill { width: 100%; }
.reel__bar.is-active .reel__fill { animation: fill var(--slide-seconds) linear forwards; }
@keyframes fill { from { width: 0 } to { width: 100% } }

/* hover / focus pause freezes Ken Burns, the progress fill and advancement */
.reel.is-paused .reel__slide.is-active .reel__img,
.reel.is-paused .reel__bar.is-active .reel__fill { animation-play-state: paused; }

/* — mobile mode: horizontal looping track — */
.reel.is-mobile .reel__track {
  display: flex;
  width: 100%; height: 100%;
  transition: transform var(--dur-base) var(--ease);
  will-change: transform;
}
.reel.is-mobile .reel__slide {
  position: relative; inset: auto;
  flex: 0 0 100%;
  opacity: 1;
}
.reel.is-mobile .reel__img { transform: none; animation: none; }

/* reduced motion: first frame only, no autoplay, no Ken Burns */
@media (prefers-reduced-motion: reduce) {
  .reel__slide.is-active .reel__img { animation: none; transform: scale(1.02); }
  .reel__bar.is-active .reel__fill { animation: none; width: 100%; }
}

/* ── services ─────────────────────────────────────────────────────────── */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: var(--space-xl);
}
.svc-grid > :nth-child(-n + 2) { grid-column: span 6; }   /* 01, 02 */
.svc-grid > :nth-child(n + 3)  { grid-column: span 4; }   /* 03, 04, 05 */

/* double-bezel card: outer glass shell + inner core */
.card {
  background: var(--surface-glass-shell);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 7px; height: 100%;
}
.card__core {
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-lg);
  padding: 30px 30px 34px;
  height: 100%;
  position: relative; overflow: hidden;
  box-shadow: var(--inset-top-hairline);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.card:hover .card__core,
.card:focus-within .card__core {
  transform: translateY(-4px);
  box-shadow: var(--inset-top-hairline), var(--shadow-lift);
}

.svc__num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--text-muted); }
.svc__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-h3); line-height: calc(var(--lh-h3) / var(--fs-h3));
  letter-spacing: var(--ls-h3);
  margin: var(--space-sm) 0 var(--space-2xs);
}
.svc__text { color: var(--text-muted); }
.svc .tag-row { margin-top: var(--space-md); }

/* signature accent on the SEO / AI-Search card */
.svc--seo { border-color: rgba(45,226,230,0.45); }
.svc--seo .card__core {
  background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(45,226,230,0.08));
}
.svc--seo .svc__title {
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.badge {
  position: absolute; top: 22px; right: 22px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-inverse); background: var(--accent-cyan);
  padding: 4px 9px; border-radius: var(--radius-full);
}

/* ── selected work ────────────────────────────────────────────────────── */

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
  align-items: start;
}
.work-grid__side { display: grid; gap: var(--space-md); }

/* shared media block for every case / tile */
.media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
}
.media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* Letter watermark stands in until a real screenshot lands in /assets.
   main.js removes .media--empty as soon as an image actually loads. */
.media--empty::before {
  content: attr(data-letter);
  position: absolute; right: 6%; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-weight: 700; font-size: 8rem; line-height: 1;
  color: rgba(255,255,255,0.85); mix-blend-mode: overlay; pointer-events: none;
}
.media__chip {
  position: absolute; top: var(--space-sm); left: var(--space-sm); z-index: 2;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-color: var(--border-strong); color: var(--text-primary);
}

/* featured case */
.case {
  background: var(--surface-glass-shell);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-2xl);
  padding: 9px;
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.case:hover, .case:focus-within { transform: translateY(-4px); border-color: var(--border-strong); }
.case__core {
  background: linear-gradient(180deg, rgba(12,12,18,0.6), rgba(6,6,8,0.4));
  border-radius: var(--radius-xl);
  box-shadow: var(--inset-top-hairline);
  overflow: hidden;
}
.case__body { padding: var(--space-lg); }
.case__name {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.75rem, 2.4vw, 2.125rem);
  line-height: 1.1; letter-spacing: var(--ls-h2);
}
.case__text { color: var(--text-secondary); margin-top: var(--space-2xs); max-width: 60ch; }

/* Task / Insight / Solution / Result */
.case__steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.step__k {
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-cyan); margin-bottom: var(--space-2xs);
}
.step__t { font-size: var(--fs-body-sm); line-height: 1.5; color: var(--text-secondary); }

.case__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-sm); margin-top: var(--space-lg);
}

/* work tile */
.tile {
  display: block; text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}
.tile .media { aspect-ratio: 16 / 9; }
.tile__body { padding: var(--space-md); }
.tile__name {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-title); line-height: calc(var(--lh-title) / var(--fs-title));
  letter-spacing: var(--ls-title);
}
.tile__text { color: var(--text-muted); font-size: var(--fs-body-sm); margin-top: var(--space-3xs); }
.tile .tag-row { margin-top: var(--space-xs); }

.more-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md); margin-top: var(--space-sm);
}
.work__more-label { margin-top: var(--space-xl); }
.work__cta { display: flex; justify-content: center; margin-top: var(--space-xl); }

/* ── contact ──────────────────────────────────────────────────────────── */

.contact { text-align: center; padding: var(--space-4xl) 0 var(--space-3xl); }
.contact__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-display); line-height: 1.02; letter-spacing: var(--ls-h2);
}
.contact__text { color: var(--text-muted); margin: var(--space-md) auto 0; max-width: 46ch; }
.contact__actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-sm); margin-top: var(--space-xl);
}

/* ── footer ───────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border-hairline);
  padding-block: var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-sm);
}
.footer__copy {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.footer__social { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.footer__social a {
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.footer__social a:hover {
  color: var(--text-primary);
  border-color: rgba(45,226,230,0.45);
  background: rgba(45,226,230,0.08);
}

/* ============================================================================
   RESPONSIVE
   ========================================================================= */

/* tablet — hero to one column, work to one column, tiles to two */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding-top: 130px; }
  .hero__reel { max-width: 445px; }
  .work-grid { grid-template-columns: 1fr; }
  .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case__steps { grid-template-columns: repeat(2, 1fr); }
}

/* ── <=768px — Figma frame 204-431 "Landing / Mobile" (390) ──────────── */
@media (max-width: 768px) {
  :root { --nav-h: 76px; }

  .section { padding-block: var(--space-3xl); }

  /* compact nav: brand + CTA only */
  .nav { inset: var(--space-sm) 0 auto; }
  .nav__pill { width: calc(100% - var(--space-lg)); justify-content: space-between; gap: var(--space-sm); }
  .nav__links { display: none; }

  .hero { min-height: auto; padding-top: 108px; gap: var(--space-xl); }
  /* Figma mobile drops the eyebrow to the three disciplines only… */
  .hero__eyebrow-tail { display: none; }
  /* …and steps the lead down from Body/Lead (22) to Body/Base (16). */
  .hero__lead {
    max-width: none;
    font-size: var(--fs-body);
    line-height: calc(var(--lh-body) / var(--fs-body));
  }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
  .hero__proof { gap: var(--space-lg) var(--space-xl); }

  /* full-bleed showreel: escape the .wrap gutter, edge to edge */
  .hero__reel {
    max-width: none;
    width: 100vw;
    margin-inline: calc(50% - 50vw);
  }
  .reel { border-radius: 0; }
  .reel::after { display: none; }
  .reel__slot { margin-inline: 0; border-radius: 0; }

  .svc-grid { grid-template-columns: 1fr; }
  .svc-grid > * { grid-column: 1 / -1; }
  .card__core { padding: var(--space-md) var(--space-md) var(--space-lg); }

  .more-grid { grid-template-columns: 1fr; }
  .case__body { padding: var(--space-md); }
  .case__steps { grid-template-columns: 1fr; gap: var(--space-md); }
  .case__foot { flex-direction: column; align-items: stretch; }
  .case__foot .btn { justify-content: center; }
  .media--empty::before { font-size: 6rem; }

  .contact { padding: var(--space-3xl) 0 var(--space-2xl); }
  .contact__actions { flex-direction: column; align-items: stretch; }
  .contact__actions .btn { justify-content: center; }

  /* Figma mobile stacks the social pills above the copyright */
  .footer { flex-direction: column-reverse; align-items: flex-start; gap: var(--space-md); }
}
