/* Abyss landing page.
   One ground (Abyss, near-black), one accent (Blue). Copy sits on flat ground or on the
   quiet part of the depth chart. No cards, no glows, no gradient text.
   Motion: three explanatory pieces (hero chart, settlement sequence, shield lens) and a
   crossing loop. Everything else is still. */

:root {
  --abyss: #0B1226;           /* brighter than the old near-black #070A10 */
  --navy: #122050;            /* the lifted band (Ethereum section) */
  --paper: #EEF2FA;           /* light sections */
  --paper-ink: #0A1020;
  --paper-muted: #46536C;     /* 7:1 on paper */
  --paper-line: #C5D0E6;
  --sky: #8FB2FF;
  --raise: #131D3A;
  --blue: #427BFF;
  --blue-dim: #3C5CA8;

  --white: #FFFFFF;
  --text: #E6EAF2;
  --soft: #CDD6E6;         /* 11:1 on Abyss */
  --muted: #AEB9CC;        /* 7.9:1 on Abyss */
  --faint: #7C8AA6;        /* 4.4:1: borders and inactive marks only, never body text */
  --line: #27345A;
  --ink: #070A10;

  --font-display: 'Funnel Display', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: Funnel Sans, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Azeret Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --size-hero: clamp(42px, 7vw, 112px);
  --size-section: clamp(36px, 4.5vw, 72px);
  --size-body: clamp(17px, 16px + .28vw, 20px);
  --size-note: clamp(16px, 15px + .2vw, 18px);
  --size-small: 15px;

  --gutter: clamp(20px, 5vw, 72px);
  --wrap: 1280px;
  --section-gap: clamp(96px, 13vw, 192px);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --press: 120ms;
  --hover-in: 140ms;
  --hover-out: 200ms;

  --header-h: 72px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--abyss);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 200;
  padding: 12px 18px; border-radius: 999px;
  background: var(--white); color: var(--ink); font-weight: 500; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }

/* ---------- Type ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1;
  color: var(--white);
  text-wrap: balance;
}
.hero h1 { font-size: var(--size-hero); }
h2.display { font-size: var(--size-section); }

.lede { max-width: 34em; color: var(--muted); text-wrap: pretty; }
.lede + .lede { margin-top: .9em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.status { margin-top: 20px; font-size: var(--size-small); color: var(--muted); }

/* ---------- Links and buttons ---------- */

.link {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
}
.link--underlined { background-size: 100% 1px; }
@media (hover: hover) and (pointer: fine) {
  .link { transition: background-size 340ms var(--ease-out); }
  .link:hover { background-size: 100% 1px; }
  .link--underlined:hover { background-size: 0 1px; background-position: 100% 100%; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px; border-radius: 999px;
  font: 500 17px/24px var(--font-body); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--press) var(--ease-out),
              background-color var(--hover-out) var(--ease-out),
              border-color var(--hover-out) var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--white); color: var(--ink); }
.btn--quiet { color: var(--white); border-color: var(--faint); background: rgba(11, 18, 38, .6); }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 15px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transition-duration: var(--press), var(--hover-in), var(--hover-in); }
  .btn--primary:hover { background: #D9E4FF; }
  .btn--quiet:hover { border-color: var(--white); }
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */

.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  color: var(--white);
  transition: transform 320ms var(--ease-out), background-color 200ms linear;
}
.header[data-solid="true"] { background: var(--abyss); }
.header[data-hidden="true"] { transform: translateY(-100%); }
.header:focus-within { transform: none; }
.header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.lockup { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.lockup span {
  display: block; width: 132px; aspect-ratio: 207 / 44; background: currentColor;
  -webkit-mask: url(../img/abyss-lockup.svg) center / contain no-repeat;
          mask: url(../img/abyss-lockup.svg) center / contain no-repeat;
}

.nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 40px); }
.nav a:not(.btn) { font-size: 16px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

.menu-toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer; border-radius: 999px;
}
.menu-toggle svg { display: block; margin: auto; }
.menu-toggle line { transition: transform 240ms var(--ease-out); transform-origin: 12px 12px; }
.menu-toggle[aria-expanded="true"] line:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] line:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; height: calc(100dvh - var(--header-h));
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
    padding: 24px var(--gutter) 40px; background: var(--abyss); color: var(--white);
    overflow-y: auto; visibility: hidden; opacity: 0;
    transition: opacity 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .nav[data-open="true"] { visibility: visible; opacity: 1; transition-delay: 0s; }
  .nav a:not(.btn) { font: 600 32px/1.2 var(--font-display); letter-spacing: -.02em; min-height: 60px; background: none; }
  .nav .btn { margin-top: 24px; min-height: 56px; padding: 0 28px; font-size: 17px; }
  /* Without JavaScript the toggle cannot work, so only the main action stays in the bar. */
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .nav { position: static; height: auto; flex-direction: row; padding: 0; visibility: visible; opacity: 1; background: none; }
  html:not(.js) .nav a:not(.btn) { display: none; }
  html:not(.js) .nav .btn { margin: 0; min-height: 44px; padding: 0 20px; font-size: 15px; }
}

/* ---------- Hero: full-bleed living chart ---------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center;
  min-height: min(100svh, 980px);
  padding-block: calc(var(--header-h) + 48px) clamp(72px, 10vw, 140px);
  text-align: center;
}
.hero__art, .hero__canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero__art { background: url(../img/chart-hero.svg) center bottom / cover no-repeat; opacity: .8; }
.hero__canvas { display: none; }
/* When the live chart is running it replaces the still plate. */
.hero.is-live .hero__art { display: none; }
.hero.is-live .hero__canvas { display: block; }
/* A soft pool of ground colour behind the copy, and a fade into the page below. */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 40% at 50% 46%, rgba(11, 18, 38, .92) 0%, rgba(11, 18, 38, .78) 45%, rgba(11, 18, 38, 0) 100%),
    linear-gradient(rgba(11, 18, 38, 0) 72%, var(--abyss));
}
.hero .wrap { display: flex; flex-direction: column; align-items: center; }
.hero .lede { margin-top: clamp(20px, 2.4vw, 32px); max-width: 30em; color: var(--soft); }
.hero .actions { margin-top: clamp(28px, 3vw, 40px); justify-content: center; }

/* Masked entrance for the headline. A CSS animation, so no script can leave it hidden. */
.reveal > span { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.reveal > span > span { display: block; animation: rise 700ms var(--ease-out) both; }
.reveal > span:nth-child(2) > span { animation-delay: 70ms; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }

/* ---------- Sections ---------- */

.section { padding-block: var(--section-gap); }
.section--follow { padding-top: 0; }

/* Light sections: paper ground, ink type. */
.section--paper { background: var(--paper); color: var(--paper-ink); padding-block: var(--section-gap); }
.section--paper .display, .section--paper h3, .section--paper summary { color: var(--paper-ink); }
.section--paper .lede, .section--paper p, .section--paper figcaption { color: var(--paper-muted); }
.section--paper .faq, .section--paper .faq details { border-color: var(--paper-line); }
.section--paper .faq a { color: var(--paper-ink); }
.section--paper + .section { padding-top: var(--section-gap); }
.section--paper .capture figcaption { color: var(--paper-muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.section__head .lede { margin-top: clamp(20px, 2.2vw, 28px); }
.section__head .lede + .lede { margin-top: .9em; }

.capture { justify-self: end; width: 100%; max-width: 440px; }
.capture img { width: 100%; border-radius: 10% / 8.01%; }
.capture figcaption { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }



/* ---------- How a swap settles: steps scroll past a pinned diagram ---------- */

.seq { padding-top: 0; }
.seq__body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px);
  margin-top: clamp(40px, 5vw, 72px); align-items: start;
}
.seq__steps { counter-reset: step; }
.seq__steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 8px; align-content: center;
  padding-block: 28px; border-top: 1px solid var(--line);
  transition: opacity 320ms var(--ease-out);
}
.seq__steps li::before {
  content: counter(step); grid-row: span 2;
  font: 400 15px/1 var(--font-mono); color: var(--muted); padding-top: .62em;
}
.seq__steps h3, .crossing h3 { font: 600 clamp(22px, 2.1vw, 30px)/1.15 var(--font-display); letter-spacing: -.02em; color: var(--white); }
.seq__steps p { margin-top: 10px; max-width: 30em; color: var(--muted); font-size: var(--size-note); }

.seq__visual { border-top: 1px solid var(--faint); }
.seq__row {
  display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 4px 16px;
  padding: 20px 0 20px 16px; border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: opacity 320ms var(--ease-out), border-color 320ms var(--ease-out);
}
.seq__label { font-size: var(--size-small); color: var(--muted); padding-top: 3px; }
.seq__value { font-size: clamp(17px, 1.5vw, 21px); color: var(--white); }
.seq__state { grid-column: 2; font-size: var(--size-small); color: var(--soft); min-height: 1.55em; }
.seq__state b { font-weight: 400; }
.seq__visual figcaption { margin-top: 14px; font-size: 13px; color: var(--muted); }

.aside { margin-top: clamp(32px, 4vw, 56px); max-width: 44em; padding-left: 18px; border-left: 2px solid var(--blue); color: var(--text); font-size: var(--size-note); }

/* The scroll-driven behaviour only switches on when the script has taken over. */
@media (min-width: 961px) {
  .seq.is-live .seq__steps li { min-height: 62vh; border-top-color: transparent; }
  .seq.is-live .seq__steps li:first-child { min-height: 46vh; align-content: start; padding-top: 12vh; }
  .seq.is-live .seq__steps li:last-child { min-height: 52vh; }
  .seq.is-live .seq__visual { position: sticky; top: calc(50vh - 190px); }
}
.seq.is-live .seq__steps li:not(.is-now) { opacity: .34; }
.seq.is-live .seq__row:not(.is-on) { opacity: .3; }
.seq.is-live .seq__row.is-now { border-left-color: var(--blue); }

/* ---------- Shielded or unshielded ---------- */

/* A public ledger scrolls behind the copy; a lens under the cursor redacts it. */
.shield { position: relative; overflow: hidden; isolation: isolate; }
.shield .wrap { display: flex; align-items: center; min-height: clamp(520px, 46vw, 720px); }
.shield__copy { max-width: min(44%, 580px); }
.shield__canvas { display: none; position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.js .shield__canvas { display: block; }
.shield__hint { margin-top: 28px; }
@media (hover: none) { .shield__hint span { display: none; } }

.caveat { margin-top: clamp(28px, 3vw, 40px); max-width: 34em; padding-left: 18px; border-left: 2px solid var(--blue); color: var(--text); font-size: var(--size-note); }

/* Fallback lists, only when scripts are off or failed. */
.ledger { flex: 1; margin-left: clamp(40px, 6vw, 96px); }
.js .ledger { display: none; }
.ledger__view + .ledger__view { margin-top: 28px; }
.ledger__view h3 { padding-bottom: 10px; font: 500 15px/1.4 var(--font-body); color: var(--white); border-bottom: 1px solid var(--faint); }
.ledger dl > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ledger dt { font-size: 16px; color: var(--muted); }
.ledger dd { font: 500 16px/1.5 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.ledger dd.is-absent { font-family: var(--font-body); font-weight: 400; color: var(--muted); }

/* ---------- Ethereum and back: a dive from the public surface into Midnight ---------- */

.route { background: var(--navy); }
.route .lede { color: var(--soft); max-width: 36em; }
.crossing-wrap { --drop: clamp(56px, 6vw, 84px); position: relative; margin-top: clamp(56px, 7vw, 104px); }
.crossing {
  --drop: clamp(56px, 6vw, 84px);
  position: relative;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
/* Below this line the swap is shielded. */
.crossing::before {
  content: ""; position: absolute; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter));
  top: calc(var(--drop) * 1.5); height: calc(var(--drop) * .5 + 36px); z-index: 0;
  background: var(--abyss); border-top: 1px dashed var(--sky);
}
.crossing__path { position: absolute; left: 6px; top: 6px; width: 80%; height: calc(var(--drop) * 2); z-index: 1; overflow: visible; }
.crossing__path polyline { fill: none; stroke: var(--sky); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.crossing > li:not(.crossing__dot):not(.crossing__zone) { position: relative; z-index: 2; padding: calc(var(--drop) * 2 + 72px) 24px 0 0; }
.crossing > li:nth-of-type(2)::after, .crossing > li:nth-of-type(4)::after { top: var(--drop) !important; }
.crossing > li:nth-of-type(3)::after { top: calc(var(--drop) * 2) !important; }
.crossing > li:not(.crossing__dot):not(.crossing__zone)::after {             /* the station */
  content: ""; position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--navy); border: 2px solid var(--white);
}
.crossing > li:nth-of-type(3)::after { background: var(--blue) !important; }
.crossing .where { font: 400 14px/1.4 var(--font-mono); color: var(--sky); }
.crossing h3 { margin-top: 6px; }
.crossing p:not(.where) { margin-top: 8px; max-width: 20em; color: var(--soft); font-size: var(--size-note); }
.crossing__zone { position: absolute; right: 0; z-index: 2; font: 400 14px/1.4 var(--font-mono); color: var(--sky); }
.crossing__zone--public { top: calc(var(--drop) * 1.5 - 30px); right: auto; left: 86%; }
.crossing__zone--shielded { top: calc(var(--drop) * 1.5 + 12px); right: auto; left: 86%; }
.route .aside { position: relative; z-index: 2; margin-top: clamp(40px, 5vw, 64px); max-width: 36em; color: var(--white); font-size: var(--size-body); }
.route .status { position: relative; z-index: 2; color: var(--soft); }

/* The token dives, stays under for the swap, and resurfaces. */
.crossing__dot {
  position: absolute; z-index: 3; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--white); opacity: 0; pointer-events: none;
}
.crossing.is-live .crossing__dot { animation: cross-x 9s linear infinite; }
@keyframes cross-x {
  0%   { left: 2px; top: 2px; opacity: 0; }
  5%   { left: 2px; top: 2px; opacity: 1; }
  25%  { left: calc(20% + 2px); top: calc(var(--drop) + 2px); opacity: 1; }
  42%, 58% { left: calc(40% + 2px); top: calc(var(--drop) * 2 + 2px); opacity: 1; }
  75%  { left: calc(60% + 2px); top: calc(var(--drop) + 2px); opacity: 1; }
  95%  { left: calc(80% + 2px); top: 2px; opacity: 1; }
  100% { left: calc(80% + 2px); top: 2px; opacity: 0; }
}

/* ---------- Questions ---------- */

#questions .split { align-items: start; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 72px; padding: 18px 0; cursor: pointer; list-style: none;
  font: 600 clamp(19px, 1.6vw, 23px)/1.3 var(--font-display); letter-spacing: -.015em; color: var(--white);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; margin-right: 4px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-3px) rotate(45deg); transition: transform 240ms var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(225deg); }
.faq details p { max-width: 36em; padding: 0 0 26px; color: var(--muted); font-size: var(--size-note); }
.faq details p + p { margin-top: -10px; }
.faq a { color: var(--text); }

/* ---------- Closing ---------- */

/* The copy sits on flat ground; the trench plate closes the page beneath it. */
.closing { padding-top: clamp(24px, 4vw, 64px); }
.closing__art {
  height: clamp(260px, 36vw, 640px); margin-top: clamp(40px, 5vw, 72px);
  background: url(../img/chart-trench.svg) center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 55%);
          mask-image: linear-gradient(transparent, #000 55%);
}
.closing__art canvas { display: none; width: 100%; height: 100%; }
.closing.is-live .closing__art { background-image: none; }
.closing.is-live .closing__art canvas { display: block; }
.closing .display { max-width: 9em; }
.closing .lede { margin-top: clamp(20px, 2.2vw, 28px); color: var(--soft); }
.closing .actions { margin-top: clamp(28px, 3vw, 40px); }

/* ---------- Footer ---------- */

.footer { padding-block: 32px 40px; font-size: var(--size-small); color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.footer .lockup { color: var(--white); }
.footer .lockup span { width: 112px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.footer nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--text); }
.footer .built { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.footer .built img { width: 18px; height: 18px; border-radius: 4px; }
.footer .built b { font-weight: 500; color: var(--text); }
.footer .legal { flex-basis: 100%; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .capture { justify-self: start; max-width: 420px; }
  .hero::after {
    background:
      radial-gradient(ellipse 90% 34% at 50% 44%, rgba(11, 18, 38, .94) 0%, rgba(11, 18, 38, .8) 55%, rgba(11, 18, 38, 0) 100%),
      linear-gradient(rgba(11, 18, 38, 0) 72%, var(--abyss));
  }

  /* Sequence: the diagram pins under the header and the steps scroll beneath it. */
  .seq__body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .seq__visual { order: -1; }
  .seq.is-live .seq__visual {
    position: sticky; top: 0; z-index: 5; margin-inline: calc(-1 * var(--gutter));
    /* Room for the header, which returns over this strip when the page scrolls up. */
    padding: calc(var(--header-h) + 4px) var(--gutter) 0;
    background: var(--abyss); border-top: 0; box-shadow: 0 1px 0 var(--line);
  }
  .seq.is-live .seq__visual figcaption { display: none; }
  .seq.is-live .seq__row { padding-block: 9px; grid-template-columns: 6.6em minmax(0, 1fr); }
  .seq.is-live .seq__value { font-size: 15px; }
  .seq.is-live .seq__state { font-size: 13px; }
  .seq.is-live .seq__steps li { min-height: 46vh; border-top-color: transparent; }
  .seq.is-live .seq__steps li:last-child { min-height: 34vh; }

  .shield { padding-bottom: 0; }
  .shield .wrap { display: block; min-height: 0; }
  .shield__copy { max-width: none; }
  .shield__canvas { position: static; height: 380px; margin-top: 40px; z-index: 0; }
  .ledger { margin: 40px 0 var(--section-gap); }
}
@media (max-width: 900px) {
  .crossing { grid-template-columns: minmax(0, 1fr); }
  .crossing::before, .crossing__path, .crossing__zone { display: none; }
  .crossing > li:not(.crossing__dot):not(.crossing__zone) { margin-top: 0; padding: 0 0 36px 34px; border-left: 1px solid var(--sky); margin-left: 6px; }
  .crossing > li:nth-of-type(5) { padding-bottom: 0; border-left-color: transparent; }
  .crossing > li:not(.crossing__dot):not(.crossing__zone)::after { left: -7px; top: 0 !important; }
  .crossing > li:nth-of-type(3) { background: var(--abyss); margin-inline: 6px 0; padding-top: 20px; padding-bottom: 28px; margin-bottom: 36px; }
  .crossing > li:nth-of-type(3)::after { top: 20px !important; }
  .crossing.is-live .crossing__dot { display: none; }
}
@media (max-width: 420px) {
  .actions .btn { flex: 1 1 100%; }
  .seq__steps li { grid-template-columns: 2em minmax(0, 1fr); }
}
@media (min-width: 1800px) {
  :root { --wrap: 1480px; --header-h: 84px; }
  .lockup span { width: 156px; }
  .capture { max-width: 520px; }
  .nav a:not(.btn) { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal > span > span { animation: none; }
  .header[data-hidden="true"] { transform: none; }
  .crossing.is-live .crossing__dot { animation: none; opacity: 0; }
}


/* ---------- The tide: light hero and closing band ---------- */

.hero { background: var(--paper); color: var(--paper-ink); align-items: flex-start; padding-block: calc(var(--header-h) + clamp(24px, 6svh, 72px)) 42svh; }
.hero .status { background: var(--paper); padding: 6px 14px; border-radius: 999px; }
.hero .display { color: var(--paper-ink); }
.hero .lede, .hero .status { color: var(--paper-muted); }
.hero::after { display: none; }
.hero__art { background: none; }
.hero__canvas, .closing__art canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.hero .btn--primary, .closing .btn--primary, .header:not([data-solid="true"]) .btn--primary { background: var(--paper-ink); color: var(--white); }
.hero .btn--quiet, .closing .btn--quiet { color: var(--paper-ink); border-color: var(--paper-ink); background: var(--paper); }
.header:not([data-solid="true"]) { color: var(--paper-ink); }
@media (hover: hover) and (pointer: fine) {
  .hero .btn--primary:hover, .closing .btn--primary:hover, .header:not([data-solid="true"]) .btn--primary:hover { background: #1B2B5E; }
  .hero .btn--quiet:hover, .closing .btn--quiet:hover { border-color: var(--blue); }
}
@media (max-width: 860px) { .header:not([data-solid="true"]) .nav { color: var(--white); } }

.closing { background: var(--paper); color: var(--paper-ink); padding-top: var(--section-gap); }
.closing .display { color: var(--paper-ink); }
.closing .lede { color: var(--paper-muted); }
.closing__art { position: relative; overflow: hidden; background: none; -webkit-mask-image: none; mask-image: none; height: clamp(280px, 34vw, 520px); margin-top: clamp(24px, 3vw, 48px); }
.section--paper + .closing { padding-top: 0; }


/* ---------- The descent: daylight at the top of the page, the deep below ---------- */

/* The plate is 720 x 1273. Its top 23% is empty paper sky, the horizon sits at 25.8%, breakers run to
   about 55%, and the rest darkens to the page ground. The hero copy sits in the sky; the product section
   sits on the dark foot. --pw is the plate's drawn width, --ph its height. */
:root { --pw: clamp(860px, 100vw, 2200px); --ph: calc(var(--pw) * 1.768); }

.hero { display: block; position: static; isolation: auto; min-height: 0; overflow: visible; background: var(--paper); padding-block: calc(var(--header-h) + clamp(28px, 7svh, 88px)) clamp(28px, 4svh, 48px); }
.hero .status { background: none; padding: 0; border-radius: 0; }
.hero .wrap { position: relative; z-index: 2; }
main { overflow-x: clip; }

.sea { position: relative; z-index: 1; width: var(--pw); height: var(--ph); margin: calc(var(--ph) * -.225) 0 0 50%; transform: translateX(-50%); pointer-events: none; }
.sea img, .sea canvas { position: absolute; left: 0; width: 100%; image-rendering: pixelated; }
.sea img { top: 0; height: 100%; }
/* The live water covers the band from just under the horizon to where the plate goes dark. */
.sea canvas { top: 26%; height: 36%; display: none; }
.sea.is-live canvas { display: block; }

.section--deep { position: relative; z-index: 2; margin-top: calc(var(--ph) * -.32); padding-top: 0; }
@media (max-width: 860px) { .section--deep { margin-top: calc(var(--ph) * -.25); } }
.section--deep .lede { color: var(--soft); }
.section--navy { background: var(--navy); }
.section--navy .lede, .section--navy .faq details p { color: var(--soft); }

.closing { position: relative; isolation: isolate; overflow: hidden; background: var(--abyss); color: var(--text); padding-block: var(--section-gap); }
.closing .display { color: var(--white); }
.closing .lede { color: var(--soft); }
.closing .btn--primary { background: var(--white); color: var(--ink); }
.closing .btn--quiet { color: var(--white); border-color: var(--faint); background: var(--abyss); }
.closing .wrap { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.closing .wrap > * { max-width: 13em; }
.closing .lede { max-width: 22em; }
.closing .actions { justify-content: flex-end; max-width: none; }
img.closing__art { position: absolute; z-index: -1; left: 0; top: 50%; width: min(100%, 1500px); height: auto; margin: 0; transform: translateY(-50%); image-rendering: pixelated; -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 82%); mask-image: linear-gradient(90deg, #000 45%, transparent 82%); }
@media (hover: hover) and (pointer: fine) {
  .closing .btn--primary:hover { background: #D9E4FF; }
  .closing .btn--quiet:hover { border-color: var(--white); }
}
@media (max-width: 860px) {
  .closing { padding-bottom: 0; }
  .closing .wrap { align-items: flex-start; text-align: left; }
  .closing .actions { justify-content: flex-start; }
  img.closing__art { position: static; display: block; width: 160%; max-width: none; margin: 40px 0 0 -30%; transform: none; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
}

/* ================= Round 4: one descent =================
   Paper sky and copy, one band of sea that ends in the page's navy, then a single dark ground to the footer.
   The band's height does not depend on its width, so the next section arrives within about a screen at any size. */

:root { --size-hero: clamp(40px, 6.2vw, 96px); --size-section: clamp(34px, 3.9vw, 56px); --section-gap: clamp(88px, 10vw, 152px); }

.hero { padding-block: calc(var(--header-h) + clamp(32px, 6svh, 72px)) 0; text-align: center; }
.hero .display { text-wrap: balance; }
.hero .lede { max-width: 34em; }
.hero .actions { align-items: center; gap: 12px 28px; }
.hero .actions .link, .closing .actions .link { min-height: 44px; display: inline-flex; align-items: center; font-weight: 500; }
.hero .actions .link { color: var(--paper-ink); }
.sea {
  position: relative; z-index: 1; width: 100%; height: clamp(280px, 44svh, 640px);
  margin: -28px 0 0; transform: none; pointer-events: none; overflow: hidden; background: var(--abyss);
}
.sea img, .sea canvas { position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.sea img { object-fit: cover; object-position: 50% 30%; }
.sea canvas { display: none; }
.sea.is-live canvas { display: block; }
.sea.is-live img { visibility: hidden; }
@media (max-width: 860px) { .sea { height: clamp(240px, 36svh, 360px); } }

.below { padding-top: clamp(32px, 4vw, 56px); }
.below .split { align-items: start; }
.below .section__head { padding-top: clamp(0px, 3vw, 48px); }
.below .lede, .explain .lede, .shield .lede { color: var(--soft); }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.more { margin-top: 24px; }
.more .link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; color: var(--white); }
.explain .status { max-width: 34em; }
@media (min-width: 961px) { .explain--flip .section__head { order: 2; } }
@media (max-width: 960px) { .split--even { grid-template-columns: minmax(0, 1fr); } }
.loop--pending { min-height: 280px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); }

/* The swap form: a paper instrument on the dark ground. Flat fields, mono numbers; only the token marks and the
   edge above the action are dithered. */
.swap { justify-self: end; width: 100%; max-width: 420px; }
.swap__form { display: block; background: var(--paper); color: var(--paper-ink); border-radius: 6px; overflow: hidden; }
.swap__side {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--paper-line);
}
.swap__label { grid-column: 1 / -1; font: 500 13px/20px var(--font-body); color: var(--paper-muted); }
.swap__token { display: inline-flex; align-items: center; gap: 10px; font: 600 20px/28px var(--font-display); letter-spacing: -.01em; }
.swap__token img { width: 22px; height: 22px; image-rendering: pixelated; }
.swap__amount { font: 500 clamp(24px, 6.4vw, 30px)/36px var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-align: right; }
.swap__form-of { grid-column: 1 / -1; font: 400 12px/16px var(--font-mono); color: var(--paper-muted); }
.swap__form-of b { font-weight: 500; color: var(--paper-ink); }
.swap__quote { padding: 16px 24px 20px; }
.swap__quote > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.swap__quote dt { font: 400 13px/20px var(--font-body); color: var(--paper-muted); }
.swap__quote dd { font: 400 12px/20px var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.swap__quote > div:first-child dt, .swap__quote > div:first-child dd { font-weight: 500; color: var(--paper-ink); }
.swap__go {
  position: relative; display: flex; align-items: center; justify-content: center; height: 56px; margin-top: 20px;
  background: var(--blue); color: var(--abyss); font: 500 16px/24px var(--font-body);
}
.swap__go::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 20px;
  background: url(../art/edge-paper-blue.png) 0 0 / 128px 20px repeat-x; image-rendering: pixelated;
}
.swap figcaption { margin-top: 12px; font-size: 13px; line-height: 20px; color: var(--muted); }
@media (max-width: 960px) { .swap { justify-self: start; } }
@media (min-width: 1800px) { .swap { max-width: 460px; } }

/* Shielded: one transfer shown twice, the same rows in the same places. No lens, nothing follows the cursor. */
.shield { overflow: visible; }
.shield .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(40px, 6vw, 96px); align-items: start; min-height: 0; }
.shield__copy { max-width: none; }
.ledger, .js .ledger { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin: 0; flex: none; }
.ledger__view + .ledger__view { margin-top: 0; }
.ledger__view h3 { min-height: 3.2em; display: flex; align-items: flex-end; }
.ledger dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; min-height: 76px; align-content: center; }
.ledger dt { font-size: 13px; line-height: 20px; }
.ledger dd { font-size: 14px; line-height: 24px; }
.ledger dd.is-absent { height: 12px; margin: 6px 0; max-width: 11em; background: var(--blue-dim) url(../art/blue-noise.png) 0 0 / 128px; background-blend-mode: multiply; image-rendering: pixelated; }
.ledger__proof { padding-top: 14px; font-size: 14px; line-height: 20px; color: var(--soft); }
.shield__note { grid-column: 1 / -1; margin-top: 0; max-width: 46em; }
@media (max-width: 960px) {
  .shield { padding-bottom: var(--section-gap); }
  .shield .wrap { grid-template-columns: minmax(0, 1fr); }
  .ledger { margin: 0; }
}
@media (max-width: 420px) { .ledger dd { font-size: 12px; } }

/* Questions, the last call and the footer share one ground and one still plate. */
.end { position: relative; isolation: isolate; overflow: hidden; }
.end #questions .split { align-items: start; }
.end .faq details p { color: var(--soft); }
.closing { position: static; overflow: visible; isolation: auto; background: none; padding-block: 0 var(--section-gap); }
.closing .wrap { display: block; text-align: left; }
.closing .wrap > * { max-width: none; }
.closing .display { max-width: 12em; }
.closing .lede { max-width: 26em; }
.closing .actions { justify-content: flex-start; align-items: center; gap: 12px 28px; }
.closing .actions .link { color: var(--white); }
.end__art {
  position: absolute; z-index: -1; right: 0; bottom: 0; width: min(62%, 1100px); height: auto; opacity: .55; image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%), linear-gradient(transparent, #000 40%, #000 80%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 55%), linear-gradient(transparent, #000 40%, #000 80%, transparent); mask-composite: intersect;
}
@media (max-width: 860px) { .end__art { width: 120%; right: -30%; opacity: .32; } }
.footer { border-top: 1px solid var(--line); }

/* The film pages. */
.filmpage .header:not([data-solid="true"]) { color: var(--white); }
.filmpage .header:not([data-solid="true"]) .btn--primary { background: var(--white); color: var(--ink); }
.back { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: calc(var(--header-h) + 24px) var(--gutter) 0; }
.back .link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; color: var(--white); }
main #settle-l-loop figcaption, main #night-a-loop figcaption { font: 400 15px/24px var(--font-body); }
main .loop button { font: 500 14px/20px var(--font-body); }

/* ================= Round 5: a full first screen, then grounds that alternate =================
   The sea is the hero's whole backdrop: paper sky behind the words, water for the lower half. Below it each
   section has its own ground (navy, paper, blue) on a hard cut. Only blue into navy gets a dithered edge. */

.hero { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(560px, 86svh, 1500px); padding-bottom: 0; }
.sea, .hero .sea { position: absolute; inset: 0; z-index: 0; height: auto; margin: 0; background: var(--paper); }
.sea img { top: auto; bottom: 0; height: 54%; object-position: 50% 0; }

.ground { position: relative; background: var(--g, var(--abyss)); color: var(--text); }
.ground--edge::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; pointer-events: none;
  background: var(--edge) 0 0 / 256px 24px repeat-x; image-rendering: pixelated;
}
.on-navy { --g: var(--abyss); --edge: url(../art/edge-to-navy.png); }
.on-paper {
  --g: var(--paper); --edge: url(../art/edge-to-paper.png);
  --white: #0A1020; --text: #0A1020; --soft: #2B3650; --muted: #46536C; --line: #C5D0E6; --faint: #6B7892;
  --f-ground: #EEF2FA; --f-ink: #0B1226; --f-dim: #55627F; --f-blue: #427BFF; --f-soft: #0B1226;
}
.on-blue {
  --g: var(--blue); --edge: url(../art/edge-to-blue.png);
  --white: #0B1226; --text: #0B1226; --soft: #0B1226; --muted: #0B1226; --line: rgba(11, 18, 38, .4);
}
.ground .display { color: var(--white); }
.on-paper .faq details p, .on-paper .lede { color: var(--soft); }
.on-paper .faq a, .on-paper .link { color: var(--text); }
.on-paper .btn--primary { background: var(--paper-ink); color: #fff; }

/* On blue the two ledger views are navy panels, so the shielded rows read as dark water. */
.on-blue .ledger__view {
  --white: #FFFFFF; --text: #E6EAF2; --soft: #CDD6E6; --muted: #AEB9CC; --line: #27345A;
  background: var(--abyss); color: var(--text); padding: 8px 24px 24px; border-radius: 6px;
}
.on-blue .ledger__view h3 { color: var(--white); }

/* Night mode opens under its own sky. */
#night { padding-top: 0; }
.band { height: clamp(150px, 21vw, 420px); margin-bottom: clamp(40px, 6vw, 96px); image-rendering: pixelated;
  background: center 30% / cover no-repeat; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.band--stars { background-image: url(../art/k-sky-stars.png); }

/* The close sits on the chart. */
.end { overflow: visible; isolation: auto; }
.closing.ground { position: relative; isolation: isolate; overflow: hidden; background: var(--abyss); padding-block: var(--section-gap); }
.closing__chart {
  position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; image-rendering: pixelated; opacity: .8;
  -webkit-mask-image: linear-gradient(90deg, transparent 46%, #000 80%); mask-image: linear-gradient(90deg, transparent 46%, #000 80%);
}
.footer { background: var(--abyss); }
@media (max-width: 860px) {
  .ground--edge::before { height: 16px; background-size: 170.67px 16px; }
  .hero { min-height: 0; padding-bottom: 36svh; }
  .closing.ground { padding-top: 58vw; }
  .closing__chart { inset: 0 0 auto 0; height: 54vw; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
}

/* The tide runs the length of the page: every ground laps onto the next along a dithered shoreline whose
   echoes reach into both sections. The strips overlap the sections' own padding, so they add little height. */
.tide {
  position: relative; z-index: 1; height: 280px; margin-block: -72px; pointer-events: none;
  background: 0 0 / 1536px 280px repeat-x; image-rendering: pixelated;
}
.tide--navy-paper { background-image: url(../art/tide-navy-paper.png); }
.tide--paper-blue { background-image: url(../art/tide-paper-blue.png); }
.tide--blue-navy { background-image: url(../art/tide-blue-navy.png); }
.tide--navy-paper-2 { background-image: url(../art/tide-navy-paper-2.png); }
.tide--paper-navy { background-image: url(../art/tide-paper-navy.png); }
.section > .wrap, .closing > .wrap { position: relative; z-index: 2; }
#night .band { margin-top: 40px; -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 60%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 60%, transparent); }
@media (min-width: 2200px) { .tide { height: 420px; background-size: 2304px 420px; margin-block: -96px; } }
@media (max-width: 860px) { .tide { margin-block: -56px; } }

/* Night mode is under stars from its first line to its last: a sparse field over the whole section, with the
   galaxy plate across the top. */
#night { isolation: isolate; }
#night::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: url(../art/stars-tile.png) 0 0 / 1024px 1024px; image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(transparent, #000 140px, #000 calc(100% - 160px), transparent); mask-image: linear-gradient(transparent, #000 140px, #000 calc(100% - 160px), transparent);
}
#night .band { height: clamp(220px, 30vw, 560px); margin-bottom: clamp(16px, 3vw, 48px); -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 50%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 50%, transparent); }
#night .loop { background: transparent; }

/* Dark hero options: a night plate under a navy sky, light copy. */
.hero--dark, .hero--dark .sea { background: var(--abyss); }
.hero--dark .display { color: var(--white); }
.hero--dark .lede { color: var(--soft); }
.hero--dark .status { color: var(--muted); }
.hero--dark .btn--primary { background: var(--white); color: var(--ink); }
.hero--dark .actions .link { color: var(--white); }
.darkhero .header:not([data-solid="true"]) { color: var(--white); }
.darkhero .header:not([data-solid="true"]) .btn--primary { background: var(--white); color: var(--ink); }

/* ================= Round 6: a sky to the top of the page, a live swap form, a lens, big diagrams ================= */

/* Without scripts the sky is a still plate behind the still water. */
.sea { background: var(--paper) url(../art/sky-clouds.png) 50% 0 / max(100%, 1344px) auto no-repeat; image-rendering: pixelated; }
.hero--dark .sea { background-image: none; }

/* The swap form is a working demo and takes half the row. */
.below .split { align-items: center; }
.below .section__head { padding-top: 0; }
.swap { max-width: 600px; }
.swap__form { position: relative; border-radius: 8px; }
.swap__side { gap: 10px 20px; padding: 28px 32px; }
.swap__label { font-size: 15px; line-height: 20px; }
.swap__token { gap: 12px; font-size: 26px; line-height: 32px; }
.swap__token img { width: 32px; height: 32px; image-rendering: auto; }
.swap__amount {
  display: block; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit;
  font: 500 clamp(28px, 3.1vw, 44px)/48px var(--font-mono); letter-spacing: -.03em; text-align: right;
}
input.swap__amount { border-bottom: 1px solid transparent; outline: 0; caret-color: var(--blue); }
.swap.is-live input.swap__amount { border-bottom-color: var(--paper-line); cursor: text; }
.swap.is-live input.swap__amount:hover { border-bottom-color: var(--paper-muted); }
input.swap__amount:focus-visible { border-bottom-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
.swap__side { grid-template-columns: auto minmax(0, 1fr); }
.swap__form-of { display: flex; gap: 6px; align-items: center; min-height: 32px; font-size: 14px; line-height: 20px; }
.swap__form-of button {
  min-height: 32px; padding: 0 12px; border: 1px solid var(--paper-line); border-radius: 999px; background: none; color: var(--paper-muted);
  font: 500 13px/20px var(--font-body); cursor: pointer;
}
.swap__form-of button[aria-pressed="true"] { background: var(--paper-ink); border-color: var(--paper-ink); color: #fff; }
.swap__flip {
  position: absolute; z-index: 1; left: 50%; display: grid; place-items: center; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
  border: 1px solid var(--paper-line); border-radius: 999px; background: var(--paper); color: var(--paper-ink); cursor: pointer;
  transition: transform var(--press) var(--ease-out), border-color var(--hover-out) var(--ease-out);
}
.swap__flip:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .swap__flip:hover, .swap__form-of button:hover { border-color: var(--paper-ink); } }
.swap__quote { padding: 22px 32px 8px; }
.swap__quote > div { padding: 6px 0; }
.swap__quote dt { font-size: 15px; line-height: 24px; }
.swap__quote dd { font-size: 15px; line-height: 24px; }
.swap__amount, .swap__quote dd { border-radius: 3px; }
.swap .is-fresh { animation: swap-fresh 900ms var(--ease-out); }
@keyframes swap-fresh { from { background-color: rgba(66, 123, 255, .28); } to { background-color: rgba(66, 123, 255, 0); } }
.swap__timer { position: relative; margin: 0; padding: 6px 32px 18px; font: 400 14px/20px var(--font-body); color: var(--paper-muted); }
.swap__timer b { display: inline-block; min-width: 1.3em; text-align: right; font: 500 14px/20px var(--font-mono); color: var(--paper-ink); }
.swap__timer i { position: absolute; left: 32px; right: 32px; bottom: 8px; height: 2px; background: var(--paper-ink); transform-origin: 0 50%; animation: swap-count 12s linear infinite; }
@keyframes swap-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.swap__timer::after { content: ""; position: absolute; left: 32px; right: 32px; bottom: 8px; height: 2px; background: var(--paper-line); z-index: 0; }
.swap__timer i { z-index: 1; }
.swap__go { height: 64px; margin-top: 20px; font-size: 18px; text-decoration: none; transition: background-color var(--hover-out) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { a.swap__go:hover { background: #6C98FF; } }
a.swap__go:focus-visible { outline-offset: -4px; outline-color: var(--abyss); }
.swap figcaption { margin-top: 14px; font-size: 14px; line-height: 22px; }
@media (prefers-reduced-motion: reduce) { .swap__timer i { animation: none; transform: none; } }
@media (min-width: 1800px) { .swap { max-width: 680px; } }
@media (max-width: 960px) { .swap { max-width: 600px; } }
@media (max-width: 480px) {
  .swap__side { padding: 20px; } .swap__quote { padding: 18px 20px 6px; } .swap__timer { padding-inline: 20px; }
  .swap__timer i, .swap__timer::after { left: 20px; right: 20px; }
  .swap__token { font-size: 20px; } .swap__token img { width: 26px; height: 26px; }
  .swap__quote dt, .swap__quote dd { font-size: 13px; }
}

/* Diagram sections: the words run across the top and the diagram takes the full width below them. */
.explain__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(40px, 6vw, 96px); align-items: start; margin-bottom: clamp(40px, 5vw, 80px); }
.explain__head .lede:first-child { margin-top: 0; }
.explain--stack .loop { margin: 0; }
@media (max-width: 960px) { .explain__head { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 2200px) { .explain--stack > .wrap { max-width: calc(1600px + 2 * var(--gutter)); } }

/* Shielded: the original scrolling public ledger with a glass that covers what it passes over, in a panel. */
.shield .wrap { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; }
.shield__note { grid-column: auto; margin-top: 24px; max-width: 34em; }
.lens { margin: 0; }
.lens__stage { position: relative; height: clamp(360px, 34vw, 520px); border-radius: 8px; overflow: hidden; background: var(--abyss); }
.lens__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.lens__still { margin: 0; padding: 32px; color: #CDD6E6; }
@media (max-width: 960px) { .shield .wrap { grid-template-columns: minmax(0, 1fr); } }

/* Night mode: stars only, kept faint so they never read as specks on the copy, and the section fits one screen. */
#night::after { opacity: .5; }
.swap__form-of { font: 500 13px/20px var(--font-body); }
#night { padding-top: var(--section-gap); }

/* Round 8: the product section is narrower. Copy and the form sit close together in the middle of the page. */
#product > .wrap { max-width: calc(1040px + 2 * var(--gutter)); gap: clamp(40px, 5vw, 80px); }
#product .section__head { max-width: 460px; }
.swap { max-width: 440px; }
.swap__side { padding: 22px 24px; }
.swap__token { font-size: 22px; line-height: 28px; }
.swap__token img { width: 28px; height: 28px; }
.swap__go { height: 56px; font-size: 17px; }
@media (min-width: 1800px) { .swap { max-width: 480px; } #product > .wrap { max-width: calc(1160px + 2 * var(--gutter)); } }
@media (max-width: 960px) { .swap { max-width: 480px; } }
.swap__amount { font-size: clamp(26px, 2.4vw, 34px); line-height: 40px; }
.swap__quote { padding: 18px 24px 6px; }
.swap__quote dt { font-size: 14px; }
.swap__timer { padding: 6px 24px 18px; }
.swap__timer i, .swap__timer::after { left: 24px; right: 24px; }

/* Round 8: stars never run through the Night mode heading or paragraph. */
#night .explain__head > * { background: var(--abyss); box-shadow: 0 0 20px 22px var(--abyss); border-radius: 12px; }

/* Closing: the call to action sits straight on navy, and ripples on the sea floor run along the bottom into the
   footer. The plate is drawn small and shown in whole blocks, a little finer than the hero sea. */
#closing.closing { --floor: 520px; background: var(--abyss); overflow: hidden; padding-block: clamp(72px, 8vw, 128px) calc(var(--floor) * .3); }
.closing__floor { position: absolute; z-index: 0; inset: auto 0 0 0; height: var(--floor); pointer-events: none;
  background: url(../art/floor-low-1600.png) 50% 100% / 1600px 520px no-repeat; image-rendering: pixelated; }
@media (min-resolution: 1.5dppx) and (max-width: 1600px) { .closing__floor { background-image: url(../art/floor-low-1068.png); background-size: 1602px 520px; } }
@media (min-width: 1601px) { #closing.closing { --floor: 878px; } .closing__floor { background-image: url(../art/floor-low-1350.png); background-size: 2700px 878px; } }
@media (min-width: 2701px) { #closing.closing { --floor: 1248px; } .closing__floor { background-image: url(../art/floor-low-1280.png); background-size: 3840px 1248px; } }
@media (min-width: 3841px) { #closing.closing { --floor: 1665px; } .closing__floor { background-image: url(../art/floor-low-1708.png); background-size: 5124px 1665px; } }
@media (max-width: 860px) { #closing.closing { padding-bottom: 270px; } .closing__floor { background-image: url(../art/floor-low-phone.png); background-size: 1602px 520px; background-position-x: 38%; } }

/* ================= Audit polish ================= */

/* Subtle hairline so the solid sticky header separates cleanly over dark sections. */
.header[data-solid="true"] { box-shadow: 0 1px 0 var(--line); }

/* Frame the hero cleanly above the fold so the swap card doesn't get sliced at 1440x900. */
.hero { min-height: clamp(600px, 92svh, 1080px); }
.below { padding-top: clamp(56px, 6vw, 96px); }
@media (max-width: 860px) { .hero { min-height: 0; padding-bottom: clamp(230px, 38svh, 340px); } }

/* Smooth bottom fade for the JS-off static sea plate. */
.sea:not(.is-live)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14%;
  background: linear-gradient(transparent, var(--abyss)); pointer-events: none;
}

/* Swap demo: responsive scaling for large numbers, tighter timer readout, seamless dithered CTA hover. */
.swap__amount.is-long { font-size: clamp(21px, 1.9vw, 27px); }
.swap__amount.is-xlong { font-size: clamp(17px, 1.5vw, 22px); }
.swap__timer b { min-width: 1.5ch; font-variant-numeric: tabular-nums; }
.swap__go { gap: 8px; }
.swap__go-arrow { display: inline-block; transition: transform var(--hover-in) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  a.swap__go:hover { background: var(--blue); }
  a.swap__go:hover .swap__go-arrow { transform: translateX(4px); }
}

/* Signal that the shield lens follows the cursor on pointer devices. */
@media (hover: hover) and (pointer: fine) {
  .lens__stage canvas { cursor: crosshair; }
}

/* Sticky FAQ heading on desktop and tactile hover affordance on disclosure rows. */
@media (min-width: 961px) {
  #questions .section__head { position: sticky; top: calc(var(--header-h) + 32px); }
}
@media (hover: hover) and (pointer: fine) {
  .faq summary { transition: color var(--hover-in) var(--ease-out); }
  .faq summary::after { transition: transform 240ms var(--ease-out), border-color var(--hover-in) var(--ease-out); }
  .faq summary:hover::after { border-color: var(--blue); }
}

/* Footer: comfortable 44px tap targets, consistent link hover on Sommet Labs, tighter row rhythm. */
.footer .wrap { gap: 12px 40px; }
.footer nav { gap: 4px 20px; }
.footer nav a { padding-inline: 10px; margin-inline: -10px; min-width: 44px; justify-content: center; background-origin: content-box; }
.footer .built b {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .footer .built b { transition: background-size 340ms var(--ease-out); }
  .footer .built:hover b { background-size: 100% 1px; }
}

/* ================= Light/Dark themes, softened daylight & mobile audit fixes ================= */

/* Opt out of mobile browser Force Dark / Auto Dark Mode in Light mode so CSS text never inverts
   over the daytime <canvas> sea and dithered raster plates; declare native dark in Dark mode. */
:root,
:root[data-theme="light"] {
  color-scheme: only light;
  --paper: #D4DEF0;          /* softened coastal daylight (~20% less glare than #EEF2FA) */
  --paper-ink: #0A1020;      /* 13.9:1 on softened paper */
  --paper-soft: #1E2940;     /* 10.6:1 on softened paper */
  --paper-muted: #35435E;    /* 7.1:1 on softened paper */
  --paper-line: #AEBDD8;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

/* Header layout & Light/Dark theme toggle (visible in both desktop and mobile top bars). */
.header .wrap { gap: 16px; }
.header .lockup { margin-right: auto; }
.header__tools { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(212, 222, 240, .28);
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: 500 14px/1 var(--font-body);
  cursor: pointer; white-space: nowrap;
  transition: transform var(--press) var(--ease-out),
              background-color var(--hover-out) var(--ease-out),
              border-color var(--hover-out) var(--ease-out);
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle svg { display: block; flex: none; }
.theme-toggle svg.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle svg.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle svg.theme-toggle__sun { display: block; }
.lockup svg { display: block; width: 132px; height: auto; }
.footer .lockup svg { width: 112px; }
@media (min-width: 1800px) { .lockup svg { width: 156px; } }

:root:not([data-theme="dark"]) .header:not([data-solid="true"]) .theme-toggle {
  border-color: rgba(10, 16, 32, .24);
  background: rgba(10, 16, 32, .06);
}
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(212, 222, 240, .55);
  }
  :root:not([data-theme="dark"]) .header:not([data-solid="true"]) .theme-toggle:hover {
    background: rgba(10, 16, 32, .12);
    border-color: rgba(10, 16, 32, .45);
  }
}
@media (max-width: 1040px) {
  .nav { gap: clamp(14px, 2vw, 32px); }
  .theme-toggle { width: 40px; padding: 0; }
  .theme-toggle__label { display: none; }
}
@media (max-width: 860px) {
  .theme-toggle { width: 44px; height: 44px; min-height: 44px; }
}

/* Softened daylight Light mode (default): calm coastal mist sky, crisp ink, zero glare. */
.hero .lede { color: var(--paper-soft); }
.hero .btn--primary,
.header:not([data-solid="true"]) .btn--primary,
.on-paper .btn--primary {
  background: var(--paper-ink);
  color: #E2EAF7;
}
.btn--primary,
.header[data-solid="true"] .btn--primary,
.closing .btn--primary {
  background: #DCE5F4;
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .hero .btn--primary:hover,
  .header:not([data-solid="true"]) .btn--primary:hover,
  .on-paper .btn--primary:hover {
    background: #1B2B5E;
  }
  .btn--primary:hover,
  .header[data-solid="true"] .btn--primary:hover,
  .closing .btn--primary:hover {
    background: #C8D8F8;
  }
}
@media (max-width: 860px) {
  .header .nav .btn--primary {
    background: #DCE5F4;
    color: var(--ink);
  }
}

/* Match daytime sky, tides, and swap card edge to softened --paper (#D4DEF0). */
.sea {
  background: var(--paper) url(../art/day/sky-clouds.png) 50% 0 / max(100%, 1344px) auto no-repeat;
}
.sea.is-live { background-image: none; }
.tide--navy-paper { background-image: url(../art/day/tide-navy-paper.png); }
.tide--paper-blue { background-image: url(../art/day/tide-paper-blue.png); }
.tide--navy-paper-2 { background-image: url(../art/day/tide-navy-paper-2.png); }
.tide--paper-navy { background-image: url(../art/day/tide-paper-navy.png); }

.on-paper {
  --g: var(--paper);
  --white: var(--paper-ink);
  --text: var(--paper-ink);
  --soft: var(--paper-soft);
  --muted: var(--paper-muted);
  --line: var(--paper-line);
  --faint: #556585;
  --f-ground: var(--paper);
  --f-ink: #0A1020;
  --f-dim: #35435E;
  --f-blue: #427BFF;
  --f-soft: #0A1020;
}

.swap__form {
  background: var(--paper);
  color: var(--paper-ink);
}
.swap__form-of button[aria-pressed="true"] {
  background: var(--paper-ink);
  border-color: var(--paper-ink);
  color: #E2EAF7;
}
.swap__go {
  background: var(--blue);
  color: var(--abyss);
  font-weight: 600;
}
.swap__go::before {
  background: url(../art/day/edge-paper-blue.png) 0 0 / 128px 20px repeat-x;
}

/* Dark mode ([data-theme="dark"]): deep navy sky, luminous night swell, dark swap instrument. */
:root[data-theme="dark"] .header:not([data-solid="true"]) { color: var(--white); }
:root[data-theme="dark"] .header:not([data-solid="true"]) .btn--primary {
  background: #DCE5F4;
  color: var(--ink);
}
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .hero .sea {
  background: var(--abyss);
  background-image: none;
}
:root[data-theme="dark"] .hero .display { color: #DCE5F4; }
:root[data-theme="dark"] .hero .lede { color: var(--soft); }
:root[data-theme="dark"] .hero .status { color: var(--muted); }
:root[data-theme="dark"] .hero .btn--primary { background: #DCE5F4; color: var(--ink); }
:root[data-theme="dark"] .hero .actions .link { color: var(--white); }
:root[data-theme="dark"] .hero .sea img { object-position: 50% 0; }
@media (hover: hover) and (pointer: fine) {
  :root[data-theme="dark"] .header:not([data-solid="true"]) .btn--primary:hover,
  :root[data-theme="dark"] .hero .btn--primary:hover {
    background: #C8D8F8;
  }
}

:root[data-theme="dark"] .tide--light-only { display: none; }
:root[data-theme="dark"] .tide--paper-blue {
  background-image: url(../art/tide-blue-navy.png);
  transform: scale(-1, -1);
}

:root[data-theme="dark"] .on-paper {
  --g: var(--abyss);
  --white: #DCE5F4;
  --text: #E6EAF2;
  --soft: #CDD6E6;
  --muted: #AEB9CC;
  --line: #27345A;
  --faint: #7C8AA6;
  --f-ground: #0B1226;
  --f-ink: #FFFFFF;
  --f-dim: #AEB9CC;
  --f-blue: #427BFF;
  --f-soft: #E6EAF2;
}
:root[data-theme="dark"] #settle { border-top: 1px solid rgba(39, 52, 90, .65); }
:root[data-theme="dark"] #questions {
  --g: #0E1730;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="dark"] #questions .faq summary { color: #DCE5F4; }
:root[data-theme="dark"] #questions .faq details p { color: var(--soft); }
:root[data-theme="dark"] #questions .faq a { color: #DCE5F4; }

/* Dark swap instrument: elevated navy surface matching the Abyss app dark theme. */
:root[data-theme="dark"] .swap__form {
  background: #131D3A;
  color: #DCE5F4;
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(4, 8, 20, .42);
}
:root[data-theme="dark"] .swap__side { border-bottom-color: var(--line); }
:root[data-theme="dark"] .swap__label,
:root[data-theme="dark"] .swap__form-of,
:root[data-theme="dark"] .swap__quote dt,
:root[data-theme="dark"] .swap__timer { color: var(--muted); }
:root[data-theme="dark"] .swap__token,
:root[data-theme="dark"] .swap__amount,
:root[data-theme="dark"] .swap__quote dd,
:root[data-theme="dark"] .swap__form-of b { color: #DCE5F4; }
:root[data-theme="dark"] .swap__quote > div:first-child dt,
:root[data-theme="dark"] .swap__quote > div:first-child dd { color: var(--white); }
:root[data-theme="dark"] .swap.is-live input.swap__amount { border-bottom-color: var(--line); }
:root[data-theme="dark"] .swap.is-live input.swap__amount:hover { border-bottom-color: var(--faint); }
:root[data-theme="dark"] input.swap__amount:focus-visible { border-bottom-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
:root[data-theme="dark"] .swap__form-of button {
  border-color: var(--line);
  color: var(--muted);
}
:root[data-theme="dark"] .swap__form-of button[aria-pressed="true"] {
  background: #DCE5F4;
  border-color: #DCE5F4;
  color: var(--abyss);
}
:root[data-theme="dark"] .swap__flip {
  background: #131D3A;
  border-color: var(--line);
  color: #DCE5F4;
}
@media (hover: hover) and (pointer: fine) {
  :root[data-theme="dark"] .swap__flip:hover,
  :root[data-theme="dark"] .swap__form-of button:hover {
    border-color: var(--soft);
    color: var(--white);
  }
  :root[data-theme="dark"] .swap__form-of button[aria-pressed="true"]:hover {
    border-color: #C8D8F8;
    background: #C8D8F8;
    color: var(--abyss);
  }
}
:root[data-theme="dark"] .swap__timer b { color: #DCE5F4; }
:root[data-theme="dark"] .swap__timer::after { background: var(--line); }
:root[data-theme="dark"] .swap__timer i { background: var(--blue); }
:root[data-theme="dark"] .swap__go { margin-top: 12px; }
:root[data-theme="dark"] .swap__go::before {
  height: 12px;
  background: url(../art/edge-to-blue.png) 0 0 / 128px 12px repeat-x;
}

/* Keep hyphenated display phrases together on desktop, but allow wrapping on narrow phones. */
.nowrap { white-space: nowrap; }
@media (max-width: 440px) {
  .nowrap { white-space: normal; }
  :root { --size-section: clamp(30px, 8.2vw, 56px); }
}

/* Mobile framing and tide proportion polish. */
@media (max-width: 860px) {
  .hero {
    min-height: min(100svh, 860px);
    padding-block: calc(var(--header-h) + clamp(24px, 5svh, 52px)) clamp(220px, 36svh, 320px);
  }
  .tide {
    height: 180px;
    background-size: 988px 180px;
    margin-block: -44px;
  }
  .swap { max-width: 100%; }
}
@media (max-width: 420px) {
  .swap__amount { font-size: clamp(22px, 6.2vw, 28px); line-height: 34px; }
  .swap__amount.is-long { font-size: clamp(19px, 5.2vw, 24px); }
  .swap__amount.is-xlong { font-size: clamp(16px, 4.4vw, 20px); }
}

