/* ============================================================
   Quantum Frontier Fund — shared stylesheet
   Light & clean theme. Tokens in :root, mobile-first.
   ============================================================ */

:root {
  /* surfaces */
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --bg-dark-2: #111c33;
  --surface: #ffffff;

  /* text */
  --text: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --on-dark: #e8eefc;
  --on-dark-muted: #94a3b8;

  /* accents */
  --primary: #06b6d4;       /* cyan */
  --primary-600: #0891b2;
  --primary-700: #0e7490;
  --indigo: #6366f1;
  --indigo-600: #4f46e5;
  --border: #e2e8f0;
  --border-dark: #24324d;
  --ring: #0891b2;

  /* gradients */
  --grad: linear-gradient(120deg, #06b6d4, #6366f1);
  --grad-text: linear-gradient(120deg, #0e7490, #4f46e5); /* contrast-safe on white */
  --grad-soft: linear-gradient(160deg, #ecfeff 0%, #eef2ff 100%);

  /* effects */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px -8px rgba(15, 23, 42, .14);
  --shadow-lg: 0 28px 64px -24px rgba(15, 23, 42, .30);
  --glow: 0 0 0 1px rgba(6, 182, 212, .25), 0 12px 36px -12px rgba(6, 182, 212, .45);

  /* shape + rhythm */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(64px, 9vw, 112px);

  /* type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-700); text-decoration: none; }
a:hover { color: var(--primary-600); }

/* ---------- accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: 12px; top: -120px;
  z-index: 200;
  background: var(--bg-dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--bg-dark); color: var(--on-dark); }
section[id] { scroll-margin-top: 88px; }

.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- typography ---------- */
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
.display {
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.035em;
}
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); letter-spacing: -0.01em; }
p { color: var(--muted); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); }
.section--dark p, .section--dark .lead { color: var(--on-dark-muted); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary-700);
  display: inline-block;
  margin-bottom: 18px;
}
.section--dark .eyebrow { color: #22d3ee; }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section--dark .grad-text {
  background: linear-gradient(120deg, #22d3ee, #a5b4fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- inline icons ----------
   Symbols referenced via <use> don't inherit from the sprite's wrapper <g>,
   so set the stroke style on every icon-bearing svg here (one rule, :has). */
svg:has(use) {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--bg-dark);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: .98rem;
  line-height: 1;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--bg-dark); color: #fff; }
.btn-primary:hover { color: #fff; box-shadow: var(--glow); transform: translateY(-1px); }

.btn-accent { background: var(--grad); color: #fff; }
.btn-accent:hover { color: #fff; box-shadow: var(--glow); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); background: #fff; box-shadow: var(--shadow-sm); }

.section--dark .btn-ghost { color: var(--on-dark); border-color: var(--border-dark); }
.section--dark .btn-ghost:hover { border-color: var(--primary); background: rgba(255,255,255,.04); }

.btn-block { width: 100%; justify-content: center; }

.textlink {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.textlink svg { width: 16px; height: 16px; transition: transform .18s ease; }
.textlink:hover svg { transform: translateX(3px); }

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-size: 1.02rem;
}
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; }
.brand .brand-sub { color: var(--faint); font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  padding: 6px 0;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--grad);
  transition: width .2s ease;
}
.nav-links a:hover::after { width: 100%; }
/* the in-list CTA is for the mobile menu only; desktop uses .nav-cta */
.nav-links .btn-accent { display: none; }

.nav-cta { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px; height: 42px;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav[data-open="true"] .nav-links {
    display: flex;
    position: absolute;
    left: 0; right: 0; top: 68px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 14px var(--gutter) 22px;
  }
  .nav[data-open="true"] .nav-links a { padding: 12px 4px; font-size: 1.05rem; }
  .nav[data-open="true"] .nav-links a::after { display: none; }
  .nav[data-open="true"] .nav-links .btn-accent { display: inline-flex; justify-content: center; margin-top: 8px; color: #fff; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 85% 0%, rgba(99, 102, 241, .10), transparent 60%),
    radial-gradient(50% 50% at 0% 30%, rgba(6, 182, 212, .10), transparent 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 104px);
}
.hero-copy { max-width: 600px; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--faint);
  letter-spacing: .02em;
}

.hero-media { position: relative; }
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.hero-media .badge {
  position: absolute;
  left: -14px; bottom: 22px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  font-weight: 600;
}
.hero-media .badge .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(6,182,212,.18);
}

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: 16 / 10; }
  .hero-media .badge { left: 14px; }
}

/* ============================================================
   Stats band (dark)
   ============================================================ */
.stats {
  background: var(--bg-dark);
  color: var(--on-dark);
  position: relative;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-block: clamp(36px, 5vw, 52px);
}
.stat { padding: 8px 4px; }
.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #22d3ee;
  margin-bottom: 6px;
}
.stat-label {
  font-size: .82rem;
  color: var(--on-dark-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.stat + .stat { border-left: 1px solid var(--border-dark); padding-left: 24px; }

@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
  .stat + .stat { border-left: none; padding-left: 4px; }
  .stat:nth-child(odd) + .stat { border-left: 1px solid var(--border-dark); padding-left: 24px; }
}

/* ============================================================
   Cards / grids
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cbd5e1; }

.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-dark); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 26px; }

.icon-badge {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--primary-700);
  margin-bottom: 18px;
}
.icon-badge svg { width: 24px; height: 24px; }
.card-body h3 { margin-bottom: 10px; }
.card-body p { font-size: .98rem; }
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-700);
  background: #ecfeff;
  border: 1px solid #cffafe;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

/* thesis split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split ul { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 14px; }
.split li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.split li svg { width: 22px; height: 22px; flex: none; color: var(--primary); margin-top: 2px; }

/* stage & checks panel */
.panel {
  background: var(--grad-soft);
  border: 1px solid #e0e7ff;
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 44px);
}
.stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 720px) { .stage-grid { grid-template-columns: 1fr; } }
.stage-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 24px; }
.stage-item .k {
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 10px;
}
.stage-item .v {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 3vw, 1.7rem); font-weight: 700; color: var(--text);
  letter-spacing: -0.02em;
}
.stage-item .d { font-size: .92rem; margin-top: 8px; }

/* how we help */
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (max-width: 720px) { .help-grid { grid-template-columns: 1fr; } }
.help-item { display: flex; gap: 16px; align-items: flex-start; }
.help-item .icon-badge { margin-bottom: 0; flex: none; }
.help-item h3 { font-size: 1.1rem; margin-bottom: 6px; }
.help-item p { font-size: .96rem; }

/* news teaser */
.teaser {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.teaser-media { height: 100%; min-height: 260px; }
.teaser-media img { width: 100%; height: 100%; object-fit: cover; }
.teaser-body { padding: clamp(26px, 4vw, 44px); }
.teaser-body h3 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 12px 0 14px; }
@media (max-width: 820px) {
  .teaser { grid-template-columns: 1fr; }
  .teaser-media { order: -1; min-height: 220px; }
}

/* ============================================================
   Contact / form (dark closing section)
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.form-card {
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 40px);
  box-shadow: var(--shadow-lg);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 7px;
  color: var(--text);
}
.field .req { color: #dc2626; }
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, .18);
}
.field .help { font-size: .82rem; color: var(--faint); margin-top: 6px; }
.field .error { font-size: .82rem; color: #dc2626; margin-top: 6px; min-height: 1em; }
.field input:user-invalid { border-color: #dc2626; }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 4px; font-size: .92rem; font-weight: 600; }
.form-status[data-state="success"] { color: #059669; }
.form-status[data-state="error"] { color: #dc2626; }

.contact-points { list-style: none; padding: 0; margin-top: 24px; display: grid; gap: 14px; }
.contact-points li { display: flex; gap: 12px; align-items: center; color: var(--on-dark-muted); }
.contact-points svg { width: 20px; height: 20px; color: #22d3ee; flex: none; }
.contact-points a { color: var(--on-dark); font-weight: 600; }
.contact-points a:hover { color: #22d3ee; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #0b1424;
  color: var(--on-dark-muted);
  padding-block: clamp(44px, 6vw, 64px) 28px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-dark);
}
.footer-brand { max-width: 320px; }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { color: var(--on-dark-muted); font-size: .94rem; }
.footer-nav { display: flex; gap: clamp(36px, 6vw, 72px); flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-dark); margin-bottom: 14px; font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--on-dark-muted); font-size: .94rem; }
.footer-col a:hover { color: #22d3ee; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 22px; font-size: .84rem; color: var(--faint);
}

/* ============================================================
   Article (news.html)
   ============================================================ */
.article-hero { padding-block: clamp(40px, 6vw, 72px) 0; }
.article-hero .eyebrow { color: var(--primary-700); }
.article-head { max-width: 780px; margin-inline: auto; text-align: center; }
.article-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 14px 0 20px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center;
  font-family: var(--font-mono); font-size: .82rem; color: var(--faint);
}
.article-cover {
  max-width: 980px; margin: clamp(32px, 5vw, 56px) auto 0;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
}
.article-cover img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.article-cover figcaption { font-size: .8rem; color: var(--faint); padding: 10px 14px; background: var(--bg-alt); }

.prose { max-width: 720px; margin-inline: auto; padding-block: clamp(40px, 6vw, 64px); }
.prose > p { font-size: 1.12rem; line-height: 1.8; color: #334155; margin-bottom: 24px; }
.prose > p:first-of-type::first-letter {
  font-size: 3.1rem; font-weight: 700; line-height: .8;
  float: left; margin: 6px 12px 0 0; color: var(--primary-700);
}
.prose h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 14px 0 16px; }
.prose h2 + p { margin-top: 0; }
.prose ul { margin: 0 0 24px; padding-left: 0; list-style: none; display: grid; gap: 12px; }
.prose ul li { display: flex; gap: 12px; align-items: flex-start; color: #334155; font-size: 1.05rem; }
.prose ul li svg { width: 22px; height: 22px; color: var(--primary); flex: none; margin-top: 4px; }
.prose blockquote {
  margin: 8px 0 28px;
  padding: 22px 26px;
  background: var(--grad-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.18rem; font-style: italic; color: #1e293b;
}
.prose blockquote cite { display: block; margin-top: 10px; font-size: .9rem; font-style: normal; color: var(--faint); font-family: var(--font-mono); }
.pullout {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 8px 0 28px;
}
.pullout .pill {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em;
  background: #ecfeff; border: 1px solid #cffafe; color: var(--primary-700);
  padding: 8px 14px; border-radius: var(--radius-pill);
}
.article-foot {
  max-width: 720px; margin: 0 auto; padding-top: 8px;
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
}

/* ============================================================
   Reveal animation
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .06s; }
.reveal:nth-child(3) { transition-delay: .12s; }
.reveal:nth-child(4) { transition-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .card:hover, .btn:hover, .card:hover .card-media img { transform: none !important; }
}
