/* CLIO landing site — plain CSS, dark theme, single accent */

:root {
  --accent: #ea7b2a;
  --accent-soft: rgba(234, 123, 42, 0.14);
  --accent-line: rgba(234, 123, 42, 0.32);
  --bg: #0d0f12;
  --bg-2: #0f1216;
  --panel: #16191e;
  --panel-2: #1b1f25;
  --border: #23272e;
  --border-soft: #1e2229;
  --text: #e6e8eb;
  --muted: #9aa0a6;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Beta markers ===== */
/* Fixed diagonal corner ribbon (top-right of the viewport). */
.beta-ribbon {
  position: fixed;
  top: 22px;
  right: -52px;
  z-index: 1000;
  transform: rotate(45deg);
  background: var(--accent);
  color: #1a1206;
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.18em;
  text-decoration: none;
  padding: 7px 60px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.beta-ribbon:hover { filter: brightness(1.08); }
/* Small pill next to the nav wordmark. */
.beta-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font: 700 11px/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
/* Hero badge + caveat line. */
.hero-beta {
  font-size: 0.34em;
  vertical-align: super;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.25em 0.6em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.beta-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.4rem;
}
@media (max-width: 640px) { .beta-ribbon { top: 16px; right: -56px; padding: 6px 60px; } }

* { box-sizing: border-box; }

/* Dark scrollbar to match the theme. */
html, body { scrollbar-color: #2a2f37 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2a2f37;
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #3a414b; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle ambient glow at the top */
body::before {
  content: "";
  position: fixed;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(closest-side, rgba(234, 123, 42, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}
/* A `section.wrap` would otherwise lose the `section` vertical padding to
   `.wrap`'s class-specificity (padding: 0 24px), collapsing the gaps between
   sections to almost nothing. Restore the vertical rhythm (hero has its own). */
section.wrap:not(.hero) { padding-top: 80px; padding-bottom: 80px; }
section.wrap.tight { padding-top: 56px; padding-bottom: 56px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(13, 15, 18, 0.72);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.brand .wordmark { font-size: 18px; }
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-links a.ghbtn {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--panel);
}
.nav-links a.ghbtn:hover { border-color: var(--accent-line); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.btn:hover { border-color: var(--accent-line); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #170c02;
}
.btn-primary:hover { background: #f08a3f; border-color: #f08a3f; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
section.tight { padding: 64px 0; }
.section-head { margin-bottom: 36px; }
.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
h1, h2, h3 { line-height: 1.15; margin: 0; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.01em; }
.section-sub { color: var(--muted); margin: 12px 0 0; max-width: 60ch; }

/* ---------- Hero ---------- */
.hero { padding: 92px 0 64px; text-align: center; }
.hero-logo {
  width: 88px; height: 88px;
  margin: 0 auto 26px;
  object-fit: contain;
  filter: drop-shadow(0 12px 34px rgba(234, 123, 42, 0.22));
}
.hero h1 {
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #fff, #c7ccd2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline { color: var(--accent); font-weight: 600; font-size: clamp(17px, 2.6vw, 22px); margin: 0 0 18px; }
.hero .subtitle { color: var(--muted); font-size: clamp(16px, 2vw, 19px); max-width: 56ch; margin: 0 auto 34px; }
.hero-code { max-width: 680px; margin: 0 auto 24px; text-align: left; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Hero product showcase image */
.hero-showcase {
  max-width: 960px;
  margin: 48px auto 0;
  padding: 10px;
  background: #08090b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(234, 123, 42, 0.08);
}
.hero-showcase img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius) - 6px);
  display: block;
}

/* ---------- Code blocks ---------- */
/* Flex row: the command text and the copy control live in separate
   columns so the icon never overlaps the text. */
.code {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #0b0d10;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 0;
  overflow: hidden;
}
.code pre {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 10px 0 10px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: #e9edf1;
}
.code pre .prompt { color: var(--accent); user-select: none; }
.code pre .cmt { color: var(--muted); }
.copy-btn {
  flex: 0 0 auto;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.copy-btn svg { width: 16px; height: 16px; display: block; }
.copy-btn:hover { color: var(--text); border-color: var(--accent-line); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Install tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 18px; }
.tab {
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
}
.tab.active { color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.tab:hover { color: var(--text); }
.tabpane { display: none; }
.tabpane.active { display: block; }
.hint { color: var(--muted); font-size: 14px; margin-top: 16px; }
.hint code { font-family: var(--mono); background: var(--panel); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); }

/* ---------- Hero run modes + no-install ---------- */
.run-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.run-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 200px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.run-mode .run-mode-label {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.run-mode .run-mode-sep {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
}
.run-mode code {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.reassure { color: var(--muted); font-size: 14px; margin-top: 14px; }
.reassure a { font-weight: 600; }
.no-install { color: var(--muted); font-size: 14px; margin-top: 14px; }
.no-install a { font-weight: 600; }

/* ---------- IOWarp family ---------- */
.family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.family-card {
  display: block;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.family-card:hover { border-color: var(--accent-line); text-decoration: none; }
.family-card h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 6px;
}
.family-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Doc callout ---------- */
.callout {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.callout p { color: var(--text); margin: 0; }

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel-frame {
  position: relative;
  background: #08090b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.slides { width: 100%; height: 100%; }
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 15, 18, 0.7);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  z-index: 3;
  transition: background 0.15s, border-color 0.15s;
}
.car-arrow:hover { background: var(--panel); border-color: var(--accent-line); }
.car-arrow.prev { left: 14px; }
.car-arrow.next { right: 14px; }
.car-caption {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-top: 18px;
  min-height: 1.4em;
}
.car-caption strong { color: var(--text); font-weight: 600; }
.car-dots { display: flex; gap: 9px; justify-content: center; margin-top: 16px; }
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.dot:hover { background: var(--muted); }
.dot.active { background: var(--accent); transform: scale(1.25); }

/* ---------- Desktop ---------- */
.os-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 16px;
}
.os-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 24px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.os-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.os-logo {
  width: 48px;
  height: 48px;
  color: var(--text);
}
.os-logo svg { width: 100%; height: 100%; display: block; }
.os-name { font-size: 20px; font-weight: 700; margin: 0; }
/* Architecture sublabel under each OS name. */
.os-arch {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Download area: pushed to the bottom so primary buttons line up across cards. */
.os-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
}
.os-primary { width: 100%; justify-content: center; }

/* Secondary formats: a row of small outlined pill buttons that light up on hover.
   Reserve a consistent min-height so cards with no secondary format (macOS)
   stay the same height and primary buttons stay aligned. */
.os-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.os-format {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.os-format:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
/* Subtle muted note for cards with no secondary formats (keeps height parity). */
.os-formats-note {
  color: var(--muted);
  font-size: 13px;
}

/* Honesty caption under the primary download: whether the resolved build
   bundles the CLIO backend or is attach-only. Populated by app.js; empty until
   the release assets resolve, so it takes no vertical space on failure. */
.os-dl-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  text-align: center;
  min-height: 0;
}
.os-dl-note:empty { display: none; }

/* "Your platform" badge — hidden unless the card is the detected OS. */
.os-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font: 700 11px/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.os-card.is-detected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 34px rgba(234, 123, 42, 0.28);
}
.os-card.is-detected .os-logo { color: var(--accent); }
.os-card.is-detected .os-badge { display: block; }

/* Native-shell screenshot */
.desktop-shot {
  margin: 36px 0 0;
  padding: 10px;
  background: #08090b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}
.desktop-shot img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius) - 6px);
  display: block;
}
.desktop-shot figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
  padding-bottom: 4px;
}

/* ---------- Docker ---------- */
.docker-cards { display: grid; gap: 14px; }
details.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
details.card summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary::before { content: "+"; color: var(--accent); font-weight: 700; font-size: 18px; width: 16px; }
details.card[open] summary::before { content: "−"; }
details.card summary .tag { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 500; }
details.card .card-body { padding: 0 22px 22px; }
details.card .card-body .hint { margin-top: 12px; }
.docker-note { color: var(--muted); font-size: 14px; margin-top: 18px; }
.docker-note code { font-family: var(--mono); background: var(--panel); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); }

/* ---------- Contributing teaser ---------- */
.teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  background: linear-gradient(120deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
}
.teaser h3 { font-size: 22px; margin-bottom: 6px; }
.teaser p { color: var(--muted); margin: 0; max-width: 52ch; }

/* ---------- Contributing page ---------- */
.doc { padding: 64px 0; }
.doc h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; margin-bottom: 10px; }
.doc .lead { color: var(--muted); font-size: 18px; max-width: 62ch; margin: 0 0 36px; }
.doc h2 { font-size: 24px; margin: 44px 0 16px; }
.doc p { color: var(--text); }
.doc ul { color: var(--muted); padding-left: 20px; }
.doc ul li { margin: 8px 0; }
.doc ul li code, .doc p code { font-family: var(--mono); background: var(--panel); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); font-size: 0.92em; }
.doc-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- Uninstall cards ---------- */
.uninstall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0 8px;
}
.uninstall-card {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.uninstall-card h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.uninstall-card p { color: var(--muted); margin: 0 0 12px; }
.uninstall-card .uninstall-keeps { color: var(--text); font-size: 0.92rem; }
.uninstall-card .uninstall-keeps strong { color: var(--accent); }
.uninstall-card .code { margin-top: auto; }
.uninstall-card .hint { margin: 14px 0 8px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-family { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.footer-family-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-family a { color: var(--muted); font-size: 14px; }
.footer-family a:hover { color: var(--text); }
.footer .credit { color: var(--muted); font-size: 13px; }
.footer .credit .accent { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  section { padding: 60px 0; }
  .nav-links { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 8px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; border-radius: 8px; }
  .nav-links a.ghbtn { margin-top: 4px; text-align: center; justify-content: center; }
  .nav-toggle {
    display: inline-flex; margin-left: auto;
    background: var(--panel); border: 1px solid var(--border);
    color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 18px; line-height: 1;
  }
  .car-arrow { width: 36px; height: 36px; }
  .os-grid { grid-template-columns: 1fr; }
  .family-grid { grid-template-columns: 1fr; }
  .uninstall-grid { grid-template-columns: 1fr; }
}
