/* ==========================================================================
   Spacetime — core tokens + shared chrome (header, curtain, buttons, footer)
   Built on the microsoft.ai base: cream / warm ink / paper / peach→terracotta,
   Bradford LL serif + Red Hat Mono.
   ========================================================================== */
@import url('../assets/fonts/fonts.css');

:root {
  --font-serif: 'Bradford LL', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'Red Hat Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --ink: #5d524b;
  --ink-soft: #857a6e;
  --ink-deep: #3b322c;
  --cream: #fef9ed;
  --paper: #f7ecd9;
  --paper-mid: #f2ead9;
  --rust: #a67c52;

  --hero-1: #fde3d1;
  --hero-2: #fbd3be;
  --hero-3: #f0b494;
  --hero-4: #dc8f6c;
  --hero-5: #b8694a;
  --hero-hi: #fff3e6;

  /* Spacetime extensions: the sunset of the hero runs on into dusk */
  --dusk: #241b17;
  --dusk-2: #2f241f;
  --dusk-line: rgba(254, 249, 237, 0.16);
  --ember: #e9a07a;      /* keyword highlight on dark */
  --mark: #ffe2c4;       /* highlighter on light */
  --terracotta: #c8704e;

  --edge: clamp(1rem, 3vw, 2.25rem);
  --header-h: clamp(3.75rem, 5.4vw, 4.5rem);
  --radius-lg: 20px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--cream); }
body {
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--cream);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

::selection { background: var(--hero-4); color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 2000;
  background: var(--ink); color: var(--cream); padding: .7rem 1.1rem; border-radius: 999px;
  font-size: 12px; transition: top .25s var(--ease-out-quart);
}
.skip-link:focus { top: 1rem; }

.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rust);
}
.eyebrow::before { content: ''; width: 1.6em; height: 1px; background: currentColor; }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 22px; left: var(--edge); right: var(--edge); z-index: 900;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-inline: clamp(1rem, 2.2vw, 1.75rem);
  background: var(--cream);
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 4px 60px rgba(93, 82, 75, .22));
  transition: transform .5s var(--ease-out-expo);
}
.site-header.is-hidden { transform: translateY(calc(-100% - 30px)); }
.brand { display: inline-flex; align-items: baseline; gap: .7rem; white-space: nowrap; }
.brand__name { font-family: var(--font-serif); font-size: 1.45rem; letter-spacing: -.01em; color: var(--ink-deep); }
.brand__name em { font-style: italic; }
.brand__role { font-size: 11px; color: var(--ink-soft); letter-spacing: .02em; }
.site-nav { display: flex; gap: clamp(1.25rem, 2.6vw, 2.5rem); }
.site-nav a { font-size: 12px; font-weight: 500; color: var(--ink-soft); transition: color .25s; position: relative; }
.site-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease-out-expo); }
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.header-right { display: flex; align-items: center; gap: 1.25rem; }
.t-readout {
  font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: .5em;
}
.t-readout b { font-weight: 500; color: var(--ink); min-width: 6.2ch; display: inline-block; }
.t-readout i { width: 6px; height: 6px; border-radius: 50%; background: var(--terracotta); display: inline-block; animation: tpulse 2s infinite; }
@keyframes tpulse { 50% { opacity: .25; } }
.header-cta {
  display: inline-flex; align-items: center; gap: .45em;
  font-family: var(--font-serif); font-size: .85rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink);
  white-space: nowrap;
}
.header-cta svg { width: .85em; height: .85em; transition: transform .3s var(--ease-out-quart); }
.header-cta:hover svg { transform: translate(.15em, -.15em); }

@media (max-width: 900px) {
  .site-nav, .brand__role, .t-readout { display: none; }
}
@media (max-width: 720px) {
  .site-header { top: 14px; }
  .brand__name { font-size: 1.25rem; }
}

/* ---------- pills / buttons ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .02em;
  height: 3.1em; padding: 0 1.9em; border-radius: 2em;
  transition: transform .35s var(--ease-out-quart), background .25s, box-shadow .35s, color .25s;
  white-space: nowrap;
}
.pill svg { width: 1em; height: 1em; }
.pill--dark { background: var(--ink); color: var(--paper); }
.pill--tan { background: var(--paper); color: var(--ink); }
.pill--cream { background: var(--cream); color: var(--ink); }
.pill--line { box-shadow: inset 0 0 0 1px currentColor; }
.pill:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(58, 45, 38, .18); }

/* ---------- curtain page transition ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 1500; pointer-events: none;
  background: var(--terracotta);
  color: var(--cream);
  display: grid; place-items: center;
  transform: translateY(101%);
}
.curtain__title { font-family: var(--font-serif); font-size: clamp(2.6rem, 9vw, 8rem); font-style: italic; line-height: 1; text-align: center; padding: 0 var(--edge); }
.curtain__meta { position: absolute; left: var(--edge); bottom: var(--edge); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.curtain.is-leaving { transition: transform .75s var(--ease-out-expo); transform: translateY(0); pointer-events: all; }
html.is-arriving .curtain { transform: translateY(0); animation: curtain-out 1s .15s var(--ease-out-expo) forwards; }
@keyframes curtain-out { to { transform: translateY(-101%); } }

/* ---------- reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease-out-quart), transform 1.1s var(--ease-out-expo); transition-delay: var(--d, 0s); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1200;
  transform: translate(-50%, calc(100% + 48px));
  visibility: hidden;
  background: var(--ink-deep); color: var(--cream); font-size: 12px; padding: .9rem 1.4rem; border-radius: 999px;
  transition: transform .5s var(--ease-out-expo), visibility 0s .5s;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .5s var(--ease-out-expo); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
