/* CommandMate landing page (Issue #1200).
   Plain CSS, no build step, no dependencies. Light and dark are both driven by
   prefers-color-scheme; there is no theme toggle to keep the page dependency-free. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --surface: #ffffff;
  --border: #d8dee4;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --accent: #0a7d8c;
  --accent-fg: #ffffff;
  --accent-subtle: #e6f4f6;
  --shadow: 0 1px 3px rgb(31 35 40 / 0.08), 0 8px 24px rgb(31 35 40 / 0.06);
  --radius: 12px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #151b23;
    --surface: #151b23;
    --border: #3d444d;
    --fg: #e6edf3;
    --fg-muted: #9198a1;
    --accent: #39c0ce;
    --accent-fg: #04232a;
    --accent-subtle: #0e2e33;
    --shadow: 0 1px 3px rgb(1 4 9 / 0.4), 0 8px 24px rgb(1 4 9 / 0.3);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

img,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.75rem 1rem;
  z-index: 10;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.925rem;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--fg);
}

@media (max-width: 560px) {
  .nav-links a:not(:last-child) {
    display: none;
  }
}

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

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-top: 2.5rem;
  }
}

.status-pill {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.05rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.lede {
  margin: 0 0 1.75rem;
  font-size: 1.15rem;
  color: var(--fg-muted);
}

.install {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.7rem 0.7rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 24rem;
}

.install-lg {
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
}

.install-sm {
  margin-top: 0.75rem;
  max-width: 20rem;
}

.install-cmd {
  color: var(--fg);
  overflow-x: auto;
  white-space: nowrap;
  /* Without this the nowrap text sets an unshrinkable min-content floor, so a
     long command widens the whole page on a phone instead of scrolling here. */
  min-width: 0;
}

.install-cmd::before {
  content: "$ ";
  color: var(--fg-muted);
}

.copy-btn {
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-muted);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

.copy-btn[data-copied="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.prereq {
  margin: 1rem 0 1.75rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta-center {
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}

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

.btn-ghost {
  border-color: var(--border);
  color: var(--fg);
}

.btn-ghost:hover {
  border-color: var(--fg-muted);
}

.hero-media {
  margin: 0;
}

.hero-media img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
  background: var(--bg-subtle);
}

/* ---------- sections ---------- */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.section-lede {
  margin: 0 0 2rem;
  color: var(--fg-muted);
}

.section > h2 + .cards,
.section > h2 + .table-scroll {
  margin-top: 2rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem;
}

.card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.94rem;
}

.note {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--accent-subtle);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 0.9rem;
}

/* ---------- quick start tracks ---------- */

.tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
  align-items: start;
}

.track {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.track-tag {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.track h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.track-lede {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.94rem;
}

.track-note {
  margin: 0.9rem 0 0;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

/* Inline code only: .install-cmd sits inside a box that already frames it. */
.track code:not(.install-cmd),
.note code {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
}

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

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem;
}

.steps > li {
  counter-increment: step;
  padding-top: 2.75rem;
  position: relative;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.9rem;
  font-weight: 700;
}

/* One column, badge beside the content rather than above it. Must stay after
   the `.steps > li` rules above: same specificity, so order decides. */
.steps-stack {
  /* minmax(0, …) rather than 1fr: a grid item's auto minimum would otherwise
     let a wide command box stretch the column past the card. */
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  margin-top: 1.25rem;
}

.steps-stack > li {
  padding-top: 0;
  padding-left: 2.75rem;
}

.steps-stack > li::before {
  top: 0.1rem;
}

.steps h4 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* A command box the card can't show in full is worse than no button at all. */
.track .install {
  max-width: none;
}

/* On a phone the button and the command cannot share a line without the command
   scrolling out of sight — which defeats a section that exists to be read and
   copied. Give the command the width and let the button sit under it. */
@media (max-width: 30rem) {
  .track {
    padding: 1.25rem;
  }

  .steps-stack > li {
    padding-left: 2.25rem;
  }

  .install {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .install-cmd {
    flex: 1 0 100%;
  }
}

/* ---------- tutorial ---------- */

/* Must stay after `.install-sm`: same specificity, so source order decides. The
   clone URL is the one thing this section hands over, and at 20rem half of it
   would sit behind a scroll. */
.install-wide {
  max-width: 34rem;
}

/* A URL, not a shell command — it goes into the Repositories screen, so the
   `$ ` prompt the other boxes carry would be telling the reader to run it. */
.install-cmd.install-url::before {
  content: none;
}

.tutorial-note {
  margin: 0.9rem 0 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1.25rem;
  align-items: start;
}

.shot {
  margin: 0;
}

.shot-wide {
  grid-column: span 2;
}

@media (max-width: 700px) {
  .shot-wide {
    grid-column: span 1;
  }
}

.shot img {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--bg-subtle);
}

.shot figcaption {
  margin-top: 0.6rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* ---------- comparison table ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 46rem;
  font-size: 0.875rem;
}

.compare th,
.compare td {
  padding: 0.7rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.compare thead th {
  background: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.compare tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.compare td {
  color: var(--fg-muted);
}

.compare td.yes {
  color: var(--fg);
  font-weight: 600;
  background: var(--accent-subtle);
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: 0;
}

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

.closing {
  text-align: center;
}

.closing h2 {
  margin-bottom: 1.5rem;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 2.5rem 1.25rem 2rem;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand p {
  margin: 0.35rem 0 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.copyright {
  max-width: var(--maxw);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.82rem;
}
