/* 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. */
:root {
  color-scheme: light;
  --paper: #efe6da;
  --paper-hi: #f6f0e7;
  --paper-lo: #e5d9c9;
  --ink: #2a1f19;
  --ink-2: #4c3e34;
  --ink-3: #66564a;
  --umber: #8a4f2c;
  --gold: #e7cba7;
  --line: rgba(42, 31, 25, 0.12);
  --line-2: rgba(42, 31, 25, 0.22);
  --cream: #f8f3ea;
  --card: #fbf8f2;
  --vellum: #f6eee3;
  --midnight: #17110d;
  --dark: #2e221b;
  --night: rgba(40, 30, 24, 0.82);
  /* surfaces and tints used by the rooms and the app mock-ups (one place for every colour) */
  --white: #fff;
  --ivory: #f7f2e9;
  --porcelain: #fffaf3;
  --linen: #fbf7f0;
  --sand: #f2ebe0;
  --wheat: #f1e6d6;
  --wheat-2: #ecdcc6;
  --dune: #ede3d5;
  --dune-2: #e9dfcf;
  --flush: #fbf1e6;
  --flush-2: #f1e2d0;
  --term: #2b211b;
  --taupe: #8a7f70;
  --taupe-2: #85766a;
  --code-k: #7f6a59;
  --code-c: #857565;
  --rust: #b4502f;
  --rust-2: #a44a2c;
  --rust-3: #8e4128;
  --ok: #4f7a45;
  --ok-lt: #a9cf9c;
  --bad: #a4513a;
  --bad-lt: #e3a08a;
  --serif: "Newsreader", "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);
}
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scrollbar-color: #bfae9c var(--paper); scroll-padding-top: 90px; }
@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: #dcc6aa; 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; }
: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; }
.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 { 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(42,31,25,.6); }
.btn--cream { background: var(--cream); color: var(--ink); box-shadow: 0 10px 28px -14px rgba(20,12,6,.55); }
.btn--line { background: rgba(248,243,234,.4); color: var(--ink); border-color: var(--line-2); }
.btn--glass { background: rgba(27,22,18,.6); color: var(--cream); border-color: rgba(255,248,238,.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: #3d2e25; }
  .btn--cream:hover { background: #fffaf2; }
  .btn--line:hover { background: rgba(248,243,234,.85); border-color: rgba(42,31,25,.34); }
  .btn--glass:hover { background: rgba(27,22,18,.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; }

/* engines that are live hide their still; stills stay when WebGL is missing or lost */
.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; } }
