/* ==========================================================================
   Landing page
   ========================================================================== */

.home {
  overflow-x: clip;
}

.home-nav {
  padding: 8px 16px;
  font-size: var(--fs-sm);
}

/* Hero ----------------------------------------------------------------- */

.hero {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 110px) var(--sp-5) var(--sp-8);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin-bottom: var(--sp-5);
}

.hero-code {
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: -0.03em;
  padding: 0 0.18em;
  border-radius: 0.18em;
  color: var(--brand);
  background: var(--brand-soft);
}

.grad {
  background: var(--neon-grad);
  filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.45));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: 54ch;
  margin-bottom: var(--sp-6);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.hero-cta .btn {
  padding: 14px 26px;
  font-size: 1rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin: 0;
}
.stats div {
  display: flex;
  flex-direction: column-reverse;
}
.stats dt {
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
.stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Hero visual ----------------------------------------------------------- */

.hero-visual {
  position: relative;
  min-height: 26rem;
  display: grid;
  place-items: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 38%, transparent), transparent);
  filter: blur(30px);
  opacity: 0.7;
}

.window {
  position: relative;
  width: min(100%, 30rem);
  border-radius: 18px;
  background: var(--code-bg);
  border: 1px solid #ffffff14;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: transform 0.6s var(--ease);
}
.hero-visual:hover .window:not(.mini) {
  transform: perspective(1200px) rotateY(0) rotateX(0);
}

.window.mini {
  position: absolute;
  width: min(78%, 340px);
  right: -4%;
  bottom: 2%;
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateZ(40px);
  animation: bob 6s ease-in-out infinite;
}

.window-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: var(--code-head);
  border-bottom: 1px solid #ffffff0f;
}
.window-head i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.window-head i:nth-child(2) { background: #febc2e; }
.window-head i:nth-child(3) { background: #28c840; }
.window-head span {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #8e97bd;
}

.window-code {
  margin: 0;
  padding: 18px 20px 22px;
  min-height: 250px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--code-text);
  white-space: pre;
  overflow: hidden;
}
.window.mini .window-code {
  min-height: 0;
  font-size: 0.78rem;
  padding: 12px 16px;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--brand);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.float-badge {
  position: absolute;
  z-index: 2;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: bob 5s ease-in-out infinite;
  white-space: nowrap;
}
.float-badge.b1 { top: 2%; left: 4%; }
.float-badge.b2 { top: 12%; right: -2%; animation-delay: -1.2s; }
.float-badge.b3 { bottom: 26%; left: -4%; animation-delay: -2.4s; }
.float-badge.b4 { bottom: -2%; left: 18%; animation-delay: -3.6s; }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

/* How it works -------------------------------------------------------- */

.how {
  max-width: 78rem;
  margin: 0 auto var(--sp-8);
  padding: 0 var(--sp-5);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.how-card {
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.how-card > span {
  font-size: 1.8rem;
  display: block;
  margin-bottom: var(--sp-3);
}
.how-card h3 {
  font-size: 1.1rem;
}
.how-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* Playground teaser ----------------------------------------------------- */

.teaser {
  --mod: #a855f7;
  --mod-2: #22d3ee;
  max-width: 70rem;
  margin: 0 auto var(--sp-7);
  padding: var(--sp-7) var(--sp-5) 0;
}
.teaser-head {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto var(--sp-6);
}
.teaser-head h2 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--sp-3);
}
.teaser-head p {
  color: var(--text-muted);
}
.teaser .demo {
  box-shadow: 0 0 90px -30px #a855f7;
}
.teaser .demo p,
.teaser .demo-hint {
  color: var(--text-muted);
}
.teaser-more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}
.teaser .pg-explain code,
.teaser .demo-hint code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
}

/* Roadmap --------------------------------------------------------------- */

.roadmap {
  max-width: 70rem;
  margin: 0 auto;
  padding: var(--sp-7) var(--sp-5) var(--sp-8);
}

.roadmap-head {
  text-align: center;
  margin-bottom: var(--sp-7);
}
.roadmap-head h2 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--sp-3);
}
.roadmap-head p {
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
}

.filters {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.filter {
  padding: 8px 16px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.filter:hover {
  color: var(--text);
}
.filter.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.path {
  position: relative;
  display: grid;
  gap: var(--sp-5);
}

.path-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  margin-left: -2px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.path-fill {
  display: block;
  width: 100%;
  height: 0;
  background: linear-gradient(#8b5cf6, #06b6d4, #ff2d20, #10b981, #3b82f6, #ef4444, #f43f5e, #6366f1, #ff2d20);
  background-size: 100% 1400px;
}

.level-banner {
  position: relative;
  z-index: 1;
  justify-self: center;
  padding: 8px 20px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  color: var(--text);
  margin: var(--sp-4) 0;
}

.stop {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: center;
  transition: opacity 0.3s;
}

.stop-dot {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 0 0 6px var(--bg), 0 14px 30px -10px var(--c1);
  transform: rotate(-6deg);
  transition: transform 0.4s var(--ease);
}

.stop:hover .stop-dot {
  transform: rotate(0) scale(1.08);
}

.stop-card {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  display: block;
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.stop.right .stop-card {
  grid-column: 3;
}

.stop-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
}

.stop-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--c1) 55%, var(--border));
  box-shadow: 0 26px 50px -26px var(--c1);
}

.stop-top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.stop-icon {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.5rem;
  background: color-mix(in srgb, var(--c1) 16%, transparent);
}

.stop-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.stop-card p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}

.stop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stop-meta span {
  font-size: 0.76rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.stop-meta .go {
  margin-left: auto;
  color: var(--c1);
  background: color-mix(in srgb, var(--c1) 12%, transparent);
  font-weight: 600;
}

.stop.is-dim {
  opacity: 0.18;
}

/* Final CTA ------------------------------------------------------------- */

.final-cta {
  max-width: 56rem;
  margin: 0 auto var(--sp-8);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(500px 240px at 80% 0%, rgba(255, 255, 255, 0.25), transparent 60%),
    linear-gradient(135deg, #7c3aed, #db2777 55%, #0891b2);
  box-shadow: 0 0 80px -20px rgba(168, 85, 247, 0.7);
}
.final-cta h2 {
  font-size: var(--fs-3xl);
}
.final-cta p {
  opacity: 0.9;
  margin-bottom: var(--sp-5);
}
.final-cta .btn {
  background: #fff;
  color: #1a1030;
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.4);
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-visual {
    min-height: 380px;
    margin: 0 var(--sp-5);
  }
  .how {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .path-line {
    left: 28px;
  }
  .stop {
    grid-template-columns: 56px 1fr;
    gap: var(--sp-4);
    align-items: start;
  }
  .stop-dot {
    grid-column: 1;
    width: 52px;
    height: 52px;
  }
  .stop-card,
  .stop.right .stop-card {
    grid-column: 2;
  }
  .level-banner {
    justify-self: start;
  }
  .final-cta {
    margin: 0 var(--sp-4) var(--sp-7);
    padding: var(--sp-7) var(--sp-5);
  }
}

@media (max-width: 560px) {
  .home-nav {
    display: none;
  }
  .hero {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
  .hero-visual {
    margin: 0;
    min-height: 330px;
  }
  .window,
  .window.mini {
    transform: none;
  }
  .window.mini {
    right: 0;
    bottom: -6%;
  }
  .float-badge.b2,
  .float-badge.b3 {
    display: none;
  }
  .how {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 var(--sp-4);
  }
  .teaser {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
  .roadmap {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
  .stats {
    gap: var(--sp-5);
  }
  .stats dd {
    font-size: 1.6rem;
  }
}

/* Phones: calmer hero visual, 2×2 stats */
@media (max-width: 560px) {
  .float-badge {
    display: none;
  }
  .hero-visual {
    min-height: 0;
    display: block;
  }
  .hero-visual::before {
    inset: 10% 0;
  }
  .window-code {
    min-height: 0;
    font-size: 0.76rem;
    padding: 14px 14px 16px;
  }
  .window.mini {
    position: relative;
    right: auto;
    bottom: auto;
    width: 86%;
    margin: -18px 0 0 auto;
    animation: none;
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4);
  }
  .hero-cta .btn {
    flex: 1 1 100%;
  }
  .roadmap-head h2,
  .teaser-head h2,
  .final-cta h2 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }
  .filters {
    display: flex;
    gap: 4px;
  }
  .filter {
    padding: 7px 10px;
    font-size: 0.8rem;
  }
  .stop-card {
    padding: var(--sp-4);
  }
  .stop-icon {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
}

/* Tablets: 2-column how-cards already; give hero visual room */
@media (min-width: 561px) and (max-width: 1000px) {
  .hero-visual {
    max-width: 34rem;
    margin: 0 auto;
    width: 100%;
  }
}
