/* ===================================================================
   GRANT INVESTS — shared brand stylesheet ("Graphite Terminal")
   Single source of truth for the design system across all pages.
   Change the brand by editing the tokens in :root below.
   --------------------------------------------------------------------
   ACCENT color  -> --accent / --accent-2   (cyan / electric blue)
   BRAND name    -> the .brand markup in each page's nav
   CONTACT email -> footer mailto in each page
   SOCIAL links  -> footer + follow section in index.html
   --------------------------------------------------------------------
   FONTS are loaded via <link rel="preconnect"/stylesheet> in each page's
   <head> (faster than @import — no render-blocking round-trip here).
   =================================================================== */

:root {
  /* canvas */
  --bg:          #0a0c10;
  --bg-grid:     rgba(255,255,255,0.022);
  --surface:     #11151c;
  --surface-2:   #151b24;
  --surface-3:   #1a212c;
  --line:        rgba(255,255,255,0.085);
  --line-2:      rgba(255,255,255,0.14);

  /* ink */
  --ink:         #eef2f7;
  --ink-soft:    #9aa7b8;
  --ink-faint:   #647082;
  --ink-dim:     #7b8696;   /* ≥4.5:1 on --bg for small labels/counts */

  /* accent — cyan / electric blue */
  --accent:      #22d3ee;
  --accent-2:    #38bdf8;
  --accent-deep: #0891b2;
  --accent-ink:  #04212a;        /* text that sits ON the accent fill */
  --accent-soft: rgba(34,211,238,0.10);
  --accent-line: rgba(34,211,238,0.35);
  --glow:        rgba(34,211,238,0.18);

  /* type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout */
  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint data-grid + accent glow, fixed behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 100%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  top: -380px; left: 50%;
  transform: translateX(-50%);
  width: 1100px; height: 760px;
  z-index: -2;
  background: radial-gradient(ellipse at center, var(--glow), transparent 65%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- container ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }

/* ---- eyebrow / labels ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 11.5px; font-weight: 500; color: var(--accent);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent-line);
}

/* =====================  NAV  ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,16,0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
}
@media (max-width: 640px) { .nav-inner { padding: 0 18px; height: 56px; } }
.brand {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  letter-spacing: -0.01em; color: var(--ink);
}
.brand .mark {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-family: var(--font-mono); font-weight: 700;
  font-size: 14px; box-shadow: 0 0 18px var(--glow);
}
.brand .mark svg { width: 17px; height: 17px; display: block; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  padding: 8px 12px; border-radius: 8px; transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); }
.nav-links a.cta {
  color: var(--accent); border: 1px solid var(--accent-line); margin-left: 4px;
}
.nav-links a.cta:hover { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 560px) {
  .nav-links a { padding: 11px 11px; font-size: 13px; } /* taller tap target */
  .nav-links a.label-full { display: none; }
  .nav .brand .wordmark, .nav .brand .dot { display: none; } /* mobile: just the GI mark */
}

/* =====================  BUTTONS  ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-body); font-size: 15.5px; font-weight: 600;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent;
  transition: transform .06s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent-line), 0 10px 30px -12px var(--glow);
}
.btn-primary:hover { box-shadow: 0 0 0 1px var(--accent), 0 14px 36px -10px var(--glow); }
.btn-ghost {
  background: var(--surface); color: var(--ink); border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); }
.btn svg { width: 17px; height: 17px; }

/* =====================  FOOTER  ===================== */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 96px; padding: 48px 0 56px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.012));
}
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px; flex-wrap: wrap; margin-bottom: 30px;
}
.footer .brand { font-size: 17px; margin-bottom: 12px; }
.footer-tag { color: var(--ink-faint); font-size: 14px; max-width: 320px; margin: 0; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 11px; font-weight: 500; color: var(--ink-dim); margin: 0 0 12px;
}
.footer-col a, .footer-col span {
  display: block; color: var(--ink-soft); font-size: 14.5px; margin-bottom: 9px;
  transition: color .16s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--ink-dim); font-size: 12.5px;
}
.footer-bottom .disclaimer { max-width: 620px; color: var(--ink-faint); }
.footer-bottom a { color: var(--ink-faint); }
.footer-bottom a:hover { color: var(--accent); }

/* social icon buttons */
.socials { display: flex; gap: 10px; margin-top: 4px; }
.socials a {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 9px; border: 1px solid var(--line-2); color: var(--ink-soft);
  transition: color .18s, border-color .18s, background .18s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.socials svg { width: 18px; height: 18px; }

/* =====================  SCROLL REVEAL  =====================
   Gated on html.js (set synchronously in <head>) so that with JS
   disabled — or for crawlers that don't run JS — content stays visible. */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* =====================  SHARED SECTION BITS  ===================== */
.section-head { margin-bottom: 30px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 4vw, 40px); line-height: 1.08; letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-head p { color: var(--ink-soft); font-size: 17px; margin: 0; max-width: 640px; }

.mono { font-family: var(--font-mono); }

/* =====================  BACK TO TOP  ===================== */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: rgba(17,21,28,0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); color: var(--ink-soft);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, color .2s ease, border-color .2s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent-line); }
.to-top svg { width: 20px; height: 20px; }
@media (max-width: 560px) { .to-top { right: 14px; bottom: 14px; } }
@media print { .to-top { display: none !important; } }

/* =====================  EMAIL GATE MODAL  ===================== */
.gate-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(6,8,11,0.74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.gate-overlay[hidden] { display: none; }
.gate-card {
  position: relative; width: 100%; max-width: 420px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 30px 28px 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.75), 0 0 0 1px var(--accent-line);
}
.gate-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; margin: 6px 0 8px; }
.gate-card .gate-name { color: var(--accent); }
.gate-sub { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 18px; line-height: 1.55; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-input {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 13px 14px;
}
.gate-input::placeholder { color: var(--ink-dim); }
.gate-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-submit { justify-content: center; width: 100%; }
.gate-msg { color: #ff9b9b; font-size: 13.5px; margin: 10px 0 0; }
.gate-fine { color: var(--ink-dim); font-size: 11.5px; margin: 14px 0 0; }
.gate-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 20px; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s;
}
.gate-close:hover { color: var(--ink); border-color: var(--line-2); }
.gate-done { text-align: center; }
.gate-done h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 16px; }
.gate-check {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; margin: 2px auto 14px;
  color: #34d399; background: rgba(52,211,153,0.10); border: 1px solid rgba(52,211,153,0.4);
}
.gate-check svg { width: 26px; height: 26px; }
.gate-dl { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gate-dl .btn { justify-content: center; }

/* =====================  PRINT / PDF  ===================== */
@media print {
  @page { margin: 12mm; }
  html, body { background: #0a0c10 !important; color: var(--ink); font-size: 10.5pt; line-height: 1.5; }
  body::before, body::after { display: none !important; }
  .nav, .footer, .no-print, .btn, .socials, .to-top, .gate-overlay { display: none !important; }
  .print-only { display: block !important; }
  /* scroll-reveal never fires without scrolling — force everything visible in print */
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: var(--accent); text-decoration: none; }
  .wrap { max-width: 100%; padding: 0 4mm; }
  section, .card, .tier, .inst-list, .alloc-cell, .sector { break-inside: avoid; page-break-inside: avoid; }
}
.print-only { display: none; }
