/*
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * getmartin.com — Global Stylesheet
 * Design System v2 — Updated post Chapter 1
 * Fonts: Clash Display + Satoshi
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 */


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. TOKENS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root {

  /* Brand colors */
  --navy:          #2a3a4a;
  --navy-dark:     #1e2c3a;
  --navy-light:    #344a5c;
  --navy-mid:      #243342;
  --lime:          #b8d400;
  --lime-hover:    #cef000;
  --lime-dim:      rgba(184,212,0,0.1);
  --purple:        #7b35d8;
  --purple-muted:  #b07aff;
  --orange:        #f47320;

  /* Light section */
  --off-white:     #e8e6e0;

  /* Neutrals — dark context */
  --white:         #f0eff0;
  --white-dim:     rgba(240,239,240,0.55);
  --white-faint:   rgba(240,239,240,0.1);
  --white-ghost:   rgba(240,239,240,0.05);
  --grid:          rgba(240,239,240,0.035);

  /* Card surfaces */
  --card-bg:           rgba(240,239,240,0.07);
  --card-border:       rgba(240,239,240,0.16);
  --card-bg-hover:     rgba(240,239,240,0.11);
  --card-border-hover: rgba(240,239,240,0.26);

  /* Dark text — light section context */
  --ink:           #1e2c3a;
  --ink-dim:       rgba(30,44,58,0.65);
  --ink-faint:     rgba(30,44,58,0.12);
  --grid-light:    rgba(30,44,58,0.06);

  /* Typography */
  --font-display: 'Roboto', sans-serif;
  --font-body:    'Roboto', sans-serif;

  /* Type scale — minimum 16px */
  --text-base: 1rem;
  --text-lg:   1.15rem;
  --text-xl:   1.4rem;
  --text-2xl:  1.8rem;
  --text-3xl:  2.4rem;
  --text-4xl:  3.2rem;
  --text-5xl:  4.2rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Layout */
  --max-width:  1280px;
  --gutter:     clamp(1.5rem, 5vw, 6rem);
  --col-gap:    8px;
  --nav-height: 56px;

  /* Animation */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   500ms;
  --dur-enter:  700ms;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   2. RESET & BASE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--navy-dark);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
button { cursor: pointer; }
a { cursor: pointer; }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. GLOBAL FINISHING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
*:focus-visible { outline: 1px solid var(--lime); outline-offset: 3px; }
::selection { background: var(--lime); color: var(--navy-dark); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy-dark); }
::-webkit-scrollbar-thumb { background: var(--navy-light); }
::-webkit-scrollbar-thumb:hover { background: var(--lime); }

a { color: inherit; text-decoration: none; transition: color var(--dur-base); }
a.link-accent { color: var(--lime); }
a.link-accent:hover { color: var(--lime-hover); }
a.link-subtle {
  color: var(--white-dim);
  border-bottom: 1px solid var(--white-faint);
  transition: color var(--dur-base), border-color var(--dur-base);
}
a.link-subtle:hover { color: var(--white); border-color: var(--white-dim); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. BACKGROUND UTILITIES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bg-grid-dark { position: relative; }
.bg-grid-dark::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none; z-index: 0;
}

.bg-grid-light { position: relative; }
.bg-grid-light::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-light) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none; z-index: 0;
}

.bg-grid-sm::before { background-size: 40px 40px; }
.bg-grid-lg::before { background-size: 120px 120px; }

.bg-dots-dark { position: relative; }
.bg-dots-dark::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(240,239,240,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

.bg-grid-dark > *, .bg-grid-light > *, .bg-dots-dark > * { position: relative; z-index: 1; }

.glow-lime {
  position: absolute;
  top: -160px; left: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(184,212,0,0.07) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. SECTION TYPES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-dark  { background: var(--navy-dark); color: var(--white); }
.section-navy  { background: var(--navy);      color: var(--white); }
.section-light { background: var(--off-white); color: var(--ink); }
.section-cut   { height: 2px; background: var(--lime); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. TYPOGRAPHY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.t-display {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, var(--text-5xl));
  font-weight: 700; line-height: 1.0; letter-spacing: -0.02em;
}
.t-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3.6rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.02em;
}
.t-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, var(--text-4xl));
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
}
.t-h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, var(--text-3xl));
  font-weight: 700; line-height: 1.15; letter-spacing: -0.01em;
}
.t-h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600; line-height: 1.2;
}
.t-lead  { font-size: var(--text-lg);   font-weight: 300; line-height: 1.75; color: var(--white-dim); }
.t-body  { font-size: var(--text-base); font-weight: 300; line-height: 1.65; color: var(--white-dim); }
.t-small { font-size: var(--text-base); font-weight: 300; line-height: 1.5;  color: var(--white-dim); }

/* Eyebrow — editorial, no decoration */
.t-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300; letter-spacing: 0.04em;
  color: var(--white-dim);
}

/* Label — uppercase */
.t-label {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--white-dim);
}

/* Color modifiers */
.t-accent  { color: var(--lime); }
.t-orange  { color: var(--orange); }
.t-purple  { color: var(--purple-muted); }
.t-dim     { color: var(--white-dim); }
.t-white   { color: var(--white); }
.t-strong  { color: var(--white); font-weight: 400; }

/* Light section overrides */
.section-light .t-lead,
.section-light .t-body,
.section-light .t-small,
.section-light .t-label,
.section-light .t-eyebrow { color: var(--ink-dim); }
.section-light .t-strong  { color: var(--ink); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   8. BUTTONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--navy-dark); background: var(--lime);
  border: none; padding: 0.9rem 2rem; cursor: none;
  transition: background var(--dur-base) var(--ease-out), gap var(--dur-base) var(--ease-out);
}
.btn-primary:hover { background: var(--lime-hover); gap: 14px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--white); background: transparent;
  border: 1px solid var(--white-faint);
  padding: 0.9rem 2rem; cursor: none;
  transition: border-color var(--dur-base), gap var(--dur-base) var(--ease-out);
}
.btn-secondary:hover { border-color: var(--white-dim); gap: 14px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 300;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--white-dim); background: none; border: none;
  padding: 0; cursor: none;
  transition: color var(--dur-base), gap var(--dur-base) var(--ease-out);
}
.btn-ghost:hover { color: var(--white); gap: 10px; }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   9. CARDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.4rem;
  position: relative; overflow: hidden;
  transition: background var(--dur-base), border-color var(--dur-base), transform var(--dur-base) var(--ease-out);
}
.card:hover { background: var(--card-bg-hover); border-color: var(--card-border-hover); transform: translateY(-2px); }

/* Stat card — square corners, number dominant */
.card-stat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.4rem 1.4rem 1.6rem;
  position: relative; overflow: hidden;
  transition: background var(--dur-base), border-color var(--dur-base), transform var(--dur-base) var(--ease-out);
}
.card-stat:hover { background: var(--card-bg-hover); border-color: var(--card-border-hover); transform: translateY(-2px); }

.stat-number {
  font-family: var(--font-display);
  font-weight: 700; line-height: 0.95;
  letter-spacing: -0.03em; margin-bottom: 0.8rem;
  display: flex; align-items: baseline; gap: 1px;
}
.stat-number.lg { font-size: clamp(2.4rem, 4.2vw, 4rem); }
.stat-number.xl { font-size: clamp(3rem, 5.5vw, 5rem); }

.num-val { display: inline-block; font-variant-numeric: tabular-nums; }
.num-suf { display: inline-block; opacity: 0; font-size: 0.6em; align-self: flex-start; padding-top: 0.2em; }
.num-suf:empty { display: none; }
.num-suf.show { animation: sufIn 0.3s var(--ease-out) forwards; }

.stat-label {
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 300;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(240,239,240,0.6); margin-bottom: 0.4rem;
}
.stat-desc { font-size: var(--text-base); font-weight: 300; line-height: 1.4; color: rgba(240,239,240,0.6); }
.stat-desc strong { color: var(--white); font-weight: 500; }

/* Stat color — number only */
.stat-lime   .stat-number { color: var(--navy-dark); }
.stat-orange .stat-number { color: var(--navy-dark); }
.stat-purple .stat-number { color: var(--navy-dark); }

/* Top bar — sweeps on reveal */
.stat-bar { display: none; }

/* Lime card — CTA or thesis statement */
.card-lime {
  background: var(--lime) !important;
  border: 1px solid var(--lime) !important;
  padding: 1.4rem;
}
.card-lime.interactive { transition: background var(--dur-base); cursor: pointer; }
.card-lime.interactive:hover { background: var(--lime-hover) !important; }

.card-lime-text {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--navy-dark);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   10. TAGS & BADGES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.tag {
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 300;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.3rem 0.8rem; border: 1px solid; display: inline-block;
}
.tag-default { color: var(--white-dim); border-color: var(--white-faint); }
.tag-lime    { color: var(--lime);    border-color: var(--lime);    background: var(--lime-dim); }
.tag-purple  { color: var(--purple-muted); border-color: var(--purple); background: rgba(123,53,216,0.1); }
.tag-orange  { color: var(--orange);  border-color: var(--orange);  background: rgba(244,115,32,0.08); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   11. INPUTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.input-label {
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 300;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--white-dim); display: block; margin-bottom: 0.5rem;
}
.input-field {
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 300;
  color: var(--white); background: var(--navy);
  border: 1px solid var(--white-faint);
  padding: 0.85rem 1.2rem; outline: none; width: 100%;
  transition: border-color var(--dur-base);
}
.input-field::placeholder { color: var(--white-dim); opacity: 0.5; }
.input-field:focus { border-color: var(--lime); }
.input-field.input-error { border-color: var(--orange); }
.input-hint { font-size: var(--text-base); color: var(--white-dim); margin-top: 0.4rem; }
.input-hint.error { color: var(--orange); }
.input-row { display: flex; gap: 0; }
.input-row .input-field { flex: 1; }
.input-row .btn-primary { flex-shrink: 0; }

.section-light .input-field { background: white; color: var(--ink); border-color: var(--ink-faint); }
.section-light .input-field::placeholder { color: var(--ink-dim); }
.section-light .input-field:focus { border-color: var(--navy); }
.section-light .input-label { color: var(--ink-dim); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   12. NAVIGATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.nav {
  position: relative; z-index: 100;
  height: var(--nav-height); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(30,44,58,0.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--white-faint);
}
.nav-fixed { position: fixed; top: 0; left: 0; right: 0; }

.nav-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-base); font-weight: 700;
  letter-spacing: 0.04em; color: var(--white); text-decoration: none;
}
.nav-wordmark span { color: var(--lime); }

.chapter-tag {
  font-family: var(--font-body);
  font-size: var(--text-base); font-weight: 300;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--white-dim); display: flex; align-items: center; gap: 6px;
}
.chapter-tag .dot { width: 6px; height: 6px; background: var(--lime); display: inline-block; flex-shrink: 0; }

.nav-dots { display: flex; gap: 6px; align-items: center; }
.nav-dot {
  height: 5px; width: 5px;
  background: var(--white-faint); border: none; padding: 0; cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.nav-dot:hover  { background: var(--white-dim); width: 14px; }
.nav-dot.active { background: var(--lime); width: 24px; }

.nav-progress {
  position: absolute; bottom: 0; left: 0;
  height: 1px; background: var(--lime); width: 0%;
  transition: width var(--dur-slow) var(--ease-out);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   13. DIVIDERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.divider         { width: 100%; height: 1px; background: var(--white-faint); }
.divider-accent  { width: 100%; height: 1px; background: linear-gradient(90deg, var(--lime) 0%, transparent 60%); }
.divider-section { width: 100%; height: 1px; background: linear-gradient(90deg, transparent 0%, var(--white-faint) 20%, var(--white-faint) 80%, transparent 100%); }
.divider-cut     { width: 100%; height: 2px; background: var(--lime); }

.section-light .divider         { background: var(--ink-faint); }
.section-light .divider-section { background: linear-gradient(90deg, transparent 0%, var(--ink-faint) 20%, var(--ink-faint) 80%, transparent 100%); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   14. LAYOUT HELPERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.chapter {
  width: 100vw; height: 100vh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

.col-split {
  display: grid; grid-template-columns: 1fr 1fr;
  flex: 1; overflow: hidden;
}

.col-left {
  display: flex; flex-direction: column; justify-content: center;
  padding: 4vw 3.5vw 4vw 5vw;
  border-right: 1px solid var(--white-faint);
}

.col-right {
  display: flex; flex-direction: column; justify-content: center;
  gap: var(--col-gap);
  padding: 3vw 5vw 3vw 3.5vw;
}

.col-center {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-24) var(--gutter);
}

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--col-gap);
}
.span-full { grid-column: 1 / -1; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--col-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--col-gap); }
.grid-2.gap-md, .grid-3.gap-md { gap: 2rem; }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   15. ENTRANCE ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.anim-up   { opacity: 0; animation: fadeUp   var(--dur-enter) var(--ease-out) forwards; }
.anim-fade { opacity: 0; animation: fadeIn   var(--dur-enter) var(--ease-out) forwards; }
.anim-down { opacity: 0; animation: fadeDown var(--dur-enter) var(--ease-out) forwards; }

.delay-1 { animation-delay: 0.10s; }
.delay-2 { animation-delay: 0.20s; }
.delay-3 { animation-delay: 0.35s; }
.delay-4 { animation-delay: 0.50s; }
.delay-5 { animation-delay: 0.65s; }
.delay-6 { animation-delay: 0.80s; }
.delay-7 { animation-delay: 0.95s; }
.delay-8 { animation-delay: 1.10s; }

@keyframes fadeUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Scramble counter keyframes */
@keyframes numSlam {
  0%   { opacity: 0; transform: translateY(20px) scale(0.85); }
  60%  { opacity: 1; transform: translateY(-5px) scale(1.06); }
  80%  { transform: translateY(2px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}
@keyframes sufIn {
  from { opacity: 0; transform: translateX(-3px); }
  to   { opacity: 1; transform: translateX(0); }
}

.num-val.slam  { animation: numSlam 0.65s var(--ease-out) forwards; }
.num-val.pulse { animation: breathe 3.5s var(--ease-inout) infinite; }

/* Headline fade — 8s fade out, punchline fades in */
.headline-fade { transition: opacity 8s linear; }
.headline-fade.gone { opacity: 0; }
.headline-reveal { opacity: 0; transition: opacity 1.2s var(--ease-out); }
.headline-reveal.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .anim-up, .anim-fade, .anim-down { animation: none; opacity: 1; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   16. MOBILE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {

  :root {
    --text-5xl: 2.6rem;
    --text-4xl: 2rem;
    --text-3xl: 1.6rem;
    --text-2xl: 1.4rem;
    --text-xl:  1.2rem;
  }

  body { cursor: auto; }
  button, a { cursor: pointer; }

  .chapter { height: auto; overflow-y: auto; }

  .col-split { grid-template-columns: 1fr; }
  .col-left  { padding: 3rem 1.5rem 2rem; border-right: none; border-bottom: 1px solid var(--white-faint); }
  .col-right { padding: 2rem 1.5rem 4rem; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .nav-dots { display: none; }
}
