:root {
  --bg: #0a0a0a;
  --bg-elev: #141413;
  --cream: #fefbf3;
  --cream-dim: #e9e6de;
  --muted: #8c8983;
  --muted-2: #5a5752;
  --line: rgba(254, 251, 243, 0.08);
  --line-strong: rgba(254, 251, 243, 0.18);
  --accent: #00e07c;
  --accent-soft: rgba(0, 224, 124, 0.18);
  --user-bubble: rgba(254, 251, 243, 0.06);
  --serif: "Instrument Serif", "GCArbiter-Light", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-w: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}

/* ---------- Background atmosphere ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(0, 224, 124, 0.06), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(254, 251, 243, 0.04), transparent 60%);
}
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 32px;
  gap: 24px;
}

.logo {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--cream);
  user-select: none;
}

.nav {
  display: flex;
  gap: 4px;
  background: rgba(254, 251, 243, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(8px);
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 160ms ease, background 160ms ease;
}
.nav-btn:hover {
  color: var(--cream-dim);
}
.nav-btn.is-active {
  color: var(--bg);
  background: var(--cream);
}

.model-select {
  position: relative;
  justify-self: end;
}
.model-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(254, 251, 243, 0.04);
  color: var(--cream-dim);
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.model-btn:hover {
  border-color: var(--line-strong);
  background: rgba(254, 251, 243, 0.07);
}
.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #15140f;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 6px;
  z-index: 10;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.model-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.model-menu button:hover {
  background: rgba(254, 251, 243, 0.06);
  color: var(--cream);
}
.model-menu button[aria-selected="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-soft);
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 0 24px;
}

.welcome {
  max-width: var(--max-w);
  margin: clamp(60px, 12vh, 140px) auto 0;
  text-align: center;
  transition: opacity 360ms ease, transform 360ms ease;
}
.welcome.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.hero {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--cream);
}
.hero em {
  font-style: italic;
  color: var(--cream-dim);
}

.subtitle {
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- Features ---------- */
.features {
  max-width: 1100px;
  margin: clamp(80px, 14vh, 160px) auto 0;
  padding: 0 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.feature {
  background: var(--bg);
  padding: 36px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  transition: background 240ms ease;
}
.feature:hover {
  background: #111110;
}
.feature-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.feature-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  margin: 0;
  color: var(--cream);
  letter-spacing: -0.005em;
}
.feature-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- Globe section ---------- */
.globe-section {
  max-width: 1100px;
  margin: clamp(80px, 14vh, 160px) auto 0;
  padding: 0 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: 520px;
}
.globe-copy {
  padding-right: 8px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  font-weight: 500;
}
.globe-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: var(--cream);
}
.globe-title em {
  font-style: italic;
  color: var(--cream-dim);
}
.globe-sub {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
  max-width: 380px;
}

.globe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin-left: auto;
}
.globe-wrap::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 224, 124, 0.10), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}
.globe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 700ms ease;
}
.globe.is-ready {
  opacity: 1;
}

/* ---------- Page footer ---------- */
.page-foot {
  max-width: 1100px;
  margin: clamp(80px, 14vh, 140px) auto 60px;
  padding: 28px 8px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.page-foot-logo {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.2em;
  color: var(--cream-dim);
  text-transform: none;
}

/* ---------- Landing/Chat mode toggle ---------- */
.thread { display: none; }
body.is-chatting .landing { display: none; }
body.is-chatting .thread { display: flex; }

/* ---------- Models page ---------- */
body.page-models {
  overflow: auto;
  display: block;
  min-height: 100dvh;
}
.models-page {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.models-intro {
  max-width: 760px;
  margin: clamp(40px, 8vh, 80px) auto 0;
  text-align: center;
}
.models-intro .hero {
  font-size: clamp(36px, 5.4vw, 60px);
}
.models-toolbar {
  max-width: 1180px;
  margin: clamp(40px, 6vh, 64px) auto 22px;
  padding: 16px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.models-meta { font-weight: 500; }
.models-legend {
  display: flex;
  gap: 22px;
  font-size: 11px;
}
.models-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.dot-in { background: var(--accent); }
.dot-out { background: #c89831; }

.m-err { color: #ffb4a8; text-transform: none; letter-spacing: 0; }

/* The matrix: cards share a single hairline grid — no individual borders. */
.models-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}
@media (max-width: 900px) {
  .models-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .models-grid { grid-template-columns: 1fr; }
  .models-page { padding: 0 18px 60px; }
}

.m-card {
  background: var(--bg);
  padding: 30px 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 320px;
  transition: background 320ms ease;
  text-decoration: none;
  color: inherit;
}
.m-card:hover {
  background: #111110;
}

.m-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.m-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: none;
}
.m-company { font-weight: 500; }

.m-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--cream);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.1 * 28px);
}
.m-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.55 * 13.5px);
}

.m-rule {
  height: 1px;
  background: var(--line);
  margin: 0;
}

.m-prices {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.m-price-row dt {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.m-price-row dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.m-price-row dd span {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  margin-left: 4px;
}

.m-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.m-meta .m-dot { opacity: 0.45; }
.m-spacer { flex: 1; }
.m-date { color: var(--muted); }

/* CTA tile that fills the 51st cell so the matrix is rectangular. */
.m-card-cta {
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 224, 124, 0.05), transparent 70%), var(--bg);
  cursor: pointer;
}
.m-card-cta:hover {
  background: linear-gradient(180deg, rgba(0, 224, 124, 0.10), transparent 70%), #111110;
}
.m-cta-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.m-cta-title {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.m-cta-title em { font-style: italic; color: var(--cream-dim); }
.m-cta-link {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Skeleton while loading */
.m-skel {
  background: linear-gradient(90deg, rgba(254,251,243,0.02), rgba(254,251,243,0.05), rgba(254,251,243,0.02));
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.page-models .page-foot {
  margin-top: clamp(50px, 8vh, 90px);
  margin-bottom: 0;
}

/* ---------- Docs page ---------- */
body.page-docs {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
}

.docs-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
  overflow: hidden;
}

.docs-sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 24px 18px 40px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
}
.docs-sidebar-head { padding: 4px 8px 14px; }
.docs-eyebrow {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.docs-sidebar-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--cream);
}
.docs-sidebar-search { padding: 6px 8px 18px; }
.docs-sidebar-search input {
  width: 100%;
  appearance: none;
  background: rgba(254, 251, 243, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--cream);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.docs-sidebar-search input::placeholder { color: var(--muted-2); }
.docs-sidebar-search input:focus {
  border-color: var(--line-strong);
  background: rgba(254, 251, 243, 0.07);
}

.docs-nav { display: flex; flex-direction: column; gap: 16px; }
.docs-nav-group { display: flex; flex-direction: column; gap: 2px; }
.docs-nav-company {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 8px 4px;
}
.docs-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--cream-dim);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.docs-nav-item:hover { background: rgba(254, 251, 243, 0.04); }
.docs-nav-item.is-active {
  background: rgba(254, 251, 243, 0.08);
  color: var(--cream);
}
.docs-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}
.docs-nav-item.is-available .docs-nav-dot { background: var(--accent); }
.docs-nav-item.is-pending {
  color: var(--muted-2);
  cursor: default;
}
.docs-nav-item.is-pending:hover { background: transparent; }
.docs-nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-nav-empty, .docs-nav-loading {
  padding: 12px 10px;
  color: var(--muted-2);
  font-size: 13px;
}

.docs-main {
  overflow-y: auto;
  padding: 40px clamp(20px, 6vw, 80px) 80px;
}
.docs-loading, .docs-empty {
  color: var(--muted);
  padding: 40px 0;
  max-width: 720px;
}

.docs-article {
  max-width: 760px;
  margin: 0 auto;
}

.docs-breadcrumb {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 28px;
}
.docs-breadcrumb a { color: var(--muted); text-decoration: none; }
.docs-breadcrumb a:hover { color: var(--cream); }
.docs-breadcrumb span { opacity: 0.4; }

.docs-eyebrow-inline { display: inline-block; margin-bottom: 8px; color: var(--accent); }

.docs-h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--cream);
}
.docs-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--cream-dim);
  margin: 0 0 40px;
  max-width: 620px;
}
.docs-lede {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--cream-dim);
  margin: 0 0 40px;
  max-width: 620px;
}
.docs-h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.005em;
  color: var(--cream);
  margin: 44px 0 14px;
}
.docs-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--cream-dim);
  margin: 0 0 14px;
}
.docs-body code, .docs-tagline code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: rgba(254, 251, 243, 0.06);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--cream);
}
.docs-list {
  margin: 0 0 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--cream-dim);
}
.docs-list li::marker { color: var(--accent); }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  font-size: 14px;
}
.docs-table th, .docs-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.docs-table th {
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  width: 38%;
}
.docs-table td { color: var(--cream); }
.docs-table tr:last-child th, .docs-table tr:last-child td { border-bottom: 0; }
.docs-dim { color: var(--muted-2); font-size: 0.9em; }
.docs-fineprint {
  font-size: 12px;
  color: var(--muted-2);
  margin: -8px 0 0;
  letter-spacing: 0.02em;
}

.docs-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin: 12px 0 40px;
}
.docs-stat {
  background: var(--bg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.docs-stat-num {
  font-family: var(--serif);
  font-size: 36px;
  color: var(--cream);
  line-height: 1;
}
.docs-stat-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Code blocks */
.docs-tabs {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  margin: 12px 0 20px;
  background: #0c0c0a;
}
.docs-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: rgba(254, 251, 243, 0.02);
}
.docs-tab {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 160ms ease, border-color 160ms ease;
}
.docs-tab:hover { color: var(--cream-dim); }
.docs-tab.is-active {
  color: var(--cream);
  border-bottom-color: var(--accent);
}
.docs-code {
  display: none;
  margin: 0;
  padding: 18px 22px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cream);
  white-space: pre;
  overflow-x: auto;
}
.docs-code.is-active { display: block; }
.docs-code code {
  font-family: inherit;
  background: transparent;
  padding: 0;
}

.docs-next { margin-top: 36px; }
.docs-next-btn {
  display: inline-block;
  border: 1px solid var(--line-strong);
  padding: 12px 24px;
  border-radius: 999px;
  color: var(--cream);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease;
}
.docs-next-btn:hover {
  border-color: var(--cream-dim);
  background: rgba(254, 251, 243, 0.06);
}

/* Mobile */
@media (max-width: 820px) {
  body.page-docs {
    overflow: auto;
    display: block;
  }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 280px;
  }
  .docs-main { overflow: visible; padding: 28px 20px 60px; }
  .docs-stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Thread ---------- */
.thread {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeUp 320ms ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg .role {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--sans);
}
.msg.user .role { color: var(--accent); }

.msg .body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--cream);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.assistant .body { color: var(--cream); }
.msg.user .body {
  color: var(--cream-dim);
  background: var(--user-bubble);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  vertical-align: -2px;
  background: var(--cream);
  margin-left: 2px;
  animation: blink 1s steps(2, end) infinite;
  border-radius: 1px;
}
@keyframes blink {
  50% { opacity: 0; }
}

.msg.error .body {
  color: #ffb4a8;
  border: 1px solid rgba(255, 100, 80, 0.25);
  background: rgba(255, 100, 80, 0.06);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
}

/* ---------- Composer ---------- */
.composer {
  position: relative;
  z-index: 2;
  padding: 16px 24px 24px;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(10, 10, 10, 0.95) 40%, var(--bg) 100%);
}
.composer-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 22px;
  background: rgba(20, 20, 19, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  transition: border-color 200ms ease, background 200ms ease;
}
.composer-wrap:focus-within {
  border-color: rgba(254, 251, 243, 0.32);
  background: rgba(20, 20, 19, 0.85);
}

.composer-input {
  flex: 1;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--cream);
  font: inherit;
  font-size: 15.5px;
  line-height: 1.55;
  resize: none;
  outline: none;
  padding: 12px 0;
  max-height: 220px;
}
.composer-input::placeholder {
  color: var(--muted-2);
}

.send-btn {
  appearance: none;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, background 200ms ease, opacity 200ms ease;
}
.send-btn:hover { transform: translateY(-1px); }
.send-btn:disabled {
  background: rgba(254, 251, 243, 0.12);
  color: var(--muted-2);
  cursor: not-allowed;
  transform: none;
}

.hint {
  max-width: var(--max-w);
  margin: 10px auto 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .features { grid-template-columns: 1fr; }
  .globe-section { grid-template-columns: 1fr; min-height: auto; gap: 24px; }
  .globe-wrap { max-width: 380px; margin: 0 auto; }
  .globe-sub { max-width: none; }
}
/* ---------- Mobile nav drawer ---------- */
.menu-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  padding: 4px;
  z-index: 12;
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: #111110;
  border-right: 1px solid var(--line);
  z-index: 11;
  transform: translateX(-100%);
  transition: transform 280ms ease;
  display: none;
  flex-direction: column;
  padding: 0;
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-logo {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.18em;
  color: var(--cream);
}
.drawer-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color 160ms ease;
}
.drawer-close:hover { color: var(--cream); }

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 4px;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--cream-dim);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.drawer-nav a:hover { background: rgba(254, 251, 243, 0.06); }
.drawer-nav a.is-active {
  background: rgba(254, 251, 243, 0.08);
  color: var(--cream);
}
.drawer-nav a .drawer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 16px 18px; gap: 12px; }
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .drawer { display: flex; }
  .drawer-overlay { display: block; }
  .model-select { justify-self: end; }
  .hero { font-size: 38px; }
  .composer { padding: 12px 14px 18px; }
  .stage { padding: 0 16px; }
  .hint { display: none; }
  .features { margin-top: 60px; }
  .feature { padding: 28px 22px 32px; }
  .feature-title { font-size: 22px; }
  .globe-section { margin-top: 60px; }
  .page-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 60px auto 28px;
  }
}

/* Scrollbar */
.stage::-webkit-scrollbar { width: 10px; }
.stage::-webkit-scrollbar-track { background: transparent; }
.stage::-webkit-scrollbar-thumb {
  background: rgba(254, 251, 243, 0.06);
  border-radius: 999px;
}
.stage::-webkit-scrollbar-thumb:hover {
  background: rgba(254, 251, 243, 0.12);
}

/* ---------- Contact page ---------- */
body.page-contact {
  overflow: auto;
  display: block;
  min-height: 100dvh;
}
.contact-page {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.contact-intro {
  max-width: 760px;
  margin: clamp(40px, 8vh, 80px) auto 0;
  text-align: center;
}
.contact-intro .hero {
  font-size: clamp(36px, 5.4vw, 60px);
}

.contact-form {
  margin-top: clamp(40px, 6vh, 64px);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-full { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.form-label .req { color: var(--accent); }

.form-input {
  appearance: none;
  background: rgba(254, 251, 243, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--cream);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.form-input::placeholder { color: var(--muted-2); }
.form-input:focus {
  border-color: var(--line-strong);
  background: rgba(254, 251, 243, 0.07);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg width='10' height='10' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.5L5 6.5L8 3.5' stroke='%238c8983' stroke-width='1.2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-select option {
  background: #15140f;
  color: var(--cream);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-submit {
  display: block;
  margin: 36px auto 0;
  appearance: none;
  border: 0;
  background: var(--cream);
  color: var(--bg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 48px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, background 200ms ease, opacity 200ms ease;
}
.form-submit:hover { transform: translateY(-1px); }
.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form-success {
  text-align: center;
  padding: 60px 0;
}
.form-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 20px;
}
.form-success-title {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--cream);
  margin: 0 0 10px;
}
.form-success-body {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.page-contact .page-foot {
  margin-top: clamp(50px, 8vh, 90px);
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .contact-page { padding: 0 18px 60px; }
}
