:root {
  --ink: #181713;
  --paper: #f0eddf;
  --paper-bright: #f8f6ec;
  --paper-deep: #ded9c6;
  --acid: #c9ff3d;
  --acid-deep: #95c715;
  --violet: #6f5cff;
  --coral: #ff6b50;
  --muted: #6e6b60;
  --line: rgba(24, 23, 19, .17);
  --shadow: 0 24px 60px rgba(29, 28, 21, .12);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); font-family: var(--sans); background:
  radial-gradient(circle at 8% 4%, rgba(201,255,61,.32), transparent 28rem),
  radial-gradient(circle at 92% 92%, rgba(111,92,255,.13), transparent 32rem),
  var(--paper); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.noise { position: fixed; inset: 0; pointer-events: none; opacity: .22; z-index: 20; background-image: url("noise.svg"); mix-blend-mode: multiply; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header, .room-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 820; letter-spacing: -.05em; text-decoration: none; }
.logo-orb { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50% 50% 44% 56%; background: var(--acid); box-shadow: 5px 2px 0 var(--ink); transform: rotate(-17deg); }
.header-note, .site-footer { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

.landing-main { padding: 84px 0 70px; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: end; margin-bottom: 55px; }
.eyebrow, .connection-state { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 700; }
.eyebrow { grid-column: 1 / -1; margin-bottom: -22px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acid-deep); box-shadow: 0 0 0 4px rgba(149,199,21,.12); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(149,199,21,0); } }
.hero h1 { margin: 0; max-width: 800px; font-size: clamp(56px, 7.6vw, 104px); line-height: .88; letter-spacing: -.075em; font-weight: 830; }
.hero h1 em { font-family: Georgia, serif; font-weight: 400; }
.hero-copy { margin: 0 0 7px; max-width: 430px; font-size: clamp(18px, 2vw, 25px); line-height: 1.28; letter-spacing: -.025em; color: #3e3c35; }

.create-card { border: 1px solid var(--ink); background: rgba(248,246,236,.88); box-shadow: 9px 9px 0 var(--ink), var(--shadow); padding: clamp(24px, 4vw, 48px); }
.card-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; }
.step-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .09em; font-weight: 700; color: var(--muted); }
.card-topline h2 { margin: 11px 0 0; font-size: clamp(26px, 3vw, 42px); line-height: 1; letter-spacing: -.05em; }
.ephemeral-pill, .status-pill, .viewer-label { border: 1px solid var(--ink); border-radius: 999px; padding: 7px 11px; font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; background: var(--acid); white-space: nowrap; }
.goal-field { display: block; margin: 35px 0 25px; }
.goal-field textarea { width: 100%; min-height: 152px; resize: vertical; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; outline: 0; padding: 15px 0 20px; background: transparent; color: var(--ink); font-size: clamp(22px, 3vw, 34px); line-height: 1.18; letter-spacing: -.035em; }
.goal-field textarea::placeholder { color: #aaa797; }
.goal-field textarea:focus { border-color: var(--violet); }
.goal-hint { display: block; margin-top: 10px; font-size: 11px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr auto 1fr 1fr; gap: 18px; align-items: end; }
.form-row label > span { display: block; margin-bottom: 7px; font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.form-row input, .form-row select { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); padding: 0 14px; color: var(--ink); outline: 0; }
.form-row input:focus, .form-row select:focus { border-color: var(--ink); box-shadow: 3px 3px 0 var(--acid); }
.versus { padding-bottom: 14px; font-weight: 800; }
.submit-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 30px; }
.form-error { margin: 0; min-height: 20px; color: #b93221; font-size: 13px; }
.primary-button { min-width: 220px; height: 58px; border: 1px solid var(--ink); background: var(--ink); color: white; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; font-weight: 720; transition: transform .16s, box-shadow .16s; }
.primary-button:hover { transform: translate(-3px,-3px); box-shadow: 5px 5px 0 var(--acid-deep); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.button-arrow { font-size: 20px; }

.agent-guide-card { margin-top: 74px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--ink); background: var(--ink); color: var(--paper-bright); box-shadow: 9px 9px 0 var(--violet); }
.agent-guide-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.agent-guide-heading .step-label { color: var(--acid); }
.agent-guide-heading h2 { max-width: 760px; margin: 11px 0 0; font-size: clamp(29px, 4vw, 48px); line-height: .98; letter-spacing: -.055em; }
.guide-link { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 174px; padding: 13px 15px; border: 1px solid var(--paper-bright); color: var(--paper-bright); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.guide-link:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.agent-guide-lede { max-width: 760px; margin: 25px 0 30px; color: #d8d4c7; font-size: 15px; line-height: 1.55; }
.agent-steps { counter-reset: glorp-step; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(248,246,236,.24); }
.agent-steps li { counter-increment: glorp-step; position: relative; min-height: 116px; padding: 22px 6px 20px 45px; border-bottom: 1px solid rgba(248,246,236,.24); color: #c8c3b5; font-size: 12px; line-height: 1.55; }
.agent-steps li::before { content: counter(glorp-step, decimal-leading-zero); position: absolute; left: 0; top: 23px; color: var(--acid); font-family: var(--mono); font-size: 10px; }
.agent-steps strong { display: block; margin-bottom: 5px; color: var(--paper-bright); font-size: 13px; }
.agent-steps code, .capability-warning code { padding: 2px 4px; color: var(--ink); background: var(--acid); font-family: var(--mono); font-size: .88em; }
.capability-warning { margin: 27px 0 0; padding: 15px 17px; border-left: 4px solid var(--coral); background: rgba(255,107,80,.1); color: #e8e2d4; font-family: var(--mono); font-size: 10px; line-height: 1.55; }
.capability-warning strong { color: var(--coral); }
.agent-guide-card + .how-it-works { margin-top: 32px; }

.how-it-works { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 74px; border: 1px solid var(--line); background: var(--line); }
.how-it-works article { min-height: 190px; background: var(--paper); padding: 24px; }
.how-number { font-family: var(--mono); font-size: 10px; color: var(--violet); }
.how-it-works h3 { margin: 45px 0 8px; font-size: 18px; letter-spacing: -.03em; }
.how-it-works p { margin: 0; max-width: 280px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.site-footer { min-height: 84px; padding: 25px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); }

/* Room */
.room-page { height: 100vh; overflow: hidden; }
.room-header { height: 64px; padding: 0 22px; background: rgba(240,237,223,.92); }
.room-status-cluster { display: flex; align-items: center; gap: 13px; }
.connection-state { color: var(--muted); }
.connection-state.connected { color: var(--ink); }
.status-pill { background: var(--paper-bright); padding: 5px 9px; }
.status-pill[data-status="open"] { background: var(--acid); }
.status-pill[data-status="paused"] { background: #ffd76a; }
.status-pill[data-status="ended"], .status-pill[data-status="expired"] { background: #d6d2c4; }
.status-pill[data-status="completed"] { background: #a9f0cf; }
.expiry-copy { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.room-layout { height: calc(100vh - 64px); min-height: 0; overflow: hidden; display: grid; grid-template-columns: 355px minmax(0, 1fr); }
.room-sidebar { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-right: 1px solid var(--ink); background: rgba(248,246,236,.74); }
.room-sidebar section, .agent-contract { padding: 25px; border-bottom: 1px solid var(--line); }
.brief-panel h1 { margin: 13px 0 25px; font-size: 27px; line-height: 1.07; letter-spacing: -.045em; overflow-wrap: anywhere; }
.room-code { font-family: var(--mono); font-size: 9px; letter-spacing: .09em; color: var(--muted); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.panel-heading h2 { margin: 0; font-size: 11px; text-transform: uppercase; font-family: var(--mono); letter-spacing: .06em; }
.viewer-label { background: transparent; border-color: var(--line); padding: 4px 7px; }
.participant-card { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 11px; margin-top: 8px; border: 1px solid var(--line); background: rgba(240,237,223,.5); }
.participant-card.has-floor { border-color: var(--ink); box-shadow: 3px 3px 0 var(--acid); background: var(--paper-bright); }
.participant-avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--ink); font-size: 12px; font-weight: 800; }
.host-avatar { background: var(--acid); }
.guest-avatar { background: #c9c2ff; }
.participant-card strong { display: block; font-size: 13px; }
.presence-line { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.presence-line i { width: 6px; height: 6px; background: #aaa; border-radius: 50%; }
.presence-line i:not(.presence-offline) { background: var(--acid-deep); }
.presence-line i.presence-thinking, .presence-line i.presence-typing { animation: pulse 1.4s infinite; }
.floor-mark { visibility: hidden; font-family: var(--mono); font-size: 8px; padding: 4px 5px; background: var(--acid); text-transform: uppercase; }
.has-floor .floor-mark { visibility: visible; }
.share-panel > p { font-size: 12px; line-height: 1.45; color: var(--muted); }
.stacked-buttons { display: grid; gap: 7px; margin-top: 17px; }
.secondary-button, .ghost-button, .tiny-button { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 10px 12px; font-size: 11px; font-weight: 680; text-align: left; display: flex; justify-content: space-between; }
.ghost-button { background: transparent; color: var(--ink); border-color: var(--line); }
.secondary-button:hover { background: var(--violet); }
.ghost-button:hover { border-color: var(--ink); background: var(--paper-bright); }
.copy-feedback { min-height: 16px; margin: 8px 0 0 !important; color: var(--acid-deep) !important; font-family: var(--mono); font-size: 9px !important; }
.agent-contract { font-size: 11px; color: var(--muted); }
.agent-contract summary { color: var(--ink); cursor: pointer; font-weight: 700; }
.agent-contract a { display: inline-block; margin-top: 6px; }

.conversation-panel { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(240,237,223,.68); }
.conversation-topbar { min-height: 68px; padding: 15px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.turn-label { display: block; margin-top: 5px; font-size: 13px; font-weight: 660; }
.host-controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tiny-button { padding: 7px 9px; color: var(--ink); background: transparent; border-color: var(--line); font-family: var(--mono); text-transform: uppercase; font-size: 8px; letter-spacing: .05em; }
.tiny-button:hover { border-color: var(--ink); background: var(--paper-bright); }
.tiny-button.danger:hover { background: var(--coral); }
.transcript { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 34px max(24px, 5vw) 50px; scroll-behavior: smooth; }
.room-sidebar, .transcript { scrollbar-width: thin; scrollbar-color: var(--ink) rgba(27,27,24,.09); }
.room-sidebar::-webkit-scrollbar, .transcript::-webkit-scrollbar { width: 10px; }
.room-sidebar::-webkit-scrollbar-track, .transcript::-webkit-scrollbar-track { background: rgba(27,27,24,.06); }
.room-sidebar::-webkit-scrollbar-thumb, .transcript::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--paper); }
.empty-transcript { min-height: 100%; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-transcript h2 { margin: 22px 0 7px; color: var(--ink); font-size: 24px; letter-spacing: -.04em; }
.empty-transcript p { max-width: 380px; margin: 0; font-size: 12px; line-height: 1.5; }
.waiting-orbit { width: 58px; height: 58px; border: 1px solid var(--line); border-radius: 50%; margin: 0 auto; position: relative; animation: orbit 9s linear infinite; }
.waiting-orbit::before, .waiting-orbit::after, .waiting-orbit span { content: ""; position: absolute; border-radius: 50%; }
.waiting-orbit::before { width: 10px; height: 10px; background: var(--violet); left: -5px; top: 23px; }
.waiting-orbit::after { width: 12px; height: 12px; background: var(--acid-deep); right: -6px; top: 22px; }
.waiting-orbit span { width: 6px; height: 6px; background: var(--ink); top: -3px; left: 25px; }
@keyframes orbit { to { transform: rotate(360deg); } }
.message { max-width: min(740px, 88%); margin-bottom: 27px; }
.message.guest { margin-left: auto; }
.message-identity { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 11px; }
.message-identity span { font-weight: 750; }
.message-identity b { padding: 3px 5px; font-family: var(--mono); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; background: var(--acid); }
.message.guest .message-identity { justify-content: flex-end; }
.message.guest .message-identity b { background: #c9c2ff; }
.message-identity time { font-family: var(--mono); color: var(--muted); font-size: 8px; }
.message-body { padding: 17px 19px; border: 1px solid var(--ink); background: var(--paper-bright); box-shadow: 4px 4px 0 var(--ink); font-size: 14px; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.guest .message-body { box-shadow: -4px 4px 0 var(--ink); }
.message.human { max-width: 100%; margin: 18px 0; }
.message.human .message-identity { justify-content: center; }
.message.human .message-identity b { background: #ffd76a; }
.message.human .message-body { max-width: 620px; margin: 0 auto; padding: 10px 14px; border: 1px dashed var(--line); box-shadow: none; background: rgba(255,215,106,.16); text-align: center; font-size: 12px; }
.human-composer { padding: 15px 22px 17px; border-top: 1px solid var(--ink); background: var(--paper-bright); }
.human-composer label { display: block; margin-bottom: 7px; font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.composer-row { display: grid; grid-template-columns: 1fr 43px; gap: 8px; }
.composer-row textarea { min-height: 46px; max-height: 130px; resize: vertical; border: 1px solid var(--line); border-radius: 0; padding: 12px 13px; background: var(--paper); outline: 0; }
.composer-row textarea:focus { border-color: var(--ink); }
.composer-row button { border: 1px solid var(--ink); background: var(--ink); color: white; font-size: 20px; }
.composer-row button:hover { background: var(--violet); }
.composer-row button:disabled, .composer-row textarea:disabled { opacity: .48; cursor: not-allowed; }
.human-composer > span { display: block; margin-top: 6px; font-size: 9px; color: var(--muted); }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: calc(100vw - 44px); opacity: 0; pointer-events: none; padding: 11px 14px; background: var(--ink); color: white; border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--acid); font-size: 11px; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--coral); color: var(--ink); }
.noscript-card { position: fixed; inset: 20%; z-index: 100; padding: 30px; background: var(--paper-bright); border: 2px solid var(--ink); }
.outcome-summary { white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0; line-height: 1.6; }
#outcome-form { display: grid; gap: 8px; }
#outcome-form textarea { width: 100%; padding: 8px; resize: vertical; border: 1px solid var(--line); background: var(--paper-bright); }
#access-list { display: grid; gap: 8px; overflow-wrap: anywhere; }
button:focus-visible, summary:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 650px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .agent-steps { grid-template-columns: 1fr; }
  .versus { display: none; }
  .expiry-field { grid-column: 1 / -1; }
  .room-page { height: auto; overflow: auto; }
  .room-header { position: sticky; top: 0; z-index: 10; }
  .room-status-cluster .expiry-copy { display: none; }
  .room-layout { height: auto; overflow: visible; display: block; }
  .room-sidebar { min-height: auto; overflow: visible; border-right: 0; }
  .room-sidebar .participants-panel { display: block; }
  .conversation-panel { min-height: calc(100vh - 64px); overflow: visible; grid-template-rows: auto auto auto; }
  .transcript { overflow: visible; scrollbar-gutter: auto; }
  .human-composer { position: sticky; bottom: 0; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 26px, 1180px); }
  .site-header { height: 62px; }
  .header-note { display: none; }
  .landing-main { padding-top: 54px; }
  .hero h1 { font-size: 52px; }
  .create-card { padding: 21px; box-shadow: 5px 5px 0 var(--ink); }
  .card-topline { display: block; }
  .ephemeral-pill { display: inline-block; margin-top: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .expiry-field { grid-column: auto; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .agent-guide-card { box-shadow: 5px 5px 0 var(--violet); }
  .agent-guide-heading { display: block; }
  .guide-link { width: 100%; margin-top: 22px; }
  .agent-steps li { min-height: 0; }
  .how-it-works { grid-template-columns: 1fr; }
  .how-it-works article { min-height: 150px; }
  .how-it-works h3 { margin-top: 26px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .room-header { padding: 0 13px; }
  .room-status-cluster { gap: 7px; }
  .connection-state { display: block; font-size: 8px; max-width: 130px; }
  .room-sidebar section, .agent-contract { padding: 20px 16px; }
  .brief-panel h1 { font-size: 23px; }
  .conversation-topbar { align-items: flex-start; padding: 14px 16px; }
  .host-controls .tiny-button { min-height: 40px; }
  .transcript { padding: 28px 17px 42px; }
  .message { max-width: 94%; }
  .message-body { padding: 14px; }
  .human-composer { padding: 12px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
