/* ─── Tokens ───────────────────────────────────────────── */
:root {
  --bg: #0B0C0F;
  --bg-elev: #0E1015;
  --fg: #EDE8DD;
  --muted: #8A867D;
  --accent: #D9974D;
  --accent-soft: #D9974D33;
  --accent-faint: #D9974D14;
  --rule: #1A1B20;

  --serif: 'Newsreader', Georgia, serif;
  --sans:  'Geist', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --body:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --max-prose: 680px;
  --max-wide: 960px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-rush: cubic-bezier(0.7, 0, 0.2, 1);
}

/* ─── Fonts ────────────────────────────────────────────── */
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/Newsreader-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/Inter-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/JetBrainsMono-Variable.woff2') format('woff2-variations');
  font-weight: 400 600;
  font-display: swap;
}

/* ─── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; }

/* ─── Base ─────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--bg); }

/* ─── Layout ───────────────────────────────────────────── */
.container { max-width: var(--max-prose); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: var(--max-wide); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 7rem 0; }
@media (max-width: 768px) { section { padding: 4rem 0; } }

/* ─── Type ─────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}
h1 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 2.875rem); }
h3 { font-size: 1.5rem; }
p  { margin: 0 0 1.25rem; max-width: var(--max-prose); }
.lede { font-size: 1.25rem; line-height: 1.55; color: var(--fg); }
.muted { color: var(--muted); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
  font-weight: 500;
}

.metric {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: 0.75rem;
  font-weight: 500;
}

a.inline {
  color: var(--fg);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 250ms var(--ease);
  padding-bottom: 2px;
}
a.inline:hover { background-size: 100% 1px; }

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 78vh;
  min-height: 600px;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 0 1.5rem 5rem;
  isolation: isolate;
}
@media (max-width: 768px) { .hero { height: 70vh; min-height: 480px; padding-bottom: 3rem; } }

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 24% 34%, rgba(217,151,77,0.06) 0%, transparent 58%),
    linear-gradient(180deg, rgba(11,12,15,0.12) 0%, rgba(11,12,15,0.24) 52%, rgba(11,12,15,0.72) 100%),
    url('assets/hero-systems.webp') center center / cover no-repeat;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 90% at 50% 60%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 60%, black 30%, transparent 80%);
  z-index: 1;
}
.hero-scan {
  position: absolute; left: -40%; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent 0%, var(--accent-soft) 50%, transparent 100%);
  z-index: 2;
  animation: scan 1.6s var(--ease) 0.5s 1 both;
  pointer-events: none;
  mix-blend-mode: screen;
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: var(--max-wide);
  margin: 0 auto;
  width: 100%;
}
.hero h1 { max-width: 18ch; }
.hero .lede { max-width: 56ch; }

@keyframes scan {
  from { left: -40%; }
  to   { left: 110%; }
}

/* ─── Buttons ──────────────────────────────────────────── */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  border: 0;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 200ms var(--ease), box-shadow 300ms var(--ease);
  margin-top: 1rem;
}
.cta::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(closest-side at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.25), transparent 70%);
  opacity: 0;
  transition: opacity 200ms var(--ease);
  z-index: -1;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 12px 36px var(--accent-soft); }
.cta:hover::before { opacity: 1; }

/* ─── Pillars ──────────────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
@media (max-width: 768px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  padding: 2rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  transition: border-color 300ms var(--ease), transform 300ms var(--ease);
}
.pillar:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.pillar h3 { margin-top: 0.75rem; font-size: 1.25rem; }
.pillar p { font-size: 1rem; color: var(--muted); margin-bottom: 0; line-height: 1.55; }

/* ─── Stories ──────────────────────────────────────────── */
.stories { display: flex; flex-direction: column; gap: 7rem; margin-top: 3rem; }
@media (max-width: 768px) { .stories { gap: 4rem; } }

.story h3 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 500;
  margin-bottom: 1.25rem;
  max-width: 30ch;
}
.story p { color: var(--fg); }
.story-diagram {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0 1.25rem;
  position: relative;
  overflow: hidden;
}
.story-diagram svg {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
}
.story-diagram::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(217,151,77,0.04), transparent 60%);
  pointer-events: none;
}

.impact-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 5rem;
  font-style: italic;
}

/* ─── Reveal ───────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
.stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ─── Section eyebrow row ─────────────────────────────── */
.section-head { margin-bottom: 1rem; }
.section-head h2 { margin-bottom: 0.75rem; }
.section-head p.lede { color: var(--muted); margin-bottom: 0; }

/* ─── About + Contact ──────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  margin-top: 1rem;
}
.about-portrait {
  margin: 0;
  position: relative;
  max-width: 300px;
}
.about-portrait::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(217,151,77,0.18);
  border-radius: 10px;
  pointer-events: none;
}
.about-portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #0E1014;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  filter: saturate(0.85);
}
.about-copy { max-width: 56ch; }
.about-copy p { max-width: none; }
.about-copy > :last-child { margin-bottom: 0; }
.about-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: 0 0 0.25rem; }
.about-role { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 1.5rem; text-transform: uppercase; }

.contact a { color: var(--accent); text-decoration: none; font-weight: 500; }
.contact a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .about-portrait {
    max-width: 320px;
  }
}

/* ─── Footer ───────────────────────────────────────────── */
footer {
  padding: 3rem 0 4rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ─── Skip link ────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 1rem; top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border-radius: 3px;
  z-index: 100;
  transform: translateY(-200%);
  transition: transform 200ms var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--fg); outline-offset: 2px; }

/* ─── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero-scan { display: none; }
  /* Snap diagram animations to final state */
  .story-diagram svg .anim { animation: none !important; }
  .story-diagram svg .anim-final { opacity: 1 !important; transform: none !important; }
}
