/* Landing page only. Shared tokens, buttons, header and footer live in styles.css. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Gradients and masks shared by every stage drawing. */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Needs scripts (the gallery draws its stages with them). */
.js-only { display: none; }
.js .js-only { display: grid; }

.banner { max-width: var(--page); margin: 0 auto; padding: 16px 20px 0; }

section[id] { scroll-margin-top: 72px; }

/* Sections ------------------------------------------------------------------------------- */

.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.band { background: var(--ink-2); border-block: 1px solid var(--line); }
.section h2 { font-size: clamp(2.25rem, 4.6vw, 3.5rem); }
.section-lead { font-size: var(--step-1); max-width: 56ch; margin: 0 0 8px; }
.lead { font-size: var(--step-1); color: #c6d0f0; max-width: 40ch; }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 72px; }
  .split-head { position: sticky; top: 96px; align-self: start; }
}

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

.hero { padding: clamp(28px, 4vw, 56px) 0 clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.hero h1 {
  font-size: clamp(2.9rem, 12.5vw, 4.6rem);
  line-height: 0.96;
  margin-bottom: 0.32em;
}
.hero h1 .line { display: block; }
.hero-copy .lead { margin-bottom: 0; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-ctas .fine { flex-basis: 100%; margin: 6px 0 0; font-size: var(--step--1); }

.demo { order: 2; }
.stage-note { order: 3; }
.hero-ctas { order: 4; }
@media (max-width: 480px) {
  .hero-ctas .btn { flex: 1 1 100%; }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); column-gap: 56px; row-gap: 20px; }
  .hero h1 { font-size: clamp(3.3rem, 5.9vw, 4.8rem); }
  .hero-copy { grid-column: 1; grid-row: 1; align-self: end; }
  .hero-ctas { grid-column: 1; grid-row: 2; align-self: start; margin-top: 12px; }
  .demo { grid-column: 2; grid-row: 1 / span 2; }
  .stage-note { grid-column: 2; grid-row: 3; }
}

.demo {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, 0.7);
}

.prompt { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.prompt-field { position: relative; flex: 1; min-width: 0; }
.prompt-field input {
  margin: 0;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
}
.prompt-field input::placeholder { color: #8e9ac5; opacity: 1; }
.prompt-field.demoing input::placeholder { color: transparent; }
.prompt-demo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 17px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 2px;
  background: var(--yellow);
  animation: caret 1.05s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.prompt .btn { min-height: 46px; padding-inline: 22px; }

.stage-frame { position: relative; aspect-ratio: 4 / 3; background: #0c1738; }
.stage-svg { display: block; width: 100%; height: 100%; }

.thinking {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 14px;
  border-radius: 999px;
  background: rgba(11, 20, 48, 0.86);
  border: 1px solid var(--line);
  font-size: var(--step--1);
  font-weight: 600;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.thinking.on { opacity: 1; transform: none; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); }
.thinking.on .dots i { animation: dot 0.9s ease-in-out infinite; }
.thinking.on .dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking.on .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

.timeline { display: flex; align-items: center; gap: 14px; padding: 13px 16px 14px; border-top: 1px solid var(--line); }
.tl-track { position: relative; flex: 1; height: 6px; border-radius: 99px; background: var(--ink-3); }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--blue); }
.timeline.playing .tl-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.35);
}
.tl-key {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: var(--yellow);
}
.tl-time { min-width: 86px; text-align: right; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline.busy .tl-track { overflow: hidden; }
.timeline.busy .tl-track::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  border-radius: 99px;
  background: var(--blue);
  opacity: 0.7;
  animation: busy 1s ease-in-out infinite;
}
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.stage-note { margin: 4px 4px 0; font-size: var(--step--1); max-width: none; }
@media (min-width: 960px) { .stage-note { margin-top: 0; } }

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

.steps { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: step; border-top: 1px solid var(--line); }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--line);
}
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-stretch: 78%;
  font-size: 2rem;
  line-height: 1;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}
.step:nth-child(2)::before { background: var(--blue); }
.step:nth-child(3)::before { background: var(--green); }
.step-text h3 { font-size: var(--step-3); margin-bottom: 0.25em; }
.step-text p { margin: 0; font-size: var(--step-1); }
.step-art {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--ink-2);
  padding: 10px;
  max-width: 340px;
}
.step-art svg { display: block; width: 100%; height: auto; }
@media (min-width: 760px) {
  .step { grid-template-columns: 72px minmax(0, 1fr) 320px; gap: 32px; align-items: center; padding: 36px 0; }
  .step::before { width: 72px; height: 72px; border-radius: 18px; font-size: 2.6rem; }
  .step-art { grid-column: auto; }
}

.mock { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 14px; }
.mock-field {
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--text);
  font-size: 0.95rem;
}
.mock .caret { height: 1em; vertical-align: -2px; animation: none; }
.mock-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--ink-3);
  color: #c6d0f0;
  font-size: 0.8125rem;
  font-weight: 600;
}
.chip.hot { color: var(--yellow); box-shadow: inset 0 0 0 1.5px rgba(245, 205, 48, 0.55); background: transparent; }
.chip svg { display: inline-block; width: 14px; height: 14px; flex: none; }
.pill { padding: 6px 16px; border-radius: 99px; background: var(--yellow); color: #1a1400; font-size: 0.8125rem; font-weight: 700; }
.mock-row.start { justify-content: flex-start; }

/* What it does ----------------------------------------------------------------------------- */

.facts { list-style: none; margin: 28px 0 0; padding: 0; }
.facts li { position: relative; padding: 0 0 10px 24px; color: var(--text); font-weight: 600; }
.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--green);
}

.features { list-style: none; margin: 0; padding: 0; }
.features li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.features li:first-child { border-top: 0; padding-top: 0; }
.features li:last-child { padding-bottom: 0; }
.features .icon { width: 72px; height: 72px; }
.features h3 { font-size: var(--step-2); margin: 2px 0 0.2em; }
.features p { margin: 0; max-width: 52ch; }
@media (min-width: 600px) {
  .features li { grid-template-columns: 88px minmax(0, 1fr); gap: 24px; }
  .features .icon { width: 88px; height: 88px; }
}

/* Gallery ---------------------------------------------------------------------------------- */

.gallery {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}
@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 26px; }
  .tile:nth-child(3n + 2) { margin-top: 36px; }
}
.tile-stage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: #0c1738;
  cursor: pointer;
}
.tile-stage:hover { border-color: var(--blue); }
.tile-stage:focus-visible { outline-offset: 4px; border-radius: var(--radius-m); }
.tile-cap { margin: 12px 2px 0; max-width: none; color: var(--text); font-weight: 600; }

/* FAQ -------------------------------------------------------------------------------------- */

.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 20px 0;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-weight: 650;
  font-size: var(--step-1);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 28px;
  text-align: center;
  color: var(--yellow);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: #fff; }
.faq details p { margin: 0; padding: 0 44px 22px 0; }

/* Final call to action ------------------------------------------------------------------- */

.final { padding-block: clamp(72px, 10vw, 140px); }
.final h2 { font-size: clamp(2.6rem, 6.4vw, 4.8rem); max-width: 14ch; }
.final .lead { margin-bottom: 28px; }

/* Hero: live 3D stage ------------------------------------------------------------------ */
.stage-3d {
  background:
    radial-gradient(70% 90% at 50% 100%, #1d3a8a 0%, rgba(29, 58, 138, 0) 70%),
    linear-gradient(180deg, #08102a 0%, #0c1740 100%);
}
.stage-canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.4s ease; }
.stage-3d.ready .stage-canvas { opacity: 1; }
.stage-label {
  position: absolute; left: 16px; bottom: 14px; margin: 0;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(11, 20, 48, 0.72); border: 1px solid var(--line);
  color: var(--text); font-size: var(--step--1); font-weight: 600;
}
@media (prefers-reduced-motion: reduce) { .stage-canvas { transition: none; } }
.stage-picks { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.stage-picks:empty { display: none; }
.pick {
  min-height: 36px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ink-3); color: var(--muted);
  font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pick:hover { color: var(--text); border-color: #3b5299; }
.pick[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.pick:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
