/* ── Tokens: white / blue / red / green ─────────────────────────────────── */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f4fa;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #5b6b82;
  --blue: #1d4ed8;
  --blue-2: #2563eb;
  --blue-soft: #eaf1ff;
  --red: #dc2626;
  --red-soft: #fdecec;
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --navy: #0b1f4b;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --nav-h: 66px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.65 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; color: var(--text); }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }
.grad-text { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; border-radius: 6px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font); padding: 13px 22px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(29, 78, 216, .25); }
.btn-primary:hover { background: var(--blue-2); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ok { background: var(--green); color: #fff; }
.btn-ok:hover { background: #15803d; }
.btn-sm { padding: 9px 15px; font-size: 14px; border-radius: 9px; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { height: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@media (min-width: 720px) { .nav-inner { padding: 0 28px; } }
.agent-page .nav-inner { max-width: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; font-size: 14px; }
.brand-text b { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a:not(.btn) { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--text); background: var(--surface-2); }
.nav-links a:not(.btn).active { color: var(--blue); background: var(--blue-soft); }
.nav-links .btn { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 12px; }
  .nav-links .btn { margin: 8px 0 0; }
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 88px 0; } }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 12px; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); }
.section-head p { color: var(--muted); font-size: 17px; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.card h3 { font-size: 18px; }
.card p { color: var(--muted); margin: 0; }
.icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px; background: var(--blue-soft); color: var(--blue); }
.icon svg { width: 22px; height: 22px; }
.icon.red { background: var(--red-soft); color: var(--red); }
.icon.green { background: var(--green-soft); color: var(--green); }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 56px 0 32px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .hero { padding: 88px 0 72px; } }
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 13px; color: var(--muted); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.pill b { background: var(--red); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .05em; }
.hero h1 { font-size: clamp(34px, 5.6vw, 58px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 18px; }
.hero .lead { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 34px; }
.hero-meta div { font-size: 14px; color: var(--muted); }
.hero-meta strong { display: block; font-size: 26px; color: var(--navy); font-weight: 800; }
.hero-meta div:nth-child(2) strong { color: var(--red); }
.hero-meta div:nth-child(3) strong { color: var(--green); }

.terminal { background: var(--code-bg); border-radius: 16px; box-shadow: 0 24px 50px rgba(15, 23, 42, .18); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; }
.terminal-bar i:nth-child(2) { background: #f59e0b; }
.terminal-bar i:nth-child(3) { background: #22c55e; }
.terminal-bar span { margin-left: 8px; font-size: 13px; color: #94a3b8; font-family: var(--mono); }
.terminal-body { padding: 20px; min-height: 300px; font: 13.5px/1.7 var(--mono); color: var(--code-text); }
.terminal-body > div { margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-prompt::before { content: 'you › '; color: #60a5fa; font-weight: 600; }
.term-code { color: #bfdbfe; background: rgba(96, 165, 250, .1); border-left: 2px solid #60a5fa; padding: 6px 10px; border-radius: 0 6px 6px 0; }
.term-out { color: #86efac; padding-left: 12px; }

/* ── Steps ──────────────────────────────────────────────────────────────── */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { position: relative; padding-top: 60px; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; top: 20px; left: 24px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font: 700 14px var(--font);
}

/* ── Flow diagram ───────────────────────────────────────────────────────── */
.flow { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 900px) { .flow { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; } }
.flow-node { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; text-align: center; box-shadow: var(--shadow-sm); }
.flow-node strong { display: block; margin-bottom: 4px; }
.flow-node span { font-size: 14px; color: var(--muted); }
.flow-node.hl { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.flow-arrow { display: grid; place-items: center; color: var(--blue); font-size: 22px; font-weight: 700; }
@media (max-width: 899px) { .flow-arrow { transform: rotate(90deg); } }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td code, .inline-code { font-family: var(--mono); font-size: 13px; background: var(--blue-soft); padding: 2px 7px; border-radius: 6px; color: var(--blue); }

/* ── Inner pages ────────────────────────────────────────────────────────── */
.page-hero { padding: 56px 0 28px; background: #fff; border-bottom: 1px solid var(--border); }
.page-hero h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.03em; }
.page-hero p { color: var(--muted); font-size: 18px; max-width: 680px; margin: 0; }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list li::before { content: '✓'; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; margin-top: 2px; }
.x-list li::before { content: '✕'; background: var(--red-soft); color: var(--red); }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font: 500 14px var(--font); padding: 9px 14px; border-radius: 999px; cursor: pointer; background: #fff; border: 1px solid var(--border-strong); color: var(--text); transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.callout { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius); margin-top: 24px; background: var(--blue-soft); border: 1px solid #c7d7fe; }
.callout p { margin: 0; color: var(--text); }

/* ── Developer ──────────────────────────────────────────────────────────── */
.dev-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .dev-grid { grid-template-columns: 360px 1fr; gap: 60px; } }
.dev-photo { position: relative; max-width: 360px; margin: 0 auto; width: 100%; }
.dev-photo img { border-radius: 18px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; box-shadow: var(--shadow); border: 4px solid #fff; outline: 1px solid var(--border); }
.dev-badge { position: absolute; left: 16px; bottom: 16px; right: 16px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .95); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm); }
.dev-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dev-name { font-size: clamp(32px, 5vw, 50px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.dev-role { font-size: 18px; color: var(--blue); margin-bottom: 20px; font-weight: 600; }
.info-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 24px 0; }
.info { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.info .icon { margin: 0; width: 40px; height: 40px; flex: none; }
.info small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.info strong { font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); }
.novatix-card { display: grid; gap: 20px; align-items: center; padding: 30px; border-radius: 18px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--blue); box-shadow: var(--shadow-sm); }
@media (min-width: 800px) { .novatix-card { grid-template-columns: 1fr auto; } }
.novatix-card h3 { font-size: 24px; }

/* ── CTA ────────────────────────────────────────────────────────────────── */
.cta-band { text-align: center; padding: 52px 24px; border-radius: 20px; background: var(--navy); color: #fff; }
.cta-band h2 { font-size: clamp(26px, 3.6vw, 38px); color: #fff; }
.cta-band .grad-text { color: #93c5fd; }
.cta-band p { color: #cbd5e1; max-width: 560px; margin: 0 auto 24px; }
.cta-band .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 44px; background: #fff; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding-bottom: 28px; }
.footer-grid > div:first-child { max-width: 360px; }
.footer-grid p { margin-top: 14px; font-size: 14px; }
.footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer-grid a:not(.brand), .footer-grid span { display: block; color: var(--text); font-size: 14px; margin-bottom: 8px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-top: 18px; padding-bottom: 26px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.novatix { font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.novatix:hover { color: var(--red); }

/* ── Agent page: fixed app layout (only the messages scroll) ────────────── */
body.agent-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.agent-page > .nav { position: relative; flex: none; }
body.agent-page > section { flex: 1; min-height: 0; }
.mini-footer { flex: none; text-align: center; font-size: 12.5px; color: var(--muted); padding: 7px 16px; border-top: 1px solid var(--border); background: #fff; }

/* Join + score screens */
.join-wrap { overflow-y: auto; display: grid; place-items: center; padding: 32px 16px; }
.join-card { width: 100%; max-width: 960px; display: grid; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow); }
@media (min-width: 860px) { .join-card { grid-template-columns: 1fr 1fr; } }
.join-side { padding: 34px; background: var(--navy); color: #e2e8f0; }
.join-side h2 { font-size: 28px; color: #fff; }
.join-side .grad-text { color: #93c5fd; }
.join-side .muted { color: #cbd5e1; }
.join-side .inline-code { background: rgba(255,255,255,.12); color: #fff; }
.join-side .check-list li::before { background: rgba(34, 197, 94, .2); color: #4ade80; }
.join-side a { color: #93c5fd; }
.join-side .eyebrow { color: #93c5fd; }
.join-form { padding: 34px; display: flex; flex-direction: column; justify-content: center; }
.join-form h3 { font-size: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input, textarea.input { width: 100%; font: 15px var(--font); color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.error { color: var(--red); font-size: 14px; min-height: 1.4em; margin-top: 10px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chat */
.chat-app { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
@media (min-width: 1080px) { .chat-app { grid-template-columns: 290px minmax(0, 1fr); } }
.chat-side { display: none; border-right: 1px solid var(--border); padding: 20px; overflow-y: auto; background: #fff; }
@media (min-width: 1080px) { .chat-side { display: block; } }
.chat-side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.chat-side h4:first-child { margin-top: 0; }
.side-chips { display: flex; flex-direction: column; gap: 8px; }
.side-chips .chip { text-align: left; border-radius: 9px; font-size: 13.5px; }
.side-note { font-size: 13px; color: var(--muted); }

.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-top { flex: none; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.chat-who { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue); color: #fff; font-weight: 800; font-size: 14px; }
.chat-who small { display: block; color: var(--green); font-weight: 600; font-size: 12px; }
.chat-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.stat b { color: var(--text); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--red) !important; }
.timer-bar { flex: none; height: 3px; background: var(--border); }
.timer-bar div { height: 100%; width: 100%; background: var(--blue); transition: width 1s linear, background .3s; }
.timer-bar div.low { background: var(--red); }

#messages { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 16px; }
.msg { max-width: 920px; margin: 0 auto 18px; display: flex; gap: 12px; }
.msg .who { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.msg.assistant .who { background: var(--navy); }
.msg.user { flex-direction: row-reverse; }
.msg.user .who { background: var(--blue); }
.msg .bubble { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; overflow-wrap: anywhere; font-size: 15px; box-shadow: var(--shadow-sm); }
.msg.user .bubble { flex: 0 1 auto; background: var(--blue); color: #fff; border-color: var(--blue); border-top-right-radius: 4px; }
.msg.assistant .bubble { border-top-left-radius: 4px; }
.msg.assistant.plain .bubble { max-width: 720px; flex: 0 1 auto; }
.msg :not(pre) > code { font-family: var(--mono); font-size: 13px; background: var(--blue-soft); padding: 2px 6px; border-radius: 6px; color: var(--blue); }
.msg.user :not(pre) > code { background: rgba(255,255,255,.2); color: #fff; }

/* Result blocks inside an agent reply */
.block { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 10px 0; background: #fff; }
.block:first-child { margin-top: 0; }
.block:last-child { margin-bottom: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.block-head .tag-dot { display: inline-flex; align-items: center; gap: 7px; }
.block-head .tag-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.block.code .block-head { background: var(--code-bg); color: #93c5fd; border-color: #1e293b; }
.block.output .block-head { background: var(--green-soft); color: var(--green); }
.block.error .block-head { background: var(--red-soft); color: var(--red); }
.block.chart .block-head { background: var(--blue-soft); color: var(--blue); }
.block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 13px/1.6 var(--mono); white-space: pre; }
.block.code pre { background: var(--code-bg); color: var(--code-text); }
.block.output pre { background: #fbfdfc; color: var(--text); max-height: 420px; }
.block.error pre { background: #fffafa; color: #991b1b; white-space: pre-wrap; }
.block.chart img { margin: 0 auto; padding: 10px; background: #fff; }
.copy-btn { font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .05em; color: #cbd5e1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

.typing { display: inline-flex; gap: 5px; align-items: center; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer { flex: none; padding: 12px 16px 14px; border-top: 1px solid var(--border); background: #fff; }
.composer-inner { max-width: 920px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { resize: none; height: 50px; max-height: 160px; }
.composer .btn { height: 50px; }
.composer-hint { max-width: 920px; margin: 6px auto 0; font-size: 12px; color: var(--muted); }

/* Score */
.score-card { width: 100%; max-width: 620px; text-align: center; padding: 38px 28px; border-radius: 20px; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow); }
.score-ring { --p: 0; width: 176px; height: 176px; margin: 18px auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--border) 0); }
.score-ring div { width: 146px; height: 146px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 44px; font-weight: 800; color: var(--navy); }
.score-box { text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-top: 12px; white-space: pre-wrap; font-size: 15px; }
.score-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }

@media (max-width: 600px) {
  .composer .btn span.label { display: none; }
  .chat-stats .stat.actions { display: none; }
  .join-side, .join-form { padding: 24px 20px; }
  .composer-hint { display: none; }
}

/* ── Developer profile ──────────────────────────────────────────────────── */
.profile-hero {
  position: relative; overflow: hidden; color: #fff; padding: 64px 0 0;
  background:
    radial-gradient(700px 380px at 85% 10%, rgba(37, 99, 235, .55), transparent 65%),
    radial-gradient(500px 300px at 5% 100%, rgba(220, 38, 38, .25), transparent 70%),
    linear-gradient(135deg, #0b1f4b 0%, #0f2a66 55%, #0b1f4b 100%);
}
.profile-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
@media (min-width: 900px) { .profile-hero { padding-top: 88px; } }
.profile-grid { position: relative; display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .profile-grid { grid-template-columns: 380px 1fr; gap: 64px; } }

.profile-photo { position: relative; width: 100%; max-width: 340px; margin: 0 auto; }
.photo-ring { padding: 6px; border-radius: 28px; background: linear-gradient(135deg, #60a5fa, #ffffff 45%, #f87171); box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
.photo-ring img { border-radius: 23px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; }
.photo-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  background: #fff; color: var(--text); font-size: 13.5px; font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); white-space: nowrap;
}
.photo-chip svg { width: 16px; height: 16px; color: var(--blue); }
.chip-top { top: 26px; left: -14px; }
.chip-bottom { bottom: 26px; right: -14px; }
@media (max-width: 600px) { .profile-photo { max-width: 230px; } .profile-hero { padding-top: 40px; } .chip-top { left: -10px; top: 16px; } .chip-bottom { right: -10px; bottom: 16px; } .photo-chip { font-size: 12.5px; padding: 7px 11px; } }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); } 70% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.profile-intro { text-align: center; }
@media (min-width: 900px) { .profile-intro { text-align: left; } }
.profile-kicker { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #93c5fd; padding: 6px 12px; border: 1px solid rgba(147, 197, 253, .35); border-radius: 999px; margin-bottom: 18px; }
.profile-intro h1 { color: #fff; font-size: clamp(38px, 6.5vw, 66px); font-weight: 800; letter-spacing: -0.04em; margin-bottom: 8px; }
.profile-title { font-size: clamp(19px, 2.4vw, 24px); font-weight: 600; margin-bottom: 18px; background: linear-gradient(90deg, #93c5fd, #ffffff, #fca5a5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.profile-lead { color: #cbd5e1; font-size: 17.5px; max-width: 580px; margin: 0 auto 22px; }
@media (min-width: 900px) { .profile-lead { margin-left: 0; } }
.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; justify-content: center; }
@media (min-width: 900px) { .profile-meta { justify-content: flex-start; } }
.profile-meta span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 14px; color: #e2e8f0; }
.profile-meta svg { width: 17px; height: 17px; color: #93c5fd; }
.profile-intro .hero-cta { justify-content: center; }
@media (min-width: 900px) { .profile-intro .hero-cta { justify-content: flex-start; } }
.btn-light { background: #fff; color: var(--navy); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.btn-light:hover { background: #eef4ff; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }

.stat-strip {
  position: relative; display: grid; grid-template-columns: repeat(2, 1fr); margin: 56px 0 -1px;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .12); overflow: hidden;
}
@media (min-width: 760px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat-strip div { padding: 24px 18px; text-align: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-strip strong { display: block; font-size: 34px; font-weight: 800; color: var(--blue); line-height: 1.1; }
.stat-strip div:nth-child(2) strong { color: var(--red); }
.stat-strip div:nth-child(3) strong { color: var(--green); }
.stat-strip div:nth-child(4) strong { color: var(--navy); }
.stat-strip span { font-size: 14px; color: var(--muted); }

.about-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.4fr 1fr; } }
.about-card, .edu-card { padding: 30px; }
.about-card h2 { font-size: clamp(24px, 3vw, 30px); }
.about-card .check-list { margin-top: 18px; }
.timeline { position: relative; display: grid; gap: 26px; margin-top: 8px; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.tl-dot { position: relative; width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 0 0 5px #fff; }
.tl-dot.green { background: var(--green); }
.tl-dot svg { width: 21px; height: 21px; }
.tl-date { display: inline-block; font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 3px 9px; border-radius: 999px; margin-bottom: 6px; }
.tl-item h3 { font-size: 17px; margin-bottom: 2px; }
.tl-item p { margin: 0; font-size: 14.5px; }

.skill-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.skill-card { border-top: 3px solid var(--blue); }
.skill-card:nth-child(2) { border-top-color: var(--red); }
.skill-card:nth-child(3) { border-top-color: var(--green); }
.skill-card:nth-child(4) { border-top-color: var(--navy); }
.skill-card h3 { margin-bottom: 14px; }
.skill-card .tag { background: var(--surface-2); }

.project-card { display: grid; border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
@media (min-width: 960px) { .project-card { grid-template-columns: 1.1fr 1fr; } }
.project-body { padding: 32px; }
.project-body h3 { font-size: 24px; }
.project-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.project-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 18px 0; }
.project-points div { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; }
.project-points svg { width: 18px; height: 18px; color: var(--green); flex: none; }
.project-preview { display: grid; place-items: center; padding: 32px; background: linear-gradient(135deg, #0b1f4b, #1d4ed8); }
.pv-window { width: 100%; max-width: 440px; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); display: grid; gap: 10px; transform: rotate(-1.5deg); }
.pv-bar { display: flex; gap: 6px; }
.pv-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.pv-bar i:nth-child(2) { background: #f59e0b; }
.pv-bar i:nth-child(3) { background: #22c55e; }
.pv-msg { justify-self: end; background: var(--blue); color: #fff; font-size: 13px; padding: 8px 12px; border-radius: 12px 12px 3px 12px; }
.pv-code, .pv-out { font: 12px/1.5 var(--mono); padding: 9px 11px; border-radius: 9px; overflow-wrap: anywhere; }
.pv-code { background: var(--code-bg); color: var(--code-text); }
.pv-out { background: var(--green-soft); color: #14532d; }
.pv-code b, .pv-out b { display: block; font: 700 10px var(--font); letter-spacing: .08em; margin-bottom: 3px; color: #93c5fd; }
.pv-out b { color: var(--green); }
.pv-chart { display: flex; align-items: flex-end; gap: 6px; height: 80px; padding: 8px 10px 0; border: 1px solid var(--border); border-radius: 9px; }
.pv-chart span { flex: 1; background: var(--blue); border-radius: 4px 4px 0 0; opacity: .85; }
.pv-chart .h1 { height: 35%; } .pv-chart .h2 { height: 60%; } .pv-chart .h3 { height: 92%; } .pv-chart .h4 { height: 74%; }
.pv-chart .h5 { height: 50%; background: var(--red); } .pv-chart .h6 { height: 30%; } .pv-chart .h7 { height: 18%; }

/* ── AI model picker ────────────────────────────────────────────────────── */
.composer-tools { max-width: 920px; margin: 0 auto 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-tools label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.composer-tools label svg { color: var(--blue); }
.model-select {
  font: 600 13.5px var(--font); color: var(--blue); background: var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  border: 1px solid #c7d7fe; border-radius: 9px; padding: 7px 32px 7px 12px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.model-select:hover { border-color: var(--blue); }
.model-select:focus { outline: none; box-shadow: 0 0 0 3px var(--blue-soft); border-color: var(--blue); }
.model-note { font-size: 12.5px; color: var(--muted); }
.model-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.model-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
@media (max-width: 600px) { .model-note { display: none; } }
