/* Layout: one scene card that is the page's day/night switch; the whole page follows the mode. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111216;
  --ink-2: #4b4f5a;
  --ink-3: #8a8f9b;
  --surface: #ffffff;
  --edge: rgba(17, 18, 22, 0.07);
  --knob: #111216;
  --knob-ink: #ffffff;
  --foot-bg: #101217;
  --foot-ink: #f3efe6;
  --foot-2: #8b8f99;
  --dot: #f2a33a;
  --shadow: 0 10px 30px rgba(17, 18, 22, 0.12), 0 1px 3px rgba(17, 18, 22, 0.08);
  --grain-opacity: 0.3;
  --grain-blend: multiply;
  --radius: 28px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fade: 0.9s ease;
  --sans: "Archivo", -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-mode="night"] {
  color-scheme: dark;
  --bg: #08090b;
  --ink: #f3efe6;
  --ink-2: #b3b5bc;
  --ink-3: #6c707b;
  --surface: #1b1d23;
  --edge: rgba(255, 255, 255, 0.07);
  --knob: #f3efe6;
  --knob-ink: #111216;
  --foot-bg: #f3efe6;
  --foot-ink: #111216;
  --foot-2: #6b6c70;
  --dot: #8fb8ff;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  --grain-opacity: 0.16;
  --grain-blend: overlay;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The page only ever scrolls up and down. */
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--fade), color var(--fade);
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.lede, nav .clock, .fact .d, .when, h2, .switch, footer, footer .line { transition: background-color var(--fade), color var(--fade), box-shadow var(--fade); }

/* Grain: a noise layer over any element with .grain */
.grain { position: relative; isolation: isolate; overflow: hidden; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; border-radius: inherit;
  background-image: var(--grain); opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  transition: opacity var(--fade);
}

/* Aura: a soft glow at the top of the page, warm by day and cool by night */
.aura { position: absolute; inset: 0 0 auto; height: 900px; pointer-events: none; z-index: 0; overflow: hidden; }
.aura span { position: absolute; inset: 0; transition: opacity 1.4s ease; }
.aura .day { background: radial-gradient(60% 55% at 80% 8%, rgba(255, 176, 64, 0.20), transparent 70%); }
.aura .night { opacity: 0; background: radial-gradient(60% 55% at 80% 8%, rgba(90, 150, 255, 0.14), transparent 70%); }
[data-mode="night"] .aura .day { opacity: 0; }
[data-mode="night"] .aura .night { opacity: 1; }

nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0 8px; font-size: 14px; }
nav .me { font-weight: 600; text-decoration: none; letter-spacing: 0.01em; }
nav .clock { color: var(--ink-3); font-variant-numeric: tabular-nums; }
nav .clock .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); margin-right: 8px; vertical-align: 1px; transition: background-color var(--fade); }

h1, h2, .when {
  font-family: var(--sans); font-weight: 500; font-variation-settings: "wdth" 118;
  letter-spacing: -0.02em; margin: 0; text-wrap: balance;
}
h1 { font-size: clamp(44px, 7.4vw, 84px); line-height: 1; margin-top: 56px; }
h2 { font-size: clamp(28px, 3.6vw, 38px); line-height: 1.1; margin-bottom: 22px; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 600px; margin: 18px 0 34px; }

/* The scene: a sky that crossfades, a sun that sets and a moon that rises, and the copy for each */
/* No card: the keys and the copy sit straight on the page, with the sun or moon behind the keys. */
.scene { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 32px; margin-top: 8px; }
.sky { position: absolute; inset: 0; z-index: 0; border-radius: inherit; transition: opacity 1.2s ease; }
.sky.day { display: none; }
.sky.night { opacity: 0; }
[data-mode="night"] .sky.day { opacity: 0; }
[data-mode="night"] .sky.night { opacity: 1; }
/* Stars stay on the moon's side of the card, never behind the text */
.stars { position: absolute; inset: 0 50% 0 0; }
.stars span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #f3efe6; opacity: 0.55; animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.15; } }

.bodies {
  position: relative; z-index: 1; height: 340px; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 96%); mask-image: linear-gradient(180deg, #000 72%, transparent 96%);
}
.body { position: absolute; inset: 0; display: grid; place-items: center; transition: transform 1.3s var(--ease), opacity 1s ease; }
.body svg { position: absolute; width: 420px; height: 420px; }
.body .soft { opacity: 0.9; }
.body .core { opacity: 0.85; }
.moon { transform: translateY(70%); opacity: 0; }
[data-mode="night"] .sun { transform: translateY(70%); opacity: 0; }
[data-mode="night"] .moon { transform: none; opacity: 1; }

.copies { position: relative; z-index: 4; display: grid; }
.copy { grid-area: 1 / 1; transition: opacity 0.6s ease, transform 0.8s var(--ease), visibility 0s linear 0s; }
.copy[aria-hidden="true"] { opacity: 0; transform: translateY(14px); visibility: hidden; transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s linear 0.4s; }
.when { font-size: clamp(36px, 4.4vw, 52px); line-height: 1; margin-bottom: 26px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; max-width: 440px; }
.fact .t { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 500; font-variation-settings: "wdth" 108; letter-spacing: -0.01em; }
.fact .d { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.intro { margin: -12px 0 26px; font-size: 17px; color: var(--ink-2); max-width: 460px; transition: color var(--fade); }

/* The stage: the sun or moon behind, and the two keycaps that switch day and night */
.stage { position: relative; z-index: 2; height: 460px; display: grid; place-items: center; }
.stage .bodies { position: absolute; left: -2%; top: 0; width: 70%; height: 66%; -webkit-mask-image: none; mask-image: none; overflow: visible; opacity: 0.85; }
.stage .body svg { width: 360px; height: 360px; }
/* The artboard is 1920 × 1080 with the keys in the middle; the box shows x 230 to 1730 and y 150 to 950, shadows included. */
.keys { position: relative; z-index: 2; width: 100%; max-width: 680px; aspect-ratio: 1500 / 800; overflow: hidden; }
.keys canvas { position: absolute; width: 128%; left: -15.33%; top: -18.75%; aspect-ratio: 16 / 9; height: auto; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* The hidden Day and Night buttons: off screen until focused from the keyboard. */
.keys-radios { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.keys-radio { font: inherit; font-size: 14px; font-weight: 500; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.keys-radio[aria-checked="true"] { background: var(--knob); color: var(--knob-ink); }
.keys-radio:focus-visible { outline: 2px solid var(--dot); outline-offset: 2px; }
.has-keys .keys-radio:not(:focus-visible) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.no-keys .keys { display: none; }


.block { margin: 104px 0; }

/* Tiles: blurred colour fields with one white word each */
/* Two big tiles per row (one on phones). The word sits in the middle and scales with the tile,
   so it stays large at every width; its line sits small along the bottom. */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tile { container-type: inline-size; aspect-ratio: 5 / 4; border-radius: 26px; clip-path: inset(0 round 26px); color: #fff; display: grid; place-items: center; padding: 8%; max-width: 100%; }
.tile .bg { position: absolute; inset: -30px; filter: blur(26px) saturate(1.1); z-index: 0; }
.tile.grain::after { opacity: 0.55; mix-blend-mode: overlay; background-size: 140px; }
.tile.grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background-image: var(--grain); background-size: 90px; opacity: 0.3; mix-blend-mode: multiply;
}
.tile > * { position: relative; z-index: 4; }
.tile .words { display: contents; }
.tile .big { position: relative; z-index: 4; font-size: clamp(40px, 14cqi, 96px); line-height: 0.95; font-weight: 500; font-variation-settings: "wdth" 112; letter-spacing: -0.03em; text-align: center; text-shadow: 0 0 28px rgba(255, 255, 255, 0.5); }
/* The line sits small along the bottom edge, under the centred word. */
.tile .lbl { position: absolute; z-index: 4; left: 7%; right: 7%; bottom: 6.5%; margin: 0 auto; max-width: 40ch; text-align: center; font-size: clamp(12.5px, 2.6cqi, 15px); font-weight: 500; line-height: 1.35; text-wrap: balance; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25); opacity: 0.95; }

a.pill { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; text-decoration: none; padding: 11px 18px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }

/* Footer: the page's opposite, a dark band by day and a cream band by night */
footer { background: var(--foot-bg); color: var(--foot-ink); margin-top: 120px; position: relative; z-index: 1; }
footer .wrap { padding-top: 30px; padding-bottom: 26px; }
footer .line { margin: 0; font-size: 14px; color: var(--foot-2); text-align: right; }
footer .mark { font: 400 clamp(96px, 22vw, 290px)/0.9 var(--serif); letter-spacing: -0.03em; margin: 40px 0 0; text-align: right; }

/* Not-found page */
.lost { min-height: 62vh; display: grid; align-content: center; justify-items: start; gap: 18px; }
.lost h1 { margin-top: 0; }
.lost p { margin: 0; color: var(--ink-2); font-size: 18px; max-width: 520px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01s !important; animation: none !important; }
}

@media (max-width: 860px) {
  .scene { grid-template-columns: 1fr; gap: 8px; }
  .stage { height: 300px; }
  /* On phones the box stays inside the screen; a tighter crop keeps the keys big. */
  .keys { width: 100%; aspect-ratio: 1360 / 800; }
  .keys canvas { width: 141.2%; left: -22.06%; top: -18.75%; }
  .stage .body svg { width: 260px; height: 260px; }
  .bodies { height: 210px; }
  .stars { inset: 0 0 auto 0; height: 250px; }
  .body svg { width: 290px; height: 290px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { aspect-ratio: 1 / 1; }
  .wrap { padding: 0 16px; }
  h1 { margin-top: 40px; }
  .lede { font-size: 17px; margin-bottom: 28px; }
  .block { margin: 80px 0; }
}
