/* ================= fonts ================= */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/space-mono-700.woff2') format('woff2');
}

/* ================= tokens ================= */
:root {
  /* brand gradient — pink (top of the mark) fades to raspberry (bottom) */
  --pink: #F06CA0;
  --raspberry: #C51A4A;
  --raspberry-a11y: #E14F82; /* raspberry lightened to meet 4.5:1 on --panel for small text */
  --grad: linear-gradient(90deg, var(--pink), var(--raspberry));
  --grad-v: linear-gradient(180deg, var(--pink), var(--raspberry));

  --green: #75A928;   /* Raspberry Pi green — reserved for healthy / live / success */
  --amber: #d4a017;

  --void: #0a0b0d;
  --panel: #12141a;
  --panel-alt: #171a21;
  --border: #262b33;
  --border-faint: #191d24;
  --text: #e8eef5;
  --muted: #8b949e;
  --faint: #7b848e; /* lightened to meet 4.5:1 on --panel */

  --font-display: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-term: ui-monospace, "SF Mono", Consolas, "DejaVu Sans Mono", monospace;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ================= base ================= */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--font-term); }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 3px;
}

.badge { height: 18px; vertical-align: middle; }

/* pink→raspberry text, used once on the hero keyword */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================= logo mark ================= */
.mark { display: block; overflow: visible; }
.mark-nav { width: 26px; height: auto; margin-right: 10px; }
.mark-foot { width: 20px; height: auto; }

/* Nav mark reveal: hidden while the hero is in view, then slides in left→right
   and pushes the wordmark once scrolled past the hero. JS-gated so the mark
   stays visible without JS; `past-hero` is toggled by the IntersectionObserver
   in copy.js. */
.js .mark-nav {
  width: 0;
  margin-right: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-10px);
  transition: width .4s ease, margin-right .4s ease, opacity .4s ease, transform .4s ease;
}
.js.past-hero .mark-nav {
  width: 26px;
  margin-right: 10px;
  opacity: 1;
  transform: translateX(0);
}

/* ================= nav ================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: rgba(10, 11, 13, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-faint);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
}

.nav-links a { position: relative; padding-bottom: 2px; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -2px;
  height: 1.5px;
  background: var(--grad);
  transition: right .25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }
.nav-links .nav-docs { color: var(--text); }
.nav-docs span { color: var(--raspberry-a11y); }

/* ================= hero ================= */
.hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 44px;
  padding: 72px 40px 64px;
}

.hero-copy { flex: 1; min-width: 300px; }

.hero-eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--pink);
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.28;
  letter-spacing: -.3px;
}

.hero-sub {
  margin: 0 0 24px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.install-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--panel-alt);
  border: 1px solid transparent;
  border-radius: 8px;
  background-image: linear-gradient(var(--panel-alt), var(--panel-alt)), var(--grad);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  font-family: var(--font-term);
  font-size: 13px;
}
.prompt { color: var(--green); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-family: var(--font-term);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease;
}
.copy-btn:hover { color: var(--text); }
.copy-btn.copied { color: var(--green); }

.install-pill .copy-btn {
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.hero-meta {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--muted);
}

/* terminal */
.hero-terminal { flex: 1.15; min-width: 320px; }

.terminal {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border-faint);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-raspberry { background: var(--raspberry); }
.dot-green { background: var(--green); }
.dot-grey { background: var(--border); }

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-term);
  font-size: 11px;
  color: var(--muted);
}

.terminal-body {
  margin: 0;
  padding: 18px;
  font-family: var(--font-term);
  font-size: 12.5px;
  line-height: 1.4;
  overflow-x: auto;
}
/* inline-block (not block) so the literal newline in the <pre> supplies the
   single line break — a block box would add its own, double-spacing the log —
   while still allowing the transform used by the stream-in animation. */
.tline { display: inline-block; }

/* Keep the banner's density glyphs touching without letting their font metrics
   collide with adjacent rows. */
.tline.art { line-height: 1.18; vertical-align: top; margin: 6px 0; }

/* terminal colour utilities (reused by quick-start blocks) */
.green { color: var(--green); }
.raspberry { color: var(--raspberry-a11y); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.amber { color: var(--amber); }

/* deploy banner rows — the CLI's real pink→raspberry gradient sweep */
.g0 { color: #F06CA0; }
.g1 { color: #E5588B; }
.g2 { color: #DA4375; }
.g3 { color: #D02F60; }
.g4 { color: #C51A4A; }

/* ================= sections ================= */
.section {
  padding: 60px 40px;
  border-top: 1px solid var(--border-faint);
  scroll-margin-top: 72px;
}
.section:first-of-type { border-top: none; }

.section-label {
  display: inline-block;
  margin: 0 0 10px;
  padding-bottom: 5px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--pink);
  border-bottom: 2px solid;
  border-image: var(--grad) 1;
}

.section h2 {
  margin: 0 0 30px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -.2px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .2s ease, transform .2s ease;
}

/* ================= how it works ================= */
.hiw-row { display: flex; align-items: stretch; gap: 16px; }
.hiw-card { flex: 1; padding: 22px; }
.hiw-card:hover { border-color: #333a44; transform: translateY(-2px); }

.card-index {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--raspberry-a11y);
}
.hiw-card h3 { margin: 0 0 7px; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.hiw-card p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.hiw-card code { color: var(--text); }

.hiw-arrow {
  display: flex;
  align-items: center;
  font-family: var(--font-term);
  font-size: 18px;
  color: var(--green);
}
.hiw-arrow .v { display: none; }

/* ================= features ================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.feature { padding: 20px; }
.feature:hover { border-color: #333a44; transform: translateY(-2px); }

/* density-ramp chip — the motif, not a fake number */
.dchip {
  display: block;
  width: 26px;
  height: 9px;
  margin-bottom: 12px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 5px, var(--panel) 5px, var(--panel) 6px),
    var(--grad);
  border-radius: 2px;
}

.feature h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.feature p:last-child { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.feature code { color: var(--text); font-size: 12px; }

/* ================= quick start ================= */
.qs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.qs-step { display: flex; flex-direction: column; }

.qs-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
/* the one place numbers belong: an ordered sequence */
.qs-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--void);
  background: var(--grad);
  border-radius: 5px;
}

.qs-block { position: relative; flex: 1; display: flex; }

.qs-code {
  flex: 1;
  margin: 0;
  padding: 14px 38px 14px 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-term);
  font-size: 12px;
  line-height: 1.75;
  overflow-x: auto;
}
.qs-block .copy-btn { position: absolute; top: 11px; right: 12px; }

/* Neutral, native scrollbars keep long commands discoverable without competing
   with the terminal's semantic pink and green status colours. */
.terminal-body,
.qs-code {
  --scrollbar-thumb: #5b6572;
  --scrollbar-thumb-hover: #737f8e;
  --scrollbar-track: var(--panel-alt);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

@media (prefers-contrast: more) {
  .terminal-body,
  .qs-code { --scrollbar-thumb: #aab4c1; }
}

/* Legacy Blink/WebKit fallback, kept separate from the standard scrollbar API. */
@supports not (scrollbar-color: auto) {
  .terminal-body::-webkit-scrollbar,
  .qs-code::-webkit-scrollbar { width: 8px; height: 8px; }
  .terminal-body::-webkit-scrollbar-track,
  .qs-code::-webkit-scrollbar-track { background: var(--scrollbar-track); }
  .terminal-body::-webkit-scrollbar-thumb,
  .qs-code::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 2px solid var(--scrollbar-track);
    border-radius: 999px;
  }
  .terminal-body::-webkit-scrollbar-thumb:hover,
  .qs-code::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
}

/* ================= dogfooding ================= */
.dogfood {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 24px 40px 0;
  padding: 26px 28px;
  background:
    linear-gradient(rgba(197, 26, 74, .05), rgba(197, 26, 74, .05)),
    var(--panel);
  border: 1px solid transparent;
  border-radius: 10px;
  background-image: linear-gradient(var(--panel), var(--panel)), var(--grad);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.dogfood-text { flex: 1; min-width: 260px; }
.dogfood-title {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}
.dogfood-text p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.dogfood-text code { color: var(--text); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border: 1px solid var(--green);
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(117, 169, 40, .6);
  animation: pulse 2s infinite;
}

/* ================= footer ================= */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 56px;
  padding: 34px 40px;
  border-top: 1px solid var(--border-faint);
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-links { display: inline-flex; align-items: center; gap: 24px; }
.footer-links a { position: relative; }
.footer-links a:hover { color: var(--text); }

/* ================= motion ================= */
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(117, 169, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(117, 169, 40, 0); }
}

/* the deploy log — banner then lines — streams in on load (the one moment) */
.js .tline { opacity: 0; transform: translateY(4px); }
.js.loaded .tline {
  animation: linein .3s ease forwards;
  animation-delay: calc(150ms + var(--n, 0) * 55ms);
}
@keyframes linein {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .tline { opacity: 1; transform: none; animation: none; }
  .js .mark-nav { transition: none; }
  .live-dot { animation: none; }
  .card { transition: none; }
}

/* ================= responsive ================= */
@media (max-width: 860px) {
  .hiw-row { flex-direction: column; }
  .hiw-arrow { justify-content: center; }
  .hiw-arrow .h { display: none; }
  .hiw-arrow .v { display: block; }
}

@media (max-width: 640px) {
  .nav { padding: 14px 20px; }
  .nav-links { gap: 12px; }
  .hero { padding: 48px 20px 44px; gap: 32px; }
  .hero h1 { font-size: 27px; }
  .hero-copy { flex: 1 1 100%; }
  .hero-terminal { flex: 1 1 100%; min-width: 0; width: 100%; }
  .section { padding: 44px 20px; }
  .dogfood { margin: 20px 20px 0; }
  .footer { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .nav-links a:not(.nav-docs) { display: none; }
}
