/* Layout: editorial paper page. A halftone sun is pinned behind the content
   (sticky canvas) and changes formation per section; the page itself goes
   from warm paper to ink at the end — sunrise to night. */
:root {
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --paper: #f3efe6;
  --ink: #15130f;
  --ink-2: #5d584e;
  --ink-3: #8c8679;
  --hair: #d8d1c3;
  --accent: #a34700;   /* text-safe ochre */
  --sun: #f2a516;      /* fills only */
  --on-ink: #f3efe6;

  --pad: clamp(20px, 5vw, 88px);
  --col: min(52vw, 800px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
html[data-mood="night"] {
  --paper: #0f0e0c;
  --ink: #efe9dd;
  --ink-2: #a8a193;
  --ink-3: #6f695e;
  --hair: #2a2721;
  --accent: #f2a516;
  --on-ink: #0f0e0c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--paper); transition: background-color .9s var(--ease); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .9s var(--ease), color .9s var(--ease);
}
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--sun); color: #15130f; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { top: 12px; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 40; background: #f3efe6; color: #15130f;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  transition: opacity .6s var(--ease), visibility .6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.ld-n { font-size: clamp(56px, 10vw, 120px); font-weight: 600; letter-spacing: -.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.ld-n.zero { color: #a34700; }
.ld-bar { width: 160px; height: 1px; background: #d8d1c3; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 100%; background: #15130f; transform: scaleX(0); transform-origin: left; animation: ld 1.3s var(--ease) forwards; }
@keyframes ld { to { transform: scaleX(1); } }

/* ---------- top bar ---------- */
.bar {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px var(--pad);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.035em; }
.brand svg { width: 28px; height: 28px; color: var(--ink); }
.nav ul { display: flex; gap: clamp(16px, 2.2vw, 36px); }
.nav a {
  font-size: 15px; font-weight: 500; letter-spacing: -.01em; padding: 6px 0;
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.nav a:hover { background-size: 100% 1px; }
.bar-r { display: flex; align-items: center; gap: 14px; }
.menu-btn { display: none; background: none; border: 0; padding: 8px 0; font-size: 15px; font-weight: 600; cursor: pointer; }
.menu-btn[aria-expanded="true"] { color: var(--accent); }
.menu {
  position: absolute; right: 20px; top: 68px; min-width: 220px; padding: 8px 0;
  background: var(--paper); border: 1px solid var(--ink);
}
.menu a { display: block; padding: 11px 22px; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.menu a:hover { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 26px; border-radius: 2px; cursor: pointer;
  font-size: 16px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-ink { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-ink:hover { background: var(--sun); border-color: var(--sun); color: #15130f; }
.btn-line { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* ---------- scene ---------- */
.scene { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; width: 100%; overflow: hidden; pointer-events: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.flow { position: relative; margin-top: -100vh; margin-top: -100svh; }

/* ---------- hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; padding: 0 var(--pad); display: flex; flex-direction: column; }
.hero-copy { padding-top: clamp(130px, 22vh, 230px); max-width: 860px; }
.tag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-bottom: 28px; }
.tag .sep { color: var(--ink-3); }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 25%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
h1 { font-size: clamp(48px, 8vw, 132px); line-height: .92; letter-spacing: -.06em; font-weight: 600; }
.lede { margin-top: 28px; max-width: 31em; font-size: clamp(17px, 1.35vw, 20px); color: var(--ink-2); letter-spacing: -.012em; }
.actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-foot { margin-top: auto; padding: 48px 0 clamp(32px, 7vh, 72px); max-width: min(60vw, 1100px); }
.clock-label { display: flex; gap: 16px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.clock-label span:first-child { color: var(--accent); font-weight: 600; }
.cycle { font-size: clamp(28px, 3.4vw, 56px); line-height: 1.06; letter-spacing: -.045em; font-weight: 500; min-height: 1.1em; }
.cycle .ch { display: inline-block; transition: opacity .45s ease, transform .45s var(--ease); }
.cycle .ch.off { opacity: 0; transform: translateY(.25em); }

/* ---------- sections ---------- */
.flow > section:not(.hero) { padding: clamp(120px, 22vh, 240px) var(--pad) 0; }
.sec-head { max-width: var(--col); margin-bottom: clamp(36px, 6vh, 64px); }
.eyebrow { font-size: 13px; color: var(--accent); margin-bottom: 18px; }
h2 { font-size: clamp(36px, 4.4vw, 70px); line-height: 1; letter-spacing: -.05em; font-weight: 600; }
h2 em { font-style: normal; color: var(--ink-3); }
.sec-head > p:not(.eyebrow) { margin-top: 20px; color: var(--ink-2); font-size: 18px; max-width: 34em; }
.label { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 10px; }

/* receipt rows */
.rows { max-width: var(--col); }
.row {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: baseline;
  padding: 22px 0; border-top: 1px solid var(--hair);
}
.row:last-child { border-bottom: 1px solid var(--hair); }
.row-n { font-size: 14px; color: var(--ink-3); }
.row-t { font-size: clamp(22px, 2.2vw, 36px); line-height: 1.15; letter-spacing: -.035em; font-weight: 500; }
.row-s { font-size: 13px; color: var(--ink-3); }
.row-hi .row-n, .row-hi .row-s { color: var(--accent); }

/* token */
.token > *:not(.sec-head) { max-width: var(--col); }
.ca-wrap { margin-bottom: 48px; }
.ca { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ink); }
.ca code { flex: 1; min-width: 0; font-family: var(--mono); font-size: clamp(15px, 1.4vw, 20px); overflow-wrap: anywhere; }
.note { margin-top: 12px; font-size: 14px; color: var(--ink-2); }

.reg { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 3vw, 56px); }
.reg > div { padding: 22px 0 26px; border-top: 1px solid var(--hair); min-width: 0; }
.reg .reg-wide { grid-column: 1 / -1; }
.reg dt { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; }
.reg dd { font-size: clamp(36px, 4vw, 64px); line-height: 1; letter-spacing: -.05em; font-weight: 600; overflow-wrap: anywhere; }

.split-wrap { margin-top: 40px; }
.split { display: grid; gap: 14px; }
.split li { display: grid; grid-template-columns: 64px 1fr; gap: 6px 16px; align-items: baseline; font-size: 15px; color: var(--ink-2); }
.split b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; grid-row: span 2; font-size: 20px; letter-spacing: -.03em; }
.split span { height: 6px; background: var(--hair); position: relative; order: 3; grid-column: 2; }
.split span::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--sun); }

/* steps */
.steps { max-width: var(--col); display: grid; gap: clamp(30px, 5vh, 52px); }
.steps li { display: grid; grid-template-columns: 110px 1fr; gap: 20px; align-items: baseline; }
.step-n { font-size: clamp(40px, 3.6vw, 60px); font-weight: 400; letter-spacing: -.05em; color: var(--ink-3); line-height: 1; }
.step-hi .step-n { color: var(--accent); font-weight: 600; }
.steps h3 { font-size: clamp(26px, 2.6vw, 42px); line-height: 1.05; letter-spacing: -.045em; font-weight: 600; }
.steps p { margin-top: 8px; color: var(--ink-2); max-width: 30em; }

/* faq */
.qs { max-width: var(--col); }
details { border-top: 1px solid var(--hair); }
details:last-child { border-bottom: 1px solid var(--hair); }
summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px;
  padding: 22px 0; font-size: clamp(20px, 1.9vw, 28px); font-weight: 500; letter-spacing: -.03em;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; color: var(--ink-3); transition: transform .3s var(--ease); }
details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
details p { padding: 0 0 24px; color: var(--ink-2); max-width: 36em; }

/* footer */
.foot { padding: clamp(120px, 22vh, 240px) var(--pad) 44px; }
.foot-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--ink); }
.foot-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; font-size: 15px; font-weight: 500; }
.foot-nav a:hover { color: var(--accent); }
.ca-chip { background: none; border: 1px solid var(--hair); padding: 6px 12px; border-radius: 2px; font-size: 13px; cursor: pointer; }
.ca-chip:hover { border-color: var(--ink); }
.ca-chip span { color: var(--accent); margin-left: 6px; }
.foot-line { margin-top: 32px; font-size: clamp(40px, 6.4vw, 108px); letter-spacing: -.06em; font-weight: 600; line-height: .95; }
.fine { margin-top: 36px; font-size: 13px; color: var(--ink-3); max-width: 46em; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: var(--paper); padding: 12px 18px; font-size: 14px; border-radius: 2px;
  max-width: calc(100vw - 32px);
}

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root { --col: 100%; }
  body { font-size: 16px; }
  .bar { padding: 16px 16px; }
  .nav { display: none; }
  .menu-btn { display: block; }
  .hero, .flow > section:not(.hero), .foot { padding-left: 16px; padding-right: 16px; }
  .hero-copy { padding-top: 44svh; }
  h1 { font-size: clamp(44px, 12.5vw, 68px); }
  .lede { margin-top: 18px; font-size: 16.5px; }
  .actions .btn { flex: 1 1 0; padding: 0 12px; }
  .hero-foot { max-width: none; padding: 40px 0 32px; }
  .cycle { font-size: 28px; }
  .flow > section:not(.hero) { padding-top: 104px; }
  .rows { max-width: none; }
  .row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px 0 18px; }
  .row-t { grid-column: 1 / -1; grid-row: 2; font-size: 23px; }
  .steps li { grid-template-columns: 56px 1fr; gap: 12px; }
  .step-n { font-size: 30px; }
  .reg dd { font-size: 36px; }
  .foot { padding-top: 120px; }
}
@media (max-width: 420px) {
  .bar-r .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .rv { opacity: 1; transform: none; }
}
