/* Yardarm website stylesheet — shared by every page. Light/dark via prefers-color-scheme. */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f7fa;
  --bg-code: #f0f3f7;
  --text: #16212e;
  --text-muted: #5a6b7d;
  --accent: #14608f;
  --accent-strong: #0e4a70;
  --accent-contrast: #ffffff;
  --border: #dde5ec;
  --shadow: 0 1px 3px rgba(16, 33, 49, 0.08);
  --plan: #2563eb;
  --build: #16a34a;
  --fast: #d97706;
  --danger: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1320;
    --bg-soft: #121c2c;
    --bg-code: #16233a;
    --text: #e7edf5;
    --text-muted: #94a6ba;
    --accent: #64b1e4;
    --accent-strong: #8cc7ef;
    --accent-contrast: #08111d;
    --border: #24344a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

code,
pre,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */

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

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

.nav-links a.nav-cta {
  color: var(--accent-contrast);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.3rem 0.55rem;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.5rem 0 0.9rem;
    gap: 0.7rem;
  }

  .nav-links.open {
    display: flex;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.6rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
}

.btn.btn-secondary {
  background: transparent;
  color: var(--accent);
}

.btn.btn-secondary:hover {
  background: var(--bg-soft);
}

.btn.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

/* ---------- Hero ---------- */

.hero {
  padding: 0 0 2.5rem;
  text-align: center;
}

/* Full-bleed dark band matching the hero logo image background (#1c1d1c),
   so the logo blends into the strip in both color schemes. */
.hero-band {
  background: #1c1d1c;
  padding: 1.5rem 1.25rem;
}

.hero-logo {
  max-width: 9rem;
  width: 100%;
}

.hero h1 {
  font-size: 2.3rem;
  line-height: 1.2;
  margin: 1rem 0 0.5rem;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 auto 1.6rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Sections & cards ---------- */

.section {
  padding: 2.75rem 0;
}

.section.alt {
  background: var(--bg-soft);
}

.section h2 {
  font-size: 1.7rem;
  margin: 0 0 0.4rem;
}

.section .section-lead {
  color: var(--text-muted);
  max-width: 46rem;
  margin: 0 0 1.6rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.section.alt .card {
  background: var(--bg);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

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

/* ---------- Code blocks ---------- */

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.87rem;
  line-height: 1.55;
}

code {
  background: var(--bg-code);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.88em;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

kbd {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.08rem 0.4rem;
  font-size: 0.82em;
}

.code-block {
  position: relative;
  max-width: 44rem;
}

.code-block.centered {
  margin: 0 auto;
}

.code-block pre {
  padding-right: 4.6rem;
}

.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--text);
}

/* ---------- Notes ---------- */

.note {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.93rem;
}

.note.warn {
  border-left-color: var(--fast);
}

/* ---------- Tables ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.92rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-soft);
}

/* ---------- Docs layout ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.docs-sidebar {
  font-size: 0.9rem;
}

.docs-sidebar nav {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 5.5rem);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.2rem 0 0.4rem;
}

.sidebar-title:first-child {
  margin-top: 0;
}

.docs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar li {
  margin: 0.15rem 0;
}

.docs-sidebar a {
  display: block;
  color: var(--text-muted);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.docs-sidebar a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.docs-sidebar a.current {
  color: var(--accent);
  font-weight: 600;
  background: var(--bg-soft);
}

.docs-sidebar .toc a.active {
  color: var(--accent);
}

.docs-content {
  min-width: 0;
}

.docs-content h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.docs-content .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.8rem;
}

.docs-content h2 {
  font-size: 1.45rem;
  margin: 2.4rem 0 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1.12rem;
  margin: 1.6rem 0 0.4rem;
}

.docs-content li {
  margin: 0.3rem 0;
}

.docs-footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar nav {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
  }
}

/* ---------- Prose pages (support / privacy / terms) ---------- */

.prose {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}

.prose h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.prose h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.5rem;
}

.prose .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.prose .updated {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.8rem;
}

/* ---------- Mode chips ---------- */

.mode-chip {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85em;
  border-radius: 6px;
  padding: 0.05rem 0.5rem;
  color: #fff;
}

.mode-chip.plan {
  background: var(--plan);
}

.mode-chip.build {
  background: var(--build);
}

.mode-chip.fast {
  background: var(--fast);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

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

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

.site-footer p {
  margin: 0;
}
