:root {
  color-scheme: dark;
  --ground: #08090d;
  --surface: #0e131d;
  --surface-raised: #141c29;
  --line: #222d3b;
  --line-strong: #38485c;
  --ink: #f4f7fa;
  --ink-secondary: #b9c6d1;
  --muted: #8797a6;
  --lime: #c8ff00;
  --violet: #8b5cf6;
  --violet-deep: #7c3aed;
  --sky: #38bdf8;
  --mint: #1f9d73;
  --focus: #38bdf8;
  --radius-control: 7px;
  --radius-surface: 14px;
  scrollbar-color: var(--line-strong) var(--ground);
}

* { box-sizing: border-box; }
*::selection { background: var(--sky); color: #071117; }
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: var(--ground); }
*::-webkit-scrollbar-thumb { border: 3px solid var(--ground); border-radius: 999px; background: var(--line-strong); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }
html { scroll-behavior: smooth; background: var(--ground); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-width: 0; margin: 0; overflow-x: hidden; background: var(--ground); color: var(--ink); font-size: 15px; line-height: 1.6; }
a { color: inherit; text-underline-offset: 4px; }
button { color: inherit; font: inherit; }
a, button { touch-action: manipulation; }
:is(a, button):focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.skip-link { position: fixed; z-index: 300; top: 12px; left: 12px; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; transform: translateY(-180%); border-radius: var(--radius-control); background: var(--lime); color: #101500; font-weight: 750; }
.skip-link:focus { transform: translateY(0); }

/* PUBLIC NAVBAR */
.public-header { position: sticky; z-index: 100; top: 0; border-bottom: 1px solid rgba(56, 72, 92, .68); background: rgba(8, 9, 13, .93); backdrop-filter: blur(16px); }
.header-inner { width: min(100% - 40px, 1360px); min-height: 76px; display: flex; align-items: center; gap: 28px; margin-inline: auto; }
.brand-link { min-height: 44px; display: inline-flex; flex: none; align-items: center; gap: 11px; color: var(--ink); font-size: 1.05rem; font-weight: 780; letter-spacing: -.02em; text-decoration: none; }
.brand-link > span:last-child > span { color: var(--lime); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 3px; }
.brand-mark i { width: 8px; height: 8px; border-radius: 2px; }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(3) { background: var(--lime); }
.brand-mark i:nth-child(2) { background: var(--violet); }
.brand-mark i:nth-child(4) { background: var(--sky); }
.public-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.public-nav a, .text-action { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-secondary); font-size: .84rem; font-weight: 700; text-decoration: none; transition: color 140ms ease; }
.public-nav a:hover, .text-action:hover { color: var(--ink); }
.public-nav .mobile-nav-action { display: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-control); background: transparent; cursor: pointer; }

/* BUTTONS */
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-control); font-weight: 760; text-decoration: none; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: #7c3aed; background: var(--violet); color: #fff; }
.button-primary:hover { border-color: var(--sky); background: var(--violet-deep); }
.button-secondary { border-color: var(--line-strong); background: rgba(14, 19, 29, .8); color: var(--ink); }
.button-secondary:hover { border-color: var(--sky); background: var(--surface-raised); }
.button-large { min-height: 50px; padding-inline: 20px; }

/* HERO SECTION */
.hero { position: relative; width: min(100% - 40px, 1360px); min-height: 720px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .78fr); align-items: center; gap: clamp(48px, 7vw, 112px); margin-inline: auto; padding: clamp(90px, 11vw, 150px) 0; overflow: hidden; }
#hero-signal-canvas { position: absolute; inset: 6% -18% auto 23%; z-index: 0; width: 95%; height: 62%; opacity: .34; pointer-events: none; }
.hero-copy, .reception-preview { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--violet); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.hero h1 { max-width: 13ch; margin: 0; font-size: clamp(3.25rem, 7vw, 5.8rem); font-weight: 690; letter-spacing: -.04em; line-height: .95; text-wrap: balance; }
.hero-copy > p:first-of-type { max-width: 64ch; margin: 30px 0 0; color: var(--ink-secondary); font-size: clamp(1rem, 1.5vw, 1.22rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-boundary { max-width: 68ch; margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.hero-boundary strong { color: var(--lime); }

/* RECEPTION PREVIEW CARD (OPTION 1) */
.reception-preview { align-self: end; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-surface); background: rgba(14, 19, 29, .94); box-shadow: 0 26px 90px rgba(0, 0, 0, .45); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.preview-heading > div { display: grid; gap: 3px; }
.preview-heading span { color: var(--sky); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.preview-heading strong { font-size: 1.05rem; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid rgba(31, 157, 115, .4); border-radius: 999px; background: rgba(31, 157, 115, .15); color: #86efac; font-size: .74rem; font-weight: 750; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; animation: pulse-green 1.8s infinite; }

/* AUDIO WAVEFORM CANVAS */
.preview-waveform { padding: 18px 24px; border-bottom: 1px solid var(--line); background: rgba(139, 92, 246, .04); }
#waveform-canvas { width: 100%; height: 54px; display: block; }

/* DIALOGUE TRANSCRIPT */
.preview-dialogue { padding: 22px 24px; display: grid; gap: 14px; border-bottom: 1px solid var(--line); }
.dialogue-turn { display: grid; grid-template-columns: 88px 1fr; gap: 12px; font-size: .88rem; }
.dialogue-speaker { font-weight: 780; color: var(--ink); }
.dialogue-speaker.receptionist { color: var(--violet); }
.dialogue-text { color: var(--ink-secondary); margin: 0; line-height: 1.5; }

/* TELEMETRY CHIPS */
.preview-telemetry { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px; background: rgba(8, 9, 13, .6); }
.telemetry-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: .74rem; font-weight: 650; }
.telemetry-chip strong { color: var(--sky); }
.telemetry-chip strong.verified { color: var(--mint); }

/* WORKFLOW / HOW IT WORKS SECTION */
.information-section, .operating-section { border-top: 1px solid var(--line); }
.information-section { padding: clamp(84px, 10vw, 140px) max(20px, calc((100vw - 1360px) / 2)); scroll-margin-top: 76px; }
.section-heading { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: clamp(36px, 7vw, 100px); align-items: start; }
.section-heading h2, .boundaries h2 { max-width: 16ch; margin: 0; font-size: clamp(2.3rem, 4.5vw, 5rem); font-weight: 650; letter-spacing: -.04em; line-height: 1; text-wrap: balance; }
.section-heading p, .boundaries > div > p { max-width: 68ch; margin: 8px 0 0; color: var(--ink-secondary); font-size: 1rem; }
.path-statement { margin: 70px 0 24px; color: var(--lime); font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 780; letter-spacing: -.015em; }
.information-path { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; padding: 0; border-top: 1px solid var(--line-strong); list-style: none; }
.information-path li { min-width: 0; padding: 24px 20px 8px 0; border-right: 1px solid var(--line); }
.information-path li + li { padding-left: 20px; }
.information-path li:last-child { border-right: 0; }
.information-path span { color: var(--sky); font-size: .78rem; font-weight: 800; }
.information-path p { margin: 10px 0 0; color: var(--muted); font-size: .82rem; }

/* CONNECTIONS & BOUNDARIES LEDGERS */
.operating-section { background: var(--surface); }
.connections, .boundaries { padding: clamp(84px, 9vw, 126px) max(20px, calc((100vw - 1360px) / 2)); scroll-margin-top: 76px; }
.section-heading.compact h2 { font-size: clamp(2.3rem, 4vw, 4.4rem); }
.connection-ledger { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 58px; border-block: 1px solid var(--line-strong); }
.connection-ledger article { min-width: 0; padding: 28px 24px 26px 0; border-right: 1px solid var(--line); }
.connection-ledger article + article { padding-left: 24px; }
.connection-ledger article:last-child { border-right: 0; }
.connection-ledger h3 { margin: 0; font-size: 1.12rem; }
.connection-ledger p { margin: 12px 0 24px; color: var(--ink-secondary); font-size: .86rem; }
.connection-ledger span { color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; }

.boundaries { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: clamp(48px, 8vw, 124px); border-top: 1px solid var(--line); background: var(--ground); }
.boundaries .button { margin-top: 30px; }
.boundary-list { margin: 0; border-top: 1px solid var(--line-strong); }
.boundary-list div { display: grid; grid-template-columns: minmax(140px, .7fr) minmax(0, 1.3fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.boundary-list dt { font-weight: 780; }
.boundary-list dd { margin: 0; color: var(--muted); font-size: .85rem; }

/* PUBLIC FOOTER */
.public-footer { border-top: 1px solid var(--line); background: #06070a; }
.footer-inner, .footer-legal { width: min(100% - 40px, 1360px); margin-inline: auto; }
.footer-inner { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 48px; padding: 68px 0 50px; }
.footer-brand p { max-width: 31ch; color: var(--muted); }
.footer-inner nav { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.footer-inner nav h2 { margin: 0 0 12px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-inner nav a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-secondary); font-size: .86rem; text-decoration: none; }
.footer-inner nav a:hover { color: var(--ink); }
.footer-inner nav span { min-height: 32px; display: inline-flex; align-items: center; color: var(--muted); font-size: .82rem; cursor: not-allowed; }
.footer-legal { margin-top: 0; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

/* AUTH MODAL DRAWER (#auth-panel) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.auth-panel-open { overflow: hidden; }
#auth-panel { width: min(100%, 580px); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 0; overflow: hidden; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: -30px 0 90px rgba(0, 0, 0, .48); }
#auth-panel[open] { animation: auth-panel-enter 180ms ease-out; }
#auth-panel::backdrop { background: rgba(1, 4, 9, .72); backdrop-filter: blur(3px); }
.auth-panel-frame { height: 100%; display: flex; flex-direction: column; }
.auth-panel-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(20px, 5vw, 42px); border-bottom: 1px solid var(--line); }
.auth-panel-close { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-control); background: transparent; color: var(--ink-secondary); font-size: 24px; cursor: pointer; }
.auth-panel-close:hover { border-color: var(--sky); color: var(--ink); }
.auth-panel-scroll { flex: 1; overflow-y: auto; padding: 46px clamp(20px, 7vw, 56px) 70px; }
.auth-panel-scroll > section { width: min(100%, 460px); margin-inline: auto; }
.auth-panel-scroll h1 { margin: 0 0 10px; font-size: 30px; letter-spacing: -.025em; }
.auth-panel-scroll label { display: block; margin: 17px 0 7px; color: var(--ink-secondary); font-size: 13px; font-weight: 680; }
.auth-panel-scroll input { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: #0a0f18; color: var(--ink); font: inherit; }
.auth-panel-scroll input:hover { border-color: #596d84; }
.auth-panel-scroll input:focus { border-color: var(--sky); outline: 2px solid var(--focus); outline-offset: 2px; }
.auth-panel-scroll button:not(.auth-panel-close), .auth-panel-scroll .auth-button { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; margin-top: 24px; padding: 12px 16px; border: 1px solid #7c3aed; border-radius: var(--radius-control); background: var(--violet); color: #fff; font: 700 15px inherit; text-decoration: none; cursor: pointer; transition: background 140ms ease, border-color 140ms ease; }
.auth-panel-scroll button:not(.auth-panel-close):hover, .auth-panel-scroll .auth-button:hover { border-color: var(--sky); background: var(--violet-deep); }
.auth-panel-scroll button:disabled { opacity: .65; cursor: wait; }
.auth-kicker { display: block; margin-bottom: 12px; color: var(--sky); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.auth-copy { margin: 0 0 28px; color: var(--ink-secondary); line-height: 1.6; }
.workspace-field { display: flex; align-items: stretch; }
.workspace-field input { min-width: 0; border-radius: 7px 0 0 7px; }
.workspace-suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 7px 7px 0; background: var(--surface-raised); color: var(--muted); font-size: 13px; white-space: nowrap; }
.workspace-picker { margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.auth-panel-scroll .auth-button-secondary { margin-top: 0; border-color: var(--line-strong); background: transparent; }
.auth-panel-scroll .auth-button-secondary:hover { border-color: var(--sky); background: var(--surface-raised); }
.auth-secondary { margin-top: 20px; color: var(--muted); text-align: center; }
.auth-secondary a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); font-weight: 680; }
.auth-note { display: block; margin-top: 20px; color: var(--muted); line-height: 1.55; text-align: center; }
.notice { display: none; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); font-size: 14px; }
.notice.show { display: block; }
.notice.error { border-color: #813d4a; background: #321920; color: #ffccd4; }
.notice.success { border-color: #267255; background: #153429; color: #c9f9df; }
.verify { display: none; }
.verify.show { display: block; }

@keyframes auth-panel-enter { from { transform: translateX(28px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse-green { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.85); } }

/* RESPONSIVE LAYOUT */
@media (max-width: 1040px) {
  .public-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; margin: 0; padding: 12px 20px 18px; border-bottom: 1px solid var(--line); background: var(--ground); }
  .public-nav[data-expanded] { display: grid; }
  .public-nav a { min-height: 44px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { max-width: 820px; }
  .reception-preview { width: min(100%, 720px); justify-self: end; }
  .information-path { grid-template-columns: repeat(3, 1fr); }
  .information-path li:nth-child(3) { border-right: 0; }
  .connection-ledger { grid-template-columns: repeat(2, 1fr); }
  .connection-ledger article:nth-child(2) { border-right: 0; }
}

@media (max-width: 820px) {
  .header-inner, .footer-inner, .footer-legal { width: min(100% - 28px, 1360px); }
  .header-actions .text-action { display: none; }
  .section-heading, .boundaries { grid-template-columns: 1fr; }
  .section-heading { gap: 24px; }
  .section-heading p, .boundaries > div > p { margin-top: 0; }
  .connection-ledger { grid-template-columns: 1fr; }
  .connection-ledger article, .connection-ledger article + article { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .header-actions { display: none; }
  .public-nav .mobile-nav-action { display: inline-flex; }
  .hero { width: min(100% - 28px, 1360px); padding: 76px 0 84px; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .dialogue-turn { grid-template-columns: 1fr; gap: 4px; }
  .information-section, .connections, .boundaries { padding-inline: 14px; }
  .information-path { grid-template-columns: 1fr; }
  .information-path li, .information-path li + li { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  #auth-panel { width: 100%; border-left: 0; }
  .workspace-field { display: block; }
  .workspace-field input { border-radius: 7px 7px 0 0; }
  .workspace-suffix { min-height: 42px; border-left: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 7px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
  #auth-panel[open] { animation: none; }
  .status-pill i { animation: none; }
}
