/* ============================================================
   GridAxon — Global design system
   Dark precision-engineering language.
   Accent locked to grid-green. One radius family.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --bg:          #ffffff;
  --bg-2:        #f4f8fa;
  --surface:     #ffffff;
  --surface-2:   #eef4f7;
  --line:        rgba(12, 45, 56, 0.12);
  --line-strong: rgba(12, 45, 56, 0.20);

  --text:        #0c2630;
  --text-dim:    #48606b;
  --text-faint:  #83969f;

  --accent:      #16b6d0;   /* brand teal (from logo): fills, graphics, borders, buttons */
  --accent-ink:  #0a7488;   /* darkened teal: teal TEXT on white (AA contrast) */
  --accent-deep: #0c94ad;
  --accent-soft: rgba(16, 176, 208, 0.12);
  --btn-ink:     #04333d;   /* near-black teal: label on bright-teal button */

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-sans:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* radius system: interactive 10px, containers 14px, pills full */
  --r-int:  10px;
  --r-box:  14px;
  --r-pill: 999px;

  --maxw: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  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; }
ul { list-style: none; padding: 0; }
canvas { pointer-events: none; }

/* ---- Selection behaviour ----
   Decorative / UI text behaves like app chrome (arrow cursor, not selectable).
   Real reading content (paragraphs, contact info, quotes, form fields) stays selectable. */
h1, h2, h3, h4, .eyebrow, .section-title, .nav, .logo, .btn, .pill,
.stat, .num, .lbl, .idx, .s-num, .why-item .n, .role, .founder-mono,
.markets-label, .market-logo, .footer h4, .footer-bottom {
  -webkit-user-select: none; user-select: none;
}
p, .lead, blockquote, .contact-info, .footer-contact,
input, textarea, select, label {
  -webkit-user-select: text; user-select: text;
}

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent-ink);
  opacity: 0.7;
}
.section-title { font-size: clamp(1.9rem, 4vw, 3rem); }
.lead { color: var(--text-dim); font-size: 1.08rem; max-width: 62ch; }
.muted { color: var(--text-dim); }
.nowrap { white-space: nowrap; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(44px, 5vw, 72px) 0; }
.section-head { max-width: 780px; margin-bottom: 42px; }
.section-head .lead { margin-top: 20px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-int);
  font-weight: 600; font-size: 0.95rem;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--btn-ink); }
.btn-primary:hover { background: #22c1de; transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.btn-lg { padding: 16px 28px; font-size: 1rem; }

/* ---- Founder avatar photo (fills the circular mono frame) ---- */
.founder-mono { overflow: hidden; }
.founder-mono img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }

/* ---- Badge / pill ---- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: 84px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 20px rgba(12, 45, 56, 0.05);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.nav-links a {
  font-size: 0.93rem; color: var(--text-dim);
  transition: color 0.2s; position: relative; padding: 4px 0;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--accent);
}
/* ---- Nav dropdown (Resources → Blogs) ---- */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 0;
  min-width: 168px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-box); box-shadow: 0 12px 32px rgba(12, 45, 56, 0.12);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}
.nav-dropdown-menu::before {
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
  padding: 9px 12px; border-radius: var(--r-int); font-size: 0.9rem;
  color: var(--text-dim); transition: background 0.2s, color 0.2s;
}
.nav-dropdown-menu a:hover { background: var(--surface-2); color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--r-int); align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ---- Logo ---- */
.logo { display: inline-flex; align-items: center; }
.logo img { height: 38px; width: auto; display: block; }
.footer-brand .logo img { height: 34px; }

/* ---- Staggered pill reveal (cascades in after the copy) — motion only, see Scroll reveal ---- */
.reveal-pills .pill { transition: transform 0.45s var(--ease); }
.reveal-ready .reveal-pills:not(.in) .pill { transform: translateY(10px) scale(0.96); }
.reveal-pills.in .pill:nth-child(1) { transition-delay: 0.20s; }
.reveal-pills.in .pill:nth-child(2) { transition-delay: 0.26s; }
.reveal-pills.in .pill:nth-child(3) { transition-delay: 0.32s; }
.reveal-pills.in .pill:nth-child(4) { transition-delay: 0.38s; }
.reveal-pills.in .pill:nth-child(5) { transition-delay: 0.44s; }
.reveal-pills.in .pill:nth-child(6) { transition-delay: 0.50s; }
.reveal-pills.in .pill:nth-child(7) { transition-delay: 0.56s; }
.reveal-pills.in .pill:nth-child(8) { transition-delay: 0.62s; }

/* ---- CTA band (used on home + all interior pages) ---- */
.cta-band { position: relative; overflow: hidden; }
.cta-inner { position: relative; z-index: 2; border: 1px solid rgba(255,255,255,0.12); border-radius: var(--r-box); background: linear-gradient(150deg, #0c2630, #04333d); padding: clamp(40px, 6vw, 72px); text-align: center; }
.cta-inner h2 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 18ch; margin: 0 auto; color: #f6935c; }
.cta-inner p { color: rgba(255,255,255,0.75); margin: 20px auto 34px; max-width: 52ch; }
.cta-inner .btn-ghost { border-color: rgba(255,255,255,0.28); color: #fff; }
.cta-inner .btn-ghost:hover { border-color: #86E68A; color: #86E68A; transform: translateY(-2px); }
.cta-mesh { position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.10) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 50%, #000, transparent 70%); }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 72px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.3fr; gap: 48px; }
.footer-brand .lead { font-size: 0.98rem; margin-top: 18px; max-width: 42ch; }
.footer h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 20px; font-weight: 500; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--text-dim); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-ink); }
.footer-contact li { color: var(--text-dim); margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-start; }
.footer-contact svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; margin-top: 3px; }
.footer-contact a:hover { color: var(--accent-ink); }
.footer-bottom { margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); }

/* ============================================================
   Scroll reveal
   ============================================================ */
/* Motion only: content is never hidden. Without JS nothing is offset; main.js
   adds .reveal-ready to <html> after marking on-screen elements .in, so only
   elements still below the fold get a small offset that settles on scroll. */
.reveal, .reveal-text { transition: transform 0.7s var(--ease); }
.reveal-ready .reveal:not(.in), .reveal-ready .reveal-text:not(.in) { transform: translateY(26px); }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ============================================================
   Scroll-down indicator (hero + page-hero, all pages)
   ============================================================ */
.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-faint); text-decoration: none;
  transition: color 0.3s var(--ease);
  animation: hero-scroll-bob 2.6s ease-in-out infinite;
}
.hero-scroll:hover { color: var(--accent-ink); }
.hero-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--r-int); }
.hero-scroll-mouse {
  width: 26px; height: 42px; border-radius: var(--r-pill);
  border: 2px solid currentColor;
  display: flex; justify-content: center; padding-top: 8px;
}
.hero-scroll-dot {
  width: 4px; height: 8px; border-radius: var(--r-pill);
  background: currentColor;
  animation: hero-scroll-dot 1.8s var(--ease) infinite;
}
.hero-scroll-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.2em;
  text-transform: uppercase;
}
@keyframes hero-scroll-dot {
  0%   { opacity: 0; transform: translateY(-5px); }
  25%  { opacity: 1; }
  60%  { opacity: 1; transform: translateY(9px); }
  100% { opacity: 0; transform: translateY(13px); }
}
@keyframes hero-scroll-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}
/* compact page-hero variant: tuck it against the lower edge, hide where it would crowd the heading */
.page-hero .hero-scroll { bottom: 18px; }
@media (max-width: 900px) { .page-hero .hero-scroll { display: none; } }
@media (max-width: 640px) { .hero-scroll-label { display: none; } }

/* ============================================================
   Responsive — global
   ============================================================ */
@media (max-width: 900px) {
  .nav-links, .nav-right .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-menu.open { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* Mobile menu */
.mobile-menu { display: none; position: fixed; inset: 84px 0 auto 0; z-index: 49; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 20px 24px 28px; }
.mobile-menu a { display: block; padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.mobile-menu-group { padding: 16px 0 4px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.mobile-menu .btn { width: 100%; justify-content: center; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .btn:hover { transform: none; }
  .hero-scroll { animation: none; }
  .hero-scroll-dot { animation: none; opacity: 0.8; transform: none; }
}
