/* =========================================================================
   CLAY · site styles
   Warm paper and sage washes, deep forest green, gold-orange + green as the
   core pair. The gold accents are hue-shifted from the original violets with
   the same OKLCH chroma and the same WCAG luminance, so contrast is unchanged.
   ========================================================================= */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter Variable";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #faf6ee;
  --sage: #bfdcc8;
  --mint: #e4f1e8;
  --forest: #1f3a2e;
  --forest-2: #16291f;
  --gold: #9c5b08;
  --gold-deep: #6c3700;
  --gold-light: #d79b4b;
  --leaf: #5e9f74;
  --ink: #1a1a1a;
  --muted: #575757;
  --line: rgba(26, 26, 26, 0.12);
  --line-strong: rgba(26, 26, 26, 0.22);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.26;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .12  0 0 0 0 .09  0 0 0 0 .06  0 0 0 .5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

img,
svg,
canvas { display: block; max-width: 100%; }

a { color: inherit; }
h1, h2 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
em { font-style: italic; }

::selection { background: var(--gold-light); color: var(--ink); }

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

.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: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--forest);
  color: var(--paper);
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.shell {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4.2vw, 56px);
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-glyph { width: 32px; height: 32px; color: var(--ink); }
.brand-word {
  font-family: var(--serif);
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0.08em;
}
.header-gh {
  color: var(--forest);
  transition: color 0.2s;
}
.header-gh:hover { color: var(--gold); }
.header-gh svg { display: block; }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 24px) 0 clamp(32px, 5vh, 64px);
  background:
    radial-gradient(58% 52% at 50% 38%, rgba(191, 220, 200, 0.55), rgba(191, 220, 200, 0) 72%),
    radial-gradient(34% 34% at 86% 84%, rgba(215, 155, 75, 0.16), rgba(215, 155, 75, 0) 70%),
    var(--paper);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 clamp(8px, 1.5vh, 20px);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
}
.eyebrow-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 13px 0 0 var(--leaf);
  margin-right: 13px;
}

/* the 3D stage: square-ish, sized off the viewport so it never pushes the
   buttons below the fold */
.viewer {
  position: relative;
  width: min(100%, 46svh, 540px);
  aspect-ratio: 1;
  margin: 0 auto;
}
.viewer canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}
.viewer-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.viewer.has-scene .viewer-fallback { display: none; }
.viewer-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.is-grabbable { cursor: grab; }
.is-grabbable:active { cursor: grabbing; }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 4.8vw, 3.9rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-top: clamp(6px, 1.6vh, 18px);
  background: var(--gold);
  color: #000;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 0.15em 0.35em;
}
.hero-title em { color: inherit; }

.hero-lede {
  max-width: 44rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: clamp(20px, 3vh, 34px);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 560;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
}
.pill--solid {
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 12px 26px -16px rgba(31, 58, 46, 0.75);
}
.pill--solid:hover { background: #28503f; transform: translateY(-2px); }
.pill--solid:active { transform: translateY(0) scale(0.985); }
.pill--muted {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line-strong);
  color: var(--muted);
  cursor: default;
}
.pill .icon { width: 15px; height: 15px; flex: none; }
.pill-meta {
  padding-left: 0.6rem;
  border-left: 1px solid rgba(26, 26, 26, 0.2);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.pill--solid .pill-meta { color: #cfe3d6; border-left-color: rgba(250, 246, 238, 0.32); }

.credit {
  max-width: 46rem;
  margin: clamp(18px, 3vh, 30px) 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}
.credit a { color: var(--gold-deep); }

/* ------------------------------------------------------------------ band */

.band {
  background: var(--forest);
  color: var(--paper);
  padding: clamp(44px, 6vw, 72px) 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(250, 246, 238, 0.14);
}
.stat {
  padding: 1.5rem 1.4rem 1.7rem;
  background: var(--forest);
}
.stat dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.85rem;
}
.stat dd { margin: 0; }
.stat-big {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  margin-bottom: 0.55rem;
}
.stat-note { display: block; font-size: 0.88rem; color: #c9dccf; }
.band-fine { margin: 1.3rem 0 0; font-size: 0.8rem; color: #a9c4b2; max-width: 68rem; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  background: var(--forest-2);
  color: #c9dccf;
  padding: 1.6rem 0 1.8rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.6rem;
  font-size: 0.85rem;
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 5px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .header-gh svg { width: 20px; height: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .hero { min-height: 0; padding-top: calc(var(--header-h) + 16px); }
  .viewer { width: min(100%, 48svh, 420px); }
  .actions { width: 100%; flex-direction: column; align-items: stretch; }
  .pill { width: 100%; }
  .stats { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
