/*
  Carom site. Dark first, like the app, with a light theme that follows the system
  until someone picks one. System fonts on purpose: nothing here calls another
  server, which is also what the page says about the app.
*/

:root {
  color-scheme: dark;
  --bg: #131519;
  --bg-2: #171a1f;
  --surface: #1b1e24;
  --surface-2: #21252c;
  --border: #2b3038;
  --text: #dce0e7;
  --muted: #9aa3b2;
  --accent: #5b83f5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 131, 245, 0.14);
  --orange: #e0913f;
  --green: #57b981;
  --purple: #a97ad6;
  --glow-1: rgba(91, 131, 245, 0.22);
  --glow-2: rgba(224, 145, 63, 0.14);
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --radius: 14px;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;
  --wrap: 1120px;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --border: #dde1e8;
  --text: #1c2027;
  --muted: #566070;
  --accent: #3c66e0;
  --accent-soft: rgba(60, 102, 224, 0.1);
  --glow-1: rgba(60, 102, 224, 0.18);
  --glow-2: rgba(224, 145, 63, 0.16);
  --shadow: 0 30px 70px -25px rgba(24, 34, 60, 0.35), 0 0 0 1px rgba(20, 30, 50, 0.06);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f6f7f9;
    --bg-2: #eef0f4;
    --surface: #ffffff;
    --surface-2: #f1f3f7;
    --border: #dde1e8;
    --text: #1c2027;
    --muted: #566070;
    --accent: #3c66e0;
    --accent-soft: rgba(60, 102, 224, 0.1);
    --glow-1: rgba(60, 102, 224, 0.18);
    --glow-2: rgba(224, 145, 63, 0.16);
    --shadow: 0 30px 70px -25px rgba(24, 34, 60, 0.35), 0 0 0 1px rgba(20, 30, 50, 0.06);
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

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

img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); }
code {
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.08em 0.4em;
  overflow-wrap: anywhere;
}
strong { font-weight: 650; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 32px, 780px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }
.ico { flex: none; }

/* ───── header ───── */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-in { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn, .lang summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 38px; height: 38px; padding: 0 9px;
  color: var(--muted); background: transparent; border: 0; border-radius: 9px;
  cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; text-decoration: none; list-style: none;
}
.icon-btn:hover, .lang summary:hover, .lang[open] summary { color: var(--text); background: var(--surface-2); }
.lang { position: relative; }
.lang summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  display: grid; gap: 2px;
}
.lang-menu a { padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.95rem; }
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a[aria-current] { color: var(--accent); font-weight: 650; }
.when-light { display: none; }
:root[data-theme='light'] .when-dark { display: none; }
:root[data-theme='light'] .when-light { display: inline-flex; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .when-dark { display: none; }
  :root:not([data-theme]) .when-light { display: inline-flex; }
}
@media (max-width: 760px) {
  .top-in { gap: 8px; padding-block: 8px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 6px 10px; white-space: nowrap; }
}

/* ───── buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--surface); transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -8px var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 12px; }

/* ───── hero ───── */
.hero {
  position: relative; overflow: hidden; padding: clamp(48px, 9vw, 104px) 0 0;
  background:
    radial-gradient(60% 55% at 15% 0%, var(--glow-1), transparent 70%),
    radial-gradient(50% 50% at 90% 10%, var(--glow-2), transparent 70%);
}
.hero-in { text-align: center; max-width: 820px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px 14px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 0.85rem; font-weight: 650; letter-spacing: 0.01em;
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); letter-spacing: -0.035em; }
.grad { display: inline-block; background: linear-gradient(100deg, var(--accent), var(--purple) 55%, var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); margin: 22px auto 0; max-width: 660px; }
.lead strong { color: var(--text); }
.lead-sm { font-size: 1.1rem; color: var(--muted); }
.cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin: 18px 0 0; font-size: 0.9rem; color: var(--muted); }
.hero-shot { margin-top: clamp(36px, 6vw, 64px); }
.hero-shot .window { transform-origin: top center; margin-bottom: -6%; }

/* ───── screenshots ───── */
.window { margin: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.window-bar { display: flex; gap: 7px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); display: block; }
.shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; background: var(--surface); }

/* ───── sections ───── */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.tint, .band { background: var(--bg-2); border-block: 1px solid var(--border); }
.band { padding: clamp(56px, 8vw, 96px) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(32px, 5vw, 56px); }
.section-head h2, .section h2, .band h2, .final h2 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); }
.section-head p { margin: 14px 0 0; color: var(--muted); font-size: 1.1rem; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-2px); }
.card.plain:hover { transform: none; }
.card-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }

.tour-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.tour-item.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.tour-item.flip .tour-text { order: 2; }
.tour-text h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 14px 0 12px; }
.tour-text p { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.82rem; font-weight: 650; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks .ico { color: var(--green); margin-top: 3px; }
.ticks.big { gap: 16px; }
.ticks.big li { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.ticks.big .ico { color: var(--accent); }
@media (max-width: 860px) {
  .tour-item, .tour-item.flip { grid-template-columns: 1fr; }
  .tour-item.flip .tour-text { order: 0; }
}

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; margin-bottom: 28px; }
.split h3 { margin-bottom: 14px; font-size: 1.1rem; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 7px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 0.93rem; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.two h2 { margin-bottom: 16px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

/* ───── download ───── */
.platforms { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); margin-bottom: 24px; }
.platform { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.platform.mine { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.platform-head { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.platform-head h3 { color: var(--text); font-size: 1.25rem; }
.platform p { color: var(--muted); font-size: 0.96rem; flex: 1; }
.platform-links { display: flex; flex-wrap: wrap; gap: 8px; }
.version { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.first-run { max-width: 780px; margin: 48px auto 0; }
.first-run h3 { font-size: 1.3rem; margin-bottom: 8px; }
.first-run h3.spaced { margin-top: 40px; }

.fold { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; }
.fold summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; font-weight: 600; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary .ico { color: var(--muted); transition: transform 0.15s; }
.fold[open] summary .ico { transform: rotate(180deg); }
.fold-body { padding: 0 20px 6px; color: var(--muted); }
.fold-body p { margin-bottom: 0.9em; }

.code { margin: 0 0 1em; padding: 14px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; font-size: 0.9rem; line-height: 1.55; color: var(--text); }
.code code { background: none; border: 0; padding: 0; font-size: inherit; }

.final { padding: clamp(64px, 9vw, 112px) 0; text-align: center; background: radial-gradient(55% 90% at 50% 100%, var(--glow-1), transparent 70%); border-top: 1px solid var(--border); }
.final h2 { margin-bottom: 14px; }

/* ───── footer ───── */
.foot { border-top: 1px solid var(--border); padding: 36px 0; color: var(--muted); font-size: 0.93rem; }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }
.foot-brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.foot-brand img { border-radius: 6px; }
.foot-brand strong { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }

/* ───── keys ───── */
.keys { display: inline-flex; gap: 4px; white-space: nowrap; vertical-align: baseline; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 0.12em 0.5em; text-align: center;
  font-size: 0.82em; font-weight: 600; line-height: 1.5; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
}

/* ───── guide ───── */
.guide-head { padding: clamp(40px, 7vw, 72px) 0 12px; }
.guide-head h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.guide-head .lead { margin: 18px 0 0; max-width: 720px; }
.guide-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-block: 28px 96px; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc-fold summary { list-style: none; cursor: default; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; padding: 0 0 10px; }
.toc-fold summary::-webkit-details-marker { display: none; }
.toc-fold summary .ico { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 900px) {
  .guide-body { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
  .toc-fold summary { cursor: pointer; padding-bottom: 0; }
  .toc-fold summary .ico { display: block; }
  .toc-fold[open] summary { padding-bottom: 10px; }
}

.prose { min-width: 0; }
.doc { padding-bottom: 20px; margin-bottom: 44px; border-bottom: 1px solid var(--border); }
.doc:last-child { border-bottom: 0; }
.doc h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); margin-bottom: 14px; position: relative; }
.doc h3 { font-size: 1.2rem; margin: 26px 0 10px; }
.anchor { position: absolute; left: -1.1em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.doc h2:hover .anchor, .anchor:focus { opacity: 1; }
@media (max-width: 900px) { .anchor { display: none; } }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.doc li { margin-bottom: 0.5em; }
.doc li::marker { color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 42px; min-height: 30px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.88rem; }
.doc .window { margin: 22px 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; }
th, td { text-align: left; padding: 11px 16px; vertical-align: top; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tbody th { font-weight: 600; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 640px) { tbody th { white-space: normal; } th, td { padding: 10px 12px; } }

.note { margin: 1.3em 0; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--surface); }
.note strong { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 2px; }
.note p { margin: 0; color: var(--text); }
.note.warn { border-left-color: var(--orange); }
.note.warn strong { color: var(--orange); }
.note.info { border-left-color: var(--purple); }
.note.info strong { color: var(--purple); }

.os-switch { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 12px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 0.88rem; }
.os-switch span { padding: 0 10px; color: var(--muted); }
.os-switch button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; }
.os-switch button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.os-switch:not(.ready) { display: none; }

.gen-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 8px; }
.gen-tools input { flex: 1 1 260px; max-width: 420px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.gen-tools input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gen-tools:not(.ready) { display: none; }
.gen-group h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin: 22px 0 10px; }
.count { font-size: 0.78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }
.gen-list { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.gen-list li { margin: 0 !important; }
.gen-list code { display: inline-block; color: var(--purple); background: color-mix(in srgb, var(--purple) 10%, var(--surface)); border-color: color-mix(in srgb, var(--purple) 28%, var(--border)); font-size: 0.83rem; cursor: pointer; }
.gen-list code:hover { border-color: var(--purple); }
.gen-list code.copied { color: var(--green); border-color: var(--green); }
[hidden] { display: none !important; }
