/* Design tokens: the single place where colour, type, space and motion are defined.
   Components use these variables and never raw values. Values come from the Phase 1–2 prototypes. */
:root {
  color-scheme: dark;

  /* neutrals: near-black, not pure black; off-white, not pure white */
  --bg: #0e0e10;
  --bg-2: #141417;
  --bg-3: #1b1b1f;
  --line: #27272c;
  --fg: #e6e4df;
  --fg-2: #a6a49f;
  --fg-3: #868480;   /* faintest text. 4.6:1 or more on every background above (AA for small text) */

  /* one accent. Used only to point at what matters right now. */
  --accent: #ffb86b;
  --accent-ink: #1a1206;

  /* type (system stack for now; the typeface is a Phase 5 decision) */
  --font: -apple-system, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --t-xs: 0.75rem;
  --t-s: 0.875rem;
  --t-m: 1.0625rem;
  --t-l: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  --t-xl: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  --t-display: clamp(2.5rem, 1.5rem + 6vw, 6.5rem);
  --lh-body: 1.55;
  --measure: 62ch;
  --column: 41rem;        /* the text column of a case: one width for headings, paragraphs and lists */

  /* space */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 1rem; --s-4: 1.5rem;
  --s-5: 2.5rem; --s-6: 4rem; --s-7: 6rem; --s-8: 9rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius: 10px;

  /* motion: one voice for the whole site */
  --d-1: 160ms;  /* micro: colour, opacity */
  --d-2: 360ms;  /* ui: reveal, hover lift */
  --d-3: 720ms;  /* signature: page transition */
  --e-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --e-inout: cubic-bezier(0.65, 0, 0.35, 1);

  /* layout */
  --wrap: 80rem;          /* max content width on the home */
  --bar-space: 5.5rem;    /* room kept at the bottom of a page for the fixed bar */
}
/* Base: reset, defaults, a few shared atoms, page transition and reduced motion. No page-specific rules. */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 var(--t-m)/var(--lh-body) var(--font); min-height: 100svh; overflow-x: clip; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* when momentum scrolling is running (it adds .lenis to <html>), the browser's own smooth scrolling must be off or the two fight */
html.lenis { scroll-behavior: auto; }

/* atoms */
.eyebrow { font: 500 var(--t-xs)/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.eyebrow b { color: var(--accent); font-weight: 500; }
.muted { color: var(--fg-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.placeholder { color: var(--fg-3); font-style: italic; }

/* skip link: visible only when focused */
.skip { position: fixed; top: var(--s-3); left: var(--s-3); z-index: 100; padding: var(--s-2) var(--s-3); background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: var(--t-s); transform: translateY(-200%); transition: transform var(--d-1); }
.skip:focus-visible { transform: none; outline-offset: 2px; }

/* a full-viewport section: the home is a sequence of these */
.scene { position: relative; min-height: 100svh; display: grid; align-content: center; padding: var(--s-7) var(--gutter); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; }

/* page transition: a short cross-fade between pages. Going into a case, its title and image travel to the
   case hero (named in Scene.astro and case/Hero.astro). The top and bottom bars stay in place. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 220ms var(--e-out) both; }
::view-transition-new(root) { animation: vt-in var(--d-3) var(--e-out) 140ms both; }
::view-transition-group(case-title), ::view-transition-group(case-frame) { animation-duration: var(--d-3); animation-timing-function: var(--e-inout); }
::view-transition-old(case-frame), ::view-transition-new(case-frame) { height: 100%; object-fit: cover; }
::view-transition-group(top), ::view-transition-group(bar) { animation-duration: var(--d-2); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(28px); } }

/* reduced motion: fades or nothing, everywhere */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.lang[data-astro-cid-zh35qibh] {
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: .08em;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-2);
  transition: color var(--d-1), border-color var(--d-1), background var(--d-1);
}

.lang[data-astro-cid-zh35qibh]:hover {
  color: var(--fg);
  border-color: var(--fg-3);
  background: var(--bg-2);
}
.top[data-astro-cid-4zcwgehy] {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: calc(var(--s-3) + env(safe-area-inset-top, 0px)) var(--gutter) var(--s-3);
  pointer-events: none;
  view-transition-name: top;
  background: linear-gradient(var(--bg) 70%, transparent);
}

.top[data-astro-cid-4zcwgehy] > * {
  pointer-events: auto;
}

.left[data-astro-cid-4zcwgehy] {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-width: 0;
  flex: 1;
}

.back[data-astro-cid-4zcwgehy] {
  font-size: var(--t-s);
  color: var(--fg);
  padding: var(--s-2) 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  transition: color var(--d-1);
}

.back[data-astro-cid-4zcwgehy]:hover {
  color: var(--accent);
}

.right[data-astro-cid-4zcwgehy] {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex: none;
}

.link[data-astro-cid-4zcwgehy] {
  font-size: var(--t-s);
  color: var(--fg-2);
  padding: var(--s-2) var(--s-1);
  transition: color var(--d-1);
}

.link[data-astro-cid-4zcwgehy]:hover, .link[data-astro-cid-4zcwgehy][aria-current] {
  color: var(--fg);
}

.name[data-astro-cid-4zcwgehy] {
  font-size: var(--t-s);
  color: var(--fg-2);
  transition: color var(--d-1);
}

.name[data-astro-cid-4zcwgehy] b[data-astro-cid-4zcwgehy] {
  color: var(--fg);
  font-weight: 500;
}

.name[data-astro-cid-4zcwgehy]:hover {
  color: var(--fg);
}

.role[data-astro-cid-4zcwgehy] {
  color: var(--fg-3);
}

@media (width <= 480px) {
  .role[data-astro-cid-4zcwgehy], .name[data-astro-cid-4zcwgehy].has-back {
    display: none;
  }
}
main[data-astro-cid-hkbrpulz]:focus {
  outline: none;
}

.preview[data-astro-cid-hkbrpulz] {
  font: 500 var(--t-xs)/1.5 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.foot[data-astro-cid-hkbrpulz] {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-5) var(--gutter) calc(var(--bar-space) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--fg-3);
  font-size: var(--t-s);
}
