/* ============================================================
   Athena Docs — shared stylesheet
   Three-column documentation shell (sidebar · content · TOC).
   Reuses the SealGrid marketing palette (teal/blue/deep-navy).
   Zero external deps, system fonts only, no build step.
   ============================================================ */

:root {
  --teal: #1D9E75;
  --teal-bright: #28c294;
  --blue: #185FA5;
  --blue-bright: #2a7fd0;

  --bg: #070b13;
  --bg-2: #0a1019;
  --bg-3: #0e1622;
  --panel: #111c2b;
  --panel-2: #15212f;
  --line: #1e2c3d;
  --line-2: #29384b;

  --text: #e6edf5;
  --text-dim: #9fb0c3;
  --text-faint: #6b7e93;

  --radius: 10px;
  --radius-lg: 16px;

  --sidebar-w: 280px;
  --toc-w: 240px;
  --nav-h: 64px;
  --content-maxw: 820px;

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

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Paint a dark canvas during navigation/load — prevents the white flash
   between full page loads on a dark site. The matching dark background is also
   set inline in each page's <head> so the very first paint is dark too. */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); background: var(--bg); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--teal); color: #03110b; }

:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--teal); color: #03110b; padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* ---------- Top bar ---------- */
header.docnav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: rgba(7,11,19,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.docnav .brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; color: var(--text); }
.docnav .brand:hover { text-decoration: none; }
.docnav .brand svg { display: block; }
.docnav .brand b { color: var(--teal-bright); }
.docnav .brand .product {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint);
  border-left: 1px solid var(--line-2); padding-left: 11px; margin-left: 3px;
}
.docnav .spacer { flex: 1; }
.docnav .nav-ext { display: flex; align-items: center; gap: 4px; }
.docnav .nav-ext a {
  color: var(--text-dim); font-size: .9rem; font-weight: 500;
  padding: 7px 13px; border-radius: 8px; transition: color .15s, background .15s;
}
.docnav .nav-ext a:hover { color: var(--text); background: rgba(255,255,255,.05); text-decoration: none; }
.docnav .nav-ext a.cta {
  background: linear-gradient(135deg, var(--teal) 0%, #168a64 100%);
  color: #03110b; font-weight: 600;
}
.docnav .nav-ext a.cta:hover { background: linear-gradient(135deg, var(--teal-bright) 0%, var(--teal) 100%); }

.menu-btn {
  display: none; background: transparent; border: 1px solid var(--line-2);
  border-radius: 8px; width: 40px; height: 38px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center; color: var(--text);
}
.menu-btn svg { display: block; }

/* ---------- Layout shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1440px; margin: 0 auto;
  align-items: start;
}

/* ---------- Sidebar ---------- */
aside.sidebar {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 26px 16px 60px 22px;
}
aside.sidebar::-webkit-scrollbar { width: 9px; }
aside.sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.side-search {
  width: 100%; margin-bottom: 20px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); font-family: var(--font); font-size: .9rem;
  padding: 9px 12px;
}
.side-search::placeholder { color: var(--text-faint); }
.side-search:focus { outline: none; border-color: var(--teal); }

.side-group { margin-bottom: 22px; }
.side-group > .side-title {
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--text-faint);
  padding: 0 10px; margin-bottom: 8px;
}
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group li a {
  display: block; padding: 7px 10px; border-radius: 8px;
  color: var(--text-dim); font-size: .92rem; font-weight: 500;
  border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s;
}
.side-group li a:hover { color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; }
.side-group li a.active {
  color: var(--teal-bright); background: rgba(29,158,117,.09);
  border-left-color: var(--teal-bright); font-weight: 600;
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(3,6,11,.6); backdrop-filter: blur(2px);
}

/* ---------- Content ---------- */
main.content {
  min-width: 0;
  padding: 40px clamp(24px, 4vw, 56px) 96px;
  max-width: calc(var(--content-maxw) + 112px);
}
.content .breadcrumb {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .04em;
  color: var(--text-faint); margin-bottom: 18px;
}
.content .breadcrumb a { color: var(--text-faint); }
.content .breadcrumb a:hover { color: var(--text-dim); }

.content h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 680; }
.content h2 {
  font-size: 1.5rem; letter-spacing: -.01em; margin: 2.4em 0 .7em; font-weight: 640;
  padding-top: .3em; border-top: 1px solid var(--line);
}
.content h2:first-of-type { border-top: 0; }
.content h3 { font-size: 1.16rem; margin: 1.8em 0 .5em; font-weight: 620; }
.content h4 { font-size: 1rem; margin: 1.5em 0 .4em; font-weight: 620; color: var(--text); }
.content .lead { font-size: 1.14rem; color: var(--text-dim); margin: 0 0 1.4em; }
.content p { margin: 0 0 1.1em; color: var(--text); }
.content ul, .content ol { margin: 0 0 1.2em; padding-left: 1.4em; color: var(--text); }
.content li { margin: .35em 0; }
.content li::marker { color: var(--teal); }
.content strong { color: #f2f6fb; font-weight: 640; }

/* anchored headings */
.content h2, .content h3 { scroll-margin-top: calc(var(--nav-h) + 20px); position: relative; }
.content .anchor {
  opacity: 0; color: var(--text-faint); margin-left: 8px; font-weight: 400;
  text-decoration: none; transition: opacity .15s;
}
.content h2:hover .anchor, .content h3:hover .anchor { opacity: 1; }

/* inline + block code */
.content code {
  font-family: var(--mono); font-size: .86em;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 6px; padding: .12em .4em; color: #c8e6da;
}
.content pre {
  margin: 0 0 1.3em; padding: 16px 18px; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  position: relative;
}
.content pre code { background: none; border: 0; padding: 0; font-size: .86rem; color: #d4e2ee; line-height: 1.6; }
.content pre .tok-cmt { color: var(--text-faint); }
.content pre .tok-key { color: var(--teal-bright); }
.content pre .tok-str { color: #d6a44a; }
.content pre .tok-num { color: var(--blue-bright); }

.copy-btn {
  position: absolute; top: 9px; right: 9px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 7px;
  color: var(--text-dim); font-size: .72rem; font-family: var(--mono);
  padding: 4px 9px; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s;
}
.content pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--teal-bright); border-color: var(--teal); }

/* tables */
.content .table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius); }
.content table { width: 100%; border-collapse: collapse; min-width: 480px; }
.content th, .content td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
.content thead th { background: var(--bg-2); color: var(--text-faint); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.content tbody td { color: var(--text-dim); }
.content tbody tr:last-child td { border-bottom: 0; }
.content td code { white-space: nowrap; }

/* callouts / admonitions */
.callout {
  display: flex; gap: 13px; padding: 15px 18px; margin: 0 0 1.4em;
  border: 1px solid var(--line-2); border-left-width: 3px; border-radius: var(--radius);
  background: var(--bg-2); color: var(--text-dim); font-size: .94rem;
}
.callout .ic { flex: none; margin-top: 2px; }
.callout p { margin: 0 0 .4em; color: var(--text-dim); }
.callout p:last-child { margin: 0; }
.callout .ctitle { font-weight: 650; color: var(--text); display: block; margin-bottom: 3px; }
.callout.note { border-left-color: var(--blue-bright); }
.callout.note .ic { color: var(--blue-bright); }
.callout.tip { border-left-color: var(--teal-bright); }
.callout.tip .ic { color: var(--teal-bright); }
.callout.warn { border-left-color: #d6a44a; background: rgba(214,164,74,.06); }
.callout.warn .ic { color: #d6a44a; }
.callout.airgap { border-left-color: var(--teal); background: rgba(29,158,117,.07); }
.callout.airgap .ic { color: var(--teal-bright); }

/* pills / badges */
.pill {
  display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  vertical-align: middle;
}
.pill.now { color: var(--teal-bright); border: 1px solid rgba(40,194,148,.4); background: rgba(29,158,117,.08); }
.pill.soon { color: var(--text-faint); border: 1px solid var(--line-2); }

/* cards grid (home / overview) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 0 0 1.5em; }
.doc-card {
  display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-2); transition: transform .16s, border-color .2s, background .2s;
}
.doc-card:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--panel); text-decoration: none; }
.doc-card .dc-ic { color: var(--teal-bright); margin-bottom: 11px; }
.doc-card h3 { margin: 0 0 5px; font-size: 1.02rem; color: var(--text); }
.doc-card p { margin: 0; color: var(--text-dim); font-size: .9rem; }

/* screenshots / figures */
.content figure.shot { margin: 0 0 1.6em; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); }
.content figure.shot img { display: block; width: 100%; height: auto; }
.content figure.shot figcaption { padding: 10px 15px; font-size: .85rem; color: var(--text-faint); border-top: 1px solid var(--line); }
.content figure.shot img { cursor: zoom-in; }

/* narrated tutorial videos (mirrors figure.shot) */
.content figure.video { margin: 0 0 1.6em; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #000; }
.content figure.video video { display: block; width: 100%; height: auto; background: #000; }
.content figure.video figcaption { padding: 10px 15px; font-size: .85rem; color: var(--text-faint); border-top: 1px solid var(--line); background: var(--bg-2); }

/* Click-to-enlarge lightbox for screenshots */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(3, 7, 13, 0.88); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 4vh 4vw;
  cursor: zoom-out;
}
.lightbox.open { display: flex; animation: lb-fade .12s ease; }
.lightbox img {
  max-width: 94vw; max-height: 94vh; width: auto; height: auto;
  border-radius: var(--radius); border: 1px solid var(--line-2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.shot-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 200px; padding: 28px; text-align: center;
  color: var(--text-faint); font-family: var(--mono); font-size: .82rem;
  background:
    repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 13px, var(--bg-3) 13px, var(--bg-3) 26px);
}
.shot-ph svg { color: var(--line-2); }

/* prev / next */
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 54px; padding-top: 26px; border-top: 1px solid var(--line); }
.pager a {
  flex: 1; max-width: 48%; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg-2);
  color: var(--text); transition: border-color .2s, background .2s;
}
.pager a:hover { border-color: var(--teal); background: var(--panel); text-decoration: none; }
.pager .dir { font-family: var(--mono); font-size: .72rem; color: var(--text-faint); letter-spacing: .08em; text-transform: uppercase; }
.pager .ttl { display: block; margin-top: 3px; font-weight: 600; color: var(--teal-bright); }
.pager a.next { text-align: right; margin-left: auto; }

/* ---------- TOC ---------- */
aside.toc {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 40px 22px 60px 8px;
}
.toc .toc-title {
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 12px;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-faint); font-size: .85rem; line-height: 1.4;
  transition: color .15s, border-color .15s;
}
.toc li a:hover { color: var(--text-dim); text-decoration: none; }
.toc li a.h3 { padding-left: 26px; font-size: .82rem; }
.toc li a.active { color: var(--teal-bright); border-left-color: var(--teal-bright); }

/* ---------- Footer ---------- */
.doc-footer {
  border-top: 1px solid var(--line); color: var(--text-faint);
  font-size: .82rem; padding: 22px 0; margin-top: 40px; text-align: center;
}
.doc-footer a { color: var(--text-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  aside.toc { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: flex; }
  aside.sidebar {
    position: fixed; top: var(--nav-h); left: 0; z-index: 90;
    width: 300px; max-width: 86vw; height: calc(100vh - var(--nav-h));
    background: var(--bg-2); transform: translateX(-100%);
    transition: transform .22s ease; border-right: 1px solid var(--line);
  }
  body.sidebar-open aside.sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .docnav .nav-ext a:not(.cta) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
