/* ============================================================
   REPS — EDITORIAL REDESIGN
   Font: Nunito (SF Pro Rounded web equivalent)
   Mobile-first. Zero gradients. Zero glow. Pure contrast.
   ============================================================ */

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }
ul { list-style: none; }

/* ---------- TOKENS ---------- */
:root {
  --black:   #0a0a0a;
  --near:    #111111;
  --surface: #161616;
  --border:  #2a2a2a;
  --muted:   #666;
  --dim:     #999;
  --white:   #f4f4f5;
  --purple:  #8b5cf6;
  --purple-d:#7c3aed;

  /* SF Pro Rounded → Nunito as closest web match (rounded terminals, friendly weight contrast) */
  --ff-sans: "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ff-serif: 'Instrument Serif', Georgia, serif;

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- BASE ---------- */
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- GRAIN ---------- */
.grain {
  position: fixed;
  inset: -200%;
  width: 400%;
  height: 400%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  animation: grain-drift 8s steps(2) infinite;
}
@keyframes grain-drift {
  0%   { transform: translate(0,0); }
  10%  { transform: translate(-5%,-5%); }
  20%  { transform: translate(-10%,5%); }
  30%  { transform: translate(5%,-10%); }
  40%  { transform: translate(-5%,15%); }
  50%  { transform: translate(-10%,5%); }
  60%  { transform: translate(15%,0); }
  70%  { transform: translate(0,10%); }
  80%  { transform: translate(-15%,0); }
  90%  { transform: translate(10%,5%); }
  100% { transform: translate(5%,0); }
}

/* ---------- SCROLL PROGRESS ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--purple);
  z-index: 999;
  transition: width 0.1s linear;
}

/* ============================================================
   NAV
   ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(10,10,10,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 28px; width: auto; display: block; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dim);
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--white); }
.nav-links .nav-cta {
  color: var(--white);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 100px;
  font-weight: 700;
  transition: border-color 0.2s, background 0.2s;
}
.nav-links .nav-cta:hover {
  border-color: var(--purple);
  background: rgba(139,92,246,0.1);
}
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: var(--black);
  font-family: var(--ff-sans);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 16px 28px;
  border-radius: 100px;
  transition: transform 0.2s var(--ease-spring), background 0.2s;
  will-change: transform;
  white-space: nowrap;
}
.btn-primary:active {
  transform: scale(0.96);
  background: #ccc;
}
.btn-primary svg { flex-shrink: 0; }

/* ============================================================
   HERO — mobile first
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 80px 20px 60px;
}
.hero-layout {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
}
.hero-text { width: 100%; }
.hero-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(56px, 13vw, 120px);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.05em;
  color: var(--white);
  margin-bottom: 24px;
}
.hero-title-accent {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--dim);
  max-width: 480px;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.hero-free {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Hero phone */
.hero-phone {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ---------- PHONE FRAME ---------- */
.phone-frame {
  position: relative;
  width: 100%;
  max-width: 280px;
  border-radius: 44px;
  border: 2px solid var(--border);
  overflow: hidden;
  background: var(--near);
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.phone-frame.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.phone-frame--sm { max-width: 240px; }
.phone-screen { width: 100%; overflow: hidden; }
.phone-screen img { width: 100%; height: auto; display: block; }

/* ============================================================
   TICKER
   ============================================================ */
.ticker-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 14px 0;
  background: var(--near);
}
.ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: ticker-scroll 24s linear infinite;
}
.ticker-track span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 20px;
  white-space: nowrap;
}
.ticker-dot {
  width: 4px !important;
  height: 4px !important;
  background: var(--purple) !important;
  border-radius: 50% !important;
  padding: 0 !important;
  flex-shrink: 0;
  display: inline-block;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   CHAPTERS — mobile first (single column)
   ============================================================ */
.chapter { padding: 80px 20px; }

.chapter-layout {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* On mobile: text always comes first, phone below */
.chapter-layout--right { flex-direction: column; }
.chapter-layout--left  { flex-direction: column; }
.chapter-layout--dual  { flex-direction: column; }

.chapter-index {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 16px;
}
.chapter-title {
  font-size: clamp(36px, 8vw, 68px);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--white);
  margin-bottom: 20px;
}
.chapter-title em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
}
.chapter-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--dim);
}
.chapter-phone { display: flex; justify-content: center; }

/* ---------- Detail Card ---------- */
.chapter-detail { margin-top: 28px; }
.detail-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--surface);
}
.detail-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
}
.detail-value {
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--white);
}
.detail-sub { font-size: 0.8125rem; color: var(--muted); }

/* ---------- Stat row ---------- */
.stat-row-editorial {
  display: flex;
  gap: 28px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.stat-ed { display: flex; flex-direction: column; gap: 2px; }
.stat-ed-num {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--white);
  line-height: 1;
}
.stat-ed-pct { font-size: 1.125rem; font-weight: 900; color: var(--white); }
.stat-ed-label {
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ============================================================
   LIVE ACTIVITY BANNER
   ============================================================ */
.live-activity-banner {
  margin: 0 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--near);
  overflow: hidden;
  padding: 48px 24px;
}
.live-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: flex-start;
  position: relative;
}
.live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.live-pulse::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
.live-banner-widget img {
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  border: 1px solid var(--border);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.live-banner-widget img.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   FINAL CTA
   ============================================================ */
.final-cta {
  padding: 100px 20px;
  border-top: 1px solid var(--border);
}
.final-cta-inner { max-width: 900px; }
.final-cta-title {
  font-size: clamp(48px, 11vw, 104px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--white);
  margin-bottom: 24px;
}
.final-cta-title em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
}
.final-cta-sub {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 40px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-left { display: flex; align-items: center; gap: 16px; }
.footer-logo-img { height: 22px; width: auto; display: block; }
.footer-copy { font-size: 0.8125rem; color: var(--muted); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 0.8125rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal-clip {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal-clip.in-view { opacity: 1; transform: translateY(0); }

.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   FOCUS
   ============================================================ */
*:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }

/* ============================================================
   TABLET (640px+)
   ============================================================ */
@media (min-width: 640px) {
  .hero { padding: 96px 32px 72px; }
  .hero-phone .phone-frame { max-width: 320px; }
  .hero-actions { flex-direction: row; align-items: center; }
  .chapter { padding: 100px 32px; }
  .live-activity-banner { margin: 0 24px; padding: 56px 40px; }
}

/* ============================================================
   DESKTOP (1024px+)
   ============================================================ */
@media (min-width: 1024px) {
  #navbar { padding: 0 40px; height: 64px; }
  .nav-logo-img { height: 32px; }
  .nav-links { gap: 32px; }
  .mobile-menu-btn { display: none !important; }
  .nav-links { display: flex !important; }

  /* Hero: left text + right phone */
  .hero { padding: 120px 40px 80px; }
  .hero-layout {
    flex-direction: row;
    align-items: center;
    gap: 80px;
  }
  .hero-text { flex: 1; }
  .hero-phone { flex: 0 0 400px; }
  .hero-phone .phone-frame { max-width: 360px; }
  .hero-actions { flex-direction: row; align-items: center; }

  /* Chapters: row layouts */
  .chapter { padding: 160px 40px; }
  .chapter-layout { flex-direction: row; align-items: center; gap: 80px; }
  .chapter-layout--right { flex-direction: row; }
  .chapter-layout--left  { flex-direction: row; }
  .chapter-layout--right .chapter-text { flex: 1; }
  .chapter-layout--right .chapter-phone { flex: 0 0 360px; }
  .chapter-layout--left .chapter-text { flex: 1; order: 2; }
  .chapter-layout--left .chapter-phone { flex: 0 0 360px; order: 1; }
  .chapter-layout--dual {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 60px;
  }
  .chapter-layout--dual .chapter-text { flex: 0 0 100%; }
  .chapter-layout--dual .chapter-phone { flex: 1; }

  .phone-frame { max-width: 320px; }
  .phone-frame--sm { max-width: 260px; }

  /* Live banner */
  .live-activity-banner { margin: 0 40px; padding: 80px; border-radius: 24px; }
  .live-banner-inner { flex-direction: row; align-items: center; gap: 80px; }
  .live-banner-widget img { width: 320px; }

  /* CTA */
  .final-cta { padding: 160px 40px; }

  /* Footer */
  footer { padding: 32px 40px; }
  .footer-logo-img { height: 26px; }
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
@media (max-width: 1023px) {
  .mobile-menu-btn { display: flex; }
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: rgba(10,10,10,0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    gap: 8px;
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
    z-index: 1001;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links li { 
    width: 100%;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  }
  .nav-links.open li {
    opacity: 1;
    transform: translateX(0);
  }
  .nav-links.open li:nth-child(1) { transition-delay: 0.1s; }
  .nav-links.open li:nth-child(2) { transition-delay: 0.15s; }
  .nav-links.open li:nth-child(3) { transition-delay: 0.2s; }
  .nav-links.open li:nth-child(4) { transition-delay: 0.25s; }

  .nav-links li a {
    display: block;
    padding: 20px 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    border-bottom: 1px solid var(--border);
    color: var(--white);
  }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-links .nav-cta {
    margin-top: 32px;
    display: inline-flex;
    width: auto;
    padding: 16px 32px;
    font-size: 1.125rem;
    border-radius: 100px;
    background: var(--white);
    color: var(--black);
    border: none;
  }
}

/* ============================================================
   TINY PHONES (375px and below)
   ============================================================ */
@media (max-width: 390px) {
  .hero-title { font-size: 52px; }
  .chapter-title { font-size: 32px; }
  .btn-primary { padding: 14px 22px; font-size: 0.875rem; }
  .hero { padding: 72px 16px 48px; }
  .chapter { padding: 72px 16px; }
  .live-activity-banner { margin: 0 12px; padding: 36px 18px; }
  .final-cta { padding: 80px 16px; }
  footer { padding: 24px 16px; }
  .stat-row-editorial { gap: 20px; }
}
