/* Grail — shared styles */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #14110d;          /* warm near-black */
  --bg-2: #1b1813;        /* raised surface */
  --bg-3: #221e18;        /* card surface */
  --ink: #f3ece0;         /* warm off-white */
  --ink-2: #c8bfae;       /* secondary */
  --ink-3: #8a826f;       /* tertiary */
  --rule: #2a251d;        /* hairlines */
  --rule-2: #3a332a;      /* stronger rule */
  --gold: #d4a547;        /* accent — drawn from logo */
  --gold-2: #e8c376;      /* hover / lighter */
  --gold-soft: rgba(212,165,71,0.14);
  --danger: #c66b52;      /* warm rust, for comparison */

  --f-display: 'Instrument Serif', 'Times New Roman', serif;
  --f-body: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  position: relative;
}

/* ---------- Global fixed video background ---------- */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  opacity: 0.55;
  filter: contrast(1.1) saturate(0.85) brightness(0.95);
  pointer-events: none;
  transition: opacity 1.5s ease-out;
}
.bg-video.faded-out {
  opacity: 0;
}
.bg-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(20,17,13,0.0), rgba(20,17,13,0.3) 70%),
    linear-gradient(180deg, rgba(20,17,13,0.05) 0%, rgba(20,17,13,0.25) 60%, rgba(20,17,13,0.55) 100%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9'/><feColorMatrix values='0 0 0 0 0.83  0 0 0 0 0.65  0 0 0 0 0.28  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.28;
  mix-blend-mode: overlay;
}

/* Everything after nav sits on a translucent dark panel so the video reads through */
.nav,
.page-main,
.final-cta,
.footer {
  position: relative;
  z-index: 5;
}
.page-main {
  background: rgba(20, 17, 13, 0.88);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  background: rgba(20,17,13,0.55);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.nav-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.nav-brand .wordmark {
  letter-spacing: 0.22em;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.nav-brand .wordmark .sub {
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-top: 3px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  color: var(--ink-2);
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 2px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  color: inherit;
}
.btn-primary {
  background: var(--gold);
  color: #1a1408;
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost {
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-link {
  color: var(--ink-2);
  padding: 12px 0;
  border: none;
}
.btn-link:hover { color: var(--gold); }
.btn-link::after {
  content: '→';
  margin-left: 6px;
  transition: transform 0.2s;
  display: inline-block;
}
.btn-link:hover::after { transform: translateX(3px); }

/* ---------- Typography utilities ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow-muted {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.display i, .display em { font-style: italic; color: var(--gold); }

h1.display { font-size: clamp(56px, 9.5vw, 148px); }
h2.display { font-size: clamp(44px, 6.5vw, 96px); }
h3.display { font-size: clamp(30px, 3.6vw, 52px); }

.kicker-mono {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* ---------- Section scaffolding ---------- */
section {
  padding: clamp(72px, 9vw, 140px) 0;
  border-top: 1px solid var(--rule);
}
section.tight { padding: clamp(48px, 6vw, 88px) 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: clamp(40px, 5vw, 72px);
}

.lede {
  font-size: clamp(19px, 1.4vw, 22px);
  color: var(--ink-2);
  max-width: 58ch;
  line-height: 1.55;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 56px 0 40px;
  background: rgba(20,17,13,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer h5 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--ink-2); font-size: 14px; }
.footer a:hover { color: var(--ink); }
.footer-legal {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}

/* ---------- Hairline grid marks ---------- */
.tick-row {
  display: flex;
  gap: 2px;
  height: 8px;
  align-items: end;
  margin: 24px 0;
}
.tick-row span {
  width: 1px;
  background: var(--rule-2);
  height: 4px;
}
.tick-row span.tall { height: 8px; background: var(--gold); }

/* ---------- Fade on scroll (subtle; never blocks content visibility) ---------- */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { gap: 18px; }
  .nav-links .hide-sm { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; gap: 10px; }
}

/* Selection */
::selection { background: var(--gold); color: #1a1408; }

/* Scrollbar (subtle) */
html { scrollbar-color: var(--rule-2) var(--bg); }
