/* ---------------------------------------------------------------------------
   z3k.sh — landing page
   Design tokens are the console's shadcn/ui set (zinc, new-york, radius .5rem)
   copied verbatim from console/src/input.css so the two properties read as one
   product. The only addition is --hot: a single ember accent reserved for
   live/running state. Everything else stays achromatic.
   --------------------------------------------------------------------------- */

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --border: 240 5.9% 90%;
  --ring: 240 10% 3.9%;
  --radius: 0.5rem;

  /* the one spend of colour */
  --hot: 18 88% 44%;
  --hot-foreground: 0 0% 100%;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --gutter: 1.5rem;
  --max: 1180px;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;

  --hot: 20 95% 58%;
  --hot-foreground: 240 10% 3.9%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "rlig" 1, "calt" 1;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 2px);
}

/* --- primitives ---------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.rule {
  border-top: 1px solid hsl(var(--border));
}

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.hot {
  color: hsl(var(--hot));
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: hsl(var(--hot));
  flex: none;
}

.lede {
  color: hsl(var(--muted-foreground));
  font-size: 1.0625rem;
  max-width: 62ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding-inline: 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-ghost {
  border-color: hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background: hsl(var(--accent));
}

.btn-sm {
  height: 2.125rem;
  padding-inline: 0.75rem;
}

.card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 0.1875rem 0.625rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: hsl(var(--muted-foreground));
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--hot));
  flex: none;
}

.dot-live {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* --- section scaffold ---------------------------------------------------- */

.section {
  border-top: 1px solid hsl(var(--border));
  padding-block: 5rem;
}

.section-head {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
  font-weight: 600;
  text-wrap: balance;
  max-width: 20ch;
}

/* --- header -------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.85);
  backdrop-filter: saturate(180%) blur(12px);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 3.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* The brand is the name, set in the page's own sans — no mark beside it.
   Inherits the surrounding text colour, which is what makes it work in both
   themes and reversed on the accent. */
.brand-name {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: hsl(var(--foreground));
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.nav a:hover {
  color: hsl(var(--foreground));
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.icon-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.dark .theme-sun {
  display: none;
}

.theme-moon {
  display: none;
}

.dark .theme-moon {
  display: block;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  padding-block: clamp(3.5rem, 1rem + 8vw, 6.5rem);
}

.hero-grid {
  display: grid;
  gap: 3.5rem;
  align-items: start;
}

@media (min-width: 62rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 4rem;
  }
}

.hero h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.5rem, 1.3rem + 4.2vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
  font-weight: 600;
  text-wrap: balance;
}

.hero h1 .hot {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: -0.02em;
  color: hsl(var(--hot));
}

.hero-lede {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-meta span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: hsl(var(--border));
}

/* --- deploy transcript --------------------------------------------------- */

.terminal {
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.terminal-body {
  padding: 1rem 0.875rem 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  min-height: 21rem;
  overflow-x: auto;
}

.line {
  display: flex;
  gap: 0.625rem;
  white-space: pre;
  opacity: 0;
}

.line.shown {
  opacity: 1;
}

.line-mark {
  width: 1.25rem;
  flex: none;
  color: hsl(var(--muted-foreground));
  text-align: right;
}

.line-body {
  color: hsl(var(--muted-foreground));
  min-width: 0;
}

.line-cmd .line-mark {
  color: hsl(var(--hot));
}

.line-cmd .line-body {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.line-ok .line-mark {
  color: hsl(var(--hot));
}

.line-time {
  color: hsl(var(--muted-foreground));
  opacity: 0.6;
}

.terminal-out {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed hsl(var(--border));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.terminal-out.shown {
  opacity: 1;
}

.terminal-url {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--hot));
  padding-bottom: 1px;
}

/* --- stack strip --------------------------------------------------------- */

.strip {
  border-top: 1px solid hsl(var(--border));
  padding-block: 1.5rem;
  background: hsl(var(--muted) / 0.4);
}

.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
}

.strip-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.strip-inner ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

/* --- steps --------------------------------------------------------------- */

.steps {
  display: grid;
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: hsl(var(--card));
  padding: 1.75rem 1.5rem 2rem;
  display: grid;
  gap: 0.625rem;
  align-content: start;
}

.step-n {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: hsl(var(--hot));
}

.step h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.step p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

/* --- feature grid -------------------------------------------------------- */

.features {
  display: grid;
  gap: 1rem;
}

@media (min-width: 46rem) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 68rem) {
  .features {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature {
  padding: 1.375rem 1.25rem 1.5rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.feature h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.feature code {
  font-family: var(--font-mono);
  font-size: 0.8125em;
  color: hsl(var(--foreground));
}

/* --- workspace status rows ----------------------------------------------- */

.rows {
  margin: 0;
  display: grid;
}

.rows .row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid hsl(var(--border));
}

.rows .row:last-child {
  border-bottom: 0;
}

.rows dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  flex: none;
  min-width: 9.5rem;
}

.rows dd {
  margin: 0;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* --- starting points ----------------------------------------------------- */

.starters {
  display: grid;
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

@media (min-width: 52rem) {
  .starters {
    grid-template-columns: repeat(3, 1fr);
  }
}

.starter {
  background: hsl(var(--card));
  padding: 1.25rem 1.25rem 1.375rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.starter h3 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.starter p {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: hsl(var(--foreground));
}

/* --- split (gitops + architecture) --------------------------------------- */

.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 62rem) {
  .split {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 4rem;
  }
  .split-flip > :first-child {
    order: 2;
  }
}

.split h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.375rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 600;
  text-wrap: balance;
  margin-top: 1rem;
}

.split p {
  margin-top: 1.125rem;
  color: hsl(var(--muted-foreground));
}

.checks {
  display: grid;
  gap: 0.625rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

.checks li {
  display: grid;
  grid-template-columns: 1rem 1fr;
  gap: 0.75rem;
  align-items: start;
  color: hsl(var(--muted-foreground));
}

.checks svg {
  width: 1rem;
  height: 1rem;
  margin-top: 0.28rem;
  color: hsl(var(--hot));
}

.checks strong {
  color: hsl(var(--foreground));
  font-weight: 500;
}

/* --- code block ---------------------------------------------------------- */

.code {
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.code pre {
  margin: 0;
  padding: 1.125rem 0.875rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: hsl(var(--foreground));
  tab-size: 2;
}

.code .k {
  color: hsl(var(--muted-foreground));
}

.code .s {
  color: hsl(var(--hot));
}

.code .c {
  color: hsl(var(--muted-foreground));
  opacity: 0.7;
}

/* --- architecture diagram ------------------------------------------------ */

.diagram {
  padding: 1.5rem 1.25rem;
}

.diagram svg {
  width: 100%;
  height: auto;
}

.diagram .stroke {
  stroke: hsl(var(--border));
}

.diagram .fill-card {
  fill: hsl(var(--card));
}

.diagram .fill-muted {
  fill: hsl(var(--muted));
}

.diagram .label {
  fill: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

.diagram .label-sm {
  fill: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  font-size: 9px;
}

.diagram .spoke {
  stroke: hsl(var(--border));
  stroke-dasharray: 3 3;
}

.diagram .hot-stroke {
  stroke: hsl(var(--hot));
}

/* --- stats --------------------------------------------------------------- */

.stats {
  display: grid;
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 2.5rem;
}

@media (min-width: 46rem) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  background: hsl(var(--card));
  padding: 1.25rem 1.25rem 1.375rem;
  display: grid;
  gap: 0.25rem;
}

.stat dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.stat dd {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* --- pricing ------------------------------------------------------------- */

.price-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 52rem) {
  .price-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.price {
  padding: 1.5rem 1.375rem 1.75rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.price .price-amount {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.price .price-amount small {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.price h3 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.price p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.price-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* --- closing ------------------------------------------------------------- */

.closing {
  border-top: 1px solid hsl(var(--border));
  padding-block: 5.5rem;
  text-align: center;
}

.closing h2 {
  font-size: clamp(1.875rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
  max-width: 18ch;
  margin-inline: auto;
}

.closing p {
  margin-top: 1rem;
  color: hsl(var(--muted-foreground));
  max-width: 48ch;
  margin-inline: auto;
}

.closing .hero-actions {
  justify-content: center;
}

/* --- footer -------------------------------------------------------------- */

.footer {
  border-top: 1px solid hsl(var(--border));
  padding-block: 3rem 2.5rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 46rem) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 2rem;
  }
}

.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  margin-bottom: 0.875rem;
}

.footer ul {
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.footer ul a:hover {
  color: hsl(var(--foreground));
}

.footer-blurb {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  max-width: 34ch;
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.colophon .spacer {
  margin-left: auto;
}

/* --- reveal on scroll ---------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .line,
  .terminal-out {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .dot-live {
    animation: none;
  }
}

@media (max-width: 52rem) {
  .nav {
    display: none;
  }

  /* The hero transcript is the page's main visual, and on a phone `pre` turned
     it into six truncated lines with the payoff off-screen and no affordance
     that it scrolled. Wrap instead: the flex mark column keeps its own gutter,
     so wrapped continuations hang under the text rather than under the arrow. */
  .terminal-body {
    min-height: 0;
    font-size: 0.75rem;
    overflow-x: visible;
  }

  .line {
    white-space: pre-wrap;
  }

  .line-body {
    overflow-wrap: anywhere;
  }

  /* Touch targets. 34px buttons and 16px-tall footer links are fine with a
     mouse and mean fat-finger misses on a phone. */
  .btn-sm {
    height: 2.5rem;
    padding-inline: 0.875rem;
  }

  .icon-btn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .masthead-actions {
    gap: 0.375rem;
  }

  .footer ul {
    gap: 0.125rem;
  }

  .footer ul a {
    display: inline-block;
    padding-block: 0.6875rem;
  }

  .brand {
    padding-block: 0.375rem;
  }
}
