/* =========================================================
   Landing page. Loads after landing.css (shared tokens, nav,
   buttons, footer, task cards).

   The hero shows the product rather than a metaphor for it: a run
   in miniature, revealed step by step. Colour carries the same roles
   as the demo - gold the Leader and the answer, cyan routing, emerald
   a measurement, violet what you can click.
   ========================================================= */

.home {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4.5vw, 64px) 96px;
  box-sizing: border-box;
}

/* ---------- Full-Height Single-Page Hero (defined in Full-Viewport Overrides below) ---------- */

.galaxy-crack-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-kicker {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.2vw, 0.88rem);
  letter-spacing: 0.1em;
  color: var(--violet);
  text-transform: uppercase;
}

.home-title {
  margin: 0 0 26px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #f8fafc;
  max-width: 18ch;
  text-wrap: balance;
  text-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

.home-lead {
  margin: 0 0 38px;
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.7;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.home-note {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.86rem;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  transition: all 0.25s ease;
}

.hero-scroll-hint:hover {
  color: var(--cyan);
  transform: translateX(-50%) translateY(3px);
}

.scroll-arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bounceDown 2s infinite ease-in-out;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.nav-link-btn {
  background: none;
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link-btn:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: var(--violet);
  color: #fff;
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.35);
}

/* =========================================================
   HOLLYWOOD-GRADE SCI-FI CINEMATIC CANVAS INTRO
   ========================================================= */
.cinema-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #020309;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinema-intro.fade-out {
  opacity: 0;
  pointer-events: none;
  filter: brightness(2.5) blur(16px);
  transform: scale(1.1);
}

#cinema-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.cinema-anamorphic {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 70% at 50% 50%, transparent 45%, rgba(2, 3, 9, 0.88) 100%),
    linear-gradient(180deg, rgba(2, 3, 9, 0.45) 0%, transparent 15%, transparent 85%, rgba(2, 3, 9, 0.6) 100%);
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.9);
}

.cinema-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 4vw, 44px);
  font-family: var(--mono);
  color: var(--muted);
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: rgba(234, 238, 252, 0.5);
}

.hud-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-weight: 500;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: hudBlink 1.4s infinite ease-in-out;
}

@keyframes hudBlink {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}

.cinema-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 860px;
  padding: 18px 24px;
  border-radius: 20px;
  background: radial-gradient(ellipse 75% 65% at 50% 50%, rgba(2, 3, 9, 0.76) 0%, transparent 100%);
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}

.cinema-title {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.95), 0 0 32px rgba(167, 139, 250, 0.45);
}

.cinema-subtitle {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9), 0 0 14px rgba(251, 191, 36, 0.5);
  font-weight: 500;
}

.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
}

.hud-coords {
  color: var(--dim);
}

.cinema-skip-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cinema-skip-btn:hover {
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.6);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}

.cinema-skip-btn kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.68rem;
}

/* ---------- Sections ---------- */
.home-section {
  padding-top: clamp(56px, 9vh, 104px);
}

.home h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.home-section-lead {
  margin: 0 0 28px;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.7;
}

/* Four steps of one sequence: a numbered rail, not four cards. */
.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 32px 0 0;
  padding: 28px 0 0;
  list-style: none;
  border-top: 1px solid var(--border);
  counter-reset: flow;
}

.flow li {
  counter-increment: flow;
  min-width: 0;
}

.flow-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow h3 {
  margin: 0 0 8px;
  font-family: var(--body);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--ink);
}

.flow h3::before {
  content: "0" counter(flow);
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--muted);
}

.flow p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.97rem;
}

/* The engine: four pillars in display type, then three claims. No cards -
   hairlines and type carry it. */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 32px 0 0;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pillars div {
  min-width: 0;
}

.pillars dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.pillars dd {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.creed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.creed h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.creed p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.97rem;
}

/* ---------- Close ---------- */
.home-close {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
  margin-top: clamp(56px, 9vh, 104px);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(124, 58, 237, 0.1), rgba(34, 211, 238, 0.04));
}

.home-close h2 {
  margin-bottom: 8px;
}

.home-close p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.7;
}

.home-close cite {
  color: var(--ink);
  font-style: italic;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-title {
    max-width: 20ch;
  }

  .flow,
  .pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 36px;
  }

  .creed {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillars {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
  }

  .creed {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .replay.is-animated [data-step],
  .replay.is-animated .replay-beat .beat-bar i {
    transition: none;
  }
}

/* =========================================================
   COSMIC HERO - FULL-VIEWPORT OVERRIDES
   ========================================================= */

/* Prevent the full-width hero from creating horizontal scroll */
html,
body {
  overflow-x: hidden;
  
}

/* Full viewport-width hero */
.home-hero.full-height {
  position: relative;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: clamp(40px, 8vh, 80px) clamp(20px, 4vw, 40px) clamp(60px, 10vh, 100px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  
}

/* Full-width animation layer */
.home-hero.full-height .galaxy-crack-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  display: block;
  margin: 0;
  padding: 0;
  pointer-events: none;
  z-index: 1;
}

/* Text and buttons above the canvas */
.home-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Scroll indicator above the canvas */
.home-hero .hero-scroll-hint {
  z-index: 2;
}