/* ============================================================================
   Plot45 — Landing page · "The Front Page"
   Broadsheet: achromatic ink on cool paper. No gradients, no shadows.
   Hairlines + tint for depth. 3px corners. System grotesk. Mono+tabular for
   data only. Colour belongs to the data — the one brand spark is the yellow 45.
   Tokens lifted verbatim from the app's site.css.
   ========================================================================== */

:root {
  --bg: #fafbfb;
  --bg-subtle: #eef0f1;
  --panel: #ffffff;
  --panel-hover: #f4f5f6;
  --text: #15171a;
  --muted: #5b6166;
  --faint: #8b9197;
  --line: rgba(20, 24, 28, 0.12);
  --line-strong: #d4d8da;
  --accent: #15171a;
  --accent-soft: rgba(20, 24, 28, 0.06);
  --success: #1f7a3a;
  --danger: #b42318;
  --brand-45: #f4c01e;
  --brand-45-ink: #1a1a1a;       /* ink that sits on yellow */
  --paper-grid: #d7e0ea;          /* pencil graph-paper blue */

  --radius: 3px;
  --radius-lg: 4px;
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --reveal-shift: 18px;
}

[data-theme="dark"] {
  --bg: #131417;
  --bg-subtle: #191c20;
  --panel: #1b1e22;
  --panel-hover: #23272c;
  --text: #eef0f2;
  --muted: #9ba2a8;
  --faint: #6b7178;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #eceef0;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --success: #3abf75;
  --paper-grid: #2a3340;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--brand-45); color: var(--brand-45-ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* shared editorial primitives ---------------------------------------------- */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule--strong { background: var(--line-strong); }
.rule--ink { height: 2px; background: var(--accent); }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
p { margin: 0; }

/* the yellow mark, used precisely ------------------------------------------ */
.mark45 {
  display: inline-block;
  background: var(--brand-45);
  color: var(--brand-45-ink);
  padding: 0 0.28em;
  border-radius: 2px;
  font-weight: 800;
}

/* buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--panel-hover); border-color: var(--accent); }
.btn__arrow { transition: transform 0.18s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn--lg { font-size: 1.05rem; padding: 16px 28px; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); border-radius: var(--radius); }

/* ============================================================ top edition bar */
.edition {
  border-bottom: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.edition__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 34px;
}
.edition__row > span { white-space: nowrap; }
.edition__mid { color: var(--faint); }
.edition__live { display: inline-flex; align-items: center; gap: 7px; }
.edition__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
}
@media (max-width: 720px) { .edition__mid, .edition__right { display: none; } }

/* ===================================================================== nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { height: 26px; width: auto; }
.brand__logo--dark { display: none; }
[data-theme="dark"] .brand__logo--light { display: none; }
[data-theme="dark"] .brand__logo--dark { display: block; }
.brand__beta {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-strong);
  padding: 2px 7px; border-radius: 2px;
}
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  transition: color 0.16s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.themebtn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.themebtn:hover { background: var(--panel-hover); border-color: var(--accent); }
.themebtn svg { width: 17px; height: 17px; }
/* Swap the glyph with the theme: sun in light, crescent moon in dark. */
.themebtn__moon { display: none; }
[data-theme="dark"] .themebtn__sun { display: none; }
[data-theme="dark"] .themebtn__moon { display: inline; }
@media (max-width: 860px) { .nav__links { display: none; } }

/* =================================================================== hero */
.hero { padding: clamp(44px, 7vw, 92px) 0 clamp(40px, 6vw, 72px); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.02fr 1.18fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero__eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.hero__eyebrow .tick { width: 26px; height: 1px; background: var(--line-strong); }
.hero h1 {
  font-size: clamp(2.9rem, 6.6vw, 5.3rem);
  letter-spacing: -0.045em;
  line-height: 0.96;
}
.hero h1 .turn { display: block; }
.hero h1 em {
  font-style: normal;
  position: relative;
  isolation: isolate;
  white-space: nowrap;
}
/* headline highlight — fail-open: shown by default, animates in only when armed */
.hero h1 em::after {
  content: "";
  position: absolute;
  left: -0.04em; right: -0.04em; bottom: 0.07em;
  height: 0.16em;
  background: var(--brand-45);
  z-index: -1;
  transform: scaleX(1);
  transform-origin: left center;
}
@keyframes hl-grow { to { transform: scaleX(1); } }
.hero__dek {
  margin: 28px 0 0;
  max-width: 46ch;
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--muted);
}
.hero__dek strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; align-items: center; gap: 18px; margin-top: 36px; flex-wrap: wrap; }
.hero__note { font-size: 0.85rem; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.hero__note b { color: var(--muted); font-weight: 600; }

/* hero figure (the lead art) ----------------------------------------------- */
.figcard {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.figcard__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}
.figcard__chip {
  font-family: var(--mono); font-size: 0.74rem; font-variant-numeric: tabular-nums;
  color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
}
.figcard__chip b { color: var(--text); font-weight: 700; }
.figcard__chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.figcard__chip--push { margin-left: auto; }
.figcard__stage { position: relative; padding: 18px; }
.figcard__plot { width: 100%; height: auto; display: block; }
.figcard__phase {
  position: absolute; left: 16px; bottom: 13px;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
}
.figcard__phase b { color: var(--muted); }

/* hero figure caption (the FIG plate device) */
.figcap {
  display: flex; gap: 12px; align-items: baseline;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem; color: var(--muted);
}
.figcap__n {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); white-space: nowrap;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__figure { order: 2; }
}

/* ============================================================== marquee strip */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}
.marquee__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.marquee__step {
  padding: 26px var(--gutter);
  display: flex; align-items: center; gap: 16px;
  border-left: 1px solid var(--line);
}
.marquee__step:first-child { border-left: 0; }
.marquee__num {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  color: var(--brand-45-ink); background: var(--brand-45);
  width: 26px; height: 26px; border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .marquee__num { color: var(--brand-45-ink); }
.marquee__t { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.marquee__t span { display: block; font-size: 0.84rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
@media (max-width: 760px) {
  .marquee__row { grid-template-columns: 1fr; }
  .marquee__step { border-left: 0; border-top: 1px solid var(--line); padding: 20px var(--gutter); }
  .marquee__step:first-child { border-top: 0; }
}

/* ============================================================ feature plates */
.plates { padding: clamp(60px, 9vw, 120px) 0 clamp(20px, 4vw, 48px); }
.section-head { max-width: 720px; margin-bottom: clamp(44px, 6vw, 72px); }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -0.035em; }
.section-head p { margin-top: 20px; font-size: 1.12rem; color: var(--muted); max-width: 58ch; line-height: 1.55; }

.plate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--line);
}
.plate__body { max-width: 30rem; }
.plate--flip .plate__figure { order: -1; }
.plate__fig-index {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 22px;
}
.plate__fig-index .bar { width: 30px; height: 2px; background: var(--accent); }
.plate__body h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.03em; }
.plate__body > p { margin-top: 18px; font-size: 1.08rem; color: var(--muted); line-height: 1.55; }
.plate__list { margin: 26px 0 32px; padding: 0; list-style: none; display: grid; gap: 0; }
.plate__list li {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--line);
  font-size: 0.98rem; line-height: 1.45;
}
.plate__list li:last-child { border-bottom: 1px solid var(--line); }
.plate__list .k {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text); white-space: nowrap; margin-top: 2px; min-width: 42px;
}
.plate__list b { font-weight: 600; }
.plate__list span { color: var(--muted); }

@media (max-width: 860px) {
  .plate { grid-template-columns: 1fr; gap: 36px; }
  .plate--flip .plate__figure { order: 0; }
}

/* ============================================================== dark showcase */
.showcase {
  margin-top: clamp(48px, 7vw, 96px);
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(64px, 9vw, 120px) 0;
}
.showcase__head { text-align: center; max-width: 680px; margin: 0 auto clamp(40px, 5vw, 64px); }
.showcase__head .eyebrow { margin-bottom: 18px; }
.showcase__head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.showcase__head p { margin-top: 18px; color: var(--muted); font-size: 1.1rem; }
/* The dark showcase is a real screenshot of the workbench in dark mode, framed
   with a hairline (no shadow — depth is line + tint, per Broadsheet). */
.showcase__shot {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #121417; /* the app's dark chrome — fills any sub-pixel edge */
  line-height: 0;
}
.showcase__shot img { width: 100%; height: auto; display: block; }

/* ============================================================ quiet grid */
.grid-feats { padding: clamp(64px, 9vw, 110px) 0; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.feat {
  padding: 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feat__icon { width: 30px; height: 30px; color: var(--text); margin-bottom: 20px; }
.feat__icon svg { width: 100%; height: 100%; }
.feat h4 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 9px; }
.feat p { font-size: 0.94rem; color: var(--muted); line-height: 1.5; }
@media (min-width: 861px) {
  .feat-grid > .feat:nth-child(3n) { border-right: 0; }
  .feat-grid > .feat:nth-last-child(-n+3) { border-bottom: 0; }
}
@media (max-width: 860px) and (min-width: 561px) {
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .feat-grid > .feat:nth-child(2n) { border-right: 0; }
}
@media (max-width: 560px) {
  .feat-grid { grid-template-columns: 1fr; }
  .feat { border-right: 0; }
}

/* ============================================================== departments */
.depts { padding: clamp(64px, 9vw, 110px) 0; border-top: 1px solid var(--line); }
.depts__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.depts__head .eyebrow { margin-bottom: 18px; }
.depts__head h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); }
.depts__head p { margin-top: 20px; color: var(--muted); font-size: 1.08rem; line-height: 1.55; max-width: 42ch; }
.depts__points { display: grid; gap: 0; }
.depts__point { padding: 22px 0; border-top: 1px solid var(--line); }
.depts__point:first-child { border-top: 0; padding-top: 0; }
.depts__point h4 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; gap: 12px; }
.depts__point .n { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.depts__point p { margin-top: 8px; color: var(--muted); font-size: 0.96rem; line-height: 1.5; padding-left: 30px; }
@media (max-width: 860px) { .depts__grid { grid-template-columns: 1fr; gap: 36px; } }

/* =================================================================== final CTA */
.cta { padding: clamp(72px, 11vw, 150px) 0; border-top: 2px solid var(--accent); text-align: center; }
.cta .eyebrow { margin-bottom: 24px; }
.cta h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -0.04em; line-height: 0.98; }
.cta p { margin: 26px auto 0; max-width: 44ch; color: var(--muted); font-size: 1.15rem; }
.cta__actions { display: flex; gap: 16px; justify-content: center; margin-top: 42px; flex-wrap: wrap; }
.cta__fineprint { margin-top: 26px; font-size: 0.85rem; color: var(--faint); }

/* =================================================================== footer */
.foot { border-top: 1px solid var(--line); padding: 48px 0 40px; }
.foot__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot__brand { max-width: 30ch; }
.foot__brand img { height: 24px; margin-bottom: 16px; }
.foot__brand p { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.foot__cols { display: flex; gap: clamp(36px, 6vw, 80px); }
.foot__col h5 { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 14px; }
.foot__col a { display: block; font-size: 0.92rem; color: var(--muted); padding: 5px 0; transition: color 0.16s var(--ease); }
.foot__col a:hover { color: var(--text); }
.foot__colophon {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--faint); letter-spacing: 0.04em;
}

/* =================================================================== reveal
   Fail-open: content is VISIBLE by default. JS adds .reveal-on to <html> only
   when the tab is genuinely visible, which arms the hidden→shown animation.
   So a paused/background tab, reduced-motion, or no-JS all show content. */
.reveal { opacity: 1; transform: none; }
.reveal-on .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-shift));
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-on .reveal.is-in { opacity: 1; transform: none; }
.reveal-on .reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal-on .reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal-on .reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal-on .reveal[data-delay="4"] { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero h1 em::after { animation: none; transform: scaleX(1); }
  .btn, .btn__arrow, .themebtn, .nav__links a { transition: none; }
  .draw { transition: none !important; }
  .figcard__plot.exp-pulse { animation: none; }
  .dot.is-live { animation: none; }
}

/* ---- figure motion + fit-model chips ------------------------------------- */
.draw { transition: stroke-dashoffset 1.05s var(--ease); }

.dot.is-live { animation: dotpulse 2.2s ease-in-out infinite; }
@keyframes dotpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.34; } }

.figcard__plot.exp-pulse { animation: exp-pulse 0.6s var(--ease); }
@keyframes exp-pulse {
  0% { transform: translateY(0); opacity: 1; }
  28% { transform: translateY(4px); opacity: 0.55; }
  100% { transform: translateY(0); opacity: 1; }
}

.fitchip {
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.fitchip:hover { color: var(--text); border-color: var(--line-strong); }
.fitchip.is-active {
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: inset 0 -2px 0 var(--brand-45);
}
