/* =========================================================================
   ROVN  ·  Design System  ·  base.css
   Warm editorial authority. Paper canvas, warm ink, teal as verification.
   ========================================================================= */

:root {
  /* ---- Warm-neutral near-white (cream-clean, NO blue cast, NO brown); teal is the only accent ---- */
  --paper-0: #FFFFFF;        /* lightest, raised cards            */
  --paper:   #FBFAF7;        /* canvas, near-white, faint warmth  */
  --paper-2: #F4F2EC;        /* sunk panels, warm-neutral light   */
  --paper-3: #E9E6DE;        /* deeper sunk / rails               */

  --ink:    #1B1814;         /* primary text, warm-neutral near-black (no blue) */
  --ink-2:  #3A352D;         /* secondary                         */
  --ink-3:  #5E574C;         /* muted, AA on near-white           */
  --ink-4:  #6E6759;         /* faint captions                    */

  --line:      rgba(28, 24, 18, 0.12);   /* hairline               */
  --line-soft: rgba(28, 24, 18, 0.07);
  --line-strong: rgba(28, 24, 18, 0.20);

  /* ---- Warm-neutral near-black archival (hero panel, ledgers) — NOT blue-black ---- */
  --night:    #16130E;       /* warm near-black                   */
  --night-1:  #201C16;       /* panel                             */
  --night-2:  #2A251D;       /* raised in panel                   */
  --night-line: rgba(244, 238, 225, 0.12);
  --night-line-soft: rgba(244, 238, 225, 0.06);
  --on-night:    #F1ECE2;    /* text on night                     */
  --on-night-2:  #C4BBA9;    /* secondary on night                */
  --on-night-3:  #8E8675;    /* muted on night                    */

  /* ---- Teal: verification & interaction only ---- */
  --teal:        #0E8A8A;
  --teal-deep:   #0A6A6A;
  --teal-ink:    #0B5C5C;    /* teal text on paper (AA)           */
  --teal-bright: #2BC6B2;    /* glow on night (green-teal, not cyan-blue) */
  --teal-wash:   rgba(14, 138, 138, 0.10);
  --teal-line:   rgba(14, 138, 138, 0.30);

  /* ---- Tier semantics (warm: tan-gray / amber / teal / ink — NO blue) ---- */
  --tier-attested:  #AEA389; /* tan-gray                          */
  --tier-processed: #C58A3C; /* amber                             */
  --tier-verified:  #0E8A8A; /* teal, the lock                    */
  --tier-approved:  #1B1814; /* ink, human decision               */

  /* ---- Type ---- */
  --serif: "Fraunces", "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* fluid type scale, per-step tracking baked into utility classes */
  --t-mega:  clamp(3.1rem, 1.6rem + 6.4vw, 6.6rem);
  --t-h1:    clamp(2.5rem, 1.5rem + 4.2vw, 4.6rem);
  --t-h2:    clamp(2.0rem, 1.4rem + 2.6vw, 3.2rem);
  --t-h3:    clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem);
  --t-h4:    clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  --t-lead:  clamp(1.18rem, 1.05rem + 0.6vw, 1.5rem);
  --t-body:  1.0625rem;      /* 17px */
  --t-sm:    0.9375rem;
  --t-xs:    0.8125rem;
  --t-mono:  0.78rem;

  /* ---- Radii ---- */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;
  --r-4: 22px;
  --r-pill: 999px;

  /* ---- Easing library ---- */
  --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo:  cubic-bezier(0.16, 1, 0.30, 1);
  --ease-soft:  cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  /* ---- Elevation: hairlines over heavy shadows ---- */
  --shadow-1: 0 1px 2px rgba(28,24,18,0.05), 0 1px 0 rgba(28,24,18,0.03);
  --shadow-2: 0 2px 4px rgba(28,24,18,0.06), 0 8px 24px -14px rgba(28,24,18,0.20);
  --shadow-lift: 0 28px 60px -26px rgba(28,24,18,0.34);
  --shadow-night: 0 30px 80px -30px rgba(0,0,0,0.7);

  /* ---- Layout ---- */
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 64px);
  --header-h: 68px;
}

/* ===================== cross-document view transitions ===================== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* ===================== reset ===================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
::selection { background: var(--teal); color: #fff; }

/* paper grain removed — clean flat surface */
body::before { display: none; }

/* ===================== layout ===================== */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1440px; }
.section { position: relative; z-index: 1; padding-block: clamp(72px, 9vw, 140px); }
.section-tight { padding-block: clamp(52px, 6vw, 88px); }
main { position: relative; z-index: 1; }

/* ===================== type ===================== */
.serif { font-family: var(--serif); font-weight: 400; }
.mono  { font-family: var(--mono); }

.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.99;
  letter-spacing: -0.022em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.display em { font-style: italic; }

.h1 { font-family: var(--serif); font-weight: 400; font-size: var(--t-h1); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-h2); line-height: 1.04; letter-spacing: -0.018em; text-wrap: balance; }
.h3 { font-family: var(--serif); font-weight: 400; font-size: var(--t-h3); line-height: 1.1;  letter-spacing: -0.014em; }
.h4 { font-family: var(--sans);  font-weight: 600; font-size: var(--t-h4); line-height: 1.2;  letter-spacing: -0.01em; }

.lead { font-size: var(--t-lead); line-height: 1.45; color: var(--ink-2); letter-spacing: -0.005em; text-wrap: pretty; }
.body { color: var(--ink-2); text-wrap: pretty; }
.muted { color: var(--ink-3); }

/* eyebrow / kicker */
.kicker {
  font-family: var(--mono);
  font-size: var(--t-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 0.6em;
}
.kicker::before {
  content: ""; width: 22px; height: 1px; background: var(--ink-3); opacity: 0.6;
}
.kicker.teal { color: var(--teal-ink); }
.kicker.teal::before { background: var(--teal); opacity: 1; }
.kicker.on-night { color: var(--on-night-3); }
.kicker.on-night::before { background: var(--on-night-3); }
.kicker.no-rule::before { display: none; }

/* ===================== buttons ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em; white-space: nowrap;
  font-family: var(--sans); font-weight: 600; font-size: var(--t-sm);
  letter-spacing: -0.005em;
  padding: 0.72em 1.15em; border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: transform .35s var(--ease-quint), background .25s, color .25s, border-color .25s, box-shadow .35s var(--ease-quint);
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn .arrow { transition: transform .4s var(--ease-quint); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary { background: var(--ink); color: var(--paper-0); }
.btn-primary:hover { background: #2A251D; box-shadow: var(--shadow-2); }

.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-deep); box-shadow: 0 10px 30px -12px rgba(14,138,138,0.6); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(28,24,18,0.03); }

.btn-on-night { background: var(--on-night); color: var(--night); }
.btn-on-night:hover { background: #fff; }
.btn-ghost-night { border-color: var(--night-line); color: var(--on-night); }
.btn-ghost-night:hover { border-color: var(--on-night); background: rgba(244,238,225,0.05); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-weight: 600; font-size: var(--t-sm); color: var(--teal-ink);
  border-bottom: 1px solid var(--teal-line); padding-bottom: 1px;
  transition: border-color .25s, gap .3s var(--ease-quint);
}
.link-arrow:hover { border-color: var(--teal); gap: 0.62em; }

/* ===================== chips / pills ===================== */
.tier-chip {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3em 0.6em 0.28em; border-radius: var(--r-1);
  border: 1px solid var(--line); color: var(--ink-2); background: var(--paper-0);
}
.tier-chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.tier-chip[data-tier="attested"]  .dot { background: var(--tier-attested); }
.tier-chip[data-tier="processed"] .dot { background: var(--tier-processed); }
.tier-chip[data-tier="verified"]  .dot { background: var(--tier-verified); }
.tier-chip[data-tier="approved"]  .dot { background: var(--tier-approved); }

/* ===================== header ===================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease-quint), border-color .4s, backdrop-filter .4s;
}
.site-header.scrolled {
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-color: var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; width: 100%; }

.wordmark {
  font-family: var(--serif); font-weight: 500; font-size: 1.42rem;
  letter-spacing: -0.02em; color: var(--ink); line-height: 1;
  display: inline-flex; align-items: baseline;
}
.wordmark .dot { color: var(--teal); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-2);
  padding: 0.5em 0.72em; border-radius: var(--r-2);
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: rgba(28,24,18,0.04); }
.nav .sep { width: 1px; height: 18px; background: var(--line); margin-inline: 6px; }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-toggle { display: none; }

@media (max-width: 940px) {
  .nav, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: var(--r-2); border: 1px solid var(--line); margin-left: auto; }
}

/* ===================== footer ===================== */
.site-footer { position: relative; z-index: 1; background: var(--night); color: var(--on-night-2); padding-block: clamp(56px, 7vw, 96px) 40px; }
.site-footer a { color: var(--on-night-2); transition: color .2s; }
.site-footer a:hover { color: var(--on-night); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px 32px; }
.footer-col h5 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-night-3); margin-bottom: 16px; font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col li a { font-size: var(--t-sm); }
.footer-brand .wordmark { color: var(--on-night); font-size: 1.7rem; }
.footer-note { font-size: var(--t-sm); line-height: 1.6; color: var(--on-night-3); max-width: 34ch; margin-top: 18px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--night-line); font-size: var(--t-xs); color: var(--on-night-3); }
.footer-bottom .compliance { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-bottom .spacer { margin-left: auto; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ===================== reveal (motion) ===================== */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease-expo), transform .9s var(--ease-expo); }
.js [data-reveal].in { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: .08s; }
[data-reveal-delay="2"] { transition-delay: .16s; }
[data-reveal-delay="3"] { transition-delay: .24s; }
[data-reveal-delay="4"] { transition-delay: .32s; }
[data-reveal-delay="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .link-arrow { transition: none !important; }
}

/* shared utilities */
.eyebrow-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rule { height: 1px; background: var(--line); border: 0; }
.hairline-box { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--paper-0); }
.divider-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); display: inline-block; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ===================== focus + persistent chrome ===================== */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.engine :focus-visible, .cta-band :focus-visible, .gate :focus-visible, .founder-band :focus-visible { outline-color: var(--teal-bright); }
.wordmark { view-transition-name: wordmark; }
