/* Numrat Flasin · site styles
   Paper = public side, blueprint = business side (see website-positioning.md) */

:root {
  --paper: #efede9;
  --paper-edge: #e0dfd8;
  --grid: #e2e0da;
  --line: #dcdad3;
  --card: #f8f7f3;
  --ink: #161616;
  --ink-2: #3a3935;
  --ink-3: #5b5a55;
  --red: #d0202a;
  --yellow: #f5c84b;
  --green: #187049;
  --navy: #121930;
  --navy-2: #1d2747;
  --cyan: #7fd0ff;
  --cyan-soft: rgba(127, 208, 255, 0.45);
  --bp-text: #c9d3ea;
  --bp-muted: #9fb0d4;
  --gain: #3ddc97;
  --loss: #ff5a64;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 7vw, 96px);
  --shadow: 0 30px 60px -32px rgba(22, 22, 22, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: var(--section-y) var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.grid-2 { display: grid; gap: 40px; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* ---------- backgrounds ---------- */
.bg-paper { background-color: var(--paper); }
.bg-grid {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
}
.bg-blueprint {
  background-color: var(--navy);
  background-image: linear-gradient(rgba(127,208,255,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(127,208,255,0.07) 1px, transparent 1px);
  background-size: 80px 80px;
  color: #fff;
}
.bg-blueprint a:not(.btn) { color: var(--cyan); }
.border-top { border-top: 1px solid var(--line); }
.bg-blueprint.border-top { border-top-color: rgba(127,208,255,0.18); }

/* ---------- type ---------- */
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--red); letter-spacing: 0; }
.cyan { color: var(--cyan); }
.glow { text-shadow: 0 0 26px rgba(127,208,255,0.5); }
.mark { background: var(--yellow); padding: 0 4px; }
.mono {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.mono-sm { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.muted { color: var(--ink-3); }
.bg-blueprint .muted { color: var(--bp-muted); }
.lead { margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.45; color: var(--ink-2); max-width: 680px; }
.body { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.bg-blueprint .lead, .bg-blueprint .body { color: var(--bp-text); }
h1, h2, h3, p { margin: 0; }
.h1 { font-weight: 900; font-size: clamp(48px, 8vw, 104px); line-height: 0.95; letter-spacing: -0.045em; }
.h2 { font-weight: 900; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -0.035em; }
.h3 { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.wordmark { font-weight: 900; font-size: clamp(72px, 13vw, 184px); line-height: 0.86; letter-spacing: -0.05em; }
.wordmark .serif { letter-spacing: -0.02em; }

/* ---------- chips ---------- */
.chip {
  align-self: flex-start; display: inline-block;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px;
}
.chip-bp { background: var(--navy-2); color: var(--cyan); border: 1px solid var(--cyan); }
.chip-yellow { background: var(--yellow); color: var(--ink); }
.chip-light { background: var(--card); color: var(--ink-2); }
.chip-sm { font-size: 11px; letter-spacing: 0.12em; padding: 5px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 14px 22px; border-radius: 999px; font-weight: 700; font-size: 16px;
  text-decoration: none; background: var(--ink); color: #fff; border: 0; cursor: pointer;
  font-family: var(--sans); transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: #fff; transform: translateY(-1px); }
.btn-cyan { background: var(--cyan); color: var(--navy); font-weight: 800; box-shadow: 0 0 24px rgba(127,208,255,0.45); }
.btn-cyan:hover { color: var(--navy); box-shadow: 0 0 34px rgba(127,208,255,0.65); }
.btn-outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); padding: 12px 22px; }
.btn-outline:hover { color: var(--ink); background: rgba(22,22,22,0.05); }
.btn-green { background: var(--green); }
.btn-lg { font-size: 17px; padding: 16px 26px; }
.btns { display: flex; flex-wrap: wrap; gap: 14px; }
.link-arrow { font-weight: 700; font-size: 16px; }

/* ---------- header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .bar {
  max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-text { font-weight: 900; font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; }
.logo-text .serif { font-size: 23px; }
.nav { display: flex; align-items: center; gap: 8px 28px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a[aria-current="page"] { color: var(--red); }
.nav .btn { font-size: 15px; padding: 10px 18px; color: #fff; }
.nav-toggle {
  display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer;
  min-width: 44px; min-height: 44px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 14px; border-bottom: 0; }
}

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: 22px; padding: 32px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.card-bp {
  border: 1px solid var(--cyan-soft); border-radius: 22px; padding: 30px;
  background: rgba(18,25,48,0.6); display: flex; flex-direction: column; gap: 16px; color: #fff;
}
.card-bp.focus { border: 2px solid var(--cyan); background: rgba(127,208,255,0.08); box-shadow: 0 0 40px rgba(127,208,255,0.25); }
.door-bp {
  background-color: var(--navy);
  background-image: radial-gradient(circle at 70% 30%, rgba(127,208,255,0.16), transparent 60%), linear-gradient(rgba(127,208,255,0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(127,208,255,0.09) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  color: #fff; box-shadow: 0 30px 60px -30px rgba(18,25,48,0.6);
}
.card .btn, .card-bp .btn { margin-top: auto; align-self: flex-start; }
.card p.t, .card-bp p.t { font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.card p.d { font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.door-bp p.d, .card-bp p.d { color: var(--bp-text); }

/* number card */
.num-card { background: var(--card); border-radius: 20px; padding: 26px; box-shadow: 0 30px 60px -36px rgba(22,22,22,0.3); display: flex; flex-direction: column; gap: 6px; }
.big-num { font-weight: 900; font-size: 64px; letter-spacing: -0.04em; line-height: 1; }
.big-num .serif { font-size: 30px; }

/* ---------- episode cards ---------- */
.ep-card {
  text-decoration: none; color: var(--ink); background: var(--card); border-radius: 22px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ep-card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: 0 40px 70px -32px rgba(22,22,22,0.38); }
.ep-visual {
  aspect-ratio: 4 / 5; position: relative; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 14px; padding: 24px;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
}
.ep-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-visual.bp {
  background-color: var(--navy); color: #fff;
  background-image: linear-gradient(rgba(127,208,255,0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(127,208,255,0.09) 1px, transparent 1px);
}
.ep-visual .case { position: absolute; top: 16px; right: 16px; }
.ep-meta { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.ep-meta .sum { font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.vs { display: flex; align-items: flex-end; gap: 28px; }
.vs > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs .n { font-weight: 900; font-size: 60px; letter-spacing: -0.04em; line-height: 1; }
.n-loss { color: var(--loss); text-shadow: 0 0 22px rgba(255,90,100,0.45); }
.n-gain { color: var(--gain); text-shadow: 0 0 22px rgba(61,220,151,0.45); }
.hazard {
  width: 100%; background: var(--ink); color: #fff; text-align: center; padding: 10px 0;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  background-image: repeating-linear-gradient(135deg, var(--yellow) 0 10px, var(--ink) 10px 20px), repeating-linear-gradient(135deg, var(--yellow) 0 10px, var(--ink) 10px 20px);
  background-size: 36px 100%, 36px 100%; background-repeat: no-repeat; background-position: left center, right center;
}

/* ---------- scan bridge ---------- */
.bridge {
  position: relative; overflow: hidden; background-color: var(--navy);
  background-image: linear-gradient(90deg, var(--paper) 0, var(--paper) var(--scan, 34%), transparent var(--scan, 34%)), linear-gradient(rgba(127,208,255,0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(127,208,255,0.09) 1px, transparent 1px);
  background-size: 100% 100%, 80px 80px, 80px 80px;
}
.bridge .scan {
  position: absolute; top: 0; bottom: 0; left: var(--scan, 34%); width: 3px; background: var(--cyan);
  box-shadow: 0 0 18px 4px rgba(127,208,255,0.7), 0 0 60px 12px rgba(127,208,255,0.25);
}
.bridge .wrap { position: relative; display: flex; justify-content: flex-end; padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }
.bridge .inner { max-width: 660px; padding-left: clamp(16px, 4vw, 48px); }
@media (max-width: 700px) {
  .bridge { --scan: 6px; }
}
.scan-h { height: 3px; background: var(--cyan); box-shadow: 0 0 18px 4px rgba(127,208,255,0.6); }

/* ---------- waterfall ---------- */
.waterfall { border: 1px solid rgba(127,208,255,0.35); border-radius: 22px; padding: 28px; background: rgba(18,25,48,0.6); display: flex; flex-direction: column; gap: 18px; margin: 0; }
.wf-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; height: 300px; border-top: 1px solid var(--cyan); }
.wf-col { display: flex; flex-direction: column; }
.wf-bar {
  background: rgba(255,90,100,0.85); border-radius: 0 0 8px 8px; box-shadow: 0 0 24px rgba(255,90,100,0.35);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px;
  font-weight: 900; font-size: 26px; color: #fff;
}
.wf-total { border: 2px solid var(--loss); border-top: 0; background: rgba(255,90,100,0.15); box-shadow: none; color: var(--loss); font-size: 32px; }
.wf-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; text-align: center; line-height: 1.5; }
.wf-labels span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- offers ---------- */
.offer-light { background: var(--card); color: var(--ink); border-radius: 22px; padding: 30px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 0 0 2px var(--cyan), 0 0 48px rgba(127,208,255,0.35); }
.offer-name { font-weight: 900; font-size: 34px; letter-spacing: -0.03em; line-height: 1.05; }
.offer-list { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.7; }
.offer-light .offer-list { color: var(--ink-2); }
.card-bp .offer-list { color: var(--bp-text); }
.offer-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(127,208,255,0.25); display: flex; flex-direction: column; gap: 4px; }
.offer-light .offer-foot { border-top-color: var(--line); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- placeholders ---------- */
.ph {
  border: 1.5px dashed #b8b6ae; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
  text-align: center; padding: 16px;
}
.logos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.logos .ph { height: 88px; }
.photo { aspect-ratio: 4 / 5; max-width: 440px; width: 100%; background: var(--paper-edge); border-radius: 22px; }

/* ---------- forms ---------- */
.form { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; }
.input, .textarea, .select {
  flex: 1 1 240px; min-width: 0; min-height: 50px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid #b8b6ae; background: var(--card); font-family: var(--sans); font-size: 16px; color: var(--ink);
}
.textarea { border-radius: 18px; padding: 14px 18px; min-height: 140px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 8px; }
.form-note { font-size: 14px; color: var(--ink-3); }

/* ---------- episode page ---------- */
.ep-hero { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.player {
  position: relative; aspect-ratio: 4 / 5; max-width: 460px; width: 100%; border-radius: 22px; overflow: hidden;
  background: var(--navy); box-shadow: var(--shadow); justify-self: center;
}
.player img { width: 100%; height: 100%; object-fit: cover; }
.player .ph { position: absolute; inset: 16px; border-color: rgba(127,208,255,0.5); color: var(--cyan); background: rgba(18,25,48,0.55); }
.player video, .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.script p { font-size: 18px; line-height: 1.65; color: var(--ink-2); max-width: 720px; }
.script p + p { margin-top: 14px; }
.src-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.src-table th, .src-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.src-table th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bars { display: flex; flex-direction: column; gap: 18px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.bar-track { background: rgba(127,208,255,0.1); border-radius: 8px; height: 44px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; font-weight: 900; font-size: 20px; color: var(--navy); width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.bar-fill.cyan-fill { background: var(--cyan); box-shadow: 0 0 24px rgba(127,208,255,0.4); }
.bar-fill.loss-fill { background: var(--loss); color: #fff; box-shadow: 0 0 24px rgba(255,90,100,0.4); }
.bar-fill.gain-fill { background: var(--gain); box-shadow: 0 0 24px rgba(61,220,151,0.4); }
.bar-fill.ink-fill { background: var(--ink); color: #fff; }
.bar-row .lbl { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.timeline { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.cta-band { text-align: center; align-items: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #fff; }
.site-footer .top { max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.site-footer .wm { font-weight: 900; font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.site-footer .wm .serif { color: #ff6b73; font-size: 38px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-footer a { color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.site-footer a:hover { color: #ff6b73; }
.site-footer .bottom { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 32px; color: #a8a6a0; }
.site-footer .tag { color: #a8a6a0; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); filter: blur(6px); transition: opacity .5s ease, transform .5s ease, filter .5s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .bar-fill { transition: none; }
}
