/* ═══════════════════════════════════════════════
   UNDRUNK — styles.css
   Design language: editorial authority + earned relief
   Palette: dark opening → paper arrival
   Type: Fraunces (display) · Inter (body) · DM Mono (meta)
═══════════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
  --dark:         #0D0D0D;
  --dark-2:       #161616;
  --paper:        #F4F3EF;
  --paper-2:      #EDECEA;
  --white:        #FFFFFF;
  --ink:          #1A1A1A;
  --ink-2:        #3D3D3D;
  --muted:        #888888;
  --rule:         #DEDAD3;
  --rule-2:       #C8C4BC;
  --indigo:       #19196B;
  --indigo-2:     #2626A0;
  --indigo-pale:  #EBEBF7;
  --indigo-ghost: rgba(25,25,107,0.06);

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-mid:    0.3s ease;
  --t-slow:   0.6s ease;
  --t-spring: 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── RESET ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--dark);
  overflow-x: hidden;
  transition: background 1.4s ease;
}

body.arrived {
  background: var(--paper);
}

/* ─── TYPOGRAPHY SCALE ─── */
.f-display {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.03em;
}

.f-mono {
  font-family: 'DM Mono', 'Courier New', monospace;
}

/* ─── NAV ─── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 300;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(13,13,13,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--t-slow), background var(--t-slow);
}

.nav.light {
  border-color: var(--rule);
  background: rgba(244,243,239,0.92);
}

.nav-logo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: color var(--t-slow);
}

.nav.light .nav-logo { color: var(--ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  transition: color var(--t-fast);
}

.nav.light .nav-links a { color: var(--muted); }
.nav-links a:hover { color: rgba(255,255,255,0.85); }
.nav.light .nav-links a:hover { color: var(--ink); }

.nav-cta {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--white) !important;
  background: var(--indigo);
  padding: 7px 20px;
  text-decoration: none;
  transition: background var(--t-fast) !important;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--indigo-2) !important; }

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0 52px;
  position: relative;
  overflow: hidden;
}

/* Atmospheric gradient — weight made visible */
.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(25,25,107,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 15%,  rgba(25,25,107,0.09) 0%, transparent 55%);
}

/* Fine grain texture */
.hero-atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 88px;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 36px;
  opacity: 0;
  animation: riseIn 0.7s var(--t-spring) forwards 0.5s;
}

.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(3rem, 7.5vw, 8.5rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  color: #fff;
  margin-bottom: 0;
}

/* Line-by-line reveal — working up to saying something */
.hero-line {
  display: block;
  overflow: hidden;
}

.hero-line-inner {
  display: block;
  opacity: 0;
  transform: translateY(105%);
}

.hero-line:nth-child(1) .hero-line-inner {
  animation: lineReveal 1s var(--t-spring) forwards 0.7s;
}

.hero-line:nth-child(2) .hero-line-inner {
  animation: lineReveal 1s var(--t-spring) forwards 0.92s;
  font-style: italic;
  color: rgba(255,255,255,0.42);
}

.hero-line:nth-child(3) .hero-line-inner {
  animation: lineReveal 1s var(--t-spring) forwards 1.16s;
  font-size: 0.48em;
  font-weight: 300;
  color: rgba(255,255,255,0.2);
  letter-spacing: -0.01em;
  padding-top: 18px;
}

.hero-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 0;
  margin-top: 60px;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: riseIn 0.7s var(--t-spring) forwards 1.4s;
}

.hero-sub {
  font-size: 0.98rem;
  line-height: 1.78;
  color: rgba(255,255,255,0.3);
  max-width: 380px;
  font-weight: 300;
}

.hero-sub em {
  color: rgba(255,255,255,0.55);
  font-style: normal;
}

.hero-scroll {
  position: relative;
  z-index: 1;
  padding: 28px 0 36px;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: riseIn 0.5s ease forwards 1.9s;
}

.scroll-track {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-track::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.6), transparent);
  animation: scrollDrop 2s ease-in-out infinite 2.2s;
}

/* ─── PRIMARY BUTTON ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.83rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform var(--t-fast), background var(--t-fast), opacity var(--t-fast);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--indigo);
  color: var(--white);
  padding: 14px 28px;
}

.btn-primary:hover {
  background: var(--indigo-2);
  transform: translateY(-2px);
}

.btn-ghost-dark {
  color: rgba(255,255,255,0.38);
  border-bottom: 1px solid rgba(255,255,255,0.18);
  padding-bottom: 1px;
  background: transparent;
  font-size: 0.78rem;
}

.btn-ghost-dark:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.45); }

.btn-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform var(--t-fast);
}

.btn-primary:hover .btn-arrow { transform: translateX(3px); }

/* ─── TICKER ─── */
.ticker {
  background: var(--indigo);
  padding: 9px 0;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.ticker-track {
  display: inline-flex;
  animation: tickerScroll 36s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  font-family: 'DM Mono', monospace;
  font-size: 0.61rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  padding: 0 28px;
  flex-shrink: 0;
}

.ticker-item::after {
  content: '—';
  margin-left: 28px;
  color: rgba(255,255,255,0.18);
}

/* ─── SHARED SECTION WRAPPER ─── */
.section {
  position: relative;
}

.section-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 52px;
}

/* ─── STATS ─── */
.stats-section {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat-block {
  padding: 60px 52px;
  border-right: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.stat-block:last-child { border-right: none; }

/* Hover fill — psychological weight */
.stat-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--indigo-ghost);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s var(--t-spring);
}

.stat-block:hover::before { transform: scaleY(1); }

.stat-num {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--indigo);
  display: block;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 200px;
  position: relative;
  z-index: 1;
}

/* ─── TYPEWRITER SECTION ─── */
.tw-section {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 96px 52px;
}

.tw-inner { max-width: 900px; }

.section-kicker {
  font-family: 'DM Mono', monospace;
  font-size: 0.61rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  display: block;
}

.tw-display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.7rem, 3.8vw, 3.2rem);
  line-height: 1.28;
  color: var(--ink);
  min-height: 2.8em;
}

.tw-prefix { color: var(--muted); }

.tw-typed { color: var(--ink); }

.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.82em;
  background: var(--indigo);
  margin-left: 2px;
  vertical-align: middle;
  animation: cursorBlink 1s step-end infinite;
}

/* ─── PAIN POINTS ─── */
.pain-section {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 96px 52px;
}

.pain-head {
  margin-bottom: 52px;
}

.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-top: 12px;
  max-width: 520px;
}

/* Classified register — situations listed as facts, not sold */
.pain-register {
  width: 100%;
  border: 1px solid var(--rule);
  border-collapse: collapse;
}

.pain-entry {
  display: grid;
  grid-template-columns: 128px 1fr 1.2fr;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast);
}

.pain-entry:last-child { border-bottom: none; }

/* Active indicator bar */
.pain-entry::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--indigo);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--t-spring);
}

.pain-entry.active { background: var(--indigo-pale); }
.pain-entry.active::before { transform: scaleY(1); }
.pain-entry:hover:not(.active) { background: var(--white); }

.pain-entry:hover::before { transform: scaleY(0.5); opacity: 0.4; }
.pain-entry.active:hover::before { transform: scaleY(1); opacity: 1; }

.entry-cell {
  padding: 22px 30px;
  border-right: 1px solid var(--rule);
}

.entry-cell:last-child { border-right: none; }

.entry-cat {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.entry-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.entry-desc {
  font-size: 0.79rem;
  line-height: 1.62;
  color: var(--muted);
}

/* ─── TOOL ─── */
.tool-section {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 96px 52px;
}

.tool-inner { max-width: 680px; }

.tool-kicker {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--indigo);
  min-height: 1.4em;
  margin-bottom: 10px;
  transition: opacity var(--t-mid);
}

.tool-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 36px;
}

/* Form */
.form-stack { display: flex; flex-direction: column; gap: 18px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

textarea,
select {
  font-family: 'Inter', sans-serif;
  font-size: 0.87rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 0;
  padding: 11px 14px;
  width: 100%;
  outline: none;
  appearance: none;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}

textarea:focus,
select:focus {
  border-color: var(--indigo);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(25,25,107,0.07);
}

textarea { resize: vertical; min-height: 122px; }

select option { background: var(--white); }

/* Character count */
.char-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  transition: color var(--t-fast);
}

.char-count.warm { color: var(--indigo); }

.btn-generate {
  background: var(--indigo);
  color: var(--white);
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.83rem;
  letter-spacing: 0.01em;
  padding: 13px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-mid);
}

/* Shimmer on hover */
.btn-generate::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
}

.btn-generate:not(:disabled):hover { background: var(--indigo-2); transform: translateY(-1px); }
.btn-generate:not(:disabled):hover::after { left: 120%; }
.btn-generate:disabled { opacity: 0.28; cursor: not-allowed; }

/* ─── LOADING ─── */
.loader {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.loader.on { display: flex; }

.loader-dots { display: flex; gap: 5px; }

.loader-dots span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--indigo);
  animation: dotPulse 1.3s ease infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.18s; }
.loader-dots span:nth-child(3) { animation-delay: 0.36s; }

/* ─── OUTPUT ─── */
.output {
  margin-top: 40px;
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--indigo);
  padding: 32px;
  background: var(--paper);
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.output.on  { display: block; }
.output.vis { opacity: 1; transform: translateY(0); }

.output-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 16px;
}

.output-text {
  font-size: 0.91rem;
  line-height: 1.88;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.output-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-sm {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 18px;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.btn-sm:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-sm.filled { background: var(--indigo); color: var(--white); border-color: var(--indigo); }
.btn-sm.filled:hover { background: var(--indigo-2); }

/* ─── MANIFESTO BAND ─── */
.manifesto-band {
  background: var(--indigo);
  padding: 108px 52px;
  position: relative;
  overflow: hidden;
}

/* Atmospheric grain on the dark band */
.manifesto-band::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  pointer-events: none;
}

.manifesto-grid {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 88px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.manifesto-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.55rem, 2.8vw, 2.4rem);
  line-height: 1.38;
  letter-spacing: -0.015em;
  color: rgba(255,255,255,0.88);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.manifesto-quote.vis { opacity: 1; transform: translateY(0); }

.manifesto-aside p {
  font-size: 0.88rem;
  line-height: 1.82;
  color: rgba(255,255,255,0.4);
  font-weight: 300;
  margin-bottom: 28px;
}

.btn-ghost-light {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.52);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 2px;
  transition: color var(--t-fast), border-color var(--t-fast);
  display: inline-block;
}

.btn-ghost-light:hover { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.5); }

/* ─── FOOTER ─── */
.footer {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 26px 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ─── MANIFESTO PAGE ─── */
.manifesto-page {
  display: none;
  background: var(--paper);
  min-height: 100vh;
  padding: 112px 52px 96px;
}

.manifesto-page.on { display: block; }

.manifesto-page-inner { max-width: 640px; }

.back-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--indigo);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 64px;
  display: inline-block;
  transition: opacity var(--t-fast);
}

.back-btn:hover { opacity: 0.55; }

.manifesto-h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 64px;
}

.manifesto-h1 em {
  font-style: italic;
  color: var(--indigo);
}

.manifesto-page-inner p {
  font-size: 0.97rem;
  line-height: 1.9;
  color: var(--ink-2);
  font-weight: 300;
  margin-bottom: 24px;
}

.manifesto-page-inner p strong {
  color: var(--ink);
  font-weight: 500;
}

.manifesto-page-inner blockquote {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.32rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 52px 0;
  padding-left: 24px;
  border-left: 2px solid var(--indigo);
}

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.65s cubic-bezier(0.16,1,0.3,1),
    transform 0.65s cubic-bezier(0.16,1,0.3,1);
}

.reveal.on { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.09s; }
.delay-2 { transition-delay: 0.18s; }
.delay-3 { transition-delay: 0.27s; }

/* ─── HOME TOGGLE ─── */
.home-wrap.off { display: none; }

/* ─── KEYFRAMES ─── */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes lineReveal {
  from { opacity: 0; transform: translateY(105%); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes scrollDrop {
  0%   { top: -100%; opacity: 0; }
  30%  { opacity: 1; }
  100% { top: 200%; opacity: 0; }
}

@keyframes cursorBlink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

@keyframes dotPulse {
  0%,100% { opacity: 0.2; transform: scale(0.7); }
  50%      { opacity: 1;   transform: scale(1.3); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-block:last-child { grid-column: 1/-1; border-right: none; border-top: 1px solid var(--rule); }
  .manifesto-grid { grid-template-columns: 1fr; gap: 44px; }
  .pain-entry { grid-template-columns: 110px 1fr; }
  .pain-entry .entry-cell:last-child { display: none; }
}

@media (max-width: 640px) {
  .nav { padding: 0 20px; }
  .nav-links li:not(:last-child) { display: none; }
  .hero { padding: 0 24px; }
  .hero-footer { padding-bottom: 32px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-block { border-right: none; border-bottom: 1px solid var(--rule); }
  .stat-block:last-child { border-bottom: none; }
  .tw-section,
  .pain-section,
  .tool-section,
  .manifesto-band { padding: 64px 24px; }
  .pain-entry { grid-template-columns: 1fr; }
  .pain-entry .entry-cell:first-child { border-right: none; padding-bottom: 4px; }
  .pain-entry .entry-cell:last-child { display: none; }
  .entry-cell { padding: 16px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .footer { padding: 24px; flex-direction: column; text-align: center; }
  .manifesto-page { padding: 96px 24px 64px; }
}

/* ═══════════════════════════════════════
   NEW COMPONENT STYLES — v2 input-first
═══════════════════════════════════════ */

/* ── HERO ── */
.hero {
  padding: 100px 52px 72px;
  border-bottom: 1px solid var(--rule);
}

.hero-inner { max-width: 680px; }

.hero-kicker {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--indigo);
  display: block;
  margin-bottom: 16px;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 16px;
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--indigo);
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
}

/* ── TOOL SECTION ── */
.tool-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 52px 96px;
}

.tool-inner { display: flex; flex-direction: column; gap: 0; }

/* Label */
.tool-label {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: block;
  margin-bottom: 12px;
}

/* Main textarea */
.tool-textarea {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule-2);
  padding: 16px 18px;
  resize: vertical;
  outline: none;
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tool-textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(25,25,107,0.06);
}

.tool-textarea.small { font-size: 0.88rem; min-height: 80px; }

.char-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: right;
  margin-top: 5px;
  margin-bottom: 28px;
}

/* ── EXAMPLES ── */
.examples-wrap { margin-bottom: 32px; }

.examples-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.example-pill {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-2);
  background: var(--white);
  border: 1px solid var(--rule-2);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.12s;
  border-radius: 0;
}

.example-pill:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-pale);
}

/* ── OPTION GROUPS ── */
.option-group { margin-bottom: 24px; }

.option-group-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-pill {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-2);
  background: var(--white);
  border: 1px solid var(--rule-2);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.12s;
  border-radius: 0;
}

.option-pill:hover { border-color: var(--indigo); color: var(--indigo); }

.option-pill.active {
  background: var(--indigo);
  color: var(--white);
  border-color: var(--indigo);
}

/* ── GENERATE BUTTON ── */
.generate-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--indigo);
  color: var(--white);
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 16px 28px;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}

.btn-generate:hover { background: var(--indigo-2); }
.btn-generate:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-generate.secondary {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  margin-top: 10px;
}

.btn-generate.secondary:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-pale); }

.btn-shortcut {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  opacity: 0.45;
  letter-spacing: 0.05em;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  justify-content: center;
}

.tool-error {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #C0392B;
  margin-top: 8px;
  display: none;
}

/* ── OUTPUT ── */
.tool-output-wrap {
  margin-top: 40px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.output-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.output-actions { display: flex; gap: 8px; align-items: center; }

.btn-action {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  padding: 8px 20px;
  background: var(--indigo);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-action:hover { background: var(--indigo-2); }
.btn-action.copied { background: #1a7a3a; }

.btn-action-ghost {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  transition: color 0.15s;
}

.btn-action-ghost:hover { color: var(--ink); }

.output-box {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--indigo);
  padding: 24px 28px;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink-2);
  font-weight: 300;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 20px;
  font-family: 'Inter', sans-serif;
}

/* ── REALITY CHECK ── */
.reality-check {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.reality-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--indigo);
  display: block;
  margin-bottom: 8px;
}

.reality-text {
  font-size: 0.82rem;
  color: var(--ink-2);
  font-weight: 300;
  line-height: 1.6;
}

/* ── QUICK REWRITES ── */
.rewrite-section { margin-bottom: 24px; }

.rewrite-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.rewrite-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rewrite-pill {
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--ink-2);
  background: var(--white);
  border: 1px solid var(--rule-2);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.12s;
  border-radius: 0;
}

.rewrite-pill:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

/* ── PREDICTION ── */
.prediction-section { margin-bottom: 24px; }

.prediction-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
}

.prediction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.prediction-card {
  background: var(--white);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prediction-reaction {
  font-size: 0.78rem;
  color: var(--ink-2);
  font-weight: 400;
  line-height: 1.4;
}

.prediction-reply {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.5;
  font-style: italic;
}

.btn-use-reply {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--indigo);
  background: none;
  border: 1px solid rgba(25,25,107,0.2);
  padding: 5px 10px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.12s;
  margin-top: 4px;
}

.btn-use-reply:hover { background: var(--indigo-pale); border-color: var(--indigo); }

/* ── FOLLOW-UP ── */
.followup-section { margin-bottom: 24px; }

.btn-followup-toggle {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule-2);
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.12s;
  width: 100%;
  text-align: left;
}

.btn-followup-toggle:hover { border-color: var(--indigo); color: var(--indigo); }

.followup-input-wrap { padding-top: 14px; }

/* ── PAST CONVERSATIONS ── */
.past-section {
  border-top: 1px solid var(--rule);
  padding: 52px;
}

.past-inner { max-width: 780px; margin: 0 auto; }

.past-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 20px;
}

.past-item {
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.1s;
}

.past-item:first-child { border-top: 1px solid var(--rule); }
.past-item:hover { background: var(--white); }

.past-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.past-situation {
  font-size: 0.82rem;
  color: var(--ink-2);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.past-format {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

/* ── MANIFESTO BAND ── */
.manifesto-band {
  background: var(--indigo);
  padding: 64px 52px;
  text-align: center;
}

.manifesto-text {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.75);
  max-width: 640px;
  margin: 0 auto;
}

/* ── USES NAV LABEL ── */
.uses-nav-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero { padding: 80px 24px 52px; }
  .tool-section { padding: 40px 24px 72px; }
  .prediction-grid { grid-template-columns: 1fr; }
  .past-section { padding: 40px 24px; }
  .past-item { grid-template-columns: 50px 1fr; }
  .past-format { display: none; }
  .manifesto-band { padding: 48px 24px; }
}

/* ═══════════════════════════════════════
   MISSING CLASSES — bug fix patch
═══════════════════════════════════════ */

/* .tool-step — wrapper for the input step */
.tool-step {
  width: 100%;
}

/* .tool-input-wrap — wrapper around textarea + char count */
.tool-input-wrap {
  width: 100%;
  margin-bottom: 4px;
}

/* .past-list — container for past conversation rows */
.past-list {
  width: 100%;
}

/* .footer-links — nav links in footer */
.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-links a {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--ink);
}
