/* ─────────────────────────────────────────────
   autopunk · home page styles (index.html only)
   Loaded after tokens.css and site.css.
   Shared patterns (banner, grain, star-4, reveal, reset)
   live in site.css — don't duplicate them here.
───────────────────────────────────────────── */

html { overflow-x: hidden; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  background: var(--black);
  color: var(--off-white);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
/* Form/button elements don't inherit font-family by default — explicitly set
   so we never fall back to Arial / system-ui. */
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── RED HERO FRAME ──
   Echoes the logo's red border around a black square.
   Thin, deliberate accent — not a chunky kid-show wrapper. */
.hero-frame {
  background: var(--punk-red);
  padding: 0.5rem;
  position: relative;
}
@media (max-width: 768px) {
  .hero-frame { padding: 0.4rem; }
}

/* Nav and mobile-nav now live in site.css (single source of truth) */

/* ── HERO ──
   Simpler hero = less padding. Previous 4rem+3.5rem was sized for an
   older version with aurora + star cluster + secondary CTA. After the
   strip pass, the hero content is lighter — let the padding match. */
.hero {
  position: relative; overflow: hidden;
  padding: var(--space-2xl) var(--space-2xl) var(--space-xl);
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl); align-items: center;
  background: var(--black);
  border-radius: 12px;
  margin-top: calc(72px + var(--banner-h));
}
.hero-content, .hero-visual { position: relative; z-index: 1; }
.hero-title {
  font-family: var(--disp);
  font-size: clamp(2.4rem, 4.5vw, 3.2rem); font-weight: 400;
  line-height: 1.15; letter-spacing: -0.03em;
  color: var(--off-white); margin-bottom: 1.5rem;
  text-transform: lowercase;
}
.hero-title .accent { color: var(--punk-red); }
.hero-body {
  font-size: clamp(0.95rem, 1.4vw + 0.6rem, 1.05rem);
  font-weight: 400;
  line-height: 1.6; color: var(--off-white);
  max-width: 50ch; margin-bottom: 2rem;
  opacity: 0.92;
}
/* .btn-primary lives in site.css (single source of truth) */

/* ── TERMINAL CARD (hero right) ──
   Sharp corners echo the actual terminal metaphor. Differentiates from
   the heavy-radius panels elsewhere on the page (radius rhythm). */
.terminal-card {
  background: var(--dark-grey);
  border: 1px solid var(--off-white-10);
  border-radius: 0; overflow: hidden;
  width: 100%;
  box-shadow: 6px 6px 0 var(--off-white-10);
}
.terminal-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 8, 6, 0.3);
  border-bottom: 2px solid var(--off-white-10);
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots .dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dots .dot.red { background: var(--punk-red); }
.terminal-dots .dot.yellow { background: var(--rust); }
.terminal-dots .dot.green { background: var(--bone); }
.terminal-title {
  font-family: var(--mono); font-size: 0.8125rem; color: var(--off-white-70);
}
.terminal-body {
  padding: 1.25rem; font-family: var(--mono); font-size: 0.78rem;
  line-height: 1.65; color: var(--off-white-70);
}
.terminal-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-prompt { color: var(--punk-red); font-weight: 700; }
.t-cmd { color: var(--off-white); font-weight: 600; }
.t-flag { color: var(--off-white-40); }
.t-accent { color: var(--punk-red); }
.t-dim { color: var(--off-white-40); }
.terminal-input {
  margin: 0.4rem 0; padding: 0.6rem 0.8rem;
  background: rgba(244, 238, 209, 0.04); border-radius: 0;
  color: var(--off-white); font-size: 0.76rem; line-height: 1.5;
}
.terminal-output {
  margin: 0.5rem 0; padding: 0.75rem 0.8rem;
  background: rgba(212, 74, 74, 0.08); border-radius: 0;
  border: 1px solid rgba(212, 74, 74, 0.22);
  font-size: 0.8125rem; line-height: 1.6; color: var(--off-white-70);
}
.terminal-output div { margin-bottom: 0.15rem; }

/* ── TERMINAL AUTO-PLAY SEQUENCE ──
   Gated by `html.js-terminal-sequence` — only present when JS is on, the
   session hasn't seen the sequence yet, and prefers-reduced-motion is not
   set. Otherwise the static HTML renders in its completed state.

   Architecture:
   - All sequenced nodes start invisible.
   - JS adds .ts-in to each node in order, triggering the reveal transition.
   - The "Drafting..." line animates its braille spinner continuously until
     the output phase starts, at which point it's marked .ts-drafting-done
     which fades + strikes it through.
*/
html.js-terminal-sequence .terminal-body .ts,
html.js-terminal-sequence .terminal-body .ts-child {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 320ms cubic-bezier(.2, .7, .2, 1),
              transform 320ms cubic-bezier(.2, .7, .2, 1);
}
html.js-terminal-sequence .terminal-body .ts.ts-in,
html.js-terminal-sequence .terminal-body .ts-child.ts-in {
  opacity: 1;
  transform: translateY(0);
}

/* Typewriter clip-path wipe for designated long lines — wraps gracefully
   because clip-path wipes across the entire element, multi-line included.
   Feels like a stream rather than a wipe. */
html.js-terminal-sequence .terminal-body .ts-type,
html.js-terminal-sequence .terminal-body .ts-type-child {
  clip-path: inset(0 100% 0 0);
  transition: opacity 120ms linear,
              transform 320ms cubic-bezier(.2, .7, .2, 1),
              clip-path 680ms cubic-bezier(.25, .65, .3, 1);
}
html.js-terminal-sequence .terminal-body .ts-type.ts-in,
html.js-terminal-sequence .terminal-body .ts-type-child.ts-in {
  clip-path: inset(0 0 0 0);
}

/* ── Phase indicators (the braille spinner → ✓ transition) ──
   Each phase line shows a spinner while active. When the phase completes,
   the .phase-done state on its parent snaps the indicator to a red ✓. */
.phase-indicator {
  display: inline-block;
  width: 1.2em;
  font-family: var(--mono);
  color: var(--off-white-40);
  text-align: center;
}
html.js-terminal-sequence .terminal-body .ts.phase-active .phase-indicator {
  color: var(--punk-red);
}
html.js-terminal-sequence .terminal-body .ts.phase-done .phase-indicator {
  color: var(--punk-red);
  font-weight: 700;
}
/* Completed phase lines fade to make the active one clearly dominant. */
html.js-terminal-sequence .terminal-body .ts.phase-done {
  opacity: 0.55 !important;
  transition: opacity 220ms linear;
}

/* Output container reveals as a unit, then its children cascade in.
   Children stay hidden until they get .ts-in even if the parent reveals. */
html.js-terminal-sequence .terminal-body .terminal-output .ts-child {
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 260ms cubic-bezier(.2, .7, .2, 1),
              transform 260ms cubic-bezier(.2, .7, .2, 1);
}
html.js-terminal-sequence .terminal-body .terminal-output .ts-child.ts-in {
  opacity: 1;
  transform: translateY(0);
}
html.js-terminal-sequence .terminal-body .ts-type-child.ts-in {
  clip-path: inset(0 0 0 0);
}
html.js-terminal-sequence .terminal-body .ts-type-child {
  clip-path: inset(0 100% 0 0);
  transition: opacity 120ms linear,
              transform 260ms cubic-bezier(.2, .7, .2, 1),
              clip-path 620ms cubic-bezier(.25, .65, .3, 1);
}

/* Ready line gets a small green punch via color-transition on its text. */
html.js-terminal-sequence .terminal-body .ts[data-ts="5"].ts-in {
  animation: ts-ready-punch 620ms cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes ts-ready-punch {
  0%   { transform: translateY(4px) scale(.96); opacity: 0; }
  60%  { transform: translateY(-1px) scale(1.015); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Safety net: if JS fails to finish, the failsafe class restores everything. */
html.js-terminal-sequence-done .terminal-body .ts,
html.js-terminal-sequence-done .terminal-body .ts-child {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

/* Respect user preference explicitly — the gating class shouldn't even be
   applied under reduced-motion, but double-belt this. */
@media (prefers-reduced-motion: reduce) {
  html.js-terminal-sequence .terminal-body .ts,
  html.js-terminal-sequence .terminal-body .ts-child {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
    animation: none !important;
  }
}

.hero-stars-deco {
  position: absolute; pointer-events: none;
}

/* ── PROBLEM SECTION ──
   Editorial stat strip — no card containers. Hairline dividers between
   items; heavy red rules above + below frame the strip as a single
   composition. Breaks the "three identical cards" SaaS silhouette. */
.problem-section {
  padding: var(--space-3xl) var(--space-2xl);
  max-width: 1200px; margin: 0 auto;
}
.problem-heading-row {
  margin-bottom: var(--space-2xl);
}
.problem-heading-row .stars-row {
  display: flex; align-items: center; gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.section-heading {
  font-family: var(--disp); font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -0.03em;
  color: var(--off-white); text-transform: lowercase;
  max-width: 20ch;
}
.section-heading .accent { color: var(--punk-red); }
.problem-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 2px solid var(--punk-red);
  border-bottom: 2px solid var(--punk-red);
}
.problem-card {
  padding: var(--space-2xl) var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-xs);
}
.problem-card + .problem-card {
  border-left: 1px solid var(--off-white-10);
}
.problem-card-icon { display: none; }
.problem-stat {
  font-family: var(--disp); font-size: clamp(3.2rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.04em; color: var(--punk-red); line-height: 0.95;
  margin-bottom: var(--space-sm);
}
.problem-label {
  font-family: var(--body); font-size: 0.95rem; font-weight: 700;
  color: var(--off-white); letter-spacing: -0.005em;
  line-height: 1.3;
}
.problem-desc {
  font-size: 0.88rem; line-height: 1.55; color: var(--off-white-70);
  max-width: 32ch;
}
@media (max-width: 768px) {
  .problem-cards { grid-template-columns: 1fr; }
  .problem-card + .problem-card {
    border-left: none;
    border-top: 1px solid var(--off-white-10);
  }
  .problem-card { padding: var(--space-lg) 0; }
}

/* ── PRODUCT SECTION (The Pitch Doctor) ──
   Full-width. Heading row above + single centered product-card.
   This is the conversion section — it gets the most visual weight. */
.product-section {
  padding: var(--space-4xl) var(--space-2xl);
  max-width: 780px; margin: 0 auto;
  border-top: 2px solid var(--off-white-10);
}
.product-heading-row {
  margin-bottom: var(--space-2xl);
}

/* ── SKILLS SECTION (demoted) ──
   Smaller, comes after product. Signals "also at autopunk" not "co-lead".
   Ghost CTA on the GitHub link — never competes with the beta CTA. */
.skills-section {
  padding: var(--space-3xl) var(--space-2xl);
  max-width: 1100px; margin: 0 auto;
  border-top: 1px solid var(--off-white-10);
}
.skills-heading-row {
  margin-bottom: var(--space-lg);
}
.sp-eyebrow {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--punk-red); margin-bottom: 0.75rem;
}
.sp-heading {
  font-family: var(--disp); font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400; line-height: 1.15; letter-spacing: -0.03em;
  color: var(--off-white); margin-bottom: 1rem;
  text-transform: lowercase;
}
.sp-desc {
  font-size: 0.88rem; line-height: 1.6; color: var(--off-white-70);
  margin-bottom: 1.5rem;
}
/* 3-col grid with one featured anchor tile spanning 2 cols on the first
   row. Drops to 2 cols on narrow, 1 col on very narrow. Featured tile
   carries a sample prompt snippet — gives the eye something to land on. */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}
@media (max-width: 640px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .skills-grid { grid-template-columns: 1fr; }
}
.skill-tile {
  background: var(--dark-grey);
  border: 1px solid var(--off-white-10);
  border-radius: 0; padding: var(--space-sm) var(--space-md);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs);
  cursor: default;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.skill-tile:hover {
  border-color: var(--punk-red);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--punk-red);
}
.skill-tile.skill-tile-featured {
  grid-column: span 2;
  padding: var(--space-md) var(--space-lg);
  background: var(--punk-red);
  border-color: var(--punk-red);
  flex-direction: column; align-items: flex-start; gap: var(--space-xs);
}
@media (max-width: 640px) {
  .skill-tile.skill-tile-featured { grid-column: span 2; }
}
@media (max-width: 380px) {
  .skill-tile.skill-tile-featured { grid-column: span 1; }
}
.skill-tile-featured .skill-tile-name { color: var(--black); }
.skill-tile-featured .skill-tile-example { color: rgba(10, 8, 6, 0.7); }
.skill-tile-featured-snippet {
  font-family: var(--mono); font-size: 0.75rem;
  line-height: 1.5; color: rgba(10, 8, 6, 0.85);
  margin-top: var(--space-2xs);
  font-weight: 500;
}
.skill-tile-featured-snippet strong { color: var(--black); font-weight: 700; }
.skill-tile-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--punk-red); opacity: 0.7;
}
.skill-tile-name {
  font-family: var(--body); font-size: 0.82rem; font-weight: 600;
  color: var(--off-white); line-height: 1.35; flex: 1;
  letter-spacing: 0.005em;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.skill-tile-example {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--off-white-70);
  font-weight: 400;
}

/* Pipeline steps */
.pipeline-steps {
  display: flex; flex-direction: column; gap: 1rem;
}

/* ── PRODUCT CARDS ── */
.product-card {
  background: var(--dark-grey);
  border: 3px solid var(--punk-red);
  border-radius: 12px;
  padding: clamp(1.1rem, 3vw, 2rem);
  display: flex; flex-direction: column; gap: 1rem;
  position: relative; overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.product-card:hover {
  box-shadow: 4px 4px 0 var(--punk-red);
  transform: translate(-2px, -2px);
}
.product-banner {
  position: absolute; top: 0; right: 0;
  background: var(--punk-red); color: var(--black);
  font-family: var(--mono); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.4rem 0.85rem;
}
/* Reserve top clearance on narrow screens so the ribbon never overlaps
   "The Pitch Doctor" heading. */
@media (max-width: 520px) {
  .product-card { padding-top: 2.75rem; }
  .product-banner {
    left: 0; right: auto;
    font-size: 0.7rem; padding: 0.35rem 0.75rem;
  }
}
.product-header {
  display: flex; align-items: center; gap: 1rem;
}
.product-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--punk-red);
}
.product-name {
  font-family: var(--disp); font-size: 1.3rem; font-weight: 400;
  color: var(--off-white); line-height: 1.15;
}
.product-name small {
  display: block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--punk-red); margin-bottom: 0.2rem;
  font-family: var(--body);
}
.product-desc {
  font-size: 0.88rem; line-height: 1.6; color: var(--off-white-70);
}
.pipeline-cta {
  margin-top: 1.5rem;
}
.btn-outline {
  padding: 0.85rem 1.5rem; min-height: 44px;
  background: transparent; color: var(--punk-red);
  font-family: var(--body); font-size: 0.85rem; font-weight: 600;
  border: 2px solid var(--punk-red); border-radius: 0;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--punk-red); color: var(--black); }

/* Footer now lives in site.css (single source of truth) */

/* ── SKIP LINK (home-specific, larger and branded) ── */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--punk-red); color: var(--black);
  padding: 0.85rem 1.4rem; border-radius: 0 0 8px 8px;
  font-family: var(--disp); font-size: 0.9rem; font-weight: 400;
  min-height: 44px; display: inline-flex; align-items: center;
  z-index: 9999; transition: top 0.15s; text-decoration: none;
}
.skip-link:focus { top: 0; }
/* Global focus-visible lives in site.css so every page gets a ring. */
section[id], main { scroll-margin-top: 80px; }

/* Mobile nav now lives in site.css (single source of truth) */

/* ── RESPONSIVE ──
   Terminal card STAYS on mobile — it's the strongest proof on the page.
   Podcast producers on phones need to see the peak moment. */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-lg); }
}
@media (max-width: 700px) {
  .terminal-body { padding: 1rem; font-size: 0.8125rem; }
  .terminal-header { padding: 0.6rem 1rem; }
}
@media (max-width: 768px) {
  /* Nav + footer mobile rules live in site.css */
  .hero { padding: calc(120px + var(--banner-h)) var(--space-lg) var(--space-3xl); margin-top: 0; }
  .product-section { padding: var(--space-3xl) var(--space-lg); }
  .skills-section { padding: var(--space-2xl) var(--space-lg); }
  .problem-section { padding: var(--space-3xl) var(--space-lg); }
}
/* .skills-grid now uses auto-fit — no explicit 480px rule needed */
