/* =====================================================================
   The Money Teardown - shared design system
   themoneyteardown.com
   One stylesheet. Plain static site. No build step.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&display=swap');

/* ------------------------------------------------------------------ */
/* 1. Design tokens                                                    */
/* ------------------------------------------------------------------ */
:root {
  /* Palette */
  --canvas:      #05080f;
  --panel:       #0b1420;
  --panel-2:     #0f1b2b;   /* raised surface */
  --accent:      #15C46A;   /* brand green */
  --accent-dim:  #109d55;
  --accent-soft: rgba(21, 196, 106, 0.12);
  --ink:         #F0F4F8;
  --muted:       #7b8595;
  --red:         #e0524a;   /* sparing */

  /* Lines & edges */
  --line:        rgba(240, 244, 248, 0.08);
  --line-strong: rgba(240, 244, 248, 0.14);

  /* Type */
  --font:        'Sora', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Spacing rhythm (8px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Shadows (no gradients, radial/solid glows only) */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.55);
  --glow-accent: 0 0 0 1px rgba(21, 196, 106, 0.25), 0 12px 40px rgba(21, 196, 106, 0.18);

  /* Layout */
  --maxw: 1160px;
  --header-h: 72px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.28s;
}

/* ------------------------------------------------------------------ */
/* 2. Reset / base                                                     */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

input, textarea { font-family: inherit; font-size: 1rem; }

ul { list-style: none; padding: 0; }

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

/* Numbers / stats read as tabular */
.num, .stat, time, [data-num] { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/* 3. Typography scale                                                 */
/* ------------------------------------------------------------------ */
h1, h2, h3, h4 { line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; }

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }

p { color: var(--ink); }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); font-weight: 400; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.muted { color: var(--muted); }
.accent { color: var(--accent); }
.text-red { color: var(--red); }

/* ------------------------------------------------------------------ */
/* 4. Layout primitives                                                */
/* ------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

.section { padding-block: clamp(var(--s-7), 8vw, var(--s-9)); }
.section--tight { padding-block: var(--s-7); }

.section-head { max-width: 640px; margin-bottom: var(--s-6); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-top: var(--s-3); }
.section-head p { margin-top: var(--s-3); }

.stack > * + * { margin-top: var(--s-4); }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.wrap { flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* 5. Background decoration (grid + radial glows, NO linear gradients) */
/* ------------------------------------------------------------------ */
.bg-grid {
  position: relative;
  isolation: isolate;
}
.bg-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  opacity: 0.6;
}

/* Soft green radial glow - drop into any relatively-positioned block */
.glow {
  position: absolute;
  z-index: -1;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(21,196,106,0.20) 0%, rgba(21,196,106,0.06) 35%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.glow--top   { top: -260px; left: 50%; transform: translateX(-50%); }
.glow--left  { top: 10%; left: -280px; }
.glow--right { bottom: -200px; right: -240px; }

/* ------------------------------------------------------------------ */
/* 6. Buttons                                                          */
/* ------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--panel-2);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.8rem 1.35rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: #04180d;
  border-color: transparent;
  box-shadow: var(--glow-accent);
}
.btn--primary:hover { background: var(--accent-dim); box-shadow: 0 0 0 1px rgba(21,196,106,0.4), 0 16px 46px rgba(21,196,106,0.28); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
.btn--lg { padding: 0.95rem 1.7rem; font-size: 1.02rem; }

/* YouTube glyph baked into the subscribe button */
.btn .yt-glyph { width: 20px; height: 20px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ */
/* 7. Cards & panels                                                   */
/* ------------------------------------------------------------------ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

/* Interactive card that links somewhere - green edge on hover */
.card--link:hover { border-color: rgba(21,196,106,0.45); }

.card__icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid rgba(21,196,106,0.28);
  color: var(--accent);
  margin-bottom: var(--s-4);
}
.card__title { margin-bottom: var(--s-3); }
.card p { color: var(--muted); }
.card__cta {
  margin-top: var(--s-5);
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}
.card__cta .arrow { transition: transform var(--dur) var(--ease); }
.card--link:hover .card__cta .arrow { transform: translateX(4px); }

/* Pill / tag / badge */
.tag {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 0.32rem 0.7rem;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid rgba(21,196,106,0.28);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tag--neutral { background: rgba(240,244,248,0.05); border-color: var(--line-strong); color: var(--muted); }

/* Stat block */
.stat-row { display: flex; flex-wrap: wrap; gap: var(--s-6); }
.stat { min-width: 120px; }
.stat__value {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.stat__value.is-accent { color: var(--accent); }
.stat__label { margin-top: var(--s-2); font-size: 0.85rem; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* 8. Site header (sticky)                                             */
/* ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: var(--header-h);
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand__logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.brand__name { font-size: 1.05rem; }
.brand__name .accent { color: var(--accent); }

.nav { display: flex; align-items: center; gap: var(--s-2); }
.nav a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(240,244,248,0.05); }
.nav a[aria-current="page"] { color: var(--ink); }

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

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ */
/* 9. Hero                                                             */
/* ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding-block: clamp(var(--s-8), 12vw, calc(var(--s-9) + var(--s-6)));
  text-align: center;
}
.hero__logo {
  width: clamp(96px, 14vw, 132px);
  height: auto;
  margin: 0 auto var(--s-5);
  border-radius: 50%;
  filter: drop-shadow(0 12px 40px rgba(21,196,106,0.28));
}
.hero h1 { max-width: 15ch; margin-inline: auto; }
.hero .lead { max-width: 56ch; margin: var(--s-5) auto 0; }
.hero__actions { margin-top: var(--s-6); display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.hero__tagline {
  margin-top: var(--s-4);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/* 10. Video / media                                                   */
/* ------------------------------------------------------------------ */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.feature-media {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-6);
  align-items: center;
}

/* ------------------------------------------------------------------ */
/* 11. Email capture                                                   */
/* ------------------------------------------------------------------ */
.capture {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(var(--s-6), 6vw, var(--s-8));
  border-radius: var(--r-lg);
  border: 1px solid rgba(21,196,106,0.22);
  background: var(--panel);
}
.capture h2 { max-width: 20ch; margin-inline: auto; }
.capture .lead { max-width: 50ch; margin: var(--s-3) auto var(--s-6); }

.form-row {
  display: flex;
  gap: var(--s-3);
  max-width: 480px;
  margin-inline: auto;
  flex-wrap: wrap;
}
.form-row input[type="email"] {
  flex: 1 1 220px;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--canvas);
  color: var(--ink);
}
.form-row input::placeholder { color: var(--muted); }
.form-row input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-note { margin-top: var(--s-4); font-size: 0.82rem; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* 12. Footer                                                          */
/* ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding-block: var(--s-7) var(--s-6);
  margin-top: var(--s-8);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--s-6);
  margin-bottom: var(--s-6);
}
.footer-brand .brand { margin-bottom: var(--s-3); }
.footer-brand p { color: var(--muted); font-size: 0.92rem; max-width: 42ch; }
.footer-col h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-3); }
.footer-col a { display: block; padding: 0.28rem 0; color: var(--ink); font-size: 0.95rem; }
.footer-col a:hover { color: var(--accent); }

.footer-legal {
  border-top: 1px solid var(--line);
  padding-top: var(--s-5);
  display: grid;
  gap: var(--s-4);
}
.footer-legal .disclosure { font-size: 0.82rem; color: var(--muted); max-width: 90ch; line-height: 1.7; }
.footer-legal .disclosure strong { color: var(--ink); font-weight: 700; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-bottom nav { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.footer-bottom nav a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ */
/* 13. Scroll reveal (progressive, JS toggles .is-in)                  */
/* ------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ */
/* 14. Utilities                                                       */
/* ------------------------------------------------------------------ */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; }
.full { width: 100%; }
.divider { height: 1px; background: var(--line); border: 0; margin-block: var(--s-6); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -60px;
  background: var(--accent); color: #04180d; font-weight: 700;
  padding: 0.6rem 1rem; border-radius: var(--r-sm); z-index: 200;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s-4); }

/* ------------------------------------------------------------------ */
/* 15. Responsive                                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .feature-media { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .nav, .header-actions .btn--ghost { display: none; }
  .nav-toggle { display: inline-flex; }

  /* Mobile drawer */
  .site-header.is-open .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
    padding: var(--s-4) var(--s-5) var(--s-6);
    gap: var(--s-1);
  }
  .site-header.is-open .nav a { padding: 0.85rem 0.75rem; font-size: 1.05rem; }
}

@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
