/* My Vision Assistant documentation. Brand colours as in the app (brand-purple, deep purple,
   gold); the magenta of the numbered notes matches the arrows drawn on the screenshots. */
:root {
  --ink: #1d1523;
  --text: #352c3b;
  --muted: #6b6273;
  --line: #ebe5ee;
  --bg: #fbf9fc;
  --card: #ffffff;
  --brand: #74097d;
  --deep: #4f0759;
  --gold: #ffb957;
  --gold-ink: #3a2400;
  --accent: #e0217d;
  --tint: #f6eef8;
  --code: #f3eef5;
  --shadow: 0 1px 2px rgba(29, 21, 35, 0.04), 0 10px 30px -12px rgba(79, 7, 89, 0.18);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4eef7;
    --text: #ddd3e3;
    --muted: #a99db2;
    --line: #2e2534;
    --bg: #141016;
    --card: #1c1620;
    --brand: #d78be0;
    --deep: #e7b3ee;
    --tint: #261c2b;
    --code: #261d2b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--deep); }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--deep); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.brand em { font-style: normal; font-weight: 600; color: var(--muted); }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input { width: 100%; height: 40px; padding: 0 40px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search kbd { position: absolute; right: 10px; top: 9px; }
.results { position: absolute; top: 46px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.results a[aria-selected="true"], .results a:hover { background: var(--tint); }
.results b { display: block; color: var(--ink); font-size: 14px; }
.results small { color: var(--muted); font-size: 13px; }
.results p { margin: 8px 12px; color: var(--muted); font-size: 14px; }
.open-app { flex-shrink: 0; padding: 9px 16px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.open-app:hover { color: var(--gold-ink); filter: brightness(0.97); }
.menu { display: none; width: 40px; height: 40px; border: 0; background: none; padding: 9px; cursor: pointer; }
.menu span { display: block; height: 2px; margin: 5px 0; background: var(--ink); border-radius: 2px; }
kbd { font: 600 12px/1 Inter, system-ui, sans-serif; padding: 4px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--card); color: var(--muted); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 220px; gap: 40px; max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.sidebar { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow-y: auto; padding: 28px 8px 40px 0; }
.nav-group p { margin: 22px 0 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nav-group:first-child p { margin-top: 0; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.nav-group a:hover { background: var(--tint); color: var(--ink); }
.nav-group a[aria-current="page"] { background: var(--tint); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.content { min-width: 0; padding: 32px 0 64px; max-width: 820px; }
.toc { position: sticky; top: 64px; align-self: start; padding: 32px 0; font-size: 14px; }
.toc p { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

/* ── Text ────────────────────────────────────────────────────────────────── */
.crumb { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
h1 { margin: 0 0 12px; color: var(--ink); font-size: clamp(30px, 4.2vw, 42px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; }
h2 { position: relative; margin: 48px 0 12px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--ink); font-size: 25px; line-height: 1.25; letter-spacing: -0.02em; }
h3 { margin: 28px 0 8px; color: var(--ink); font-size: 18px; }
.anchor { position: absolute; left: -22px; opacity: 0; text-decoration: none; color: var(--muted); font-weight: 500; }
h2:hover .anchor { opacity: 1; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
p, li { max-width: 72ch; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
strong { color: var(--ink); }
code { font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code); padding: 2px 6px; border-radius: 6px; }
.ui { font-weight: 600; color: var(--ink); background: var(--tint); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.tag-new { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 30%, transparent); color: var(--gold-ink); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
@media (prefers-color-scheme: dark) { .tag-new { color: var(--gold); } }
h2 .tag-new, h3 .tag-new { font-size: 11px; }

/* ── Notes ───────────────────────────────────────────────────────────────── */
.note, .warn { margin: 20px 0; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.note { border-left: 4px solid var(--brand); }
.warn { border-left: 4px solid var(--gold); }
.note p, .warn p { margin: 4px 0; }
.note strong:first-child, .warn strong:first-child { display: block; margin-bottom: 2px; }

/* ── Steps ───────────────────────────────────────────────────────────────── */
ol.steps { list-style: none; padding: 0; counter-reset: step; margin: 18px 0; }
ol.steps > li { position: relative; padding: 2px 0 14px 48px; counter-increment: step; max-width: none; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: #fff; font-weight: 700; font-size: 15px; }
ol.steps > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 2px; width: 2px; background: var(--line); }
ol.steps > li:last-child::after { display: none; }

/* ── Screenshots ─────────────────────────────────────────────────────────── */
.shot { margin: 26px 0 32px; }
.zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.zoom:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(29, 21, 35, 0.05), 0 18px 40px -14px rgba(79, 7, 89, 0.28); }
.zoom img { display: block; width: 100%; }
.shot figcaption { margin-top: 12px; font-size: 15px; }
.shot figcaption > strong { display: block; margin-bottom: 6px; }
ol.callouts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ol.callouts li { display: flex; gap: 10px; align-items: flex-start; margin: 0; max-width: none; color: var(--text); }
.num { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; margin-top: 1px; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.18); }

/* ── Cards (welcome page) ───────────────────────────────────────────────── */
.hero { margin: 0 0 8px; padding: 44px 40px 36px; border-radius: 22px; background: radial-gradient(ellipse at 12% 0%, rgba(255, 185, 87, 0.3), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(224, 33, 125, 0.25), transparent 50%), linear-gradient(135deg, #74097d 0%, #4f0759 70%); color: #fff; box-shadow: 0 24px 50px -28px rgba(79, 7, 89, 0.7); }
.hero .crumb { color: var(--gold); }
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255, 255, 255, 0.82); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 15px; }
.btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.line { border: 1.5px solid rgba(255, 255, 255, 0.6); color: #fff; }
.btn.gold:hover { color: var(--gold-ink); filter: brightness(0.97); }
.btn.line:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 22px 0; }
.card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform 0.15s ease, border-color 0.15s ease; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--text); }
.card .ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--tint); color: var(--brand); font-size: 19px; margin-bottom: 10px; }
.card b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.card span { font-size: 14px; color: var(--muted); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { width: 100%; overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--tint); color: var(--ink); font-size: 13px; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: 0; }

/* ── Q&A ─────────────────────────────────────────────────────────────────── */
details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin: 10px 0; }
summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details > div { padding: 0 18px 14px; }

/* ── Pager, footer ───────────────────────────────────────────────────────── */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--brand); }
.pager span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.pager .next { text-align: right; }
.foot { border-top: 1px solid var(--line); padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(15, 8, 20, 0.86); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1600px, 100%); max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.lightbox button { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 26px; cursor: pointer; }

/* ── Smaller screens ─────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .menu { display: block; }
  .sidebar { position: fixed; z-index: 35; top: 64px; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); padding: 20px 16px; background: var(--card); border-right: 1px solid var(--line); transform: translateX(-105%); transition: transform 0.2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .brand span em, .search kbd { display: none; }
  .open-app { display: none; }
  .hero { padding: 32px 20px 26px; border-radius: 16px; }
  .anchor { display: none; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .pager { grid-template-columns: 1fr; }
}
