/* Frameless — the conversation is the product. */

@font-face { font-family: "Instrument Serif"; src: url(/static/fonts/instrument-serif-normal.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/static/fonts/instrument-serif-italic.woff2) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url(/static/fonts/geist-normal.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/static/fonts/geist-mono-normal.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --ink: #0b0c10;
  --ink-2: #15161c;
  --paper: #f5f2ec;
  --card: #ffffff;
  --text: #16171b;
  --muted: #6c6f78;
  --line: rgba(22, 23, 27, 0.10);
  --line-2: rgba(22, 23, 27, 0.18);
  --coral: #ff5a78;
  --coral-ink: #2a0910;
  --blue: #2433ff;
  --blue-2: #1a25d6;
  --on-blue: #f2f2f7;
  --ok: #17a35f;
  --warn: #c77700;
  --bad: #d4334a;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111216;
    --card: #191a20;
    --text: #ececf1;
    --muted: #9a9ca7;
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100dvh; }

/* ---- bar ---- */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 10px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 500 19px/1 var(--sans); letter-spacing: -0.02em; }
.corners { width: 18px; height: 18px; position: relative; display: inline-block; }
.corners::before, .corners::after { content: ""; position: absolute; width: 7px; height: 7px; border-color: currentColor; border-style: solid; }
.corners::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.corners::after { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.bar-right { display: flex; align-items: center; gap: 12px; }
.who { font: 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.ghost { background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; }
.ghost:hover { border-color: var(--text); }
.ghost.light { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.ghost.light:hover { border-color: #fff; }

/* ---- layout ---- */
.stage-wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr); gap: 14px; padding: 0 14px 14px; min-height: 0; }

/* ---- stage: Marcus ---- */
.stage { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink); color: #fff; min-height: 0; isolation: isolate; }
.idle { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; z-index: -2; filter: saturate(0.92) contrast(1.02); }
.veil { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(120% 80% at 0% 100%, rgba(11, 12, 16, 0.92) 0%, rgba(11, 12, 16, 0.55) 45%, rgba(11, 12, 16, 0) 75%),
  linear-gradient(180deg, rgba(11, 12, 16, 0.35) 0%, rgba(11, 12, 16, 0) 30%); }
.frame { position: absolute; inset: 22px; pointer-events: none; }
.frame i { position: absolute; width: 34px; height: 34px; border-color: rgba(255, 255, 255, 0.7); border-style: solid; }
.frame i:nth-child(1) { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.frame i:nth-child(2) { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

.hero { position: absolute; left: clamp(28px, 4vw, 56px); right: clamp(28px, 4vw, 56px); bottom: clamp(30px, 5vh, 60px); max-width: 640px; }
.kicker { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 18px; font: 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.dot, .live { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); display: inline-block; box-shadow: 0 0 0 0 rgba(255, 90, 120, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 120, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(255, 90, 120, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 120, 0); } }
.hero h1 { font: 400 clamp(44px, 5.6vw, 88px)/0.98 var(--serif); letter-spacing: -0.015em; margin: 0 0 18px; }
.hero h1 em { font-style: italic; color: #ffd3dc; }
.lede { font-size: clamp(15.5px, 1.25vw, 18px); line-height: 1.5; color: rgba(255, 255, 255, 0.8); margin: 0 0 26px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.call { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; background: var(--coral); color: var(--coral-ink); font-weight: 600; padding: 14px 22px; font-size: 15.5px; letter-spacing: -0.01em; transition: transform .15s ease, box-shadow .15s ease; box-shadow: 0 10px 30px -10px rgba(255, 90, 120, 0.7); }
.call .live { background: var(--coral-ink); animation: none; }
.call:hover { transform: translateY(-1px); }
.call:disabled { opacity: .7; cursor: progress; transform: none; }
.fine { margin: 16px 0 0; font: 11.5px/1.4 var(--mono); color: rgba(255, 255, 255, 0.5); letter-spacing: 0.02em; }

.zero { position: absolute; top: 34px; right: 40px; display: flex; align-items: baseline; gap: 8px; font: 11.5px/1 var(--mono); color: rgba(255, 255, 255, 0.72); letter-spacing: 0.04em; text-transform: uppercase; background: rgba(11, 12, 16, 0.45); backdrop-filter: blur(10px); padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12); }
.zero-n { font: 500 13px/1 var(--mono); color: #7ef0b0; }

.call-frame { position: absolute; inset: 0; background: var(--ink); }
.call-frame iframe { width: 100%; height: 100%; border: 0; }
.call-bar { position: absolute; left: 24px; right: 24px; bottom: 22px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.call-bar > * { pointer-events: auto; }
.rec { display: inline-flex; align-items: center; gap: 9px; font: 12px/1 var(--mono); background: rgba(11, 12, 16, 0.6); backdrop-filter: blur(10px); padding: 9px 13px; border-radius: 999px; color: #fff; }
.stage.in-call .hero, .stage.in-call .veil, .stage.in-call .idle { display: none; }

/* ---- chat ---- */
.chat { display: grid; grid-template-rows: 1fr auto auto auto; min-height: 0; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.stream { list-style: none; margin: 0; padding: 26px 24px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.stream:empty::before { content: "Marcus is here. Say hello, or pick a question below."; color: var(--muted); font: italic 22px/1.3 var(--serif); margin: auto 0 0; }
.msg { max-width: 92%; }
.msg.me { align-self: flex-end; background: var(--text); color: var(--paper); padding: 10px 15px; border-radius: 20px 20px 6px 20px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.marcus { align-self: flex-start; display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: #333 url(/static/media/marcus-poster.jpg) 50% 22% / 220% auto no-repeat; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--line-2); }
.name { font: 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 2px 0 6px; display: flex; gap: 8px; align-items: center; }
.via { color: var(--coral); }
.body { overflow-wrap: anywhere; }
.body p { margin: 0 0 9px; }
.body p:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: 4px 0 10px; padding-left: 20px; }
.body code { font: 13px var(--mono); background: var(--line); padding: 1px 5px; border-radius: 5px; }
.body a { color: var(--blue); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 1; } }

.act { align-self: flex-start; margin-left: 42px; font: 11.5px/1.3 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.act::before { content: ""; width: 10px; height: 10px; border: 1.5px solid var(--line-2); border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
.act.done::before { animation: none; border-color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }

/* cards */
.card { align-self: stretch; margin-left: 42px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 12px 32px -22px rgba(0, 0, 0, 0.3); }
.card h3 { margin: 0 0 10px; font: 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--blue); }
.card.error h3::before { background: var(--bad); }
.card.human h3::before { background: var(--coral); border-radius: 50%; }
.card p { margin: 0 0 12px; }
.card .row { display: flex; gap: 10px; flex-wrap: wrap; }
.card label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); flex: 1 1 200px; }
.card input { font: inherit; color: var(--text); background: var(--paper); border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 12px; }
.card input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.btn { border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 600; background: var(--text); color: var(--paper); }
.btn.coral { background: var(--coral); color: var(--coral-ink); }
.btn.blue { background: var(--blue); color: var(--on-blue); }
.btn:disabled { opacity: .6; cursor: progress; }
.card .actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.card .note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.card .err { color: var(--bad); font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.card.done { opacity: .75; }
pre.cmd { margin: 0; background: var(--ink); color: #e9ecff; font: 12.5px/1.5 var(--mono); padding: 13px 14px; border-radius: 12px; white-space: pre-wrap; word-break: break-all; }
.card table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.card th, .card td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.card th { font: 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 400; }
.card tr:last-child td { border-bottom: 0; }
.card .scroll { overflow-x: auto; }

/* suggestions + composer */
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 22px 10px; }
.suggest button { background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 13px; font-size: 13px; color: var(--text); }
.suggest button:hover { border-color: var(--text); }
.composer { margin: 0 14px 6px; display: flex; align-items: flex-end; gap: 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 22px; padding: 8px 8px 8px 16px; transition: border-color .15s; }
.composer:focus-within { border-color: var(--text); }
.composer textarea { flex: 1; border: 0; resize: none; background: transparent; color: var(--text); font: inherit; max-height: 180px; padding: 7px 0; outline: none; }
.send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--text); color: var(--paper); font-size: 18px; flex: none; }
.send:disabled { opacity: .3; }
.chat .error { margin: 0 22px 10px; font-size: 13px; color: var(--bad); min-height: 0; }

/* ---- background drawer ---- */
.bg { position: fixed; inset: 0 0 0 auto; width: min(620px, 100vw); background: var(--blue); color: var(--on-blue); z-index: 10; display: grid; grid-template-rows: auto auto 1fr; box-shadow: -40px 0 80px -40px rgba(0, 0, 0, 0.6); animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.bg-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px 6px; }
.bg-head h2 { margin: 0; font: 400 44px/1 var(--serif); letter-spacing: -0.01em; }
.bg .ghost { color: var(--on-blue); border-color: rgba(255, 255, 255, 0.4); }
.tabs { display: flex; gap: 4px; padding: 14px 22px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.22); overflow-x: auto; }
.tabs button { background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); padding: 10px 12px; font: 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
.bg-body { overflow-y: auto; padding: 18px 26px 40px; }
.bg-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bg-body th, .bg-body td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.16); vertical-align: top; }
.bg-body th { font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.65); font-weight: 400; }
.bg-body .muted { color: rgba(255, 255, 255, 0.7); font-size: 13.5px; }
.bg-body h4 { font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 8px; color: rgba(255, 255, 255, 0.75); }
.pill { font: 11px/1 var(--mono); padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); white-space: nowrap; }
.pill.on { background: #7ef0b0; color: #062816; }
.pill.off { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pill.wait { background: #ffd57a; color: #2b1d00; }
.linkbtn { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; font-size: 13px; }
.bg-body .btn { background: #fff; color: var(--blue-2); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- small screens ---- */
@media (max-width: 900px) {
  .stage-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 46vh) minmax(0, 1fr); padding: 0 10px 10px; gap: 10px; }
  .hero h1 { font-size: clamp(36px, 9vw, 52px); }
  .lede { display: none; }
  .zero { top: 18px; right: 18px; }
  .frame { inset: 14px; }
  .bar { padding: 10px 14px 8px; }
  .who { display: none; }
  .card { margin-left: 0; }
  .act { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dot, .live, .typing i, .act::before { animation: none; }
  .bg { animation: none; }
}

/* ---- once the conversation has started, the stage steps back ---- */
.talking .hero h1 { font-size: clamp(30px, 3.2vw, 46px); margin-bottom: 14px; }
.talking .lede, .talking .fine { display: none; }

@media (max-width: 900px) {
  .idle { object-position: 50% 14%; }
  .kicker, .fine { display: none; }
  .hero { bottom: 18px; left: 20px; right: 20px; }
  .hero h1 { font-size: clamp(30px, 8vw, 44px); margin-bottom: 14px; }
  .veil { background: linear-gradient(0deg, rgba(11, 12, 16, 0.9) 0%, rgba(11, 12, 16, 0.55) 38%, rgba(11, 12, 16, 0) 62%); }
  .talking .stage-wrap { grid-template-rows: minmax(200px, 30vh) minmax(0, 1fr); }
  .talking .hero h1 { display: none; }
  .call { padding: 11px 18px; font-size: 14.5px; }
}
