/* Temivor V2: the dot field. Day #FFFFFF turns to night #07080B between Two ways and The stack. */
:root {
  --paper: #FFFFFF;
  --ink: #0A0A0A;
  --muted: #5C5C57;
  --red: #FF2A1A;
  --f-dot: "Doto", ui-monospace, monospace;
  --f-text: "Schibsted Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --gut: 40px;
  --left: 176px;
  --top: 136px;
  --h1: clamp(60px, 9.4vw, 152px);
  --h2: clamp(48px, 6.4vw, 108px);
}
body.night { --paper: #07080B; --ink: #ECEDEF; --muted: #9DA0A9; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #FFFFFF;
  color: var(--ink);
  font: 400 17px/1.5 var(--f-text);
  overflow-x: hidden;
  transition: color .5s ease;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; background: var(--ink); color: var(--paper); font: 700 12px/1 var(--f-mono); text-decoration: none; }
.skip:focus { top: 12px; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; pointer-events: none; }
.dusk {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; visibility: hidden; background: #07080B;
  --r: 0px; --e: 100px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 calc(var(--r) - var(--e)), transparent var(--r));
  mask-image: radial-gradient(circle at 50% 50%, #000 calc(var(--r) - var(--e)), transparent var(--r));
}
/* the edge of the night is the status light's ring, travelling outward */
.dusk-ring {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; --r: 0px;
  background: radial-gradient(circle at 50% 50%, transparent calc(var(--r) - 2px), rgba(255, 42, 26, .95) var(--r), rgba(255, 42, 26, .25) calc(var(--r) + 3px), transparent calc(var(--r) + 22px));
}
.no-webgl #field { display: none; }
main { position: relative; z-index: 2; }

/* ---------- fixed frame: header, rail, readout ---------- */

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  padding: 20px var(--gut) 0;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "bar bar" ". draft";
  pointer-events: none;
}
.top a { pointer-events: auto; }
.bar { grid-area: bar; display: flex; justify-content: space-between; align-items: center; }
.mark { display: inline-flex; align-items: center; gap: 10px; font: 800 22px/1 var(--f-text); letter-spacing: -.03em; text-decoration: none; }
.mark i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: breath 2.8s ease-in-out infinite; }
.top nav { display: flex; gap: 28px; }
.top nav a { font: 700 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; padding: 6px 0; }
.top nav a:hover { color: var(--red); }
.draft { grid-area: draft; margin-top: 6px; display: flex; align-items: center; gap: 8px; font: 500 11px/1.3 var(--f-mono); color: var(--muted); }
.draft i { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }
.draft .short { display: none; }

.rail { position: fixed; left: var(--gut); top: 50%; transform: translateY(-50%); z-index: 9; }
.rail ol { list-style: none; display: grid; gap: 2px; }
.rail a { display: flex; align-items: center; gap: 10px; height: 24px; text-decoration: none; color: var(--muted); font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.rail i { width: 14px; height: 2px; background: currentColor; transition: width .4s cubic-bezier(.2,.8,.2,1), background-color .3s; }
.rail span { opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .4s cubic-bezier(.2,.8,.2,1); white-space: nowrap; }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
.rail a[aria-current] { color: var(--ink); }
.rail a[aria-current] i { width: 30px; background: var(--red); }
.rail a[aria-current] span { opacity: 1; transform: none; }

.readout { position: fixed; right: var(--gut); bottom: 24px; z-index: 9; display: flex; align-items: center; gap: 12px; }
.readout p { display: grid; gap: 3px; text-align: left; }
.readout b { font: 700 13px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.readout span { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.led { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px 2px rgba(255, 42, 26, .45); }
.led::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1.5px solid var(--red); opacity: 0; }
.readout[data-light="0"] .led { animation: breath 2.8s ease-in-out infinite; }
.readout[data-light="1"] .led { animation: notice 1.9s ease-out infinite; }
.readout[data-light="1"] .led::after { animation: ring 1.9s ease-out infinite; }
.readout[data-light="2"] .led { box-shadow: 0 0 18px 4px rgba(255, 42, 26, .6); }
.readout[data-light="3"] .led { opacity: .35; box-shadow: none; }

@keyframes breath { 0%, 100% { opacity: .55; transform: scale(.88); } 50% { opacity: 1; transform: scale(1); } }
@keyframes notice { 0% { transform: scale(1.35); } 18%, 100% { transform: scale(.95); } }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3.2); } }

.anchors { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.peak { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; }
.peak b, .peak { font: 700 11px/1 var(--f-mono); letter-spacing: .04em; }
.peak { margin: -34px 0 0 10px; padding: 4px 6px; background: var(--paper); }
.peak b { color: var(--red); margin-right: 4px; }

/* ---------- shared type ---------- */

.hl { font: 900 var(--h2)/.86 var(--f-dot); text-transform: uppercase; letter-spacing: -.015em; }
h1.hl { font-size: var(--h1); }
.hl em, .big em { font-style: normal; color: var(--red); }
/* Doto draws a full stop as a small cross; ours is the status light */
.stop { display: inline-block; width: .15em; height: .15em; margin-left: .05em; vertical-align: baseline; overflow: hidden; text-indent: 1em; border-radius: 50%; background: var(--red); box-shadow: 0 0 .18em rgba(255, 42, 26, .55); text-shadow: none; }
.ln { display: block; overflow: hidden; padding: .07em 0 .05em; margin: -.07em 0 -.05em; }
.ln > span { display: block; transform: translateY(112%); transition: transform 1.05s cubic-bezier(.16,.84,.12,1); }
.ln + .ln > span { transition-delay: .08s; }
.in .ln > span { transform: none; }

.card { clip-path: inset(0 0 100% 0); transition: clip-path .9s cubic-bezier(.2,.8,.15,1) .25s; }
.in .card { clip-path: inset(0 0 -2% 0); }

.pin p, .pin li, .pin h3, .pin figcaption, .pin .hl { text-shadow: 0 0 16px var(--paper), 0 0 6px var(--paper), 0 0 2px var(--paper); }
/* a soft plate behind copy so no dot runs through small type */
.card { background: color-mix(in srgb, var(--paper) 84%, transparent); padding: 14px 16px; margin: -14px -16px; }
.ch-stack .flag, .ch-watch .cap { background: color-mix(in srgb, var(--paper) 84%, transparent); padding: 8px 10px; margin: -8px -10px; }
.label { font: 700 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.tag { margin-top: 18px; display: inline-flex; gap: 10px; align-items: center; padding: 11px 14px; background: var(--ink); color: var(--paper); font: 700 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-shadow: none !important; }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* status words, always written out; the shape backs them up */
.st { display: flex; gap: .7em; align-items: baseline; margin-top: 12px; font: 700 11px/1.45 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(1px); }
.st.now { color: var(--ink); }
.st.now::before { background: var(--red); }
.st.notyet::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px currentColor; }
.st.future::before, .st.idea::before { box-shadow: inset 0 0 0 1.5px currentColor; }
.st.concept::before { border-radius: 1px; box-shadow: inset 0 0 0 1.5px currentColor; }

/* ---------- chapters: pinned scenes on wide screens ---------- */

.ch { position: relative; height: 170vh; }
.ch-clear { height: 125vh; }
.pin { position: sticky; top: 0; height: 100vh; min-height: 620px; overflow: hidden; }
.pin > * { position: absolute; }
.gap { display: none; }
.pin .hl { left: var(--left); top: var(--top); }

.ch-watch .lede { left: var(--left); bottom: 88px; width: 440px; }
.ch-watch .lede p:first-child { font-size: 18px; }
.ch-watch .cap { right: var(--gut); bottom: 96px; width: 220px; text-align: right; font: 500 11px/1.5 var(--f-mono); color: var(--muted); }

.ch-phone .body { left: var(--left); bottom: 88px; width: 400px; }
.ch-phone .lights { right: var(--gut); top: 50%; transform: translateY(-46%); width: 270px; }
.lights ul { list-style: none; margin: 14px 0 4px; display: grid; gap: 4px; }
.lights li { display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 8px; padding: 7px 0; color: var(--muted); transition: color .3s; }
.lights li i { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--red); opacity: .28; transition: opacity .3s, box-shadow .3s; }
.lights li b { font: 800 20px/1.1 var(--f-text); letter-spacing: -.01em; }
.lights li span { font: 500 12px/1.3 var(--f-mono); }
.lights li.on { color: var(--ink); }
.lights li.on i { opacity: 1; box-shadow: 0 0 14px 3px rgba(255, 42, 26, .5); }

.ch-answer .body { left: var(--left); bottom: 88px; width: 400px; }
.ch-answer .receipts { right: var(--gut); top: 50%; transform: translateY(-50%); width: 380px; }
.receipts ol { list-style: none; margin: 14px 0; display: grid; gap: 14px; }
.receipts li { display: grid; grid-template-columns: 56px 1fr; column-gap: 10px; }
.receipts li b { grid-row: span 2; font: 700 13px/1.4 var(--f-mono); color: var(--red); }
.receipts li span { font: 600 15px/1.35 var(--f-text); }
.receipts code { font: 500 12px/1.45 var(--f-mono); color: var(--muted); }
.receipts .src { font: 500 11px/1.5 var(--f-mono); color: var(--muted); }
.ch-answer .face { left: calc(50% + 12.4vh - 170px); bottom: 24px; width: 340px; text-align: center; font: 500 11px/1.5 var(--f-mono); color: var(--muted); }

.ch-two .today { left: var(--left); top: calc(var(--top) + var(--h2) * 1.72 + 22px); width: 420px; font: 500 12px/1.5 var(--f-mono); color: var(--muted); }
.way h3 { font: 900 clamp(34px, 3.4vw, 56px)/.9 var(--f-dot); text-transform: uppercase; margin-bottom: 10px; }
.way p:not(.st) { font-size: 16px; }
.ch-two .yours { left: var(--left); bottom: 70px; width: 330px; }
.ch-two .ours { right: var(--gut); top: calc(var(--top) + 6px); width: 330px; }

.ch-stack .flag { left: var(--left); top: calc(var(--top) - 40px); display: flex; gap: 10px; align-items: center; font: 700 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red); text-shadow: none; }
.ch-stack .flag i { width: 9px; height: 9px; border-radius: 1px; box-shadow: inset 0 0 0 2px var(--red); }
.ch-stack .hl { top: calc(var(--top) + 6px); }
.ch-stack .body { left: var(--left); bottom: 88px; width: 400px; }
.ch-stack .calls { right: var(--gut); bottom: 96px; width: 360px; }
.ch-stack .calls p:not(.st) { font-size: 15px; }

.ch-clear .sign { left: 50%; top: calc(44vh + 5.7vw + 34px); transform: translateX(-50%); width: 520px; text-align: center; }
.ch-clear .sign .st { justify-content: center; }
.ch-clear .say { font: 700 12px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* ---------- after the scenes: night pages ---------- */

.status, .founder, .close { padding: 18vh var(--gut) 12vh var(--left); position: relative; }
.big { font: 900 clamp(48px, 7vw, 120px)/.88 var(--f-dot); text-transform: uppercase; letter-spacing: -.015em; }
.status .head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 64px; }
.status .date { font: 700 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.status .grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; align-items: start; }
.ledger { display: grid; gap: 40px; }
.ledger .row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.ledger dt { display: flex; gap: 10px; align-items: baseline; font: 700 12px/1.45 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ledger dt::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); box-shadow: inset 0 0 0 1.5px currentColor; }
.ledger .now dt { color: var(--ink); }
.ledger .now dt::before { background: var(--red); box-shadow: 0 0 12px 2px rgba(255, 42, 26, .5); }
.ledger .notyet dt::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.ledger .none dt::before { border-radius: 1px; }
.ledger .next dt { color: var(--red); }
.ledger .next dt::before { box-shadow: inset 0 0 0 1.5px var(--red); }
.ledger dd { font-size: 19px; line-height: 1.5; max-width: 640px; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 12px; font: 500 11px/1.5 var(--f-mono); color: var(--muted); }

.founder p, .close > p { margin-top: 32px; max-width: 680px; font-size: 22px; line-height: 1.45; }
.cta { margin-top: 36px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cta button { font: 800 18px/1 var(--f-text); padding: 18px 26px; border: 2px solid var(--muted); background: transparent; color: var(--muted); cursor: not-allowed; }
.cta p { font: 500 12px/1.4 var(--f-mono); color: var(--muted); }
.foot { padding: 40px var(--gut) 90px var(--left); font: 500 12px/1.5 var(--f-mono); color: var(--muted); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- mid widths ---------- */

@media (max-width: 1279px) {
  :root { --left: 132px; --gut: 32px; }
  .rail span { display: none; }
}

/* ---------- phones and portrait screens: scenes flow, cards sit over the dots ---------- */

@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  :root { --gut: 16px; --left: 16px; --top: 100px; --h1: 15.4vw; --h2: 12.6vw; }
  body { font-size: 16px; }
  .rail, .top nav, .draft .long { display: none; }
  .draft .short { display: inline; }
  .top { padding: 14px var(--gut) 12px; grid-template-areas: "bar draft"; grid-template-columns: auto 1fr; align-items: center; background: var(--paper); }
  .draft { margin: 0; justify-content: flex-end; }
  .mark { font-size: 20px; }

  .ch, .ch-clear { height: auto; }
  .pin { position: relative; height: auto; min-height: 100svh; display: flex; flex-direction: column; gap: 12px; padding: var(--top) var(--gut) 18svh; overflow: visible; }
  .pin > *:not(.sr) { position: static !important; width: auto !important; transform: none !important; }
  .gap { display: block; flex: none; height: 44svh; }
  .ch-watch .gap { height: 38svh; }
  .ch-two .gap { height: 34svh; }
  .card { background: color-mix(in srgb, var(--paper) 90%, transparent); margin: 0 calc(-1 * var(--gut)); padding: 14px var(--gut); }
  .ch-stack .flag, .ch-watch .cap { margin: 0; padding: 6px 0; background: none; }
  .ch-watch .lede p:first-child { font-size: 16px; }
  .ch-watch .cap { order: 3; text-align: left; }
  .ch-two .today { order: 1; margin-top: 4px; }
  .ch-two .hl { order: 0; }
  .ch-two .gap { order: 2; }
  .ch-two .yours { order: 3; }
  .ch-two .ours { order: 4; }
  .ch-stack .flag { order: -1; margin-bottom: 4px; }
  .ch-answer .face { text-align: left; }
  .ch-clear .sign { text-align: left; }
  .ch-clear .sign .st { justify-content: flex-start; }
  .lights ul { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .lights li b { font-size: 17px; }

  .peak, .peak b { font-size: 9px; }
  .peak { margin: -26px 0 0 6px; padding: 3px 4px; }

  .status, .founder, .close { padding: 14vh var(--gut) 8vh; }
  .status .grid { grid-template-columns: 1fr; gap: 48px; }
  .shot { max-width: 300px; }
  .ledger .row { grid-template-columns: 1fr; gap: 8px; }
  .ledger dd { font-size: 17px; }
  .founder p, .close > p { font-size: 18px; }
  .foot { padding: 32px var(--gut) 80px; }
}

/* ---------- stills and reduced motion: every scene is a composed frame ---------- */

[data-still] main > * { display: none; }
[data-still="0"] #watch, [data-still="1"] #phone, [data-still="2"] #answer, [data-still="3"] #two, [data-still="4"] #stack, [data-still="5"] #clear,
[data-still="status"] #status, [data-still="founder"] #founder, [data-still="close"] #close { display: block; }
[data-still="close"] .foot { display: block; }
[data-still] .ch { height: 100vh; }
.still .ln > span, .still .card, .still .reveal { transition: none !important; }
.still .reveal { opacity: 1; transform: none; }
.still .ln > span { transform: none; }
.still .card { clip-path: none; }

/* .reduce is set by the script from the system setting or the Motion button; .no-js shows everything if the script never runs */
.reduce .ln > span, .reduce .card, .reduce .reveal { transition: none !important; }
.reduce .ln > span, .reduce .reveal, .no-js .ln > span, .no-js .reveal { transform: none !important; opacity: 1 !important; }
.reduce .card, .no-js .card { clip-path: none !important; }
.reduce .mark i, .reduce .led, .reduce .led::after { animation: none !important; }
.reduce body { transition: none; }

.motion { position: fixed; left: var(--gut); bottom: 24px; z-index: 9; display: inline-flex; gap: .5em; align-items: center; padding: 6px 0; border: 0; background: none; color: var(--muted); font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.motion::before { content: ""; width: 18px; height: 10px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px currentColor; background: radial-gradient(circle at 5px 50%, currentColor 2.5px, transparent 3px); }
.motion[aria-pressed="true"] { color: var(--ink); }
.motion[aria-pressed="true"]::before { background: radial-gradient(circle at 13px 50%, var(--red) 2.5px, transparent 3px); }
.motion b { font-weight: 700; }
.motion:hover { color: var(--red); }

.readout, .motion { transition: opacity .4s, visibility .4s; }
.past .readout, .past .motion { opacity: 0; visibility: hidden; }

/* phones: the readout and motion button join the header as a second row, so nothing covers copy at the bottom */
@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  :root { --top: 124px; }
  .readout { left: 0; right: 0; top: 50px; bottom: auto; padding: 4px calc(var(--gut) + 104px) 10px var(--gut); gap: 10px; background: var(--paper); }
  .readout p { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
  .readout span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .readout b { font-size: 11px; }
  .readout span { font-size: 10px; }
  .led { width: 10px; height: 10px; }
  .motion { left: auto; right: var(--gut); top: 50px; bottom: auto; padding: 2px 0; z-index: 11; }
}
