:root {
  color-scheme: dark;
  --bg: #0b0a0d;
  --bg-2: #120f14;
  --surface: #18131a;
  --surface-2: #211a23;
  --line: #4b2a3a;
  --line-soft: #35222e;
  --cream: #f8eee7;
  --muted: #b9aab3;
  --muted-2: #8f7f89;
  --wine: #7d1230;
  --wine-2: #520b1d;
  --wine-3: #2b0a14;
  --gold: #d9b56d;
  --gold-2: #f0d59a;
  --green: #7fe0a6;
  --amber: #f0c47a;
  --red: #ff9cab;
  --blue: #9cc2ff;
  --radius: 14px;
  --shadow: 0 22px 60px #0008;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 600px at 85% -10%, #520b1d55, transparent 60%),
    radial-gradient(900px 500px at 0% 40%, #2a0b1833, transparent 65%),
    var(--bg);
  color: var(--cream);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-2); }
img { max-width: 100%; }
p { color: var(--muted); max-width: 72ch; }
h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 .5em;
  color: var(--cream);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }
em { color: var(--gold-2); font-style: italic; }
small { color: var(--muted-2); }
code, kbd { background: #0c090d; border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 6px; font-size: .9em; }
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 30; padding: 10px 16px;
  background: var(--gold); color: #1a1015; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

header.site-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(106deg, #7d1230, #520b1d 52%, #250a12);
  border-bottom: 1px solid #9a5a70;
  padding: 12px max(4vw, 18px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 200px; height: 58px; object-fit: contain; object-position: left center; }
.brand span { letter-spacing: .22em; font-weight: 800; font-size: 12px; color: var(--gold-2); white-space: nowrap; }
nav.site-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; align-items: center; }
nav.site-nav a { padding: 6px 2px; border-bottom: 1px solid transparent; }
nav.site-nav a:hover, nav.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.nav-cta {
  border: 1px solid #d8ac74; border-radius: 999px; padding: 7px 14px !important;
  background: #2b0a14; color: var(--cream);
}
main { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
section { padding: 64px 0; }
.section-tight { padding: 36px 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .2em; font-size: 11px; font-weight: 700;
  color: var(--gold-2); margin: 0 0 12px;
}
.lede { font-size: 1.1rem; color: #d6c6ce; max-width: 70ch; }
.muted { color: var(--muted-2); }
.gold { color: var(--gold-2); }
.center { text-align: center; }
.center p { margin-left: auto; margin-right: auto; }

.hero { padding: clamp(56px, 9vw, 110px) 0 72px; border-bottom: 1px solid var(--line-soft); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 42px; align-items: start; }
.hero h1 em { display: block; }
.hero .actions { margin-top: 28px; }
.hero-note {
  background: linear-gradient(160deg, #26151d, #130f15);
  border: 1px solid var(--line); border-top: 2px solid var(--gold);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.hero-note h2 { font-size: 1.35rem; }
.hero-note ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); }
.hero-note li { margin: 7px 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta, button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #c88496; background: linear-gradient(180deg, #8a1736, #67152f);
  color: #fff7f1; padding: 11px 20px; border-radius: 9px;
  font: 700 14px/1.2 system-ui, sans-serif; cursor: pointer; min-height: 42px;
  box-shadow: 0 8px 24px #520b1d55;
}
.cta:hover, button:hover:not(:disabled), .button:hover { filter: brightness(1.12); color: #fff; }
.cta.secondary, button.secondary, .button.secondary {
  background: transparent; border-color: #8b5d6d; box-shadow: none; color: var(--cream);
}
.cta.gold, button.gold { background: linear-gradient(180deg, #e4c27c, #c49a50); color: #241318; border-color: #f0d59a; }
button:disabled, .cta[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
button.danger { background: #5a1724; border-color: #b45d70; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 16px; }
.inline-form label { margin: 0; }
.inline-form input, .inline-form select { min-width: 150px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.card {
  background: linear-gradient(155deg, #221923, #151017);
  border: 1px solid var(--line-soft); border-top: 2px solid #a86d81;
  border-radius: var(--radius); padding: 22px;
}
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card.gold-top { border-top-color: var(--gold); }
.card.flat { background: #130f15; }
.tag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .16em;
  color: var(--gold-2); text-transform: uppercase; margin-bottom: 10px;
}
.status {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; border: 1px solid #4a3a42; background: #161117; color: var(--muted);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.status.online { color: var(--green); border-color: #2d5841; }
.status.online::before { background: var(--green); }
.status.offline { color: var(--amber); border-color: #5c4a2c; }
.status.offline::before { background: var(--amber); }
.status.danger { color: var(--red); border-color: #60303a; }
.status.danger::before { background: var(--red); }
.disclosure {
  border-left: 3px solid var(--gold); background: #1a1218; padding: 14px 18px;
  border-radius: 0 10px 10px 0; color: var(--muted); font-size: 14px;
}
.warning { border-left-color: var(--amber); }
.danger-box { border-left-color: var(--red); }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.list-clean li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, .4fr) 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted-2); font-size: 13px; }
.kv dd { margin: 0; color: var(--cream); word-break: break-word; }
.hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.6; word-break: break-all; }

.form-card {
  max-width: 620px; margin: 44px auto; padding: clamp(22px, 4vw, 36px);
  background: linear-gradient(160deg, #211823, #151017);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.form-card.wide { max-width: 900px; }
label { display: block; margin: 16px 0 6px; font-size: 14px; color: #e5d4db; }
input, textarea, select {
  width: 100%; background: #0c090d; border: 1px solid #694254; color: var(--cream);
  padding: 12px 13px; border-radius: 8px; font: inherit; min-height: 44px;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--gold); }
textarea { min-height: 96px; resize: vertical; }
input:disabled, textarea:disabled, select:disabled { opacity: .55; }
.checkline { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 14px; color: var(--muted); }
.checkline input { margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
[role=status] { min-height: 1.4em; font-size: 14px; color: var(--gold-2); }
.error-text { color: var(--red); }
.field-note { font-size: 12px; color: var(--muted-2); margin: 4px 0 0; }
.divider { height: 1px; background: var(--line-soft); margin: 24px 0; border: 0; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--gold-2); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; background: #160f16; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #ffffff04; }

footer.site-footer {
  border-top: 1px solid var(--line-soft); margin-top: 40px; padding: 30px 22px;
  text-align: center; color: var(--muted-2); font-size: 12px;
}
footer.site-footer p { margin: 4px auto; }
footer.site-footer a { text-decoration: underline; text-underline-offset: 3px; }

/* Account */
.account-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; flex-wrap: wrap; }
.identity { display: flex; gap: 14px; align-items: center; }
.avatar {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #b8758a, #520b1d); border: 1px solid #c98da0;
  font: 700 22px Georgia, serif; color: #fff;
}
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 12px; }

/* Assistant */
.app-shell {
  display: grid; grid-template-columns: 290px minmax(0, 1fr) 280px; gap: 16px;
  min-height: 72vh; margin: 28px 0 50px;
}
.pane {
  background: #130f15; border: 1px solid var(--line-soft); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 520px; overflow: hidden;
}
.pane-head { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pane-head h2, .pane-head h3 { margin: 0; font-size: 1.05rem; }
.pane-body { padding: 14px; overflow: auto; flex: 1; min-height: 0; }
.pane-foot { padding: 12px; border-top: 1px solid var(--line-soft); }
.conv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.conv-list button {
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  border-radius: 9px; padding: 10px; color: var(--cream); box-shadow: none; justify-content: flex-start;
  display: grid; gap: 3px;
}
.conv-list button:hover { background: #ffffff06; }
.conv-list button[aria-current="true"] { background: #2a1520; border-color: #704155; }
.conv-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-log { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: #6e1731; border: 1px solid #9a4059; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #211923; border: 1px solid #4a3442; border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: transparent; border: 1px dashed #4b3a44; color: var(--muted); font-size: 12px; }
.msg .meta { display: block; margin-top: 6px; font-size: 10px; color: #b79ba6; }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.composer textarea { min-height: 52px; max-height: 180px; }
.composer-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.icon-btn {
  width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 17px;
  background: #241720; border: 1px solid #6b4052; box-shadow: none;
}
.icon-btn[aria-pressed="true"] { background: #6e1731; border-color: var(--gold); }
.memory-list { display: grid; gap: 8px; }
.memory-item { background: #1b141d; border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px; font-size: 13px; }
.memory-item strong { display: block; color: var(--gold-2); font-size: 11px; letter-spacing: .06em; margin-bottom: 3px; }
.memory-item button { min-height: 30px; padding: 4px 9px; font-size: 11px; margin-top: 6px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar button { padding: 7px 12px; min-height: 34px; font-size: 12px; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid #5b3d4a; color: var(--muted); }
.empty { color: var(--muted-2); font-size: 13px; padding: 18px; text-align: center; }

/* Communications */
.comms-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; margin: 28px 0 50px; min-height: 70vh; }
.thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.thread-list button { width: 100%; text-align: left; background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--cream); display: grid; gap: 3px; padding: 11px; border-radius: 9px; }
.thread-list button[aria-current="true"] { background: #2a1520; border-color: #704155; }
.thread-list .unread { color: var(--gold-2); font-weight: 700; }
.message-window { display: flex; flex-direction: column; min-height: 520px; flex: 1; }
.message-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 13px; background: #211923; border: 1px solid #45303d; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble.self { align-self: flex-end; background: #6e1731; border-color: #9a4059; }
.bubble small { display: block; margin-top: 4px; font-size: 10px; }
.call-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #160f16; padding: 18px; margin-bottom: 16px; }
.call-video { width: 100%; max-height: 320px; background: #050406; border-radius: 10px; border: 1px solid var(--line-soft); display: block; }
.call-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.call-state { font-size: 12px; color: var(--muted); }
.ringing { animation: pulse 2s infinite; }
@keyframes pulse { 50% { border-color: var(--gold); box-shadow: 0 0 0 6px #d9b56d22; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

/* Download */
.download-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.download-status { background: #170f16; border: 1px solid var(--line); border-top: 2px solid var(--amber); border-radius: var(--radius); padding: 22px; }
.download-status .big { font: 700 2.2rem Georgia, serif; color: var(--amber); display: block; margin: 8px 0; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meta-grid > div { background: #120d13; border: 1px solid var(--line-soft); border-radius: 9px; padding: 11px; }
.meta-grid dt { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); }
.meta-grid dd { margin: 4px 0 0; font-size: 14px; word-break: break-word; }

/* Auth gate */
.gate { max-width: 620px; margin: 60px auto; text-align: center; padding: 36px; border: 1px solid var(--line); border-radius: var(--radius); background: #160f16; }
.gate .actions { justify-content: center; margin-top: 22px; }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .app-shell .pane.memory { grid-column: 1 / -1; min-height: 0; }
  .comms-grid { grid-template-columns: 260px minmax(0, 1fr); }
  .hero-grid, .download-hero { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  header.site-header { gap: 8px; }
  .brand img { width: 160px; height: 46px; }
  nav.site-nav { gap: 12px; font-size: 13px; }
  main { padding: 0 16px; }
  section { padding: 44px 0; }
  .app-shell, .comms-grid { grid-template-columns: 1fr; min-height: 0; }
  .pane { min-height: 420px; }
  .form-row, .meta-grid { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .composer { grid-template-columns: 1fr; }
  .composer .cta { width: 100%; }
}
