/* ============================================================
   WHAT WE DO — sticky scroll section
   ============================================================ */

/* Outer section wrapper */
.wwd {
  background: var(--bone);
  /* Intro padding */
  padding-top: var(--sv);
}

/* ── Intro (normal flow, scrolls away) ──── */
.wwd__intro {
  display: grid; grid-template-columns: 1fr auto;
  align-items: flex-end; gap: 40px;
  padding: 0 var(--gutter) clamp(48px, 6vw, 96px);
  max-width: var(--max); margin: 0 auto;
  border-bottom: 1px solid rgba(10,10,10,.14);
}
.wwd__intro-label {
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: .2em; text-transform: uppercase; opacity: .5; margin-bottom: 16px;
}
.wwd__intro-title {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(40px, 7vw, 112px);
  line-height: .92; letter-spacing: -.04em;
}
.wwd__intro-title em { font-style: italic; opacity: .65; }
.wwd__intro-meta {
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: .1em; opacity: .4; text-align: right; white-space: nowrap;
}

/* ── Sticky scroll driver ─────────────────
   Total outer = 100svh (one visible screen of sticky) + 400svh driver
                = 5 steps × 80svh each.
   Previously 500svh — cut back to 400svh to reclaim a full viewport of
   vertical real estate without losing cinematic pacing. The overlap
   fade-range (driven in JS) still gives each step ~50vh of transition.
───────────────────────────────────────── */
.wwd-outer {
  position: relative;
  height: calc(100vh  + 400vh);   /* vh fallback for browsers without svh */
  height: calc(100svh + 400svh);  /* svh preferred — trims iOS chrome safely */
}

/* ── Sticky panel pins to viewport ───────── */
.wwd-sticky {
  position: sticky; top: 0;
  height: 100vh;   /* fallback */
  height: 100svh;  /* preferred */
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px);
  padding: 0 var(--gutter);
  max-width: none;
  align-items: center;

  /* Current tone — updated via JS */
  background: var(--wwd-bg-1);
  color: var(--wwd-fg-1);
  transition: background 800ms var(--ease), color 800ms var(--ease);
}
.wwd-sticky.is-dark { color: var(--wwd-fg-3); }

/* ── LEFT panel ───────────────────────────── */
.wwd-left {
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 60px 0;
  height: 100%;
  max-width: 520px;
}

/* Step dots nav */
.wwd__dots {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 48px;
}
.wwd__dot {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: .16em; text-transform: uppercase;
  opacity: .25; transition: opacity 500ms var(--ease);
  text-align: left;
}
.wwd__dot-line {
  display: inline-block; width: 14px; height: 1px;
  background: currentColor; flex-shrink: 0;
  transition: width 500ms var(--ease);
}
.wwd__dot.is-active { opacity: 1; }
.wwd__dot.is-active .wwd__dot-line { width: 36px; }
.wwd__dot:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 6px;
  opacity: 1;
}

/* ── Text panels ──────────────────────────
   Desktop (≥961px) uses a CSS grid single-cell stack so all panels
   share the same grid area. The container auto-sizes to the tallest
   panel (no min-height scaffold) and JS drives opacity/transform for
   the overlap transition. Tablet (768–960) resets to block flow for
   the stacked fallback; mobile (≤767) overrides to flex in
   responsive.css for the horizontal snap rail.
─────────────────────────────────────────── */
.wwd__panels { position: relative; }
.wwd__panel {
  /* Default (mobile/tablet) — block flow */
  opacity: 0; transform: translateY(22px);
  /* No CSS transition — JS drives opacity/transform directly for cinematic overlap */
  pointer-events: none;
}
.wwd__step-tag {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: .18em; text-transform: uppercase;
  opacity: .55; margin-bottom: 18px;
}
.wwd__step-tag span {
  display: inline-block; width: 22px; height: 1px;
  background: currentColor; opacity: .4;
}
.wwd__panel-title {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(28px, 3.8vw, 54px);
  line-height: 1; letter-spacing: -.03em;
  margin-bottom: 22px;
}
.wwd__panel-body {
  font-size: var(--t-base); line-height: 1.58;
  opacity: .72; max-width: 44ch; margin-bottom: 28px;
}
.wwd__micro {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px 20px; max-width: 400px;
}
.wwd__micro li {
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: .12em; text-transform: uppercase;
  padding-top: 10px; border-top: 1px solid currentColor; opacity: .6;
}
.wwd.is-dark .wwd__micro li { border-top-color: rgba(246,243,238,.2); }

/* ── RIGHT visual stage ───────────────────── */
.wwd-right {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 40px 0;
}
.wwd__visuals {
  position: relative;
  width: 100%; max-width: 560px;
  aspect-ratio: 4 / 5; max-height: 72vh;
  border: 1px solid rgba(10,10,10,.08);
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
}
.wwd.is-dark .wwd__visuals {
  border-color: rgba(246,243,238,.12);
  background: #141413;
}

.wwd__vis {
  /* Default (mobile/tablet) — JS hides this stage entirely via .wwd-right */
  opacity: 0; transform: scale(1.035);
  /* No CSS transition — JS drives opacity/transform directly for cinematic overlap */
  pointer-events: none;
  padding: clamp(22px, 3vw, 44px);
  display: flex; flex-direction: column;
}
.wwd__vis-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase; opacity: .5;
  margin-bottom: clamp(14px, 2vw, 24px);
}
/*
   Dark visual variant — was previously an inline style="color:..."
   on the panel-3 meta row. Lifted into a modifier so markup stays
   clean and the declaration is scoped + reusable.
*/
.wwd__vis--dark .wwd__vis-meta { color: rgba(246,243,238,.5); }

/* ── Visual 1: Identity ───────────────────── */
.wwd-vis-v1 {
  flex: 1; display: flex; flex-direction: column;
  background: linear-gradient(180deg,#F6F3EE,#EEE8DD); color: #0A0A0A;
  margin: -22px -44px; padding: 22px 44px;
}
.v1__mark {
  font-family: var(--font-serif); font-weight: 400; font-style: normal;
  font-size: clamp(38px, 7.5vw, 96px); line-height: .88; letter-spacing: -.05em;
  margin-top: auto;
}
.v1__mark em { font-style: italic; opacity: .5; }
.v1__palette { display: flex; gap: 5px; margin-top: 16px; height: 28px; }
.v1__palette span { flex: 1; border-radius: 1px; }
.v1__palette span:nth-child(1){ background:#0A0A0A; }
.v1__palette span:nth-child(2){ background:#C3F73A; }
.v1__palette span:nth-child(3){ background:#E7E3DB; }
.v1__palette span:nth-child(4){ background:#3A3A3A; }
.v1__palette span:nth-child(5){ background:#F6F3EE; border:1px solid #E7E3DB; }
.v1__spec {
  display: flex; gap: 16px; margin-top: 12px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; opacity: .45;
}

/* ── Visual 2: Web mockup ─────────────────── */
.wwd-vis-v2 {
  flex: 1; display: flex; flex-direction: column;
  background: #E9E4DB; color: #0A0A0A;
  margin: -22px -44px; padding: 22px 44px;
}
.v2__browser { background:#fff; border:1px solid rgba(10,10,10,.08); border-radius:3px; flex:1; display:flex; flex-direction:column; overflow:hidden; }
.v2__bar { height:24px; border-bottom:1px solid rgba(10,10,10,.06); display:flex; align-items:center; gap:5px; padding:0 10px; font-family:var(--font-mono); font-size:9px; opacity:.4; }
.v2__bar i { width:6px; height:6px; border-radius:50%; background:rgba(10,10,10,.15); }
.v2__bar span { margin-left:8px; }
.v2__navbar { display:flex; justify-content:space-between; padding:14px 18px; font-family:var(--font-mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; border-bottom:1px solid rgba(10,10,10,.05); opacity:.8; }
.v2__links { display:flex; gap:14px; opacity:.65; }
.v2__hero { padding:clamp(20px,3vw,38px); flex:1; display:flex; flex-direction:column; justify-content:space-between; }
.v2__hero h3 { font-family:var(--font-serif); font-weight:300; font-size:clamp(18px,3vw,36px); line-height:.95; letter-spacing:-.03em; max-width:12ch; }
.v2__hero h3 em { font-style:italic; opacity:.65; }
.v2__foot { display:flex; justify-content:space-between; align-items:flex-end; font-family:var(--font-mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; opacity:.55; }
.v2__cta { border:1px solid #0A0A0A; padding:8px 14px; border-radius:999px; opacity:1; }

/* ── Visual 3: Motion frames ──────────────── */
.wwd-vis-v3 {
  flex: 1; display: flex; flex-direction: column;
  background: #0E0E0D; color: #F6F3EE;
  margin: -22px -44px; padding: 22px 44px;
}
.v3__grid { flex:1; display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(2,1fr); gap:7px; }
.v3__frame { position:relative; border:1px solid rgba(246,243,238,.1); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.v3__frame::before { content:attr(data-t); position:absolute; top:7px; left:8px; font-family:var(--font-mono); font-size:9px; letter-spacing:.12em; opacity:.38; }
.v3__dot { width:clamp(14px,2.2vw,30px); height:clamp(14px,2.2vw,30px); border-radius:50%; background:var(--accent); animation:wwdPulse 2.4s var(--ease) infinite; }
.v3__dot--sm { background:#F6F3EE; transform:scale(.6); }
.v3__dot--fade { background:#F6F3EE; opacity:.35; transform:scale(.35); }
.v3__dot--ring { background:transparent; border:1px solid rgba(246,243,238,.35); transform:scale(1.55); }
.v3__dot--line { width:60%; height:1px; border-radius:0; background:var(--accent); }
.v3__dot--rect { width:52%; height:52%; border-radius:2px; background:rgba(195,247,58,.1); border:1px solid var(--accent); }
.v3__tl { margin-top:12px; height:1px; background:rgba(246,243,238,.15); position:relative; }
.v3__tl-bar { position:absolute; inset:0 auto 0 0; width:36%; background:var(--accent); }
.v3__tl-labels { display:flex; justify-content:space-between; margin-top:7px; font-family:var(--font-mono); font-size:9px; letter-spacing:.14em; opacity:.4; }

/* ── Visual 4: Editorial ─────────────────── */
.wwd-vis-v4 {
  flex: 1; display: flex; flex-direction: column;
  background: #D9D4C9; color: #0A0A0A;
  margin: -22px -44px; padding: 22px 44px;
}
.v4__eye { font-family:var(--font-mono); font-size:10px; letter-spacing:.2em; text-transform:uppercase; opacity:.5; }
.v4__lede { font-family:var(--font-serif); font-weight:300; font-size:clamp(18px,2.6vw,34px); line-height:1.05; letter-spacing:-.02em; margin-top:14px; max-width:18ch; }
.v4__lede em { font-style:italic; opacity:.65; }
.v4__cols { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:auto; font-size:12px; line-height:1.55; opacity:.7; }
.v4__foot { display:flex; justify-content:space-between; align-items:center; margin-top:22px; padding-top:16px; border-top:1px solid rgba(10,10,10,.18); font-family:var(--font-mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; }
.v4__btn { border:1px solid #0A0A0A; padding:9px 18px; border-radius:999px; }

/* ── Visual 5: System ────────────────────── */
.wwd-vis-v5 {
  flex: 1; display: flex; flex-direction: column;
  background: #F1EEE8; color: #0A0A0A;
  margin: -22px -44px; padding: 22px 44px;
}
.v5__set { flex:1; display:grid; grid-template-columns:2fr 1fr; gap:12px; }
.v5__desk, .v5__mob { background:#fff; border:1px solid rgba(10,10,10,.07); border-radius:3px; overflow:hidden; display:flex; flex-direction:column; }
.v5__tbar { height:17px; border-bottom:1px solid rgba(10,10,10,.05); display:flex; align-items:center; gap:4px; padding:0 7px; }
.v5__tbar i { width:5px; height:5px; border-radius:50%; background:rgba(10,10,10,.13); }
.v5__body { flex:1; padding:12px; display:flex; flex-direction:column; gap:7px; }
.v5__h { font-family:var(--font-serif); font-weight:400; font-size:clamp(12px,1.4vw,17px); letter-spacing:-.02em; line-height:1; }
.v5__b { height:8px; background:rgba(10,10,10,.06); border-radius:1px; }
.v5__b.w60 { width:60%; } .v5__b.w40 { width:40%; }
.v5__media { flex:1; background:linear-gradient(135deg,#E7E3DB,#D9D4C9); border-radius:2px; margin-top:5px; min-height:40px; }
.v5__mob .v5__body { padding:9px; gap:5px; }
.v5__mob .v5__h { font-size:11px; }
.v5__tokens { margin-top:12px; display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; opacity:.45; }

/* ── Desktop (≥961px) — sticky scroll engine ─────────────────
   Grid-stack replaces the old `position: absolute; inset: 0` pattern:
   every panel/visual shares grid-column:1 / grid-row:1, so the
   container auto-sizes to the tallest child. No min-height scaffold,
   no abs-positioning, same overlap behaviour driven by JS opacity.

   The :first-child baseline is the desktop safety net — if JS hasn't
   run yet (slow network, parse delay), the first panel + visual are
   visible. Once update() runs it overrides with inline styles.
──────────────────────────────────────────────────────────────── */
@media (min-width: 961px) {
  .wwd__panels  { display: grid; }
  .wwd__panels > .wwd__panel { grid-column: 1; grid-row: 1; }
  .wwd__panel:first-child {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .wwd__visuals { display: grid; }
  .wwd__visuals > .wwd__vis { grid-column: 1; grid-row: 1; }
  .wwd__vis:first-child {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
  }
}

/* ── Tablet + mobile fallback (≤960px) ─────
   Sticky engine off; panels read as stacked editorial blocks.
   Mobile (≤767) further overrides to a horizontal snap rail in
   responsive.css — those overrides come after this block.
─────────────────────────────────────────── */
@media (max-width: 960px) {
  .wwd-outer { height: auto; }
  .wwd-sticky {
    position: static;
    height: auto;
    display: block;
    padding: clamp(40px, 6vw, 80px) var(--gutter);
    background: var(--bone) !important;
    color: var(--ink) !important;
  }
  .wwd__intro {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 40px;
  }
  .wwd__intro-meta { text-align: left; }
  .wwd-left { max-width: 100%; padding: 0; height: auto; }
  .wwd__dots {
    flex-direction: row; flex-wrap: wrap;
    gap: 8px 16px; margin-bottom: 0;
    display: none; /* Hide dots on tablet — panels show as stacked blocks */
  }
  .wwd__panels { position: static; }
  .wwd__panel {
    opacity: 1; transform: none;
    padding: clamp(40px, 8vw, 80px) 0;
    border-top: 1px solid rgba(10,10,10,.1);
    pointer-events: auto;
  }
  .wwd__panel:first-child { border-top: none; padding-top: 24px; }
  .wwd-right { display: none; }
  .wwd__micro { grid-template-columns: repeat(2, minmax(0,1fr)); }

  /*
     Consolidated visual-mockup reset (previously repeated 5×, once per
     .wwd-vis-vN). All mockups use the same -22px / -44px desktop offset
     to break out of .wwd__vis padding — at this breakpoint we collapse
     that to a shared -20px/20px rhythm.
  */
  .wwd-vis-v1,
  .wwd-vis-v2,
  .wwd-vis-v3,
  .wwd-vis-v4,
  .wwd-vis-v5 {
    margin: -20px;
    padding: 20px;
  }
}

/* ── Reduced motion ─────────────────────────
   Users who've opted out of motion get a calmer experience:
   - sticky bg transitions are disabled (instant tone flip)
   - JS respects the same flag and snap-activates instead of tweening
   (see js/wwd.js :: prefersReducedMotion)
───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .wwd-sticky { transition: none; }
  .wwd__dot,
  .wwd__dot-line { transition: none; }
}
