/* Nirvani AI page components, built on nv.css tokens. */

/* Hero: the product is the hero. Copy left, the live assistant right. */
.hero { position: relative; padding: var(--s7) 0 var(--s8); overflow: clip; }
.hero::before { /* faint amethyst field, the only background flourish on the page */
  content: ""; position: absolute; inset: -20% -10% auto 35%; height: 120%;
  background: radial-gradient(closest-side, var(--aura), transparent 70%);
  filter: blur(20px); pointer-events: none; opacity: .9;
}
.hero .wrap { position: relative; display: grid; gap: var(--s7); align-items: center; }
@media (min-width: 1020px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: var(--s8); } .hero { padding: var(--s8) 0 var(--s9); } }
.hero h1 { margin-bottom: var(--s5); }
.hero h1 .line { display: block; }
.hero h1 .line:nth-child(2) { color: var(--text-2); }
.hero h1 .line:nth-child(3) { background: linear-gradient(100deg, var(--lead-strong), var(--amethyst-500) 55%, var(--rose-300)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-bottom: var(--s6); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.livebar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; margin-top: var(--s6); color: var(--text-2); font-size: .95rem; }
.livebar .num { color: var(--text); font-weight: 600; }

/* The live assistant panel */
.assistant { position: relative; }
.assistant::before { /* aura that brightens while the model is speaking */
  content: ""; position: absolute; inset: -14px; border-radius: calc(var(--r-lg) + 14px);
  background: conic-gradient(from 210deg, rgba(138,85,227,.0), rgba(138,85,227,.55), rgba(227,165,141,.45), rgba(138,85,227,.0) 70%);
  filter: blur(26px); opacity: .35; transition: opacity .6s var(--ease); z-index: 0;
}
.assistant.is-speaking::before { opacity: .85; animation: aura 4s linear infinite; }
@keyframes aura { to { filter: blur(26px) hue-rotate(25deg); } }
.assistant .panel { position: relative; z-index: 1; display: flex; flex-direction: column; height: min(600px, 78vh); overflow: hidden; }
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.assistant-head strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.assistant-head .sub { display: block; font-size: .85rem; color: var(--muted); }
.thread { flex: 1; overflow-y: auto; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; line-height: 1.6; font-size: 1rem; overflow-wrap: anywhere; }
.msg p { margin: 0 0 .6em; max-width: none; }
.msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: .2em 0 .6em; padding-left: 1.2em; }
.msg .md-h { font-weight: 700; margin-bottom: .3em; }
.msg-user { align-self: flex-end; background: color-mix(in srgb, var(--amethyst-500) 22%, var(--raised)); border: 1px solid color-mix(in srgb, var(--amethyst-500) 35%, var(--line)); border-bottom-right-radius: 6px; }
.msg-ai { align-self: flex-start; background: var(--raised); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-ai.is-pending::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 3px; vertical-align: -2px; background: var(--lead); border-radius: 2px; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.msg-err { align-self: stretch; background: var(--err-soft); color: var(--err-text); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); font-size: .95rem; }
.md-pre { margin: .5em 0; padding: 12px 14px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); overflow-x: auto; font-size: .85rem; line-height: 1.55; }
.md-pre code { background: none; border: 0; padding: 0; }
.msg-meta { font-size: .78rem; color: var(--muted); margin-top: 6px; font-family: var(--font-mono); }
.starters { display: grid; gap: var(--s2); margin-top: auto; }
.starter { text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: transparent; color: var(--text-2); font: 500 .95rem/1.45 var(--font-body); cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.starter svg { width: 18px; height: 18px; color: var(--icon); flex: none; margin-top: 2px; }
.starter:hover { border-color: color-mix(in srgb, var(--rose-400) 60%, var(--line)); color: var(--text); background: color-mix(in srgb, var(--rose-400) 6%, transparent); }
.composer { display: flex; gap: var(--s2); align-items: flex-end; padding: var(--s3); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; min-height: 50px; max-height: 180px; resize: none; border-radius: 16px; padding: 13px 16px; }
.composer .btn { --h: 50px; padding: 0 18px; }

/* Model registry table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .98rem; }
table.t th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.model { white-space: nowrap; }
table.t td.model strong { display: block; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
table.t td.model code { font-size: .8rem; }
table.t .num { white-space: nowrap; }

/* Code switch */
.split { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: var(--s8); } }
.code { border-radius: var(--r-lg); background: var(--sunken); border: 1px solid var(--line); overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs button { border: 0; background: transparent; color: var(--muted); font: 600 .88rem/1 var(--font-body); padding: 10px 14px; border-radius: var(--r-pill); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong); }
.code pre { margin: 0; padding: var(--s5); overflow-x: auto; font-size: .88rem; line-height: 1.7; color: var(--text-2); }
.code .hl { color: var(--rose-text); }
.code .kw { color: var(--lead-strong); }
.code .str { color: var(--ok-text); }
.copy { position: relative; }
.copy .icon-btn { position: absolute; top: 8px; right: 8px; }

/* Production controls: a definition list, not a card grid */
.controls { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .controls { grid-template-columns: repeat(2, 1fr); column-gap: var(--s8); } }
.controls > div { display: grid; grid-template-columns: 40px 1fr; gap: var(--s3); padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.controls svg { width: 26px; height: 26px; color: var(--icon); margin-top: 3px; }
.controls dt { font-weight: 600; font-size: 1.08rem; margin-bottom: 4px; }
.controls dd { margin: 0; color: var(--text-2); }

/* The path: a real sequence, so it is numbered */
.path { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); counter-reset: step; }
@media (min-width: 900px) { .path { grid-template-columns: repeat(4, 1fr); gap: var(--s5); } }
.path li { position: relative; padding: var(--s5) 0 0; border-top: 2px solid var(--line); counter-increment: step; }
.path li::before { content: counter(step); position: absolute; top: -16px; left: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 .85rem/1 var(--font-mono); color: var(--amethyst-950); background: var(--rose-metal); }
.path li.is-lead { border-top-color: var(--lead); }
.path h3 { font-size: 1.45rem; margin-bottom: var(--s2); }
.path p { color: var(--text-2); margin: 0; }

/* FAQ */
.faq { max-width: 860px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s5) 44px var(--s5) 0; position: relative; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; border-right: 2px solid var(--icon); border-bottom: 2px solid var(--icon); transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .answer { padding: 0 0 var(--s5); color: var(--text-2); }

/* Closing signup band */
.band { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: var(--s7) var(--s5); background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--amethyst-600) 45%, transparent), transparent 55%),
  radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--rose-500) 22%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--line-strong); }
@media (min-width: 900px) { .band { padding: var(--s8); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: center; } }
.band h2 { margin-bottom: var(--s3); }
.band form { margin-top: var(--s5); }
@media (min-width: 900px) { .band form { margin-top: 0; } }
.form-grid { display: grid; gap: 0 var(--s3); }
@media (min-width: 560px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-msg { margin: var(--s3) 0 0; min-height: 1.6em; font-size: .98rem; }
.form-msg.ok { color: var(--ok-text); }
.form-msg.err { color: var(--err-text); }

/* App pages (chat, playground, console) */
.app-head { padding: var(--s6) 0 var(--s5); }
.app-head h1 { font-size: var(--fs-3xl); margin-bottom: var(--s2); }
.app-head p { color: var(--text-2); margin: 0; }
.chat-app .assistant .panel { height: calc(100vh - 68px - 190px); min-height: 460px; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.toolbar .select { width: auto; min-height: 42px; padding: 8px 12px; }

/* Playground */
.pg-input { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.pg-models { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip svg { width: 16px; height: 16px; }
.chip span { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--text-2); font-weight: 600; font-size: .92rem; }
.chip input:checked + span { color: var(--text); border-color: var(--lead); background: color-mix(in srgb, var(--amethyst-500) 16%, transparent); }
.chip input:focus-visible + span { box-shadow: var(--focus); }
.chip input:disabled + span { opacity: .5; }
.panes { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .panes { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); } }
.pane { display: flex; flex-direction: column; min-height: 320px; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.pane-head strong { font-family: var(--font-display); font-size: 1.3rem; }
.pane-body { padding: var(--s4); flex: 1; overflow-wrap: anywhere; line-height: 1.65; }
.pane-body p { max-width: none; }
.pane-foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.pane-foot b { color: var(--text); font-weight: 600; }

/* Console */
.tiles { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: var(--s5); }
.tile { padding: var(--s5); }
.tile .label { font-size: .9rem; color: var(--muted); font-weight: 500; }
.tile .value { font-family: var(--font-mono); font-size: 2rem; font-weight: 500; margin-top: 6px; letter-spacing: -.02em; }
.tile .value small { font-size: .95rem; color: var(--muted); margin-left: 4px; }
.meter { height: 8px; border-radius: 99px; background: var(--raised); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--amethyst-500), var(--rose-300)); border-radius: inherit; }
.chart { padding: var(--s5); margin-bottom: var(--s5); }
.chart h2, .card-title { font-size: 1.5rem; margin-bottom: var(--s4); }
.bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; align-items: end; height: 180px; }
.bars span { background: linear-gradient(180deg, var(--amethyst-400), var(--amethyst-700)); border-radius: 4px 4px 1px 1px; min-height: 2px; position: relative; }
.bars span.err { background: linear-gradient(180deg, var(--err), color-mix(in srgb, var(--err) 50%, var(--amethyst-800))); }
.bars-axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin-top: 8px; }
.two-col { display: grid; gap: var(--s5); }
@media (min-width: 980px) { .two-col { grid-template-columns: 1fr 1fr; } }
.key-form { display: flex; gap: var(--s2); flex-wrap: wrap; }
.key-form .input { flex: 1 1 320px; font-family: var(--font-mono); }
.empty { padding: var(--s6); text-align: center; color: var(--text-2); }

/* Docs */
.docs { display: grid; gap: var(--s6); padding: var(--s6) 0 var(--s8); }
@media (min-width: 1000px) { .docs { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s8); } }
.toc { position: sticky; top: 92px; align-self: start; font-size: .95rem; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.toc a:hover { background: var(--raised); color: var(--text); }
@media (max-width: 999px) { .toc { position: static; } .toc ul { display: flex; flex-wrap: wrap; gap: 6px; } .toc a { border: 1px solid var(--line); } }
.prose { min-width: 0; }
.prose h1 { font-size: var(--fs-3xl); margin-bottom: var(--s4); }
.prose h2 { font-size: 2rem; margin: var(--s7) 0 var(--s3); scroll-margin-top: 90px; }
.prose h3 { font-size: 1.4rem; margin: var(--s5) 0 var(--s2); scroll-margin-top: 90px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 1.2em; }
.prose pre { margin: var(--s3) 0 var(--s5); padding: var(--s4); border-radius: var(--r-md); background: var(--sunken); border: 1px solid var(--line); overflow-x: auto; font-size: .86rem; line-height: 1.65; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose table.t { margin: var(--s3) 0 var(--s5); }
.prose .answer-first { font-size: var(--fs-lg); color: var(--text); padding: var(--s4) var(--s5); border-left: 3px solid var(--lead); background: color-mix(in srgb, var(--amethyst-500) 8%, transparent); border-radius: 0 var(--r-md) var(--r-md) 0; }
.two-col:has(> [hidden]) { grid-template-columns: 1fr; }
