/* Ember website — shared styles for index.html and guide.html.
   One accent colour, neutral surfaces, system fonts. Dark mode follows the
   visitor's OS setting. */

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

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-subtle: #f6f8fb;
  --bg-muted: #eceff5;
  --bg-hover: #f1f4f9;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --on-accent: #ffffff;

  --ink: #0b1220;
  --ink-2: #1b2740;
  --on-ink: #e8edf7;
  --on-ink-2: #aab6cc;

  --success: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;

  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.22);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.35);

  --radius: 10px;
  --radius-lg: 14px;
  --header-h: 60px;
  --sidebar-w: 264px;
  --container: 1080px;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-subtle: #101a2e;
    --bg-muted: #17233b;
    --bg-hover: #14203a;

    --text: #e8edf7;
    --text-2: #b6c1d6;
    --text-3: #8795af;

    --border: #202d46;
    --border-strong: #31415f;

    --accent: #5b9dff;
    --accent-hover: #86b7ff;
    --accent-soft: rgba(91, 157, 255, 0.12);
    --on-accent: #07101f;

    --ink: #070c18;
    --ink-2: #111b31;

    --success: #4ade80;
    --warn: #fbbf24;
    --danger: #f87171;

    --header-bg: rgba(11, 18, 32, 0.82);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
    --focus: 0 0 0 3px rgba(91, 157, 255, 0.45);
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

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

::selection { background: var(--accent-soft); color: var(--text); }

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

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

img { max-width: 100%; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.875em;
}
code {
  background: var(--bg-muted);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}
kbd {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05em 0.4em;
  color: var(--text);
  white-space: nowrap;
}
pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: var(--text-2); }

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 400;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus, .skip-link:focus-visible { top: 10px; color: var(--on-accent); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  max-width: calc(var(--container) + 48px);
  margin: 0 auto;
}
.header-inner.wide { max-width: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }

.header-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-nav a {
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
}
.header-nav a:hover { color: var(--text); background: var(--bg-hover); }
.header-nav a[aria-current="page"] { color: var(--text); }
.header-nav .icon-link { display: inline-flex; align-items: center; padding: 8px; }
.header-nav .icon-link svg { fill: currentColor; display: block; }
.header-nav .nav-cta {
  margin-left: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.header-nav .nav-cta:hover { background: var(--accent-hover); color: var(--on-accent); }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.mobile-toggle:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); }
.btn-light { background: #ffffff; color: #0b1220; }
.btn-light:hover { background: #e8edf7; color: #0b1220; }
.btn-ghost { background: transparent; color: var(--on-ink); border-color: rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---------- Landing: hero ---------- */
.hero {
  padding: calc(var(--header-h) + 72px) 0 72px;
  text-align: center;
  background: radial-gradient(70% 55% at 50% 0%, var(--accent-soft), transparent 70%);
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 16em;
  margin: 0 auto 20px;
  text-wrap: balance;
}
.hero .lede {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 38em;
  margin: 0 auto 32px;
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-meta { margin-top: 18px; font-size: 14px; color: var(--text-3); }

.shot { margin: 56px auto 0; max-width: 1000px; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.shot figcaption { margin-top: 14px; font-size: 13.5px; color: var(--text-3); }

/* ---------- Landing: sections ---------- */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 40em; margin: 0 auto 48px; text-align: center; }
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
  text-wrap: balance;
}
.section-head p { color: var(--text-2); font-size: 17px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
}
.feature .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature h3 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.feature p { font-size: 15px; color: var(--text-2); line-height: 1.6; }
.feature .beta-badge { margin-left: 4px; }

.beta-badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; counter-reset: s; }
.steps li { list-style: none; counter-increment: s; }
.steps li::before {
  content: counter(s);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 16px;
}
.steps h3 { font-size: 18px; font-weight: 650; margin-bottom: 6px; }
.steps p { color: var(--text-2); font-size: 15.5px; }
.more-link { margin-top: 40px; text-align: center; font-weight: 600; }
.more-link a::after { content: ' \2192'; }

.download-band {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
  padding: 80px 0;
}
.download-band img { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 22px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }
.download-band h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 12px; color: #fff; }
.download-band p { color: var(--on-ink-2); max-width: 36em; margin: 0 auto; font-size: 17px; }
.download-band .btn-group { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 30px 0 18px; }
.download-band .meta { font-size: 14px; color: var(--on-ink-2); }
.download-band code { background: rgba(255, 255, 255, 0.1); color: var(--on-ink); }
.download-band .meta a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.download-band .meta a:hover { color: #fff; }

/* ---------- Release history ---------- */
.releases-head { margin-bottom: 36px; text-align: center; }
.releases-head h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 12px; }
.releases-head p { color: var(--text-2); font-size: 17px; max-width: 40em; margin: 0 auto; text-wrap: pretty; }
.releases-wrap { max-width: 820px; margin: 0 auto; }

.release {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px 20px;
  margin: 0 0 20px;
}
.release-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.release h3 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release h3 a { color: var(--text); }
.release h3 a:hover { color: var(--accent); }
.release-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.release-date { font-size: 14px; color: var(--text-3); }
.release-tag { font-size: 13px; color: var(--text-3); margin: 10px 0 14px; }
.release-tag a { color: var(--text-2); }
.release-notes > p { color: var(--text-2); margin-bottom: 14px; font-size: 15.5px; }
.release-notes h4 { margin: 22px 0 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.release-notes h5 { margin: 16px 0 6px; font-size: 14px; font-weight: 650; color: var(--text); }
.release-notes ul { margin: 0 0 8px 22px; }
.release-notes li { margin-bottom: 5px; color: var(--text-2); font-size: 14.5px; }
.release-notes li strong { color: var(--text); }
.release-notes .full-changelog {
  margin: 18px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.release-notes .full-changelog strong { display: block; margin-bottom: 4px; }

.older-releases { margin-top: 8px; }
.older-releases > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 20px;
}
.older-releases > summary::-webkit-details-marker { display: none; }
.older-releases > summary:hover { background: var(--bg-hover); }
.older-releases > summary svg { transition: transform 0.2s ease; color: var(--text-3); }
.older-releases[open] > summary svg { transform: rotate(180deg); }
.older-releases[open] > summary .when-closed,
.older-releases:not([open]) > summary .when-open { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  color: var(--text-3);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 28px 24px;
  max-width: calc(var(--container) + 48px);
  margin: 0 auto;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }

/* ---------- Guide: layout ---------- */
.layout { display: flex; padding: var(--header-h) 0 0 var(--sidebar-w); }

.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.toc-section + .toc-section { margin-top: 20px; }
.toc-heading {
  display: block;
  padding: 0 10px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.toc-link {
  display: block;
  padding: 5px 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-2);
  border-radius: 7px;
}
.toc-link:hover { color: var(--text); background: var(--bg-hover); }
.toc-link.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toc-child { padding-left: 22px; font-size: 13.5px; color: var(--text-3); }

.main {
  flex: 0 1 calc(780px + 112px);
  min-width: 0;
  margin: 0 auto;
  padding: 48px 56px 96px;
}
.page-title { font-size: clamp(30px, 4vw, 38px); font-weight: 750; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 10px; }
.page-lede { font-size: 18px; color: var(--text-2); line-height: 1.55; max-width: 38em; }
.page-intro { margin-bottom: 48px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.guide-footer { margin-left: var(--sidebar-w); }

/* ---------- Prose (guide content and release page text) ---------- */
.prose h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 16px;
  color: var(--text);
}
.prose h3 { font-size: 19px; font-weight: 650; margin: 32px 0 10px; color: var(--text); }
.prose h4 { font-size: 16px; font-weight: 650; margin: 24px 0 8px; color: var(--text); }
.prose p { margin-bottom: 14px; color: var(--text-2); }
.prose ul, .prose ol { margin: 8px 0 16px 24px; color: var(--text-2); }
.prose li { margin-bottom: 6px; }
.prose li strong, .prose strong { color: var(--text); }
.prose p a, .prose li a, .prose td a, .faq-a a, .callout a { text-underline-offset: 3px; }
.prose p a:hover, .prose li a:hover, .prose td a:hover, .faq-a a:hover, .callout a:hover { text-decoration: underline; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 56px 0; }
.prose .section-lead { color: var(--text-3); font-size: 15.5px; margin-top: -6px; margin-bottom: 20px; }

.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0 24px;
  font-size: 14.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.doc-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-weight: 650;
  color: var(--text);
  font-size: 13.5px;
}
.doc-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table th + th, .doc-table td + td { border-left: 1px solid var(--border); }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
}
.callout p { margin: 0; color: var(--text-2); }
.callout p + p { margin-top: 10px; }
.callout strong { color: var(--text); }
.callout-info { border-left-color: var(--text-3); }
.callout-warn { border-left-color: var(--danger); }

.steps-list { list-style: none; margin: 16px 0 24px !important; padding: 0; counter-reset: step; }
.steps-list li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 18px 48px;
  margin: 0 0 0 0;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps-list li strong { display: block; margin-bottom: 2px; }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; background: var(--bg); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  line-height: 1.4;
}
.faq-q:hover { background: var(--bg-hover); }
.faq-q .faq-chevron { transition: transform 0.2s; flex-shrink: 0; color: var(--text-3); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 18px 18px; font-size: 15px; color: var(--text-2); line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  box-shadow: var(--shadow-md);
}
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }
.back-to-top.visible { display: flex; }

.overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 28px; }

  .mobile-toggle { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; z-index: 300; }
  .sidebar.open { transform: translateX(0); box-shadow: 6px 0 24px rgba(0, 0, 0, 0.18); }
  .layout { padding-left: 0; }
  .main { padding: 32px 22px 64px; }
  .guide-footer { margin-left: 0; }
  .overlay { position: fixed; inset: 0; top: var(--header-h); background: rgba(8, 12, 22, 0.45); z-index: 250; }
  .overlay.open { display: block; }
}

@media (max-width: 680px) {
  .container { padding: 0 20px; }
  .hero { padding-top: calc(var(--header-h) + 44px); padding-bottom: 48px; }
  .shot { margin-top: 40px; }
  .section, .download-band { padding: 56px 0; }
  .section-head { margin-bottom: 36px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .header-nav .nav-opt { display: none; }
  .release { padding: 20px 18px 16px; }
  .doc-table { display: block; overflow-x: auto; }
}

@media (max-width: 400px) {
  .brand span { display: none; }
}

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