/* /why-we-built-sorry-scroll: the research essay. Builds on styles.css tokens. */
.ww-hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--cream);
  min-height: clamp(560px, 82vh, 800px);
  display: grid; align-items: end;
  padding: 0 var(--gutter);
  isolation: isolate;
}
.ww-hero::before { /* fallback glow, also sits behind the 3D feed */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(60% 50% at 72% 42%, rgba(255,90,54,.22), transparent 70%);
}
.ww-canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; }
.ww-hero::after { /* keeps the headline readable over the feed */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(26,24,20,0) 30%, rgba(26,24,20,.86) 78%, var(--ink) 100%),
              linear-gradient(90deg, rgba(26,24,20,.75) 0%, rgba(26,24,20,0) 60%);
}
.ww-hero-copy { max-width: 1120px; width: 100%; margin: 0 auto; padding: 120px 0 clamp(48px, 7vw, 88px); display: grid; gap: 22px; }
.ww-hero .eyebrow { color: var(--ink-muted); }
.ww-hero h1 { font-size: clamp(3rem, 9vw, 7.2rem); max-width: 11ch; }
.ww-hero h1 em { font-style: normal; color: var(--tomato); }
.ww-hero .lede { color: #D9D1C2; max-width: 46ch; }
.ww-byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; color: var(--ink-muted); }
.ww-byline b { color: var(--cream); font-weight: 600; }
.ww-hint { position: absolute; right: var(--gutter); bottom: 28px; font-family: var(--mono); font-size: .78rem; color: var(--ink-muted); letter-spacing: .04em; }
@media (max-width: 640px) { .ww-hint { display: none; } }

/* Article column */
.ww { padding: clamp(48px, 7vw, 96px) var(--gutter) 40px; }
.ww-col { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(64px, 9vw, 112px); }
.ww-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.ww-text { max-width: 680px; display: grid; gap: 18px; font-size: 1.08rem; line-height: 1.62; }
.ww-text p, .ww-text li { color: #2E2A24; }
.ww-text ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.ww-text a, .ww-src a { text-decoration-color: var(--tomato); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ww-text a:hover { color: var(--tomato-deep); }
.ww-num { font-family: var(--mono); font-size: .9rem; color: var(--tomato-deep); letter-spacing: .04em; }
.ww-sec h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: .98; font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 18ch; }
.ww-sec h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; font-size: 1.35rem; }
.ww-cite { font-size: .72em; vertical-align: super; line-height: 0; text-decoration: none !important; color: var(--tomato-deep); font-weight: 700; padding-left: 1px; }

/* Origin */
.ww-origin { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.ww-quote { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0; }
.ww-quote span { color: var(--tomato); }
.ww-origin .ww-text { gap: 14px; }
.ww-phones { display: flex; gap: 14px; justify-content: center; }
.ww-phones img { width: min(46%, 220px); height: auto; border-radius: 26px; border: 6px solid var(--ink); background: var(--ink); box-shadow: 0 30px 60px -30px rgba(26,24,20,.5); }
.ww-phones img:nth-child(2) { transform: translateY(28px); }

/* Flow: open → step → in */
.ww-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: flow; }
.ww-flow li { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 18px 0; display: grid; gap: 10px; align-content: start; overflow: hidden; }
.ww-flow .ww-num::before { counter-increment: flow; content: "0" counter(flow) "  "; }
.ww-flow h3 { font-size: 1.2rem; }
.ww-flow p { color: var(--muted); font-size: .95rem; }
.ww-flow img { width: 78%; height: auto; justify-self: center; margin-top: 6px; border-radius: 22px 22px 0 0; border: 5px solid var(--ink); border-bottom: 0; background: var(--ink); aspect-ratio: 420 / 520; object-fit: cover; object-position: top; }
@media (max-width: 760px) { .ww-flow { grid-template-columns: minmax(0, 1fr); } .ww-flow img { width: 62%; } .ww-origin { grid-template-columns: minmax(0, 1fr); } }

/* Figures */
.ww-fig { margin: 0; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); display: grid; gap: 14px; }
.ww-fig.dark { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.ww-fig-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 18px; }
.ww-fig-title { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; font-size: 1.2rem; }
.ww-fig-tag { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ww-fig.dark .ww-fig-tag, .ww-fig.dark figcaption { color: var(--ink-muted); }
.ww-fig figcaption { font-size: .88rem; color: var(--muted); max-width: 70ch; }
.ww-fig svg { width: 100%; height: auto; display: block; overflow: visible; }
.ww-svg-text { font-family: var(--body); font-size: 13px; fill: var(--muted); }
.ww-svg-strong { font-family: var(--display); font-weight: 800; fill: var(--ink); }
.ww-fig.dark .ww-svg-text { fill: var(--ink-muted); }
.ww-fig.dark .ww-svg-strong { fill: var(--cream); }
.ww-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .ww-pair { grid-template-columns: minmax(0, 1fr); } }

/* Big stat row */
.ww-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ww-stat { border-top: 3px solid var(--ink); padding-top: 12px; display: grid; gap: 4px; align-content: start; }
.ww-stat b { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ww-stat.hot b { color: var(--tomato); }
.ww-stat > span { font-size: .92rem; color: var(--muted); }
.ww-fig.dark .ww-stat { border-color: var(--ink-line); }
.ww-fig.dark .ww-stat > span { color: var(--ink-muted); }
@media (max-width: 640px) { .ww-stats { grid-template-columns: minmax(0, 1fr); } }

/* Year calendar */
.ww-year { display: grid; grid-template-columns: repeat(53, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(7, auto); gap: 3px; }
.ww-year i { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--ink-line); }
.ww-year i.on { background: var(--tomato); }
@media (max-width: 640px) { .ww-year { gap: 2px; } .ww-year i { border-radius: 1px; } }

/* Dot grid */
.ww-dots { display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); gap: clamp(3px, 1vw, 10px); max-width: 860px; }
.ww-dots i { display: block; aspect-ratio: 1; border-radius: 50%; background: var(--tomato); }
.ww-dots i.gone { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-line); }
.ww-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .88rem; color: var(--ink-muted); }
.ww-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ww-legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--tomato); display: inline-block; }
.ww-legend i.o { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-muted); }

/* Ranked list (what worked in the pause) */
.ww-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ww-rank li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; }
.ww-rank .lvl { height: 10px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.ww-rank .lvl b { display: block; height: 100%; background: var(--tomato); border-radius: inherit; }
.ww-rank em { font-style: normal; font-weight: 700; display: block; }
.ww-rank small { color: var(--muted); font-size: .88rem; }
@media (max-width: 520px) { .ww-rank li { grid-template-columns: 70px minmax(0, 1fr); } }

/* Callouts */
.ww-note { max-width: 680px; border-left: 4px solid var(--tomato); background: var(--paper); border-radius: 0 16px 16px 0; padding: 16px 20px; display: grid; gap: 6px; }
.ww-note b { font-weight: 700; }
.ww-note p { color: #2E2A24; font-size: .98rem; }

/* Founder result */
.ww-result { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.ww-shot { border: 8px solid var(--ink); border-radius: 36px; overflow: hidden; background: #F6F1E7; box-shadow: 0 40px 80px -40px rgba(26,24,20,.55); max-width: 300px; justify-self: center; width: 100%; }
.ww-shot img { display: block; width: 100%; height: auto; margin-top: -11%; } /* hides the status bar */
.ww-result-side { display: grid; gap: 24px; }
.ww-weeks { display: grid; gap: 14px; }
.ww-week { display: grid; gap: 6px; }
.ww-week-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
.ww-week-row b { font-family: var(--display); font-size: 1.6rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ww-week .track { height: 22px; border-radius: 8px; background: var(--hairline); overflow: hidden; }
.ww-week .fill { height: 100%; border-radius: 8px; background: #3D7BD9; transform-origin: left; }
.ww-week.this .fill { background: var(--tomato); }
.ww-less { font-family: var(--display); font-weight: 800; letter-spacing: -.04em; line-height: .95; font-size: clamp(2.6rem, 6vw, 4.4rem); }
.ww-less small { display: block; font-family: var(--body); font-weight: 500; letter-spacing: 0; font-size: 1rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 760px) { .ww-result { grid-template-columns: minmax(0, 1fr); } }

/* Not claiming */
.ww-not { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ww-not div { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 22px; display: grid; gap: 8px; align-content: start; }
.ww-not h3 { font-size: 1.1rem; }
.ww-not p { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .ww-not { grid-template-columns: minmax(0, 1fr); } }

/* Closing */
.ww-close { background: var(--tomato); color: var(--ink); border-radius: calc(var(--radius) + 8px); padding: clamp(32px, 6vw, 72px); display: grid; gap: 22px; justify-items: start; }
.ww-close p.display { font-size: clamp(2.2rem, 6vw, 4.6rem); max-width: 16ch; }
.ww-close .fineprint { color: var(--ink); opacity: .75; }

/* Sources */
.ww-src { max-width: 820px; }
.ww-src ol { margin: 0; padding-left: 1.6em; display: grid; gap: 8px; font-size: .92rem; color: var(--muted); }
.ww-src li::marker { font-family: var(--mono); color: var(--tomato-deep); }
.ww-flow img.mid { object-position: center 42%; }
.ww-donut { max-width: 260px; justify-self: center; }

/* HTML bar charts (stay legible at any width) */
.ww-bars { display: grid; gap: 12px; }
.ww-brow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 96px; align-items: center; gap: 14px; }
.ww-brow .lab { font-size: .95rem; color: var(--muted); }
.ww-brow .trk { height: 28px; display: block; }
.ww-hbar { display: block; height: 100%; border-radius: 7px; transform-origin: left center; }
.ww-brow .val { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ww-bars-sub { font-family: var(--display); font-weight: 800; font-size: 1.05rem; margin-top: 10px; }
.ww-axis { border-top: 1px solid var(--line); padding-top: 6px; }
.ww-axis .ticks { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ww-fig-key { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.ww-fig-key i { width: 12px; height: 12px; border-radius: 50%; background: var(--tomato); flex: none; }
@media (max-width: 640px) {
  .ww-brow { grid-template-columns: minmax(0, 1fr) 82px; row-gap: 4px; column-gap: 10px; }
  .ww-brow .lab { grid-column: 1 / -1; }
  .ww-brow .trk { height: 22px; }
  .ww-axis > span:first-child, .ww-axis > span:last-child { display: none; }
  .ww-axis .ticks { grid-column: 1 / -1; }
  .ww-fig svg .ww-svg-text { font-size: 22px; }
  .ww-fig svg .ww-svg-strong { font-size: 26px; }
  .ww-fig svg .ww-plus { display: none; }
  .ww-fig svg text.big { font-size: 40px; }
}

/* Memory games */
.ww-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ww-game { background: var(--cream); border-radius: 18px; padding: 18px; display: grid; gap: 6px; align-content: start; }
.ww-game b { font-family: var(--display); font-weight: 800; font-size: 1.1rem; margin-top: 8px; }
.ww-game > span { font-size: .9rem; color: var(--muted); }
.ww-pattern { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 150px); }
.ww-pattern i { aspect-ratio: 1; border-radius: 10px; background: #FFFDF8; border: 2px solid var(--hairline); }
.ww-pattern i.on { animation: ww-flash 3.2s ease-in-out infinite; }
.ww-digits { display: flex; gap: 6px; height: 72px; align-items: center; }
.ww-digits span { font-family: var(--display); font-weight: 800; font-size: 2.4rem; width: 1.2em; text-align: center; background: #FFFDF8; border-radius: 10px; animation: ww-digit 3.2s ease-in-out infinite; }
.ww-digits span:nth-child(2) { animation-delay: .15s; } .ww-digits span:nth-child(3) { animation-delay: .3s; } .ww-digits span:nth-child(4) { animation-delay: .45s; }
.ww-missing { display: flex; gap: 6px; height: 72px; align-items: center; }
.ww-missing svg { width: 18%; max-width: 40px; height: auto; }
.ww-missing svg.gone { animation: ww-gone 3.2s ease-in-out infinite; }
@keyframes ww-flash { 0%, 66% { background: #FCA48C; border-color: var(--tomato); } 76%, 100% { background: #FFFDF8; border-color: var(--hairline); } }
@keyframes ww-digit { 0%, 66% { color: var(--ink); } 76%, 100% { color: transparent; text-shadow: 0 0 0 transparent; background: var(--hairline); } }
@keyframes ww-gone { 0%, 62% { opacity: 1; transform: none; } 72%, 94% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ww-pattern i.on, .ww-digits span, .ww-missing svg.gone { animation: none; } .ww-pattern i.on { background: #FCA48C; border-color: var(--tomato); } }
@media (max-width: 760px) { .ww-games { grid-template-columns: minmax(0, 1fr); } }
