/* Shared base for the homepage concepts: the viewer's tokens plus an Apple-leaning type scale. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f0f0f4; --ink: #1d1d1f; --ink-2: #4a4f60; --muted: #6e6e73; --faint: #a7abbb;
  --border: rgba(20, 22, 31, 0.09); --rule: rgba(20, 22, 31, 0.06); --accent: #4f5bd5; --accent-ink: #ffffff; --accent-soft: rgba(79, 91, 213, 0.12); --danger: #d64545;
  --c-msp: #f6a04d; --c-msp-soft: rgba(246, 160, 77, 0.35); --c-nuc: #0a7869; --c-tf: #b23874; --c-m6a: #800080; --c-span: rgba(20, 22, 31, 0.1); --c-band: rgba(79, 91, 213, 0.06); --c-ref: #5b6472; --c-obs: #5b8ff9; --nodata: #f0f1f4;
  --base-a: #2f9e5f; --base-c: #3b82c4; --base-g: #e0912a; --base-t: #d64545; --div-neg: #2a78d6; --div-mid: #eeeeee; --div-pos: #e34948;
  --fall-0: #ffffff; --fall-1: #ffffcd; --fall-2: #ffeda0; --fall-3: #fed977; --fall-4: #feb24c; --fall-5: #fd8c3c; --fall-6: #fc4e2a; --fall-7: #e2191c; --fall-8: #bd0026; --fall-9: #7d0025; --fall-10: #000000;
  --font: -apple-system, system-ui, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif; --mono: ui-monospace, Menlo, Consolas, monospace;
  --radius: 18px; --glass: rgba(255, 255, 255, 0.72);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #0f1016; --surface-2: #161821; --ink: #f5f5f7; --ink-2: #c7cad6; --muted: #86868b; --faint: #5b617a;
  --border: rgba(255, 255, 255, 0.1); --rule: rgba(255, 255, 255, 0.07); --accent: #8d95ff; --accent-ink: #0d0f15; --accent-soft: rgba(141, 149, 255, 0.16); --danger: #ef6b6b;
  --c-nuc: #2f9a88; --c-tf: #e884be; --c-m6a: #c77dff; --c-obs: #7fa9ff; --nodata: #1a1e2b; --div-mid: #2a2d3a; --glass: rgba(15, 16, 22, 0.7);
} }
:root[data-theme="dark"] {
  --bg: #000000; --surface: #0f1016; --surface-2: #161821; --ink: #f5f5f7; --ink-2: #c7cad6; --muted: #86868b; --faint: #5b617a;
  --border: rgba(255, 255, 255, 0.1); --rule: rgba(255, 255, 255, 0.07); --accent: #8d95ff; --accent-ink: #0d0f15; --accent-soft: rgba(141, 149, 255, 0.16); --danger: #ef6b6b;
  --c-nuc: #2f9a88; --c-tf: #e884be; --c-m6a: #c77dff; --c-obs: #7fa9ff; --nodata: #1a1e2b; --div-mid: #2a2d3a; --glass: rgba(15, 16, 22, 0.7);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 17px; line-height: 1.47; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
canvas, svg.plot { display: block; }
.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.nav { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); background: var(--glass); border-bottom: 1px solid var(--rule); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 52px; }
.nav .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.nav .brand img { width: 26px; height: 26px; }
.nav .links { margin-left: auto; display: flex; align-items: center; gap: 26px; font-size: 13px; color: var(--ink-2); }
.nav .links a:hover { color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font-size: 16px; font-weight: 500; border: 1px solid transparent; transition: transform 160ms ease, background 160ms ease; }
.pill:hover { transform: translateY(-1px); }
.pill.primary { background: var(--accent); color: var(--accent-ink); }
.pill.ghost { border-color: var(--border); background: var(--surface); color: var(--ink); }
.pill.lucky::before { content: "✦"; color: var(--accent); }
.pill.primary.lucky::before { color: inherit; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1.display { margin: 8px 0 8px; font-size: clamp(38px, 5.6vw, 66px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.lede { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.35; color: var(--ink-2); margin: 0; }
.section { padding: clamp(56px, 9vw, 120px) 0; }
.section.dark { background: #000; color: #f5f5f7; --ink: #f5f5f7; --ink-2: #c7cad6; --muted: #86868b; --surface: #0f1016; --surface-2: #161821; --border: rgba(255,255,255,0.1); --rule: rgba(255,255,255,0.07); --c-nuc: #2f9a88; --c-tf: #e884be; --c-m6a: #c77dff; --nodata: #1a1e2b; --accent: #8d95ff; --accent-ink: #0d0f15; }
h2.title { margin: 0 0 12px; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; }
p.copy { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 36rem; margin: 0; }
.frame { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.45); }
.frame-bar { display: flex; justify-content: space-between; padding: 10px 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.fig-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k-msp { background: var(--c-msp); } .k-nuc { background: var(--c-nuc); } .k-tf { background: var(--c-tf); } .k-m6a { background: var(--c-m6a); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 28px; }
.stat b { display: block; font-size: clamp(34px, 4vw, 52px); letter-spacing: -0.03em; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }
.foot { padding: 40px 0 60px; font-size: 13px; color: var(--muted); display: flex; gap: 24px; flex-wrap: wrap; }
.foot a:hover { color: var(--ink); }
svg text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.mean-line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.mean-area { fill: url(#g-acc); }
.alt-line { fill: none; stroke: var(--danger); stroke-width: 1.8; stroke-linejoin: round; }
.ref-line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; opacity: 0.9; }
.axis { stroke: var(--rule); }
.tss line { stroke: var(--ink); stroke-width: 1.4; } .tss path { stroke: var(--ink); stroke-width: 1.4; fill: none; } .tss text { fill: var(--ink); font-size: 11px; font-weight: 600; }

/* Cover page (concept A with B's gallery) ----------------------------------- */
.nav .theme { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.nav .theme:hover { color: var(--ink); background: var(--surface-2); }
.hero { display: grid; grid-template-columns: 132px 1fr; column-gap: clamp(28px, 4vw, 48px); align-items: start; text-align: left; padding: clamp(32px, 5vw, 64px) 0 0; }
.hero-mark { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 1px; }  /* logo + wordmark span the two headline lines */
.hero-logo { width: 104px; height: 104px; }
.wordmark { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; padding-left: 2px; }
.hero-text { min-width: 0; }
.hero h1.display { margin: 0 0 14px; font-size: clamp(40px, 5.4vw, 64px); line-height: 1.04; }
.hero .lede { margin: 0; max-width: 40rem; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.4; text-wrap: pretty; }
.hero .cta { justify-content: flex-start; margin-top: 26px; }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; row-gap: 16px; } .hero-mark { flex-direction: row; align-items: center; gap: 12px; } .hero-logo { width: 72px; height: 72px; } }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), #b23874 55%, #f6a04d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cta { display: flex; justify-content: center; gap: 14px; margin: 24px 0 0; flex-wrap: wrap; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 22px; scrollbar-width: thin; margin-top: 26px; }
.gcard { scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 16px 14px; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.gcard:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.5); }
.gcard b { font-size: 20px; letter-spacing: -0.01em; }
.gcard .loc { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 2px 0 10px; }
.gcard svg { width: 100%; height: 56px; }
.gcard .r { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
/* Showcase figure: same two-column grid as the hero (logo column | content), no frame */
.showcase { margin-top: clamp(30px, 4.5vw, 52px); }
.figure { display: flex; flex-direction: column; gap: 10px; }
.fig-row { display: grid; grid-template-columns: 132px 1fr; column-gap: clamp(28px, 4vw, 48px); align-items: center; }
.fig-row.flow { margin: -4px 0; }
.fig-lab { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.fig-plot { min-width: 0; }
.fig-plot canvas, .fig-plot svg { display: block; max-width: 100%; }
.fig-plot canvas.seq { border-radius: 4px; }
.fig-plot.screen { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 1px 2px rgba(20, 22, 31, 0.04), 0 22px 50px -34px rgba(20, 22, 31, 0.35); }
.fig-plot.screen canvas { margin: 4px 0; }
.fig-row.caption { margin-top: 10px; }
.fig-caption { margin: 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); line-height: 1.5; }
.fig-caption .mono { font-family: var(--mono); font-size: 12px; }
.fig-caption .legend { gap: 12px; }
@media (max-width: 720px) { .fig-row { grid-template-columns: 1fr; row-gap: 4px; } .fig-lab:empty { display: none; } }

/* Sequence letters above the colour band */
.seq-stack { display: flex; flex-direction: column; gap: 2px; }
.seq-letters { display: flex; font-family: var(--mono); font-size: 13px; font-weight: 600; line-height: 18px; overflow: hidden; }
.seq-letters span { flex: 1 1 0; text-align: center; min-width: 0; }
.seq-letters .tss-base { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.seq-stack svg { width: 100%; }
@media (max-width: 720px) { .seq-letters { font-size: 10px; } }

/* Phones: keep the nav to one row. The hero already has "Open Mola" and
   "I'm Feeling Lucky" buttons, so the bar keeps one link plus the theme toggle. */
@media (max-width: 640px) {
  .nav .wrap { gap: 12px; }
  .nav .links { gap: 14px; white-space: nowrap; }
  .nav .links a:not(:first-child) { display: none; }
}
