/* styles/base.css: Electron Hub, Baroque landing. Tokens, reset, type, buttons and reveal; one file per room in rooms/.
   Painting → print → object. One accent (umber), one display face (Newsreader, never italic),
   radius scale 8 / 16 / 24 / pill. Motion: interface under 300 ms, exits faster than entrances. */
/* Newsreader loads with font-display: swap, so no text is ever invisible. Until it lands, serif text sets in local
   Georgia scaled to Newsreader's measure (advance width and ascent/descent measured in Chromium at weights 300 and
   400), so the swap moves no line. Newsreader is optically sized and its 400 runs wider than its 300 (Newsreader /
   Georgia width: 300 at 24-40px 0.89-0.92, 400 at 20-26px 0.915-0.925, 300 at 56-92px 0.94-0.96), hence a face per
   weight and a display face for .display/.h2 where they set large (above 720px; below it they are 40-46px and take the
   reading faces). Overrides are divided by size-adjust because the browser scales them by it (Newsreader: ascent
   0.735, descent 0.265, no line gap). Where Georgia is missing (Android), the faces do not load and the stack falls
   through as before. */
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"); font-weight: 100 350; size-adjust: 91%; ascent-override: 80.77%; descent-override: 29.12%; line-gap-override: 0%; }
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"); font-weight: 351 1000; size-adjust: 92%; ascent-override: 79.89%; descent-override: 28.8%; line-gap-override: 0%; }
@font-face { font-family: "Newsreader Display Fallback"; src: local("Georgia"); size-adjust: 95.5%; ascent-override: 76.96%; descent-override: 27.75%; line-gap-override: 0%; }
:root {
  color-scheme: light;
  --paper: #e5e7ea;
  --paper-hi: #eff1f4;
  --paper-lo: #d8dadd;
  --ink: #1f2124;
  --ink-2: #3f4144;
  --ink-3: #57595c;
  --umber: #585a5d;
  --gold: #ccced1;
  --line: rgba(31, 33, 36, 0.12);
  --line-2: rgba(31, 33, 36, 0.22);
  --cream: #f1f3f6;
  --card: #f6f8fb;
  --vellum: #edeff2;
  --midnight: #101215;
  --dark: #222427;
  --night: rgba(30, 32, 35, 0.82);
  /* surfaces and tints used by the rooms and the app mock-ups (one place for every colour) */
  --white: #ffffff;
  --ivory: #f0f2f5;
  --porcelain: #fbfbfb;
  --linen: #f5f7fa;
  --sand: #eaecef;
  --wheat: #e5e7ea;
  --wheat-2: #dcdee1;
  --dune: #e2e4e7;
  --dune-2: #dee0e3;
  --flush: #f0f2f5;
  --flush-2: #e2e4e7;
  --term: #212326;
  --taupe: #7e8083;
  --taupe-2: #77797c;
  --code-k: #6c6e71;
  --code-c: #75777a;
  --rust: #646669;
  --rust-2: #5c5e61;
  --rust-3: #505255;
  --ok: #67696c;
  --ok-lt: #bec0c3;
  --bad: #626467;
  --bad-lt: #adafb2;
  --serif: "Newsreader", "Cyrillic Display", "Newsreader Fallback", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif-display: "Newsreader", "Cyrillic Display", "Newsreader Display Fallback", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --inout: cubic-bezier(0.77, 0, 0.175, 1);
  --drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r-sm: 8px; --r-md: 16px; --r-lg: 24px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  /* the floating nav pill (styles/nav.css: 12px from the top, 54px tall) plus a breath: anything pinned or scrolled
     to sits below this line, never under the pill */
  --nav-clear: 78px;
}
*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: none !important; }
*::-webkit-scrollbar { display: none !important; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-clear) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
::selection { background: #c7c9cc; color: var(--ink); }
img { display: block; max-width: 100%; }
h1, h2, h3, .h2, .h3, .lede, figcaption { text-wrap: balance; }
p, li, dd, dt { text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
input::-ms-clear { display: none; }
:focus-visible { outline: 2px solid var(--umber); outline-offset: 3px; border-radius: var(--r-sm); }
/* Focus is drawn only in keyboard modality (app.jsx sets html[data-kbd] on keydown and drops it on pointerdown).
   Browsers otherwise ring a slider after a drag, or a button whose click moved focus or scrolled the page. */
html:not([data-kbd]) :focus-visible { outline: none; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.cloud-band { position: relative; isolation: isolate; height: calc(var(--nav-clear) + 150px + env(safe-area-inset-top, 0px)); overflow: clip; pointer-events: none; }
.cloud-band img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  mask-image: linear-gradient(#000 55%, transparent); filter: grayscale(1) brightness(1.14); opacity: .72; }
@media (max-width: 540px) { .cloud-band { height: 193px; } }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--cream); padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Static first paint (inside #root, replaced by React). Shown at once without JS; after 4 s if the scripts stall. */
.prerender { min-height: 100svh; }
.js .prerender { visibility: hidden; animation: lateShow 0s linear 4s forwards; }
@keyframes lateShow { to { visibility: visible; } }

/* ── Type ── */
.display, .h2, .h3 { font-family: var(--serif); font-weight: 300; margin: 0; text-wrap: balance; font-optical-sizing: auto; }
.display, .h2 { font-family: var(--serif-display); }
@media (max-width: 720px) { .display, .h2 { font-family: var(--serif); } }
.display { font-size: clamp(46px, 6.4vw, 92px); line-height: 0.98; letter-spacing: -0.034em; }
.h2 { font-size: clamp(40px, 5vw, 72px); line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.h2--xl { font-size: clamp(50px, 6.4vw, 96px); letter-spacing: -0.034em; }
.h3 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); }
.lede { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.65; color: var(--ink-2); margin: 0; max-width: 54ch; text-wrap: pretty; }
code { font-family: var(--mono); }

/* ── Buttons ── */
.btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: var(--h); padding: 0 24px; border-radius: 999px; font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  transition: transform 160ms var(--out), background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; transition: transform 200ms var(--out); }
.btn .ic { width: 18px; height: 18px; }
.btn--lg { --h: 54px; padding: 0 28px; font-size: 16px; }
.btn--sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn--ink { background: var(--dark); color: var(--cream); box-shadow: inset 0 1px 0 rgba(255, 255, 255,.08), 0 10px 24px -12px rgba(31, 33, 36,.6); }
.btn--cream { background: var(--cream); color: var(--ink); box-shadow: 0 10px 28px -14px rgba(13, 13, 13,.55); }
.btn--line { background: rgba(241, 243, 246,.4); color: var(--ink); border-color: var(--line-2); }
.btn--glass { background: rgba(21, 23, 26,.6); color: var(--cream); border-color: rgba(247, 249, 252,.14); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
.btn--glass svg { width: 16px; height: 16px; opacity: .9; }
.tlink { display: inline-flex; align-items: center; gap: 7px; font: 500 14.5px/1.2 var(--sans); color: var(--ink); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid var(--line-2); transition: border-color 200ms ease; }
@media (pointer: coarse) { .tlink { position: relative; } .tlink::before { content: ''; position: absolute; inset: -10px -4px; } }
.tlink svg { width: 13px; height: 13px; transition: transform 200ms var(--out); }
@media (hover: hover) and (pointer: fine) {
  .btn--ink:hover { background: #2f3134; }
  .btn--cream:hover { background: #fafafa; }
  .btn--line:hover { background: rgba(241, 243, 246,.85); border-color: rgba(31, 33, 36,.34); }
  .btn--glass:hover { background: rgba(21, 23, 26,.74); }
  .btn:hover .arr, .tlink:hover svg { transform: translateX(3px); }
  .tlink:hover { border-color: var(--ink); }
}


/* ── Reveal: headings only, and only those that start below the fold (nothing on screen ever blinks out) ── */
/* Exhibits: tip up into place once, like a card set down on the table */
.lb-ready [data-rise] { transform-origin: 50% 0; transition: opacity 700ms var(--ease), transform 1000ms var(--ease); }
.lb-ready [data-rise]:not([data-risen]) { opacity: 0; transform: perspective(1400px) rotateX(10deg) translate3d(0, 48px, 0) scale(.975); }
[data-reveal] { transition: opacity 500ms var(--ease), filter 500ms var(--ease), transform 500ms var(--ease); }
[data-reveal].is-pending { opacity: 0; filter: blur(6px); transform: translateY(12px); }


/* ── Sections ── */
.section { position: relative; padding-block: clamp(120px, 13vw, 190px); }

/* rooms recede as they leave and come forward as they arrive (app/scroll.jsx) */
[data-room] { transform-origin: 50% 40%; will-change: transform, opacity; }

.section-print { position: relative; pointer-events: none; }
.section-print > .still { width: 100%; height: auto; image-rendering: pixelated; }
.section-print > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* engines that are live hide their still; stills stay when WebGL is missing or lost */
.print canvas, .section-print > canvas, .closing__sky canvas { opacity: 0; transition: opacity 800ms var(--ease); }
[data-engine].is-live > canvas { opacity: 1; }
/* the still leaves only after the canvas has fully arrived over it, so the picture never dips through to the paper */
[data-engine].is-live > .still { opacity: 0; transition: opacity 300ms var(--ease) 800ms; }
[data-engine].is-still > canvas { display: none; }
[data-engine].is-still > .still { opacity: 1 !important; }

@media (max-width: 640px) { .btn--lg { --h: 52px; padding: 0 22px; } }

.pixel-art { image-rendering: pixelated; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .pixel-art {
    translate: var(--art-x, 0px) var(--art-y, 0px);
    transition: translate 560ms var(--out);
  }
}
