/* Serral — the app's editorial system, on the web.
   Palette and type roles mirror app/Theme.kt: warm near-black paper, one serif
   for anything that speaks (Instrument Serif), a mono for anything that is
   measured, a plain sans for prose. Three directional colours, never decorative. */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --ink: #141311;
  --ink-card: #1c1a17;
  --paper: #f4f1ea;
  --muted: #8b877e;
  --faint: #5e5a53;
  --rule: #2c2926;
  --bear: #c4674a;
  --bull: #5fa37a;
  --neutral: #9a958b;
  --amber: #cba35c;
  --bear-wash: #241511;
  --bull-wash: #10201a;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(22px, 4vw, 72px);
  --measure: none;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding: 0 var(--gutter) 40px;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--paper); color: var(--ink); }

.page { max-width: var(--measure); margin: 0 auto; }
.wide { max-width: none; margin: 0 auto; }

/* ---- atoms ------------------------------------------------------------ */

.label {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint);
}
.label.muted { color: var(--muted); }
.rule { height: 1px; background: var(--rule); border: 0; }

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; }
.italic { font-style: italic; }

.body { color: var(--paper); font-size: 15px; line-height: 1.55; }
.body.muted { color: var(--muted); }
.body.faint { color: var(--faint); }

/* The masthead: wordmark left, whatever the page wants to say right. */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 0 12px;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.32em; color: var(--paper);
}
.wordmark a { color: var(--paper); }

/* A ruled section mark: hairline, then the label. */
.section { margin-top: 56px; }
.section > .rule { margin-bottom: 10px; }
.section > .label { display: block; margin-bottom: 18px; }

/* Buttons match the app's Idle screen: one filled in paper, one outlined. */
.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 64px; padding: 10px 22px;
  border-radius: 8px; border: 1px solid var(--rule);
  font-family: var(--sans); font-size: 17px; font-weight: 700; line-height: 1.2;
  color: var(--paper); background: rgba(20,19,17,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.primary:hover { background: #fff; color: var(--ink); }
.btn .sub {
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.btn.primary .sub { color: var(--faint); }

/* ---- landing ---------------------------------------------------------- */

.hero { padding: 88px 0 48px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 11vw, 104px); line-height: 0.98; letter-spacing: -0.01em;
  color: var(--paper);
}
.hero .dek {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(22px, 3.4vw, 30px); line-height: 1.25;
  color: var(--muted); max-width: 22em; margin-top: 22px;
}
.stores { margin-top: 40px; }
.stores .label { display: block; margin-bottom: 12px; }
.stores .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; }
.stores .note { margin-top: 12px; font-size: 13px; color: var(--faint); }

/* Three screens, edge to edge, in the app's own dark. */
.screens {
  margin: 64px auto 0; max-width: 1200px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.screen {
  border: 1px solid var(--rule); border-radius: 14px; overflow: hidden;
  background: var(--ink-card);
}
.screen img { width: 100%; }
.screen figcaption {
  padding: 12px 14px 14px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint);
}

/* Numbered steps read like a front-page column. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.step .num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--faint); }
.step h3 {
  font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.12;
  margin: 10px 0 10px; color: var(--paper);
}
.step p { color: var(--muted); font-size: 14.5px; max-width: 42ch; }

/* What you get: a ruled list, each row a claim and its receipt. */
.claims { display: grid; grid-template-columns: 1fr; }
.claim {
  display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 8px 32px;
  padding: 24px 0; border-top: 1px solid var(--rule);
}
.claim:last-child { border-bottom: 1px solid var(--rule); }
.claim h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.12; color: var(--paper); }
.claim p { color: var(--muted); font-size: 14.5px; max-width: 64ch; }

/* The verdict specimen: the three words, their colours, nothing else. */
.verdicts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px;
}
.verdict {
  border-radius: 12px; padding: 22px 20px 20px; background: var(--ink-card);
}
.verdict .word { font-family: var(--serif); font-size: 42px; line-height: 1; letter-spacing: -0.01em; }
.verdict.bull { background: var(--bull-wash); } .verdict.bull .word { color: var(--bull); }
.verdict.bear { background: var(--bear-wash); } .verdict.bear .word { color: var(--bear); }
.verdict.neutral .word { color: var(--neutral); }
.verdict p { margin-top: 10px; color: var(--muted); font-size: 13.5px; }

.not { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.not h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--paper); }
.not p { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 42ch; }

/* Footer: hairline, then the small print. */
footer { margin-top: 72px; }
footer .rule { margin-bottom: 16px; }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 14px; }
footer .links a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
footer .links a:hover { color: var(--paper); }
footer .fine { color: var(--faint); font-size: 12.5px; max-width: 48em; }

/* ---- legal pages ------------------------------------------------------ */

.legal-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 14px; border-bottom: 1px solid var(--rule);
}
.legal-top .back { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.legal-top .back:hover { color: var(--paper); }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1.1; margin-top: 30px; }
.legal .intro { color: var(--faint); font-size: 13px; margin-top: 8px; }
.legal .intro a { color: var(--muted); border-bottom: 1px solid var(--rule); }
.legal h2 { font-family: var(--sans); font-weight: 700; font-size: 17px; color: var(--paper); margin-top: 30px; }
.legal p, .legal li { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin-top: 8px; }
.legal b { color: var(--paper); font-weight: 600; }
.legal ol { padding-left: 22px; margin-top: 4px; }
.legal li { margin-top: 6px; }
.legal .end { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 12px; }
.legal .end a { color: var(--muted); }

/* ---- small screens ---------------------------------------------------- */

@media (max-width: 760px) {
  .hero { padding-top: 64px; }
  .screens {
    display: flex; overflow-x: auto; gap: 12px; margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); max-width: none; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .screen { flex: 0 0 72%; scroll-snap-align: start; }
  .steps, .not { grid-template-columns: 1fr; gap: 28px; }
  .claim { grid-template-columns: 1fr; gap: 6px; }
  .verdicts { grid-template-columns: 1fr; }
  .stores .row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ======================================================================
   Additions 2026-09-10 — sections borrowed from the Polymaven landing
   (nav, mountain hero, proof line, three-step cards, feature stack with
   mock windows), rebuilt in Serral's dark editorial system.
   ====================================================================== */

/* Masthead grows a nav and a button; the label stays for narrow screens. */
.masthead { gap: 24px; position: relative; z-index: 2; }
.masthead .wordmark { flex: 0 0 auto; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.nav a:hover { color: var(--paper); }
.masthead .cta {
  flex: 0 0 auto; padding: 10px 18px; border: 1px solid var(--paper); border-radius: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper);
  transition: background-color .15s ease, color .15s ease;
}
.masthead .cta:hover { background: var(--paper); color: var(--ink); }
.masthead > .label { display: none; }

/* Hero with the mountain sketch on the right, fading into the ink. */
.hero { position: relative; isolation: isolate; overflow: visible; padding: 96px 0 56px; min-height: 560px; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0 calc(-1 * var(--gutter)) 0 auto; width: 58%;
  background: url("/img/mountain.webp") 58% 42% / cover no-repeat; opacity: .82;
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 30%, rgba(0,0,0,.85) 56%, #000 74%), linear-gradient(180deg, #000, #000 68%, transparent);
  mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 30%, rgba(0,0,0,.85) 56%, #000 74%), linear-gradient(180deg, #000, #000 68%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.hero > * { position: relative; }
.hero .copy { max-width: 680px; }
.hero h1 { text-shadow: 0 2px 30px rgba(20,19,17,.9); }
.hero .dek { text-shadow: 0 1px 20px rgba(20,19,17,.9); }

/* Proof line: a check, a measured fact in mono, nothing invented. */
.proof { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; margin-bottom: 26px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.proof .check { flex: 0 0 auto; margin-top: 0; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--bull); color: var(--ink); font-size: 11px; font-weight: 700; }
.proof b { color: var(--paper); font-weight: 500; }

/* The Polymaven-style primary CTA, in paper. */
.cta-main {
  display: inline-flex; align-items: center; gap: 16px; margin-top: 34px; min-height: 54px; padding: 0 26px;
  border-radius: 8px; background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500;
  transition: transform .2s ease, background-color .2s ease;
}
.cta-main:hover { background: #fff; color: var(--ink); transform: translateY(-2px); }
.cta-main::after { content: "→"; font-size: 15px; }
.hero .stores { margin-top: 36px; }

/* Three-step cards: one panel with internal dividers, an illustration each. */
.how-head { text-align: center; margin-top: 96px; }
.how-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 68px); line-height: 1; letter-spacing: -0.01em; }
.how-head p { margin-top: 14px; color: var(--muted); font-size: 17px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 40px; border: 1px solid var(--rule); border-radius: 12px; background: var(--ink-card); overflow: hidden; }
.steps3 article { padding: 22px; }
.steps3 article + article { border-left: 1px solid var(--rule); }
.steps3 .visual {
  position: relative; height: 200px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  background-color: var(--ink);
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px; background-position: center;
}
.steps3 .visual::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, var(--ink) 100%); pointer-events: none; }
.steps3 .stepno { display: block; margin-top: 22px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--amber); }
.steps3 h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; margin-top: 8px; }
.steps3 p { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* 01 — a stack of chart photos with an upload mark. */
.v-upload .card { position: absolute; left: 50%; top: 50%; width: 58%; height: 46%; border-radius: 6px; border: 1px solid var(--rule); background: var(--ink-card); transform: translate(-50%, -50%); }
.v-upload .card.b { transform: translate(-56%, -60%) rotate(-3deg); opacity: .55; }
.v-upload .card.c { transform: translate(-44%, -40%) rotate(3deg); opacity: .55; }
.v-upload .card.a { z-index: 1; border-color: var(--muted); background: #22201c; }
.v-upload .card.a::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 18%; height: 1px; background: var(--rule); }
.v-upload .mark { position: absolute; z-index: 2; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%; background: var(--paper); color: var(--ink); transform: translate(-50%, -50%); display: grid; place-items: center; font-size: 20px; font-family: var(--sans); }

/* 02 — the signal tally: five bars, four bearish, one neutral. */
.v-tally .lbl { position: absolute; left: 16px; top: 14px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: var(--faint); }
.v-tally .bars { position: absolute; left: 50%; bottom: 30px; display: flex; align-items: flex-end; gap: 14px; transform: translateX(-50%); }
.v-tally .bars i { display: block; width: 16px; border-radius: 3px 3px 0 0; background: var(--bear); }
.v-tally .bars i.n { background: var(--neutral); }
.v-tally .base { position: absolute; left: 16px; right: 16px; bottom: 30px; height: 1px; background: var(--rule); }

/* 03 — the verdict, ringed. */
.v-verdict .ring { position: absolute; left: 50%; top: 50%; border: 1px solid var(--muted); border-radius: 50%; transform: translate(-50%, -50%); opacity: .55; }
.v-verdict .ring.r1 { width: 92px; height: 92px; opacity: .9; }
.v-verdict .ring.r2 { width: 132px; height: 132px; }
.v-verdict .ring.r3 { width: 172px; height: 172px; opacity: .3; }
.v-verdict .word { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--serif); font-size: 26px; color: var(--bull); letter-spacing: 0.01em; }

/* Feature stack: copy left, a mock "read" window right, ruled between rows. */
.stack { margin-top: 56px; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--ink); }
.feat { display: grid; grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr); gap: 48px; align-items: center; padding: 40px 42px; }
.feat + .feat { border-top: 1px solid var(--rule); }
.feat .num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--amber); }
.feat h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; margin-top: 12px; }
.feat p { margin-top: 14px; color: var(--muted); font-size: 14.5px; max-width: 46ch; }
.win { justify-self: end; width: min(100%, 520px); border: 1px solid var(--rule); border-radius: 10px; background: var(--ink-card); overflow: hidden; transition: transform .25s ease; }
.feat:hover .win { transform: translateY(-3px); }
.win .bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--rule); }
.win .bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); }
.win .bar span { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--faint); }
.win .body { padding: 22px 24px 24px; }
.win .live { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--faint); }
.win .live b { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.win .ui { margin-top: 28px; color: var(--muted); font-size: 14px; }
.win .stat { display: block; margin-top: 6px; font-family: var(--mono); font-size: clamp(26px, 3vw, 36px); font-weight: 500; letter-spacing: -0.02em; color: var(--paper); }
.win .stat.bear { color: var(--bear); } .win .stat.bull { color: var(--bull); } .win .stat.amber { color: var(--amber); }
.win .track { position: relative; margin-top: 20px; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.win .track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--paper); }
.win .track span.bear { background: var(--bear); } .win .track span.amber { background: var(--amber); } .win .track span.bull { background: var(--bull); }
.win .meta { display: flex; justify-content: space-between; margin-top: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

@media (max-width: 900px) {
  .nav { display: none; }
  .hero { padding-top: clamp(220px, 46vw, 330px); min-height: 0; }
  .hero::before { inset: 40px calc(-1 * var(--gutter)) auto calc(-1 * var(--gutter)); width: auto; height: clamp(220px, 46vw, 330px); background-position: 50% 50%; opacity: .95;
    -webkit-mask-image: linear-gradient(180deg, #000, #000 70%, transparent); mask-image: linear-gradient(180deg, #000, #000 70%, transparent);
    -webkit-mask-composite: initial; mask-composite: add; }
  .steps3 { grid-template-columns: 1fr; }
  .steps3 article + article { border-left: 0; border-top: 1px solid var(--rule); }
  .feat { grid-template-columns: 1fr; gap: 26px; padding: 28px 22px; }
  .win { justify-self: start; }
}
@media (max-width: 760px) {
  .masthead .cta { padding: 8px 12px; font-size: 10px; }
  .how-head { margin-top: 72px; }
  .proof { font-size: 11px; }
}
