/* ============================================================
   ROAN — design system
   Monochrome, editorial, premium. Archivo + Instrument Serif.
   Themeable via [data-theme] on <html>.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,300..900;1,300..900&family=Instrument+Serif:ital@0;1&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Theme tokens ---------- */
:root {
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html[data-theme="dark"] {
  --bg: #0B0B0C;
  --bg-2: #141416;
  --bg-3: #1C1C1F;
  --inv-bg: #F6F5F2;       /* inverted (paper) sections */
  --inv-ink: #0B0B0C;
  --ink: #F4F3EF;
  --ink-soft: rgba(244, 243, 239, 0.60);
  --ink-faint: rgba(244, 243, 239, 0.38);
  --ink-ghost: rgba(244, 243, 239, 0.13);
  --line: rgba(244, 243, 239, 0.13);
  --line-strong: rgba(244, 243, 239, 0.26);
  --grain-opacity: 0.05;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #F4F3EF;
  --bg-2: #FBFBF9;
  --bg-3: #FFFFFF;
  --inv-bg: #0B0B0C;
  --inv-ink: #F4F3EF;
  --ink: #0B0B0C;
  --ink-soft: rgba(11, 11, 12, 0.60);
  --ink-faint: rgba(11, 11, 12, 0.40);
  --ink-ghost: rgba(11, 11, 12, 0.10);
  --line: rgba(11, 11, 12, 0.12);
  --line-strong: rgba(11, 11, 12, 0.24);
  --grain-opacity: 0.035;
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  overflow-x: clip;
}

/* ---------- Film grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 160px); position: relative; }
.section--tight { padding-block: clamp(48px, 7vw, 96px); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------- Type ---------- */
.display {
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-size: clamp(48px, 11vw, 168px);
}
.h1 { font-weight: 800; line-height: 0.96; letter-spacing: -0.03em; font-size: clamp(38px, 6.5vw, 92px); }
.h2 { font-weight: 700; line-height: 1.0; letter-spacing: -0.025em; font-size: clamp(30px, 4.5vw, 60px); }
.h3 { font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; font-size: clamp(22px, 2.6vw, 34px); }
.lede { font-size: clamp(18px, 2vw, 23px); line-height: 1.5; color: var(--ink-soft); font-weight: 400; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.mono-tag { font-family: var(--font-display); font-weight: 500; font-size: 12px; letter-spacing: 0.04em; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 16px 26px;
  border-radius: var(--r-pill);
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
  will-change: transform;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-lg { padding: 20px 34px; font-size: 17px; }
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }

/* ---------- Header / nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding-block: 13px;
}
.nav-logo {
  display: flex; align-items: center; gap: 11px;
  font-weight: 800; letter-spacing: -0.04em; font-size: 21px;
}
.nav-logo .mark {
  width: 30px; height: 30px;
  background: url(../assets/roan-black.svg) center / contain no-repeat;
  display: block;
}
html[data-theme="dark"] .nav-logo .mark { background-image: url(../assets/roan-white.svg); }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--ink-soft); transition: color 0.25s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ---------- Reveal animation ----------
   Animates transform ONLY (never opacity from 0): embedded/unfocused frames
   can freeze a CSS animation at time-0, so the time-0 state must already be
   visible. Content is always opacity:1; when the frame is live it slides up. */
.reveal { animation: revealIn 0.8s var(--ease) both; }
.reveal[data-d="1"] { animation-delay: 0.10s; }
.reveal[data-d="2"] { animation-delay: 0.20s; }
.reveal[data-d="3"] { animation-delay: 0.30s; }
.reveal[data-d="4"] { animation-delay: 0.40s; }
@keyframes revealIn { from { transform: translateY(24px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; transform: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Marquee / ticker ---------- */
.ticker { overflow: hidden; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.ticker-track { display: flex; width: max-content; animation: scrollx var(--dur, 38s) linear infinite; }
.ticker-track.rev { animation-direction: reverse; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(-50%); } }

/* ---------- Hairline rule ---------- */
.rule { height: 1px; background: var(--line); border: 0; width: 100%; }

/* ---------- Utility ---------- */
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* hide content visually but keep layout for reveal pre-state on load */
.no-anim, .no-anim * { animation: none !important; transition: none !important; }
