/* viaduct.sh — open-source site. Design system carried over from the brand kit
   (Space Grotesk / DM Sans / JetBrains Mono, dark oklch palette). Dark by intent:
   a developer tool that lives in the terminal. */

:root {
  --radius: 0.625rem;

  --background: oklch(0.185 0.035 250.5);
  --surface: oklch(0.21 0.038 250.5);
  --foreground: oklch(0.96 0.01 250.5);
  --card: oklch(0.225 0.04 250.5);
  --primary: oklch(0.72 0.16 62);        /* viaduct orange */
  --primary-strong: oklch(0.78 0.16 66);
  --primary-foreground: oklch(0.16 0.03 60);
  --secondary: oklch(0.25 0.04 250.5);
  --muted-foreground: oklch(0.68 0.035 250.5);
  --accent: oklch(0.72 0.11 190);        /* teal */
  --success: oklch(0.78 0.16 150);
  --destructive: oklch(0.62 0.2 25);
  --border: oklch(1 0 0 / 12%);
  --border-strong: oklch(1 0 0 / 18%);
  --ring: oklch(0.72 0.16 62);

  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body { margin: 0; background: var(--background); color: var(--foreground); overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
::selection { background: color-mix(in oklab, var(--primary) 40%, transparent); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 78%, transparent);
  backdrop-filter: blur(12px);
}
.header-inner {
  height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { height: 2.5rem; width: 2.5rem; }
.brand span { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.brand .tld { color: var(--primary); }
.site-nav { display: flex; align-items: center; gap: 1.35rem; }
.site-nav a {
  font-size: 0.9rem; font-weight: 500; text-decoration: none;
  color: var(--muted-foreground); transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--foreground); }
.nav-desktop { display: none; }
.gh-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 0.4rem 0.8rem; color: var(--foreground) !important; font-weight: 500;
  background: var(--card); transition: border-color 0.15s ease, background 0.15s ease;
}
.gh-pill:hover { border-color: var(--primary); }
.gh-pill svg { height: 1.05rem; width: 1.05rem; fill: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius); padding: 0.8rem 1.4rem;
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { height: 1.1rem; width: 1.1rem; fill: currentColor; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(2rem, 4.5vw, 3.5rem) 0 2.25rem; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 38% at 50% 0%, color-mix(in oklab, var(--primary) 8%, transparent), transparent 68%),
    radial-gradient(45% 32% at 85% 12%, color-mix(in oklab, var(--accent) 5%, transparent), transparent 68%);
}
.hero-mark { margin: 0 auto 1.35rem; height: clamp(6rem, 15vw, 9rem); width: clamp(6rem, 15vw, 9rem); }
.hero h1 {
  font-weight: 600; font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.05;
  margin: 0; text-wrap: balance;
}
.hero h1 .tld { color: var(--primary); }
.lede {
  margin: 1.15rem auto 0; max-width: 34rem;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem); color: var(--muted-foreground); text-wrap: balance;
}
.lede code {
  font-family: var(--font-mono); font-size: 0.9em; font-weight: 500;
  background: var(--secondary); padding: 0.1rem 0.35rem; border-radius: 0.3rem; color: var(--foreground);
}
.actions {
  margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center;
}

/* ---------- Terminal ---------- */
.terminal {
  margin: 1.9rem auto 0; max-width: 40rem; text-align: left;
  border: 1px solid var(--border-strong); border-radius: 0.85rem; overflow: hidden;
  background: oklch(0.16 0.03 250.5);
  box-shadow: 0 30px 60px -30px oklch(0 0 0 / 65%), 0 0 0 1px oklch(1 0 0 / 3%);
}
.terminal-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 70%, transparent);
}
.dot { height: 0.7rem; width: 0.7rem; border-radius: 999px; }
.dot-red { background: var(--destructive); }
.dot-amber { background: var(--primary); }
.dot-teal { background: var(--accent); }
.terminal-title {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-foreground);
}
.terminal-body { padding: 1.05rem 1.1rem 1.2rem; overflow-x: auto; }
#screen, #inspect-screen {
  font-family: var(--font-mono); font-size: clamp(0.72rem, 2.6vw, 0.88rem); line-height: 1.7;
  color: var(--foreground); white-space: pre; margin: 0; overflow: hidden;
}
/* fixed heights: the animation types inside a stable panel, so it never resizes
   or shoves the page around as lines appear and the loop resets */
#screen { height: 16em; }
#inspect-screen { height: 22.5em; }
.ln { white-space: pre; }
.c-prompt { color: var(--primary); }
.c-dim { color: var(--muted-foreground); }
.c-url { color: var(--success); font-weight: 600; }
.c-local { color: var(--accent); }
.c-ok { color: var(--success); font-weight: 600; }
.c-req { color: #cfd3da; }
.c-warn { color: #e0b23c; font-weight: 600; }
.c-err { color: #ff6b6b; font-weight: 600; }
.cursor {
  display: inline-block; width: 0.55em; height: 1.05em; margin-bottom: -0.18em;
  background: var(--primary); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Section scaffolding ---------- */
section { padding: clamp(1.6rem, 3vw, 2.25rem) 0; }
/* alternate section grounds so each block is visually distinct as they sit closer */
main > section:nth-child(even) { background: var(--surface); }
.section-head { max-width: 40rem; margin: 0 auto 1.1rem; text-align: center; }
.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--primary); font-weight: 600; margin: 0 0 0.6rem;
}
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); line-height: 1.15; margin: 0; text-wrap: balance; }
.section-head p:not(.eyebrow) { margin: 0.9rem auto 0; max-width: 34rem; color: var(--muted-foreground); }

/* ---------- How it works (clean numbered steps, no boxes) ---------- */
/* mobile: compact rows — badge beside the title, description tucked under it */
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 30rem; display: grid; gap: 1.15rem; text-align: left; }
.steps li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; row-gap: 0.2rem; }
.step-n {
  grid-column: 1; grid-row: 1; align-self: center; display: grid; place-items: center;
  width: 1.6rem; height: 1.6rem; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 16%, transparent);
  color: var(--primary); font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
}
.steps h3 { grid-column: 2; grid-row: 1; align-self: center; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin: 0; }
.steps p { grid-column: 2; grid-row: 2; color: var(--muted-foreground); font-size: 0.95rem; margin: 0; }

/* desktop: three balanced columns, badge on top */
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 52rem; }
  .steps li { display: block; }
  .steps h3 { margin: 0.65rem 0 0; }
  .steps p { margin: 0.3rem 0 0; }
}

/* ---------- Features ---------- */
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 1rem; }
.features li {
  border: 1px solid var(--border); border-radius: 0.8rem; background: var(--card); padding: 1.25rem 1.3rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.features li:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feat-icon {
  height: 2rem; width: 2rem; border-radius: 0.55rem;
  display: grid; place-items: center; margin-bottom: 0.8rem;
  background: color-mix(in oklab, var(--primary) 18%, transparent); color: var(--primary);
}
.feat-icon svg { height: 1.15rem; width: 1.15rem; stroke: currentColor; fill: none; stroke-width: 1.9; }
.features h3 { font-size: 1.02rem; font-weight: 600; margin: 0; }
.features p { margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--muted-foreground); }

/* ---------- Open source ---------- */
.os-actions { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; margin-top: 1.5rem; }

/* ---------- Deploy band (DigitalOcean) ---------- */
.deploy-band {
  display: grid; grid-template-columns: 1fr; gap: 1.75rem; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 1rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background:
    radial-gradient(90% 150% at 100% 0%, color-mix(in oklab, #0069ff 16%, transparent), transparent 62%),
    var(--surface);
}
.deploy-copy .eyebrow { text-align: left; }
.deploy-copy h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.12; margin: 0 0 0.7rem; text-wrap: balance; }
.deploy-copy p { color: var(--muted-foreground); margin: 0 0 1.3rem; max-width: 34rem; }
.deploy-logo { display: flex; justify-content: flex-start; order: -1; }   /* mobile: logo as a header, top-left */
.deploy-logo img { width: 9.5rem; height: auto; opacity: 0.95; }
@media (min-width: 760px) {
  .deploy-band { grid-template-columns: 1.35fr 1fr; }
  .deploy-logo { justify-content: flex-end; order: 0; }
  .deploy-logo img { width: 13rem; }
}

/* ---------- Install ---------- */
.install { max-width: 44rem; margin: 0 auto; }
.code-block {
  display: flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 0.75rem;
  background: oklch(0.16 0.03 250.5); overflow: hidden;
}
.code-block + .code-block { margin-top: 0.9rem; }
.code-block pre {
  flex: 1; min-width: 0; margin: 0; padding: 0.9rem 0.75rem 0.9rem 1rem;
  font-family: var(--font-mono); font-size: clamp(0.78rem, 3.3vw, 0.88rem); line-height: 1.6;
  color: var(--foreground);
  white-space: pre; overflow-x: auto;   /* one line; scrolls instead of wrapping mid-word */
}
.code-block .c-prompt { color: var(--primary); user-select: none; }
.copy-btn {
  flex: none; align-self: center; margin-right: 0.5rem;
  border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground);
  border-radius: 0.45rem; padding: 0.3rem 0.55rem; font: inherit; font-size: 0.72rem; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--foreground); border-color: var(--border-strong); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }
.install-note { margin: 1.1rem 0 0; font-size: 0.92rem; color: var(--muted-foreground); text-align: center; }
.install-note a { color: var(--primary); text-decoration: none; }
.install-note a:hover { text-decoration: underline; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .wrap {
  border: 1px solid var(--border-strong); border-radius: 1rem; padding: clamp(1.75rem, 4vw, 2.5rem) 1.5rem;
  background:
    radial-gradient(70% 120% at 50% 0%, color-mix(in oklab, var(--primary) 12%, transparent), transparent 70%),
    var(--surface);
  max-width: 52rem;
}
.cta h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0; }
.cta p { color: var(--muted-foreground); margin: 0.8rem auto 1.6rem; max-width: 32rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.25rem 0; }
.footer-inner {
  display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center;
  color: var(--muted-foreground); font-size: 0.88rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; }
.footer-links a { text-decoration: none; color: var(--muted-foreground); }
.footer-links a:hover { color: var(--foreground); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: row; justify-content: space-between; }
}
@media (min-width: 860px) {
  .nav-desktop { display: flex; }
  .features { grid-template-columns: repeat(3, 1fr); }
}

/* phones: stack the flow vertically (arrows point down) and give buttons and
   the git-clone line full width for comfortable tap targets */
@media (max-width: 560px) {
  .wrap { padding: 0 1.35rem; }
  section { padding: 1.6rem 0; }
  .hero { padding-top: 1.5rem; }
  .hero-mark { height: 4.75rem; width: 4.75rem; }
  .section-head { margin-bottom: 1rem; }
  .actions { width: 100%; }
  .actions .btn { width: 100%; }
  .os-actions .code-block { width: 100%; }
  .deploy-logo img { width: 9rem; }
  .terminal-title { display: none; }        /* free up the narrow terminal bar */
  .cta .wrap { padding: 1.75rem 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}

/* ---------- Docs page ---------- */
.docs-hero { text-align: center; padding: clamp(2rem, 4vw, 3rem) 0 0.5rem; }
.docs-hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 600; margin: 0.35rem 0 0; text-wrap: balance; }
.docs-hero p { color: var(--muted-foreground); max-width: 40rem; margin: 0.9rem auto 0; text-wrap: balance; }

/* only set vertical padding here: .wrap owns the horizontal gutter, and a
   `padding` shorthand would zero it out (both classes sit on the same element) */
.docs-layout { display: grid; grid-template-columns: 1fr; gap: 1.75rem; padding-top: 1.25rem; padding-bottom: 3rem; }
.docs-main { min-width: 0; max-width: 47rem; }

/* Sidebar table of contents */
.docs-nav { font-size: 0.9rem; }
.docs-nav .toc-label {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.7rem;
  color: var(--muted-foreground); font-weight: 600; margin: 0 0 0.7rem;
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.docs-nav a { text-decoration: none; color: var(--muted-foreground); display: block; transition: color 0.15s ease; }
.docs-nav a:hover { color: var(--foreground); }

@media (min-width: 900px) {
  .docs-layout { grid-template-columns: 14rem 1fr; gap: 3rem; align-items: start; }
  .docs-nav { position: sticky; top: 5rem; }
  .docs-nav ul { flex-direction: column; gap: 0; border-left: 1px solid var(--border); }
  .docs-nav a { padding: 0.32rem 0 0.32rem 0.95rem; margin-left: -1px; border-left: 2px solid transparent; }
  .docs-nav a:hover { border-left-color: var(--primary); }
}

.doc-section { scroll-margin-top: 5rem; padding: 1.75rem 0; }
.doc-section + .doc-section { border-top: 1px solid var(--border); }
.doc-section:first-child { padding-top: 0.5rem; }
.doc-section h2 { font-size: clamp(1.45rem, 3.2vw, 1.9rem); margin: 0 0 0.3rem; }
.doc-section h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.4rem; }
.doc-section p { color: var(--muted-foreground); margin: 0.7rem 0; }
.doc-section p strong, .doc-section li strong { color: var(--foreground); font-weight: 600; }
.doc-section a:not(.btn) { color: var(--primary); text-decoration: none; }
.doc-section a:not(.btn):hover { text-decoration: underline; }
.doc-section :is(p, li, td) code {
  font-family: var(--font-mono); font-size: 0.86em; font-weight: 500;
  background: var(--secondary); color: var(--foreground);
  padding: 0.1rem 0.35rem; border-radius: 0.3rem;
}
.doc-section .code-block { margin: 1rem 0; }

/* numbered getting-started steps */
.doc-steps { counter-reset: step; list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.8rem; }
.doc-steps li { position: relative; padding-left: 2.5rem; color: var(--muted-foreground); }
.doc-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -0.1rem; width: 1.7rem; height: 1.7rem;
  border-radius: 999px; background: color-mix(in oklab, var(--primary) 16%, transparent);
  color: var(--primary); font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  display: grid; place-items: center;
}

/* static terminal output sample */
.doc-term { margin: 1rem 0; }
.doc-screen {
  font-family: var(--font-mono); font-size: clamp(0.74rem, 2.6vw, 0.86rem); line-height: 1.7;
  color: var(--foreground); white-space: pre; margin: 0; overflow-x: auto;
}

/* callout */
.doc-note {
  border-left: 3px solid var(--primary);
  background: color-mix(in oklab, var(--primary) 7%, transparent);
  border-radius: 0 0.5rem 0.5rem 0; padding: 0.85rem 1rem; margin: 1.15rem 0;
  font-size: 0.92rem; color: var(--muted-foreground);
}
.doc-note strong { color: var(--foreground); }

/* options table */
.table-scroll { overflow-x: auto; margin: 1rem 0; }
.opt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 34rem; }
.opt-table th, .opt-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.opt-table th { color: var(--muted-foreground); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.opt-table tr:last-child td { border-bottom: 0; }
.opt-table td:first-child code { white-space: nowrap; }

.hero-docs-link { margin-top: 0.9rem; font-size: 0.9rem; }
.hero-docs-link a { color: var(--primary); text-decoration: none; font-weight: 500; }
.hero-docs-link a:hover { text-decoration: underline; }

/* phones: tighter doc rhythm, and collapse the options table into stacked cards
   so the Description column never runs off-screen */
@media (max-width: 560px) {
  .doc-section { padding: 1.35rem 0; }
  .docs-layout { gap: 1.25rem; }

  .table-scroll { overflow: visible; }
  .opt-table { min-width: 0; }
  .opt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .opt-table, .opt-table tbody { display: block; }
  .opt-table tr {
    display: block; border: 1px solid var(--border); border-radius: 0.6rem;
    background: var(--card); padding: 0.85rem 1rem; margin-bottom: 0.7rem;
  }
  .opt-table td { display: block; border: 0; padding: 0; }
  .opt-table td:first-child { margin-bottom: 0.5rem; }
  .opt-table td:nth-child(2) { font-size: 0.85rem; color: var(--muted-foreground); margin-bottom: 0.4rem; }
  .opt-table td:nth-child(2)::before { content: "Default: "; }
  .opt-table td:last-child { font-size: 0.93rem; color: var(--muted-foreground); }
}

/* Back-to-top: dim, unobtrusive, fades in after scrolling */
.to-top {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  opacity: 0;
  transform: translateY(0.4rem);
  pointer-events: none;
  cursor: pointer;
  z-index: 60;
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.15s ease, border-color 0.15s ease;
}
.to-top.show { opacity: 0.55; transform: none; pointer-events: auto; }
/* hover/focus only lift it while it's meant to show, else a stale :hover after a
   click keeps it visible at the top until the mouse moves */
.to-top.show:hover { opacity: 1; color: var(--foreground); border-color: var(--border-strong); }
.to-top.show:focus-visible { opacity: 1; outline: 2px solid var(--primary); outline-offset: 2px; }
.to-top svg { width: 1rem; height: 1rem; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: opacity 0.25s ease; transform: none; } }
