/* Self-hosted fonts (SIL Open Font License 1.1), latin subset from the @fontsource npm packages.
   Versions and licences: assets/vendor/LICENSES.md. No requests to Google Fonts. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/fragment-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Ground Zero POV storefront: tokens, the rem grid, base and shared components.
   Black page, one warm sand accent. Inter for text, Instrument Serif italic for one word per
   title, Fragment Mono for labels and readouts. Every length is in rem on a viewport-
   tracking root size, so each design frame (1440 / 1024 / 768 / 390) renders 1:1. */

:root {
  --white: #ffffff;
  --black: #000000;
  --neutral-200: #d6dadd;
  --neutral-300: #bababa;
  --neutral-400: #9ba0a6;
  --neutral-500: #747980;
  --neutral-850: #131416;
  --neutral-875: #121315;
  --ink: #0a0b09;
  --sand: #c8a97e;
  --sand-300: #d4b98f;
  --sand-100: #e8dcc8;
  --sand-700: #8c7355;
  --sand-900: #3a2f22;
  --stone: #9c9284;
  --sky: #52c8ff;

  --background: var(--black);
  --foreground: var(--white);
  --muted: var(--neutral-400);
  --dim: var(--neutral-500);
  --title-from: var(--white);
  --title-to: var(--neutral-300);
  --title-accent: var(--neutral-200);
  --surface-raised: var(--neutral-850);
  --surface-badge: var(--neutral-875);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-glass: rgba(255, 255, 255, 0.22);
  --glass-from: rgba(255, 255, 255, 0.16);
  --glass-to: rgba(255, 255, 255, 0.04);
  --card-glass: rgba(14, 15, 17, 0.42);
  --card-solid: rgba(14, 15, 17, 0.88);
  --card-border: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.09);
  --accent: var(--sand);
  --accent-soft: var(--sand-100);
  --on-accent: var(--ink);
  --plate: #c8a97e;

  --stream-main: var(--sand);
  --stream-alt: var(--stone);
  --stream-core: var(--sand-100);
  --stream-deep: var(--sand-900);
  --stream-spark: var(--sand-100);

  --shadow-float: 0 0.5rem 1.375rem -0.25rem rgba(0, 0, 0, 0.5);
  --ease-entrance: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 150ms;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --page-width: 90rem;
  --page-inset: 5rem;
  --section-gap: 4.5rem;
  --nav-h: 5.5rem;
  --type-title: 2.75rem;
  --type-title-accent: 3.125rem;
  --line-title: 3.875rem;
}

/* ---------- The four frames ---------- */
html { font-size: min(1.111111vw, 21.333333px); }
@media (max-width: 1200px) {
  html { font-size: min(1.5625vw, 16px); }
  :root { --page-width: 64rem; --page-inset: 3rem; --section-gap: 4rem; --type-title: 2.25rem; --type-title-accent: 2.5rem; --line-title: 3.125rem; }
}
@media (max-width: 900px) {
  html { font-size: min(2.083333vw, 16px); }
  :root { --page-width: 48rem; --page-inset: 2.5rem; --section-gap: 3.5rem; --type-title: 1.875rem; --type-title-accent: 2rem; --line-title: 2.625rem; --nav-h: 4rem; }
}
@media (max-width: 580px) {
  html { font-size: min(4.102564vw, 16px); }
  :root { --page-width: 24.375rem; --page-inset: 1.25rem; --section-gap: 3rem; --type-title: 1.5rem; --type-title-accent: 1.625rem; --line-title: 2rem; --nav-h: 3.5rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--background); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
code { font-family: var(--font-mono); font-size: 0.875rem; }
::selection { background: rgba(200, 169, 126, 0.3); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 0.375rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; z-index: 90; left: var(--page-inset); top: -6rem;
  padding: 0.625rem 1.25rem; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 500;
}
.skip-link:focus { top: 0.75rem; }

.mono { font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.25rem; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* Placeholders the owner fills via tools/build.py (see SETUP.md) */
.ph {
  font-family: var(--font-mono); font-size: 0.9em; padding: 0 0.3em; border-radius: 0.25rem;
  border: 1px dashed var(--accent); background: rgba(200, 169, 126, 0.12); color: inherit; white-space: nowrap;
}

/* ---------- Page shell ---------- */
.page { position: relative; overflow-x: clip; }
main { position: relative; margin: 0 auto; width: var(--page-width); overflow-y: clip; }
/* Below-the-fold blocks skip rendering until they are near the viewport */
.cv { content-visibility: auto; contain-intrinsic-size: auto 60rem; }
.gap { height: var(--section-gap); }
.nav-slot { height: var(--nav-h); }
[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem; width: max-content;
  padding: 0.3125rem 0.8125rem 0.3125rem 0.6875rem; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--surface-badge); box-shadow: var(--shadow-float);
  color: var(--muted); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; letter-spacing: 0.025rem;
}
.badge__dot { position: relative; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--sand-300); }
.badge__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--sand-300);
  opacity: var(--halo-o, 0); transform: scale(var(--halo-s, 1));
}
@media (max-width: 1200px) { .badge { padding: 0.4375rem 0.9375rem 0.4375rem 0.6875rem; } }

/* ---------- Display titles ---------- */
.display {
  font-weight: 600; font-size: var(--type-title); line-height: var(--line-title); letter-spacing: -0.125rem;
  background: linear-gradient(to bottom, var(--title-from), var(--title-to));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.display em, .serif {
  font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: var(--type-title-accent);
  line-height: 1; letter-spacing: 0; color: var(--title-accent); -webkit-text-fill-color: var(--title-accent);
  padding-right: 0.06em;
}

/* ---------- Pill buttons ---------- */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 3rem; padding: 0 1.5rem; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 1rem; line-height: 1.5rem; font-weight: 500; white-space: nowrap;
  transform: scale(var(--press, 1));
}
.pill--md { height: 2.5rem; font-size: 0.875rem; line-height: 1.25rem; }

.cta {
  isolation: isolate; overflow: hidden; color: var(--on-accent); background: transparent; box-shadow: 0 0.5rem 0.6875rem rgba(0, 0, 0, 0.5);
}
.cta.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.cta__fill { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--accent); opacity: calc(1 - var(--p, 0) * var(--p, 0)); }
.cta__label { display: inline-flex; align-items: center; gap: 0.5rem; }
.cta__ink {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.4em;
  border-radius: inherit; background: var(--ink); color: var(--accent);
  clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0 round 999px);
}
.cta__ink-label { transform: translateX(calc(var(--p, 0) * -0.3125rem)); display: inline-flex; align-items: center; gap: 0.5rem; }
.cta__arrow { width: 0.8em; height: 0.8em; transform: translateX(calc((-8 + 8 * var(--p, 0)) * 0.0625rem)); opacity: var(--p, 0); }
.ring {
  position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from 0deg, var(--ring-color, var(--accent)) var(--fill, 0%), transparent var(--fill, 0%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.glass-btn {
  color: var(--foreground); border: 1px solid var(--border-glass);
  background: linear-gradient(to bottom, var(--glass-from), var(--glass-to)), rgba(10, 11, 12, 0.6); box-shadow: var(--shadow-float);
}
.glass-btn .ring { inset: -1px; --ring-color: rgba(255, 255, 255, 0.7); }
.glass-btn svg { width: 1rem; height: 1rem; }

/* ---------- Section head ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.section-head__main { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; width: 47.5rem; }
.section-head__aside { width: 27.5rem; color: var(--muted); }
@media (max-width: 1200px) {
  .section-head { flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
  .section-head__main { align-items: center; width: 100%; gap: 1.5rem; }
  .section-head__aside { width: 35rem; }
}
@media (max-width: 580px) {
  .section-head { gap: 0.75rem; }
  .section-head__main { gap: 0.75rem; }
  .section-head__aside { width: 100%; }
}

/* ---------- Glass card ---------- */
.card {
  position: relative; overflow: clip; border-radius: 1.625rem; border: 1px solid var(--card-border); background: var(--card-glass);
}
.hairline { height: 1px; background: var(--hairline); transform-origin: left; }

/* ---------- Reveal starting states (only when the motion engine will play them) ---------- */
html.js [data-reveal="rise"] { opacity: 0; translate: 0 1.5rem; }
html.js [data-reveal="fade"] { opacity: 0; }
html.js [data-reveal="focus"], html.js [data-reveal="focus8"] { opacity: 0; }
html.js [data-reveal="draw"] { scale: 0 1; }
html.js [data-reveal="type"] { --typed: 0; }
[data-reveal="type"], .typed {
  clip-path: inset(0 calc(100% - round(down, calc(var(--typed, 999) * 1ch + 0.5px), 1ch) - 0.1ch) 0 0);
}

/* ---------- Cursor ring ---------- */
.cursor {
  position: fixed; z-index: 50; left: 0; top: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  border: 1px solid var(--accent); pointer-events: none; opacity: 0;
  transform: translate3d(var(--cx, -200px), var(--cy, -200px), 0) translate(-50%, -50%) scale(var(--cs, 1));
}
.cursor::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: var(--cf, 0); }
html[data-cursor="on"] .cursor { opacity: 1; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; -webkit-mask-image: none !important; mask-image: none !important; }
  [data-reveal="type"] { clip-path: none !important; }
  .cursor { display: none; }
}
