/* Landing page. Every section uses a different layout family on purpose:
 * split hero, pipeline row, master-detail browser, code split, snap strip,
 * tabs, table, accordion. */

/* ── hero: asymmetric split ──────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
}
/* Two lines, always: each is 14 monospace characters, so the size is set to
   fit that measure in the column rather than left to wrap into four. */
.hero h1 {
  font-size: clamp(2rem, 3.6vw, 3.3rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}
/* Monospace, so the decode never changes the word's width. */
.hero h1 .dec {
  color: var(--green);
}
.hero h1 .ln {
  display: block;
  white-space: nowrap;
}
.hero .lede {
  margin-top: 1.4rem;
  font-size: 1.12rem;
  max-width: 34ch;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2.2rem;
}
.cta .cmdline {
  flex: 1 1 22rem;
  max-width: 26rem;
}
.shotframe {
  position: relative;
  min-width: 0;
}
/* A faint floor of the accent under the cast, so it sits on the page instead
   of floating. Static, and on a pseudo-element so it never repaints. */
.shotframe::after {
  content: "";
  position: absolute;
  inset: auto 10% -1.5rem;
  height: 3rem;
  background: radial-gradient(closest-side, rgb(152 195 121 / 0.14), transparent);
  filter: blur(14px);
  z-index: -1;
}
.shotframe img {
  width: 100%;
  border-radius: var(--r-surface);
  box-shadow: 0 30px 80px -40px rgb(0 0 0 / 0.9);
}

/* A bare 1fr is minmax(auto, 1fr): the column would refuse to shrink below
   the install command. Zero lets the command scroll inside its own box. */
.hero > * {
  min-width: 0;
}
@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .hero .lede {
    max-width: 48ch;
  }
}

/* ── how it works: a pipeline that lights in data order ──────────────── */

.pipe {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 2.75rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: stage;
}
.pipe li {
  position: relative;
  padding: 1.25rem 1.1rem 1.25rem 0;
  border-top: 1px solid var(--line-2);
  min-width: 0;
}
/* The rail that fills as data "moves" left to right. */
.pipe li::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
}
.pipe .st {
  display: block;
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
}
.pipe code {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.86rem;
  color: var(--head);
  overflow-wrap: anywhere;
}
.pipe .dsc {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--fg);
}
.pipe[data-run="done"] li::before {
  transform: none;
}
.pipe[data-run="done"] code {
  color: var(--green);
}
@media (prefers-reduced-motion: no-preference) {
  .pipe[data-run="go"] li::before {
    animation: fill 0.5s var(--ease) forwards;
    animation-delay: calc(var(--i) * 170ms);
  }
  .pipe[data-run="go"] code {
    transition: color 0.3s var(--ease);
    transition-delay: calc(var(--i) * 170ms + 250ms);
    color: var(--green);
  }
}
@keyframes fill {
  to {
    transform: none;
  }
}
.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2.5rem;
  margin-top: 2.25rem;
  font: 400 0.9rem var(--mono);
  color: var(--mut);
}
.facts b {
  color: var(--head);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .pipe {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .pipe {
    grid-template-columns: 1fr;
  }
}

/* ── command browser: master-detail ──────────────────────────────────── */

.browser {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 2.5rem;
  align-items: start;
}
.browser [role="tablist"] {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font: 400 0.9rem var(--mono);
}
.browser [role="tab"] {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-left: 1px solid var(--line-2);
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.browser [role="tab"]:hover {
  color: var(--head);
  background: var(--surface-2);
}
.browser [role="tab"][aria-selected="true"] {
  color: var(--green);
  border-left-color: var(--green);
  background: var(--green-dim);
}
.browser [role="tab"] .al {
  color: var(--mut);
  font-size: 0.8rem;
}
.panel {
  min-width: 0;
}
.panel[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .panel:not([hidden]) {
    animation: swap 0.35s var(--ease);
  }
}
@keyframes swap {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.panel .head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}
.panel .head p {
  margin: 0;
  color: var(--head);
}
.panel img {
  /* Every cast here shares one frame size, so filling the slot scales them
     all identically: same box, same text size, whichever command is picked. */
  width: 100%;
  height: auto;
  border-radius: var(--r-surface);
}
@media (max-width: 860px) {
  .browser {
    grid-template-columns: 1fr;
  }
  /* The list becomes one horizontal strip. */
  .browser [role="tablist"] {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .browser [role="tab"] {
    flex: none;
    border-left: 0;
    border-bottom: 1px solid var(--line-2);
  }
  .browser [role="tab"][aria-selected="true"] {
    border-bottom-color: var(--green);
  }
  .browser [role="tab"] .al {
    display: none;
  }
}

/* ── json: code split ────────────────────────────────────────────────── */

.jsonsplit {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
  /* Both columns the height of the taller, so the right column's first and
     last boxes line up with the left block's top and bottom. */
  align-items: stretch;
}
.jsonsplit .side-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}
/* Grid items default to min-width: auto and grow to fit a long one-liner;
   zero lets the code block scroll inside its own column instead. */
.jsonsplit .side-list > * {
  min-width: 0;
}
.jsonsplit .side-list pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .jsonsplit {
    grid-template-columns: 1fr;
  }
}

/* ── themes: snap strip of real palettes ─────────────────────────────── */

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 17rem);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.theme {
  scroll-snap-align: start;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
}
.theme h3 {
  font-size: 0.95rem;
}
.theme p {
  margin: 0.35rem 0 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--fg);
  /* two lines at line-height 1.5, so every swatch row lines up */
  min-height: 3em;
}
.sw {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  height: 1.6rem;
}
.sw span {
  border-radius: 3px;
}
.theme .use {
  display: block;
  margin-top: 0.9rem;
  font: 400 0.78rem var(--mono);
  color: var(--mut);
}

/* ── install tabs ────────────────────────────────────────────────────── */

.inst {
  margin-top: 2.5rem;
  max-width: 52rem;
}
.inst [role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.inst [role="tab"] {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-control);
  background: none;
  color: var(--fg);
  font: 400 0.85rem var(--mono);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.inst [role="tab"]:hover {
  color: var(--head);
  border-color: var(--mut);
}
.inst [role="tab"][aria-selected="true"] {
  color: var(--green-ink);
  background: var(--green);
  border-color: var(--green);
}
.inst .panel p {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  color: var(--mut);
}

/* ── update: plain stack ─────────────────────────────────────────────── */

/* The measure applies to the content, not the .wrap: a narrowed .wrap would
   centre itself and break the left edge every other section shares. */
.upd > * {
  max-width: 44rem;
}
.upd .code {
  margin-top: 1.5rem;
}

/* ── compare table ───────────────────────────────────────────────────── */

.tbl {
  margin-top: 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
}
table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
thead th {
  font: 500 0.78rem var(--mono);
  color: var(--mut);
  background: var(--surface);
}
thead th:nth-child(2) {
  color: var(--green);
}
tbody th {
  font-weight: 400;
  color: var(--fg);
}
tbody tr:last-child > * {
  border-bottom: 0;
}
td {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--mut);
}
td.y {
  color: var(--green);
}

/* ── faq accordion ───────────────────────────────────────────────────── */

.faq {
  margin-top: 2.5rem;
  max-width: 52rem;
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 1.05rem 0;
  list-style: none;
  cursor: pointer;
  color: var(--head);
  font-weight: 500;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::before {
  content: "[+]";
  flex: none;
  font: 400 0.85rem var(--mono);
  color: var(--green);
}
.faq details[open] summary::before {
  content: "[-]";
}
.faq summary:hover {
  color: var(--green);
}
.faq .a {
  margin: 0 0 1.2rem 2.6rem;
  max-width: 64ch;
}

/* The install command is 31 monospace characters; at phone widths a notch
   smaller lets it sit whole beside its copy button instead of scrolling. */
@media (max-width: 420px) {
  .hero .cmdline {
    font-size: 0.78rem;
    gap: 0.5rem;
    padding-left: 0.8rem;
  }
}

/* ── pause control for the looping casts ─────────────────────────────── */

/* Below the frame, never over it: the hero cycles through four scenes and
   some of their last lines run the full width. */
.pause {
  display: block;
  margin: 0.75rem 0 0 auto;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-control);
  background: none;
  color: var(--mut);
  font: 500 0.7rem var(--mono);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.pause:hover {
  color: var(--head);
  border-color: var(--mut);
}
.pause[aria-pressed="true"] {
  color: var(--green);
  border-color: rgb(152 195 121 / 0.5);
}
.shotframe picture,
.panel picture {
  display: block;
}
