/* ==========================================================================
   Site design system — deep ink + gold, mathematical / generative
   Shared by every page of the homepage.
   ========================================================================== */

:root {
  /* Ink (backgrounds, surfaces) */
  --ink-0: #070a14;
  --ink-1: #0b1020;
  --ink-2: #111830;
  --ink-3: #18213d;

  /* Gold (accent) */
  --gold: #e3c27a;
  --gold-strong: #f3d791;
  --gold-mid: #c9a45c;
  --gold-dim: #8f7340;
  --gold-glow: rgba(227, 194, 122, 0.18);

  /* Text */
  --cream: #f4ecdb;
  --text: #e7e1d3;
  --muted: #a9a394;
  --faint: #6f6a5f;

  /* Lines */
  --line: rgba(227, 194, 122, 0.14);
  --line-strong: rgba(227, 194, 122, 0.32);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --radius-lg: 22px;
  --nav-h: 64px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 64px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle paper grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-strong); }
::selection { background: var(--gold); color: var(--ink-0); }

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--gold);
  color: var(--ink-0);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.12;
  margin: 0;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section-title {
  font-size: clamp(30px, 4.4vw, 48px);
  margin-top: 14px;
}
.section-title em { font-style: italic; color: var(--gold); }

.section-lede {
  color: var(--muted);
  max-width: 62ch;
  margin: 16px 0 0;
  font-size: 17px;
}

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

/* ---------- Site navigation ---------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 50;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: rgba(7, 10, 20, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 20px;
}
.brand:hover { color: var(--cream); }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-size: 17px;
  background: radial-gradient(circle at 30% 30%, rgba(227,194,122,.2), transparent 70%);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--cream); background: rgba(255,255,255,0.04); }
.nav-links a[aria-current="page"] {
  color: var(--gold);
  background: var(--gold-glow);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  margin: auto;
  position: relative;
  transition: transform 0.3s var(--ease);
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px 16px 20px;
    background: rgba(7, 10, 20, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s var(--ease);
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; font-size: 16px; border-radius: 10px; }
}

/* ---------- Buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  color: var(--cream);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
  font-family: inherit;
}
.btn:hover { color: var(--cream); border-color: var(--gold); background: var(--gold-glow); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-strong), var(--gold-mid));
  color: var(--ink-0);
  border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(227,194,122,0.6);
}
.btn-primary:hover { color: var(--ink-0); background: linear-gradient(135deg, #fbe3a6, var(--gold)); }
.btn svg { width: 16px; height: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.chip--gold { color: var(--gold); border-color: var(--line-strong); background: var(--gold-glow); }

/* ---------- Cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(24,33,61,0.55), rgba(11,16,32,0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 56px;
  margin-top: 40px;
  color: var(--faint);
  font-size: 14px;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--gold); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
