/* AI Lab page */

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted-note { color: var(--muted); font-size: .9rem; margin: 0; }
.lab-label { color: var(--muted); margin: 0 0 .75rem; }

.lab-hero { padding-top: 150px; padding-bottom: 40px; }
.lab-hero__title { font-size: clamp(3.2rem, 11vw, 10rem); margin: 0; }
.lab-hero__sub { color: var(--muted); max-width: 40rem; font-size: clamp(1.05rem, 1.4vw, 1.25rem); margin: 1.5rem 0 0; }

.lab { padding-top: 24px; display: grid; gap: 2rem; }
.lab__tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: .4rem; overflow-x: auto; padding: 76px 0 .5rem; margin-top: -60px;
  background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.lab__tabs::-webkit-scrollbar { display: none; }
.lab__tabs [role="tab"] {
  flex: none; display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); font-size: .9rem; transition: color .3s, border-color .3s, background .3s;
}
.lab__tabs [role="tab"] .mono { font-size: .7rem; color: var(--accent); }
.lab__tabs [role="tab"]:hover { color: var(--fg); border-color: rgba(241, 236, 226, .35); }
.lab__tabs [role="tab"][aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.lab__tabs [role="tab"][aria-selected="true"] .mono { color: var(--bg); }

.demo { display: grid; gap: 2rem; animation: demo-in .6s var(--ease); }
@keyframes demo-in { from { opacity: 0; transform: translateY(16px); } }
.demo__head { display: grid; gap: .75rem; max-width: 52rem; }
.demo__num { color: var(--muted); margin: 0; }
.demo__num b { color: var(--accent); font-weight: 500; }
.demo__title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: .95; margin: 0; }
.demo__why { color: var(--muted); margin: 0; font-size: 1.1rem; }
.demo__body { display: grid; gap: 1.25rem; min-width: 0; }

.lab-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.lab-row > .lab-input { flex: 1 1 260px; }
.lab-input {
  font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: .85rem 1rem; min-width: 0; width: 100%; transition: border-color .3s;
}
.lab-input:focus { outline: none; border-color: var(--accent); }
.lab-input:disabled { opacity: .5; }
.lab-textarea { resize: vertical; font-family: var(--font-mono); font-size: .85rem; line-height: 1.6; margin-bottom: .75rem; }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); cursor: pointer; }
.btn--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn[disabled], .btn:disabled { opacity: .4; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips--stack { flex-direction: column; align-items: stretch; }
.chip {
  text-align: left; border: 1px dashed rgba(241, 236, 226, .25); border-radius: 10px; padding: .5rem .8rem; color: var(--muted);
  font-size: .9rem; transition: all .3s var(--ease);
}
.chip:hover, .chip.is-on { color: var(--fg); border-style: solid; border-color: var(--accent); }
.chip.is-on { background: rgba(255, 74, 28, .12); }

.lab-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; align-items: start; }
.lab-split > * { min-width: 0; }
.lab-split--brand { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }

/* Agent */
.ag-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.ag-step { display: grid; grid-template-columns: 6.5rem 1fr 1.4rem; gap: 1rem; align-items: start; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); animation: demo-in .5s var(--ease); }
.ag-step__tool { color: var(--accent); padding-top: .2rem; }
.ag-step b { font-weight: 600; }
.ag-step__out { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; }
.ag-step__state { width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); margin-top: .15rem; }
.ag-step.is-running .ag-step__state { animation: spin .8s linear infinite; }
.ag-step.is-done .ag-step__state { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--panel); }
@keyframes spin { to { transform: rotate(360deg); } }
.ag-side { position: sticky; top: 150px; display: grid; gap: 1rem; }
.ag-goal { font-size: 1.3rem; font-weight: 500; margin: 0; }
.ag-count { color: var(--muted); margin: 0; }
.ag-count b { color: var(--accent); font-weight: 500; }
.ag-approve { border: 1px solid var(--accent); border-radius: 14px; padding: 1.25rem; display: grid; gap: .75rem; animation: demo-in .5s var(--ease); }
.ag-approve h4 { margin: 0; font-size: 1.2rem; }
.ag-approve ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.ag-approve input { accent-color: var(--accent); margin-right: .4rem; }
.ag-result { margin: 0; color: var(--fg); text-transform: none; min-height: 1.2em; }

/* MCP */
.mcp-servers { display: grid; gap: .5rem; }
.mcp-server { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.mcp-server input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.mcp-server span { display: grid; }
.mcp-server small { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: .72rem; }
.mcp-trace { background: #0a0908; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; height: 380px; overflow: auto; display: grid; align-content: start; gap: .6rem; }
.rpc { border-left: 2px solid var(--line); padding-left: .8rem; animation: demo-in .4s var(--ease); }
.rpc .mono { font-size: .7rem; color: var(--muted); }
.rpc--out { border-color: var(--accent); }
.rpc--out .mono { color: var(--accent); }
.rpc--err { border-color: #ff6b5a; }
.rpc--err .mono { color: #ff6b5a; }
.rpc pre { margin: .3rem 0 0; font-family: var(--font-mono); font-size: .75rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: var(--fg); }
.mcp-answer { margin-top: 1rem; }
.mcp-answer p { margin: 0; }
.mcp-answer b { color: var(--accent); font-weight: 600; }

/* RAG */
.rag-answer { border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; background: var(--panel); font-size: 1.1rem; }
.rag-answer p { margin: 0 0 .75rem; }
.rag-answer p:last-child { margin: 0; }
.cite { color: var(--accent); font-family: var(--font-mono); font-size: .7em; }
.rag-sources { color: var(--muted); text-transform: none; letter-spacing: 0; }
.rag-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; max-height: 460px; overflow: auto; }
.rag-docs li { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; transition: border-color .4s, background .4s; }
.rag-docs li b { font-size: .9rem; }
.rag-docs li p { margin: .3rem 0 0; color: var(--muted); font-size: .85rem; }
.rag-docs li.is-hit { border-color: var(--accent); background: rgba(255, 74, 28, .08); }
.rag-score { float: right; color: var(--accent); font-size: .65rem; }

/* Vision */
.vz-img { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 280px; display: grid; place-items: center; background: var(--panel); }
.vz-img img { width: 100%; max-height: 560px; object-fit: contain; }
.vz-beam { position: absolute; left: 0; right: 0; height: 25%; top: -25%; background: linear-gradient(to bottom, transparent, rgba(255, 74, 28, .35)); border-bottom: 2px solid var(--accent); opacity: 0; }
.vz-img.is-scanning .vz-beam { opacity: 1; animation: vz-beam 1.8s var(--ease) infinite; }
@keyframes vz-beam { to { top: 100%; } }
.vz-progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: .5rem; }
.vz-progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.vz-status { color: var(--muted); text-transform: none; letter-spacing: 0; margin: 0 0 1rem; min-height: 1.2em; }
.vz-fields { display: grid; gap: .5rem; margin: 0 0 1rem; }
.vz-fields div { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; display: grid; gap: .15rem; animation: demo-in .4s var(--ease); }
.vz-fields dt { color: var(--muted); font-size: .68rem; }
.vz-fields dd { margin: 0; font-weight: 500; }
.vz-fields .is-missing dd { color: var(--muted); font-weight: 400; font-style: italic; }
.vz-raw summary { cursor: pointer; color: var(--muted); }
.vz-raw pre { white-space: pre-wrap; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); max-height: 260px; overflow: auto; background: #0a0908; padding: 1rem; border-radius: 10px; }

/* Chat (voice + concierge) */
.chat { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; height: 340px; overflow: auto; display: flex; flex-direction: column; gap: .6rem; background: var(--panel); }
.chat--tall { height: 380px; margin-bottom: .75rem; }
.msg { margin: 0; padding: .65rem .95rem; border-radius: 14px; max-width: 85%; animation: demo-in .35s var(--ease); line-height: 1.45; }
.msg--bot { background: var(--panel-2); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg--me { background: var(--fg); color: var(--bg); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { color: var(--muted); letter-spacing: .2em; }

.vc-phone { border: 1px solid var(--line); border-radius: 24px; padding: 2rem 1.5rem; display: grid; gap: 1.25rem; justify-items: center; text-align: center; background: var(--panel); }
.vc-phone .lab-row { width: 100%; }
.vc-orb { position: relative; width: 140px; height: 140px; display: grid; place-items: center; }
.vc-orb i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--accent); opacity: .25; }
.vc-orb i:nth-child(2) { inset: 18px; opacity: .45; }
.vc-orb i:nth-child(3) { inset: 38px; background: var(--accent); opacity: 1; box-shadow: 0 0 30px var(--accent); }
.vc-orb.is-speaking i:nth-child(3) { animation: orb 0.6s ease-in-out infinite alternate; }
.vc-orb.is-listening i:nth-child(1), .vc-orb.is-listening i:nth-child(2) { animation: orb-ring 1.4s ease-out infinite; }
.vc-orb.is-listening i:nth-child(2) { animation-delay: .4s; }
@keyframes orb { to { transform: scale(.82); } }
@keyframes orb-ring { 0% { transform: scale(.7); opacity: .8; } 100% { transform: scale(1.15); opacity: 0; } }
.vc-state { margin: 0; color: var(--muted); }
.vc-booking { margin-top: 1rem; border: 1px solid var(--accent); border-radius: 14px; padding: 1.1rem; animation: demo-in .5s var(--ease); }
.vc-booking dl, .cc-facts { display: grid; gap: .5rem; margin: 0; }
.vc-booking dl div, .cc-facts div { display: grid; grid-template-columns: 6rem 1fr; gap: .75rem; }
.vc-booking dt, .cc-facts dt { color: var(--muted); font-size: .68rem; padding-top: .2rem; }
.vc-booking dd, .cc-facts dd { margin: 0; }

/* Concierge */
.cc-score { display: flex; align-items: baseline; gap: .4rem; }
.cc-score b { font-family: var(--font-display); font-weight: 400; font-size: 5rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.cc-score span { color: var(--muted); }
.cc-bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin: .75rem 0; }
.cc-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .8s var(--ease); }
.cc-tier { margin: 0 0 1.25rem; color: var(--muted); }
.cc-tier.is-hot { color: var(--accent); }
.cc-tier.is-warm { color: #f2b04a; }
.cc-tier.is-cool { color: #8fb3ff; }
.cc-facts { margin-bottom: 1.25rem; }
#cc-next { margin-bottom: 1.25rem; }
#cc-next p:last-child { margin: 0; }

/* GEO */
.geo-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.geo-ring { width: 120px; height: 120px; transform: rotate(-90deg); flex: none; }
.geo-ring circle { fill: none; stroke-width: 10; }
.geo-ring__bg { stroke: var(--line); }
.geo-ring__fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.geo-score { font-family: var(--font-display); font-weight: 400; font-size: 4.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.geo-checks { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.geo-checks li { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: .6rem; align-items: start; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; }
.geo-checks li > span:first-child { font-weight: 700; }
.geo-checks .is-ok > span:first-child { color: #5fd38d; }
.geo-checks .is-bad > span:first-child { color: var(--accent); }
.geo-checks b { font-weight: 500; }
.geo-checks p { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.geo-checks .mono { color: var(--muted); font-size: .65rem; padding-top: .3rem; }

/* Brand content */
.br-controls { display: grid; gap: 1rem; align-content: start; }
.br-controls .field input[type="text"], .br-controls .lab-input { padding: .75rem .9rem; }
.br-color { flex: 1 1 90px; }
.br-color input { width: 100%; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.br-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.br-item { margin: 0; display: grid; gap: .5rem; }
.br-item canvas { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.br-item--story { grid-row: span 2; }
.br-item--link, .br-item--banner { grid-column: 1 / -1; }
.br-item figcaption { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .65rem; flex-wrap: wrap; }
.br-dl { color: var(--accent); font: inherit; text-transform: uppercase; letter-spacing: .08em; }
.br-dl:hover { text-decoration: underline; }

/* CTA */
.lab-cta { text-align: center; display: grid; justify-items: center; gap: 1.5rem; }
.lab-cta__title { font-size: clamp(2.6rem, 8vw, 7rem); margin: 0; max-width: 14ch; }
.lab-cta__sub { color: var(--muted); margin: 0; max-width: 34rem; }

@media (max-width: 900px) {
  .lab-split, .lab-split--brand { grid-template-columns: 1fr; }
  .ag-side { position: static; order: -1; }
  .ag-step { grid-template-columns: 1fr 1.4rem; }
  .ag-step__tool { grid-column: 1 / -1; padding: 0; }
}
@media (max-width: 520px) {
  .br-grid { grid-template-columns: 1fr; }
  .br-item--story { grid-row: auto; }
  .br-item--story canvas { max-height: 520px; width: auto; justify-self: center; }
  .cc-score b { font-size: 3.6rem; }
}
