/* ============================================================
   STOREYS — Investor One-Pager
   Design system: warm institutional. Deep forest green (trust,
   growth) + warm ivory surfaces + antique gold accent (legacy,
   care). Serif display (Boska) for authority + warmth, clean
   sans body (General Sans) for scan-ability.
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f6f3ea;
  --color-surface: #fdfbf5;
  --color-surface-offset: #eee8d9;
  --color-surface-offset-2: #e6ddc7;
  --color-divider: #ddd3b8;
  --color-border: #cfc3a0;

  /* Text */
  --color-text: #1c231d;
  --color-text-muted: #565f52;
  --color-text-faint: #8b9382;
  --color-text-inverse: #f6f3ea;

  /* Primary — deep forest green */
  --color-primary: #1f4b3f;
  --color-primary-hover: #163a31;
  --color-primary-active: #0f2b24;
  --color-primary-highlight: #d8e3da;

  /* Accent — antique gold */
  --color-accent: #a9782f;
  --color-accent-hover: #8c6226;
  --color-accent-highlight: #ecdfc2;
  /* Brighter gold for text placed on dark green (hero) — #a9782f fails contrast there */
  --color-accent-on-dark: #e0b869;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 140 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 140 / 0.1);
  --shadow-lg: 0 20px 48px oklch(0.2 0.02 140 / 0.16);

  --content-narrow: 640px;
  --content-default: 860px;
  --content-wide: 1180px;

  --font-display: 'Boska', 'Iowan Old Style', Georgia, serif;
  --font-body: 'General Sans', 'Inter', system-ui, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #12160f;
  --color-surface: #171c14;
  --color-surface-offset: #1c2118;
  --color-surface-offset-2: #232a1d;
  --color-divider: #2b3323;
  --color-border: #384231;

  --color-text: #e9e6da;
  --color-text-muted: #a2a795;
  --color-text-faint: #6c7362;
  --color-text-inverse: #171c14;

  --color-primary: #6fae93;
  --color-primary-hover: #8ec3a9;
  --color-primary-active: #a6d3bb;
  --color-primary-highlight: #24352c;

  --color-accent: #d3a75a;
  --color-accent-hover: #e0ba76;
  --color-accent-highlight: #3a2f1c;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.45);
}

/* ---------- Type Scale ---------- */
:root {
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-interactive), color var(--transition-interactive);
}

img, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'] { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; font-family: var(--font-display); }
p, li { text-wrap: pretty; }

a, button { transition: color var(--transition-interactive), background var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive), transform var(--transition-interactive); }

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ---------- Layout Helpers ---------- */
.wrap { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: clamp(var(--space-5), 4vw, var(--space-12)); }
.wrap--narrow { max-width: var(--content-default); }

section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s cubic-bezier(0.16,1,0.3,1);
}
.site-header--hidden { transform: translateY(-100%); }
.site-header--scrolled { box-shadow: var(--shadow-sm); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding-block: var(--space-4); }

.logo { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); flex-shrink: 0; }
.logo svg { width: 30px; height: 30px; color: var(--color-primary); }
.logo-word { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; letter-spacing: 0.01em; }
.logo-sub { display: none; }

.main-nav { display: none; }
.main-nav ul { display: flex; gap: var(--space-6); align-items: center; }
.main-nav a {
  font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: none;
  font-weight: 500; letter-spacing: 0.02em;
}
.main-nav a:hover { color: var(--color-primary); }

@media (min-width: 860px) {
  .main-nav { display: block; }
  .logo-sub { display: block; font-size: var(--text-xs); color: var(--color-text-faint); font-family: var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; margin-top: -2px; }
}

.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  background: var(--color-surface);
}
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
}
.btn--primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn--primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn--accent { background: var(--color-accent); color: #fff; }
.btn--accent:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cta-block {
  display: flex; justify-content: center;
  width: 100%; margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(var(--space-20), 12vw, var(--space-32)) clamp(var(--space-16), 8vw, var(--space-24));
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-active) 62%, #0b1f19 100%);
  color: var(--color-text-inverse);
  isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image: radial-gradient(circle at 82% 12%, color-mix(in oklab, var(--color-accent) 55%, transparent) 0%, transparent 42%),
    radial-gradient(circle at 8% 92%, color-mix(in oklab, #ffffff 12%, transparent) 0%, transparent 38%);
}
.hero-grid { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.3fr 0.9fr; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: color-mix(in oklab, var(--color-text-inverse) 78%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-text-inverse) 30%, transparent);
  border-radius: var(--radius-full); padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-6);
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); }

.hero h1 {
  font-size: clamp(2.5rem, 2rem + 3.2vw, 4.5rem);
  font-weight: 500; letter-spacing: -0.01em; margin-bottom: var(--space-6);
}
.hero h1 em { font-style: italic; color: var(--color-accent-on-dark); }

.hero p.lede {
  font-size: var(--text-lg); color: color-mix(in oklab, var(--color-text-inverse) 84%, transparent);
  max-width: 46ch; margin-bottom: var(--space-8);
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-10); }
.hero .btn--ghost { border-color: color-mix(in oklab, var(--color-text-inverse) 35%, transparent); color: var(--color-text-inverse); }
.hero .btn--ghost:hover { border-color: var(--color-accent-on-dark); color: var(--color-accent-on-dark); }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); max-width: 34rem; }
.hero-stat b { display: block; font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-accent-on-dark); font-weight: 500; }
.hero-stat span { font-size: var(--text-xs); color: color-mix(in oklab, var(--color-text-inverse) 70%, transparent); letter-spacing: 0.03em; }

.hero-card {
  background: color-mix(in oklab, var(--color-surface) 96%, transparent);
  color: var(--color-text); border-radius: var(--radius-lg); padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}
.hero-card .card-label { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-faint); margin-bottom: var(--space-3); }
.hero-card h3 { font-size: var(--text-lg); font-weight: 500; margin-bottom: var(--space-5); }
.hero-card ul { display: flex; flex-direction: column; gap: var(--space-3); }
.hero-card li { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--text-sm); padding-block: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.hero-card li:last-child { border-bottom: none; }
.hero-card li b { color: var(--color-primary); font-weight: 600; }

/* ---------- Panels ---------- */
.panel { border-bottom: 1px solid var(--color-divider); }
.panel--offset { background: var(--color-surface-offset); }

.panel-head {
  display: grid; gap: var(--space-4); margin-bottom: var(--space-10);
  grid-template-columns: 1fr; align-items: end;
}
@media (min-width: 720px) { .panel-head { grid-template-columns: auto 1fr; gap: var(--space-8); } }

.panel-num { font-family: var(--font-display); font-size: var(--text-3xl); color: var(--color-primary-highlight); line-height: 1; font-weight: 500; -webkit-text-stroke: 1px var(--color-primary); color: transparent; }
[data-theme='dark'] .panel-num { -webkit-text-stroke: 1px var(--color-primary); }

.panel-title-group h2 { font-size: var(--text-2xl); font-weight: 500; color: var(--color-text); }
.panel-title-group .kicker { display: block; font-family: var(--font-body); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent); font-weight: 600; margin-bottom: var(--space-2); }
.panel-title-group p.dek { margin-top: var(--space-3); color: var(--color-text-muted); font-size: var(--text-base); max-width: 62ch; }

.panel-body { display: grid; gap: var(--space-10); }
@media (min-width: 860px) { .panel-body.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .panel-body.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.bullet-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6) var(--space-7);
}
.panel--offset .bullet-card { background: var(--color-bg); }

.bullet-card h4 { font-size: var(--text-base); font-weight: 600; font-family: var(--font-body); color: var(--color-primary); margin-bottom: var(--space-4); display: flex; align-items: center; gap: var(--space-2); }
[data-theme='dark'] .bullet-card h4 { color: var(--color-primary-hover); }
.bullet-card h4 svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-accent); }

.bullet-list { display: flex; flex-direction: column; gap: var(--space-3); }
.bullet-list li { position: relative; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--color-text); }
.bullet-list li::before {
  content: ''; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--color-accent);
}
.bullet-list li b { color: var(--color-primary); font-weight: 600; }
[data-theme='dark'] .bullet-list li b { color: var(--color-primary-hover); }
.bullet-list.tight { gap: var(--space-2); }

/* Flat bullet grid (no cards) used in WHY panel */
.plain-bullets { display: grid; gap: var(--space-6); }
@media (min-width: 780px) { .plain-bullets.cols-2 { grid-template-columns: repeat(2, 1fr); } }
.plain-bullets li { display: flex; gap: var(--space-4); font-size: var(--text-base); }
.plain-bullets li .num { font-family: var(--font-display); color: var(--color-accent); font-size: var(--text-lg); font-weight: 500; flex-shrink: 0; width: 2ch; }

/* Pipeline deal cards */
.deal-grid { display: grid; gap: var(--space-6); }
@media (min-width: 780px) { .deal-grid { grid-template-columns: repeat(2, 1fr); } }
.deal-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-7); position: relative; overflow: hidden;
}
.deal-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--color-accent); }
.deal-card .deal-tag { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); font-weight: 600; margin-bottom: var(--space-2); }
.deal-card h4 { font-size: var(--text-lg); font-weight: 500; margin-bottom: var(--space-5); }
.deal-figures { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-5); }
.deal-figures div { border-top: 1px solid var(--color-divider); padding-top: var(--space-2); }
.deal-figures b { display: block; font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-primary); }
[data-theme='dark'] .deal-figures b { color: var(--color-primary-hover); }
.deal-figures span { font-size: var(--text-xs); color: var(--color-text-muted); }

.pipeline-total {
  margin-top: var(--space-8); padding: var(--space-6) var(--space-7); border-radius: var(--radius-lg);
  background: var(--color-primary); color: var(--color-text-inverse);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.pipeline-total b { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-accent); }
.pipeline-total span { font-size: var(--text-sm); color: color-mix(in oklab, var(--color-text-inverse) 82%, transparent); }

/* Ask panel */
.ask-grid { display: grid; gap: var(--space-6); }
@media (min-width: 860px) { .ask-grid { grid-template-columns: 1.1fr 0.9fr; } }
.ask-figure {
  background: var(--color-primary); color: var(--color-text-inverse); border-radius: var(--radius-lg);
  padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-6);
}
.ask-figure .big { font-family: var(--font-display); font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3.5rem); color: var(--color-accent); font-weight: 500; line-height: 1; }
.ask-figure .big + span { font-size: var(--text-sm); color: color-mix(in oklab, var(--color-text-inverse) 82%, transparent); }
.ask-figure hr { border: none; border-top: 1px solid color-mix(in oklab, var(--color-text-inverse) 22%, transparent); }
.ask-figure .row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.ask-figure .row b { font-family: var(--font-display); color: var(--color-accent); }

.contact-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-5);
}
.contact-card h4 { font-size: var(--text-lg); font-weight: 500; }
.contact-line { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.contact-line svg { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; }
.contact-line a { color: var(--color-text); text-decoration: none; border-bottom: 1px solid var(--color-border); }
.contact-line a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.contact-note { font-size: var(--text-xs); color: var(--color-text-muted); border-top: 1px solid var(--color-divider); padding-top: var(--space-4); }

/* Social responsibility callout (inside WHY panel) */
.callout {
  margin-top: var(--space-10); border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--color-primary-highlight), var(--color-surface-offset-2));
  border: 1px solid var(--color-border); padding: var(--space-8);
  display: grid; gap: var(--space-6);
}
@media (min-width: 780px) { .callout { grid-template-columns: 1fr 1.4fr; align-items: center; } }
.callout .callout-mark { width: 48px; height: 48px; color: var(--color-primary); }
[data-theme='dark'] .callout .callout-mark { color: var(--color-primary-hover); }
.callout h3 { font-size: var(--text-lg); font-weight: 500; margin-bottom: var(--space-2); }
.callout p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------- Disclosures ---------- */
.disclosures {
  background: var(--color-surface-offset-2); padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.disclosures h3 { font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-5); font-family: var(--font-body); font-weight: 600; }
.disclosures .disclosure-text { font-size: var(--text-xs); line-height: 1.7; color: var(--color-text-muted); max-width: 82ch; }
.disclosures .disclosure-text p { margin-bottom: var(--space-4); }
.disclosures .disclosure-text p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--space-10); background: var(--color-primary-active); color: var(--color-text-inverse); }
[data-theme='dark'] .site-footer { background: #0b0f09; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4); font-size: var(--text-xs); color: color-mix(in oklab, var(--color-text-inverse) 72%, transparent); }
.footer-inner a { color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--color-text-inverse) 30%, transparent); }
.footer-inner a:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
