/* Fonfody landing page.
   The base rules are the complete static page: it reads fully without JavaScript
   and with reduced motion. `.motion` (set by story.js) turns on the scroll story. */
@font-face {
  font-family: "Inter";
  src: url("/vendor/inter-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  src: url("/vendor/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #060e1f;
  --bg-2: #0b1a33;
  --text: #eef3fb;
  --muted: #a9b7cc;
  --faint: #8d9db6;
  --line: rgb(255 255 255 / 11%);
  --blue: #6fa0ff;
  --teal: #4fc6d0;
  --teal-text: #8be9ef;
  --red: #ff7a6e;
  --glass: rgb(255 255 255 / 5.5%);
  --focus: #8be9ef;
  --t: 1; /* a scene's progress; the static page shows every scene finished */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.defs {
  position: absolute;
}

.grad {
  background: linear-gradient(100deg, #fff 8%, #a9c6ff 52%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Navigation */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  backdrop-filter: blur(14px);
  background: linear-gradient(rgb(6 14 31 / 80%), rgb(6 14 31 / 0%));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand img {
  display: block;
  width: 58px;
  height: auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  color: var(--muted);
}

.nav-link:hover {
  color: var(--text);
}

/* Hidden until lang.js runs: without JavaScript the buttons would do nothing. */
.lang {
  display: none;
}

.js .lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  min-height: 30px;
  border-radius: 999px; /* the focus ring follows the pill instead of being cut by it */
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--blue);
  color: var(--bg);
}

/* Drawn inside the button: `.lang` clips anything outside it (overflow: hidden). */
.lang button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}

.lang button[aria-pressed="true"]:focus-visible {
  outline-color: var(--bg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 40px;
  overflow: hidden;
  background: radial-gradient(70% 44% at 50% 72%, #17418c 0%, transparent 66%);
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid rgb(79 198 208 / 40%);
  background: rgb(79 198 208 / 10%);
  color: var(--teal-text);
}

.pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.motion .pill i {
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(79 198 208 / 60%); }
  60% { box-shadow: 0 0 0 9px rgb(79 198 208 / 0%); }
}

h1 {
  font-size: clamp(42px, 7.2vw, 92px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 680;
  margin: 22px auto 18px;
  max-width: 12.5em;
  padding-bottom: 0.08em; /* keeps the descenders inside the clipped gradient */
}

.sub {
  font-size: clamp(16px, 1.7vw, 20px);
  color: var(--muted);
  max-width: 34em;
  margin: 0 auto;
}

.flow {
  display: block;
  width: min(1200px, 100%);
  height: clamp(110px, 18vh, 190px);
  margin: 26px auto 0;
  overflow: visible;
}

.flow path {
  fill: none;
  stroke: url("#flow-fade");
  stroke-width: 1.5;
}

.flow .pulse {
  display: none;
  stroke: #bfeff3;
  stroke-width: 2;
  stroke-dasharray: 0.05 0.95;
  stroke-linecap: round;
}

.motion .flow .pulse {
  display: inline;
  animation: run 3.6s linear infinite;
}

.motion .flow .pulse:nth-of-type(2n) {
  animation-delay: -1.2s;
}

.motion .flow .pulse:nth-of-type(3n) {
  animation-delay: -2.3s;
}

@keyframes run {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: min(1040px, 100%);
  margin: 0 auto;
  text-align: left;
}

.tile {
  display: block;
  padding: 16px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  transition: border-color 0.25s;
}

.tile:hover {
  border-color: rgb(111 160 255 / 55%);
}

.tile small {
  color: var(--teal);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.tile b {
  display: block;
  font-size: 15px;
  margin: 4px 0 2px;
  letter-spacing: -0.01em;
}

.tile span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Story: static layout, one chapter beside its scene */
.story {
  position: relative;
  background: linear-gradient(var(--bg), var(--bg-2) 12%, var(--bg-2) 88%, var(--bg));
}

.pin {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: center;
  padding: 84px clamp(24px, 6vw, 96px) 40px;
}

.rail {
  display: none;
}

.chapters,
.stage {
  display: contents;
}

.chapter {
  grid-column: 1;
  scroll-margin-top: 90px;
}

.scene {
  grid-column: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding: clamp(18px, 2.6vw, 32px);
  border-radius: 22px;
  background: linear-gradient(160deg, rgb(255 255 255 / 7.5%), rgb(255 255 255 / 2.5%));
  border: 1px solid rgb(255 255 255 / 13%);
}

.chapter:nth-child(1), .scene:nth-child(1) { grid-row: 1; }
.chapter:nth-child(2), .scene:nth-child(2) { grid-row: 2; }
.chapter:nth-child(3), .scene:nth-child(3) { grid-row: 3; }
.chapter:nth-child(4), .scene:nth-child(4) { grid-row: 4; }

.chapter small {
  color: var(--teal);
  font-weight: 650;
  letter-spacing: 0.1em;
  font-size: 13px;
}

.chapter h2 {
  font-size: clamp(30px, 3.9vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 660;
  margin: 10px 0 14px;
}

.chapter p {
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 18px);
  margin: 0;
  max-width: 30em;
}

.tag {
  align-self: flex-end;
  margin-top: 6px;
  font-size: 11px;
  color: var(--faint);
}

.head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Scene 1: channels merging */
.merge {
  flex: 1;
  position: relative;
  min-height: 300px;
}

.merge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 calc((1 - min(var(--t) * 1.6, 1)) * 100%) 0 0);
}

.merge path {
  fill: none;
  stroke: url("#flow-solid");
  stroke-width: 1.6;
}

.chip {
  position: absolute;
  left: 0;
  translate: 0 -50%;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgb(0 0 0 / 28%);
  border: 1px solid var(--line);
}

.chip-1 { top: 12%; }
.chip-2 { top: 31%; }
.chip-3 { top: 50%; }
.chip-4 { top: 69%; }
.chip-5 { top: 88%; }

.unified {
  --shown: clamp(0, calc((var(--t) - 0.55) * 3), 1);
  position: absolute;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  width: 46%;
  padding: 18px;
  border-radius: 16px;
  background: rgb(111 160 255 / 10%);
  border: 1px solid rgb(111 160 255 / 38%);
  opacity: var(--shown);
}

.unified small {
  color: var(--muted);
  font-size: 12px;
}

.unified b {
  display: block;
  font-size: 15px;
  margin: 2px 0 10px;
}

.meter-row {
  font-size: 12px;
  color: #c9d6ea;
  margin-top: 11px;
}

.meter {
  height: 6px;
  border-radius: 9px;
  background: rgb(255 255 255 / 10%);
  overflow: hidden;
  margin-top: 8px;
}

.meter i {
  display: block;
  height: 100%;
  width: calc(var(--w) * var(--shown));
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.meter-58 { --w: 58%; }
.meter-72 { --w: 72%; }
.meter-84 { --w: 84%; }

/* Scene 2: regime-controlled baseline */
.chart {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.chart .line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--t));
}

.chart .band {
  fill: rgb(79 198 208 / 9%);
}

.chart text {
  fill: var(--muted);
  font-size: 12px;
  font-family: inherit;
}

.chart .signal {
  fill: var(--teal);
}

.marker-signal,
.marker-event {
  stroke-dasharray: 4 4;
}

.marker-signal {
  stroke: var(--teal);
}

.marker-event {
  stroke: var(--red);
}

.gain {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}

.gain b {
  font-size: clamp(38px, 4.4vw, 58px);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gain span {
  color: var(--muted);
  font-size: 14px;
}

/* Scene 3: time machine */
.date {
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.scrub {
  position: relative;
  height: 4px;
  border-radius: 9px;
  background: rgb(255 255 255 / 12%);
  margin: 18px 0 24px;
}

.scrub i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--t) * 100%);
  border-radius: 9px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.scrub u {
  position: absolute;
  top: 50%;
  left: calc(var(--t) * 100%);
  translate: -50% -50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgb(79 198 208 / 28%);
}

.rows {
  display: grid;
  gap: 8px;
}

.rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 13.5px;
  background: rgb(0 0 0 / 24%);
  border: 1px solid rgb(79 198 208 / 42%);
  transition: opacity 0.3s, border-color 0.3s;
}

.rows em {
  font-style: normal;
  color: var(--muted);
}

.rows code {
  color: var(--teal-text);
  font: 600 12.5px ui-monospace, Menlo, monospace;
}

.fine {
  margin: auto 0 0;
  padding-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Scene 4: evidence-bound answer */
.ask {
  align-self: flex-end;
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px 14px 3px;
  background: rgb(111 160 255 / 20%);
  font-size: 14px;
}

.answer {
  margin: 12px 0;
  padding: 14px;
  border-radius: 14px 14px 14px 3px;
  background: rgb(0 0 0 / 26%);
  border: 1px solid var(--line);
  font-size: clamp(15px, 1.4vw, 18px);
  min-height: 118px;
}

.verified {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  transition: opacity 0.35s;
}

.verified b {
  color: var(--teal-text);
  font-weight: 600;
}

/* Closing */
.closing {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 24px 30px;
  background: radial-gradient(60% 42% at 50% 70%, #123a80, transparent 70%);
}

.closing img {
  display: block;
  width: clamp(180px, 22vw, 280px);
  height: auto;
  margin: 0 auto 26px;
}

.closing h2 {
  font-size: clamp(40px, 6.6vw, 84px);
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 20px 0 14px;
  font-weight: 680;
  padding-bottom: 0.08em;
}

.note {
  max-width: 40em;
  color: var(--muted);
  font-size: 14px;
  margin: 14px auto 0;
}

.foot {
  padding: 18px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

.foot p {
  margin: 0;
}

/* The scroll story. Only story.js sets `.motion`, so a failed script leaves the static page. */
.motion .story {
  height: 480vh;
}

.motion .pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.motion .rail {
  position: absolute;
  left: clamp(10px, 2.4vw, 36px);
  top: 50%;
  translate: 0 -50%;
  display: grid;
  gap: 14px;
}

.rail i {
  display: block;
  width: 3px;
  height: 34px;
  border-radius: 3px;
  background: rgb(255 255 255 / 14%);
  overflow: hidden;
}

.rail i::after {
  content: "";
  display: block;
  width: 100%;
  height: calc(var(--filled, 0) * 100%);
  background: var(--teal);
}

.motion .chapters {
  display: block;
  position: relative;
  height: 340px;
}

.motion .chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0; /* stays in the accessibility tree and in find-in-page */
}

.motion .stage {
  display: block;
  position: relative;
  height: min(66vh, 560px);
  border-radius: 22px;
  background: linear-gradient(160deg, rgb(255 255 255 / 7.5%), rgb(255 255 255 / 2.5%));
  border: 1px solid rgb(255 255 255 / 13%);
  box-shadow: 0 40px 100px rgb(0 0 0 / 50%), inset 0 1px 0 rgb(255 255 255 / 8%);
  overflow: hidden;
}

.motion .stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 75% 0%, rgb(111 160 255 / 17%), transparent 70%);
}

.motion .scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  background: none;
  border: 0;
  border-radius: 0;
  visibility: hidden;
}

.motion .marker,
.motion .verified {
  opacity: 0;
  transition: opacity 0.3s;
}

.motion .rows div {
  opacity: 0.28;
  border-color: var(--line);
}

.motion [data-at].on {
  opacity: 1;
}

.motion .rows div.on {
  border-color: rgb(79 198 208 / 42%);
}

@media (max-width: 860px) {
  .nav {
    padding: 10px 16px;
  }

  .nav-link {
    display: none;
  }

  .tiles {
    grid-template-columns: 1fr 1fr;
  }

  .pin {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 84px 18px 28px;
  }

  .chapter,
  .scene {
    grid-column: 1;
    grid-row: auto;
  }

  .chapter:nth-child(1) { order: 1; }
  .scene:nth-child(1) { order: 2; }
  .chapter:nth-child(2) { order: 3; }
  .scene:nth-child(2) { order: 4; }
  .chapter:nth-child(3) { order: 5; }
  .scene:nth-child(3) { order: 6; }
  .chapter:nth-child(4) { order: 7; }
  .scene:nth-child(4) { order: 8; }

  .chapter h2 {
    font-size: 28px;
  }

  .unified {
    width: 54%;
  }

  .chart text {
    font-size: 17px;
  }

  .motion .pin {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    padding: 74px 18px 20px;
  }

  .motion .rail {
    display: none;
  }
}

/* Small or short screens: every scene, its disclaimer included, must fit the stage. */
@media (max-height: 760px), (max-width: 860px) {
  .motion .pin {
    padding-top: 68px;
    padding-bottom: 14px;
  }

  .motion .chapters {
    height: 172px;
  }

  .motion .chapter small {
    font-size: 11px;
  }

  .motion .chapter h2 {
    font-size: clamp(22px, 3.4vw, 34px);
    margin: 4px 0 6px;
  }

  .motion .chapter p {
    font-size: 13px;
    line-height: 1.4;
  }

  .motion .stage {
    height: auto;
    min-height: 0;
    max-height: 100%;
    align-self: stretch;
  }

  .motion .scene {
    padding: 12px 14px 8px;
  }

  .motion .head {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .motion .date {
    font-size: 26px;
  }

  .motion .scrub {
    margin: 10px 0 12px;
  }

  .motion .rows {
    gap: 4px;
  }

  .motion .rows div {
    padding: 5px 10px;
    font-size: 12px;
  }

  .motion .ask,
  .motion .answer {
    padding: 7px 10px;
    font-size: 12.5px;
    min-height: 0;
  }

  .motion .answer {
    margin: 6px 0;
    min-height: 5.6em; /* room for the finished text, so typing does not move the rows */
  }

  .motion .fine,
  .motion .verified {
    padding-top: 6px;
    font-size: 11.5px;
    gap: 2px 12px;
  }

  .motion .tag {
    margin-top: 2px;
    font-size: 10px;
  }

  .motion .gain b {
    font-size: 30px;
  }

  .motion .gain span {
    font-size: 12px;
  }

  .motion .unified {
    padding: 10px;
  }

  .motion .merge {
    min-height: 0;
  }
}
