/* ==========================================================================
   AuCore — Design System v2
   Calm, high-contrast, restrained. Developed by AuR AI 2026.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg:        #0a0c10;
  --bg-2:      #0e1116;
  --surface:   #12151b;
  --surface-2: #171b22;
  --line:      #23282f;
  --line-2:    #2f353e;

  /* text */
  --text:      #e7eaef;
  --text-2:    #a8b0bd;
  --text-3:    #6f7887;

  /* accent — one hue, used sparingly */
  --accent:    #6470f3;
  --accent-2:  #8b95f7;
  --accent-bg: rgba(100, 112, 243, 0.12);
  --accent-line: rgba(100, 112, 243, 0.35);

  /* semantic */
  --ok:   #3fbf7f;
  --ok-bg: rgba(63, 191, 127, 0.12);
  --warn: #d9a13a;
  --warn-bg: rgba(217, 161, 58, 0.12);
  --err:  #e0596b;
  --err-bg: rgba(224, 89, 107, 0.12);
  --info: #3aa8c4;

  --radius:   10px;
  --radius-lg: 14px;
  --radius-sm: 7px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 4px 16px rgba(0,0,0,.28);
  --shadow-3: 0 16px 48px -16px rgba(0,0,0,.6);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;

  --nav-h: 64px;
  --gut: 80px;          /* page gutter — never let text touch the edge */
  --maxw: 1140px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg:        #fcfcfd;
  --bg-2:      #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #f7f8fa;
  --line:      #e3e6ea;
  --line-2:    #d3d8de;
  --text:      #14171d;
  --text-2:    #4e5666;
  --text-3:    #838b99;
  --accent:    #4f5ae0;
  --accent-2:  #3b45c9;
  --accent-bg: rgba(79, 90, 224, 0.08);
  --accent-line: rgba(79, 90, 224, 0.28);
  --ok:   #16855a;  --ok-bg: rgba(22,133,90,.09);
  --warn: #9a6f13;  --warn-bg: rgba(154,111,19,.1);
  --err:  #c33d51;  --err-bg: rgba(195,61,81,.09);
  --shadow-1: 0 1px 2px rgba(16,20,30,.05);
  --shadow-2: 0 4px 14px rgba(16,20,30,.07);
  --shadow-3: 0 14px 40px -14px rgba(16,20,30,.16);
}

/* ------------------------------------------------------------------ base -- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

/* soft ambient wash */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(680px 420px at 8% -8%, var(--accent-bg), transparent 70%),
    radial-gradient(560px 380px at 100% 0%, rgba(58,168,196,.06), transparent 70%);
}

/* animated starfield canvas — sits above the wash, below all content */
#sky {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; display: block;
}
[data-theme="light"] #sky { opacity: .5; }

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5 {
  margin: 0 0 .55em;
  font-weight: 650;
  letter-spacing: -.021em;
  line-height: 1.22;
  color: var(--text);
}
h1 { font-size: clamp(1.95rem, 3.6vw, 2.9rem); letter-spacing: -.03em; line-height: 1.12; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
h3 { font-size: 1.06rem; }
h4 { font-size: .93rem; }

p { margin: 0 0 1rem; color: var(--text-2); }
p:last-child { margin-bottom: 0; }

strong { color: var(--text); font-weight: 600; }
code, pre, .mono, kbd { font-family: var(--mono); font-variant-ligatures: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

img, svg { max-width: 100%; }

/* ---------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gut) * 2);
  margin: 0 auto;
  padding: 0 var(--gut);
}
.wrap-sm { max-width: calc(820px + var(--gut) * 2); }
@media (max-width: 1320px) { :root { --gut: 64px; } }
@media (max-width: 1100px) { :root { --gut: 48px; } }
@media (max-width: 860px)  { :root { --gut: 36px; } }
@media (max-width: 600px)  { :root { --gut: 24px; } }
@media (max-width: 420px)  { :root { --gut: 18px; } }

.section { padding: 84px 0; }
.section-sm { padding: 48px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.flex { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrapf { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.grow { flex: 1; }

/* ------------------------------------------------------------- typography -- */

.eyebrow {
  font-size: .7rem; font-weight: 650; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px;
}
.lead { font-size: 1.06rem; color: var(--text-2); line-height: 1.6; }
.small { font-size: .845rem; }
.tiny  { font-size: .775rem; }
.muted { color: var(--text-3); }
.dim   { color: var(--text-2); }
.accent-txt { color: var(--accent); }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0 !important; }

.num {
  font-size: 1.65rem; font-weight: 650; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--text);
}
.num-sm { font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- surfaces -- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-1);
}
.card-p0 { padding: 0; overflow: hidden; }
.card-tight { padding: 18px; }
.hoverable { transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease); }
.hoverable:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card-accent { border-color: var(--accent-line); }
.card-quiet { background: var(--surface-2); box-shadow: none; }

/* ---------------------------------------------------------------- badges --- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); white-space: nowrap;
}
.badge-accent { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.badge-ok   { background: var(--ok-bg);   border-color: transparent; color: var(--ok); }
.badge-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.badge-err  { background: var(--err-bg);  border-color: transparent; color: var(--err); }
.badge-mono { font-family: var(--mono); font-size: .7rem; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.dot-warn { background: var(--warn); }
.dot-err  { background: var(--err); }
.dot-live { position: relative; }
.dot-live::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1px solid var(--ok); opacity: .5; animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.7); opacity: .6 } 70%,100% { transform: scale(1.5); opacity: 0 } }

kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px;
  font-size: .72rem; line-height: 1.5; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; color: var(--text-2);
}

/* --------------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  font: inherit; font-size: .875rem; font-weight: 550;
  border-radius: var(--radius); border: 1px solid transparent;
  background: var(--accent); color: #fff;
  cursor: pointer; white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), opacity .16s;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-2 { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.btn-2:hover { background: var(--surface); border-color: var(--text-3); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err-bg); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn-sm { height: 30px; padding: 0 11px; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { height: 44px; padding: 0 22px; font-size: .93rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ----------------------------------------------------------------- forms --- */

label, .label {
  display: block; margin-bottom: 6px;
  font-size: .78rem; font-weight: 600; color: var(--text-2);
}
input, select, textarea {
  width: 100%; height: 38px; padding: 0 11px;
  font: inherit; font-size: .875rem;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
select { cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--accent); }
input[type="range"] { height: 20px; padding: 0; background: none; border: none; accent-color: var(--accent); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; min-width: 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: .85rem; color: var(--text-2); font-weight: 400; margin-bottom: 0; }
.check input { flex: 0 0 auto; }
.hint { font-size: .78rem; color: var(--text-3); margin-top: 5px; }

/* ------------------------------------------------------------------ nav ---- */

.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 14px; height: var(--nav-h); }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.02em; font-size: .97rem; flex: 0 0 auto; }
.brand-mark {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: block; border-radius: 8px;
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-lg { width: 46px; height: 46px; border-radius: 12px; }

.nav-links { display: flex; align-items: center; gap: 1px; margin-left: 10px; }
.nav-links a {
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: .855rem; font-weight: 500; color: var(--text-2);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current] { color: var(--text); font-weight: 550; }
.nav-right { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }

.nav-search {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 8px 0 10px; min-width: 172px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text-3);
  font-size: .8rem; cursor: pointer; transition: border-color .15s;
}
.nav-search:hover { border-color: var(--line-2); color: var(--text-2); }
.nav-search kbd { margin-left: auto; }

.nav-burger { display: none; }
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; place-items: center; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    padding: 14px var(--gut) 18px; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-3); max-height: 70vh; overflow-y: auto;
  }
  .nav-links.open a { padding: 10px 12px; }
  .nav-search { min-width: 0; width: 30px; padding: 0; justify-content: center; }
  .nav-search span, .nav-search kbd { display: none; }
}

/* ---------------------------------------------------------------- tables --- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-size: .73rem; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); white-space: nowrap;
  position: sticky; top: 0;
}
td { color: var(--text-2); }
td strong, td .num-sm { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
.td-num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ code --- */

pre.code {
  margin: 0 0 14px; padding: 18px 20px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto;
  font-size: .815rem; line-height: 1.6; color: var(--text);
  tab-size: 2;
}
pre.code .k { color: var(--accent-2); }
pre.code .s { color: var(--ok); }
pre.code .c { color: var(--text-3); font-style: italic; }
pre.code .n { color: var(--warn); }

.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px 9px 20px; background: var(--surface-2);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.code-head + pre.code { border-radius: 0 0 var(--radius) var(--radius); }

.copyfield {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 7px 8px 7px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--mono); font-size: .8rem; color: var(--text);
}
.copyfield > span:first-child { overflow-x: auto; white-space: nowrap; flex: 1; scrollbar-width: none; }
.copyfield > span:first-child::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ tabs --- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button {
  position: relative; padding: 9px 13px; border: 0; background: none;
  font: inherit; font-size: .865rem; font-weight: 500; color: var(--text-3);
  cursor: pointer; white-space: nowrap; transition: color .15s;
}
.tabs button:hover { color: var(--text-2); }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 550; }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}

.seg { display: inline-flex; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.seg button {
  padding: 5px 11px; border: 0; background: none; border-radius: var(--radius-sm);
  font: inherit; font-size: .8rem; font-weight: 500; color: var(--text-3); cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ------------------------------------------------------------------ meter -- */

.meter { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .5s var(--ease); }
.meter.ok > i   { background: var(--ok); }
.meter.warn > i { background: var(--warn); }
.meter.err > i  { background: var(--err); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 78px; }
.bars > i {
  flex: 1; min-width: 2px; height: 2px;
  background: var(--accent); opacity: .55; border-radius: 2px;
  transition: opacity .15s;
}
.bars > i:hover { opacity: 1; }
.bars > i.hi { opacity: .9; }

.heat { display: flex; gap: 2px; }
.heat > i { flex: 1; min-width: 3px; height: 26px; border-radius: 2px; background: var(--ok); opacity: .75; }
.heat > i.w { background: var(--warn); }
.heat > i.e { background: var(--err); }

/* ------------------------------------------------------------------ misc --- */

.kv { display: flex; justify-content: space-between; gap: 14px; font-size: .855rem; padding: 6px 0; }
.kv > span:first-child { color: var(--text-3); }
.kv > span:last-child, .kv > strong { color: var(--text); font-weight: 550; text-align: right; }
.kv-list > .kv + .kv { border-top: 1px solid var(--line); }

.divide > * + * { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }

.empty { padding: 34px 20px; text-align: center; color: var(--text-3); font-size: .875rem; }

.avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent);
  font-size: .74rem; font-weight: 650;
}

/* --------------------------------------------------------------- toast ----- */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  max-width: 330px; padding: 10px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-3); font-size: .855rem;
}
.toast .dot { width: 6px; height: 6px; }

/* --------------------------------------------------------------- dialog ---- */

.scrim {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(6,8,12,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
[data-theme="light"] .scrim { background: rgba(20,24,32,.34); }
.dialog {
  width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-3); padding: 26px;
}
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-head h3 { margin: 0; }

/* ------------------------------------------------------- command palette --- */

.cmdk { position: fixed; inset: 0; z-index: 180; background: rgba(6,8,12,.55); backdrop-filter: blur(3px); padding: 10vh 20px 20px; }
[data-theme="light"] .cmdk { background: rgba(20,24,32,.3); }
.cmdk-box {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-3); overflow: hidden;
}
.cmdk-input {
  height: 46px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent; font-size: .95rem; padding: 0 16px;
}
.cmdk-input:focus { box-shadow: none; border-color: var(--line); }
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: .69rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--text-2); cursor: pointer;
}
.cmdk-item[aria-selected="true"] { background: var(--accent-bg); color: var(--text); }
.cmdk-item .ci-ic { width: 18px; text-align: center; color: var(--text-3); flex: 0 0 auto; }
.cmdk-item .ci-sub { margin-left: auto; font-size: .76rem; color: var(--text-3); font-family: var(--mono); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--text-3); background: var(--surface-2); }

/* --------------------------------------------------------------- banner ---- */

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px var(--gut); font-size: .82rem; color: var(--text-2);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.banner a { color: var(--accent); font-weight: 550; }
.banner button { margin-left: auto; }

/* ----------------------------------------------------------------- prose --- */

.prose { max-width: 700px; }
.prose h2 { margin-top: 42px; padding-top: 4px; font-size: 1.28rem; }
.prose h3 { margin-top: 26px; font-size: 1rem; }
.prose > p, .prose li { color: var(--text-2); }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 1rem; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--text-3); }
.prose code { padding: 1px 5px; font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; color: var(--text); }
.prose a:not(.btn) { color: var(--accent); border-bottom: 1px solid var(--accent-line); }
.prose table { margin-bottom: 1rem; }

.toc { position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; }
.toc a { display: block; padding: 4px 10px; font-size: .82rem; color: var(--text-3); border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text-2); }
.toc a[aria-current] { color: var(--accent); border-left-color: var(--accent); font-weight: 550; }

/* ------------------------------------------------------------------ chat --- */

.chat { display: flex; flex-direction: column; gap: 10px; height: 400px; overflow-y: auto; padding-right: 4px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 12px; font-size: .885rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.note { align-self: center; max-width: 100%; background: none; color: var(--text-3); font-size: .8rem; padding: 4px; }

/* ---------------------------------------------------------------- footer --- */

.footer { border-top: 1px solid var(--line); padding: 56px 0 32px; margin-top: 72px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(4, 1fr); gap: 34px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-size: .74rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.footer nav a { display: block; padding: 3px 0; font-size: .855rem; color: var(--text-2); }
.footer nav a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--text-3);
}

/* -------------------------------------------------------------- gate page -- */

.gate { min-height: calc(100vh - var(--nav-h) - 120px); display: grid; place-items: center; padding: 48px 0; }
.gate-card { width: 100%; max-width: 400px; }

/* ------------------------------------------------------------ hero orbit -- */

.orbit-ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.orbit-ring-dash { fill: none; stroke: var(--accent-line); stroke-width: 1; stroke-dasharray: 3 7; }
.orbit-planet { stroke: var(--bg); stroke-width: 2.5; }
.orbit-label { font-family: var(--mono); font-size: 9px; fill: var(--text-3); }

/* --------------------------------------------------------------- utility --- */

[data-reveal] { will-change: opacity, transform; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

@media print { .nav, .footer, .toasts, .banner { display: none !important; } }
