/* ---- tokens ------------------------------------------------------------ */
:root {
  --ink: #0b0d12;                       /* page */
  --ink-2: rgba(255,255,255,.055);      /* glass panels */
  --ink-3: rgba(255,255,255,.08);       /* inputs, hover */
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --text: #eef0f4;
  --muted: #8f95a3;
  --accent: #34d3c0;                    /* the voice: teal */
  --accent-2: #7cc9ff;                  /* cool edge for the glow */
  --accent-ink: #04211d;
  --ok: #4ade80;
  --danger: #fb7185;
  --display: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --blur: saturate(160%) blur(18px);
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 20px 50px -20px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---- base -------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(52,211,192,.16), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(124,201,255,.12), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(52,211,192,.08), transparent 60%),
    var(--ink);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 5vw, 44px); line-height: 1.08; }
h2 { font-size: clamp(24px, 3.5vw, 30px); line-height: 1.15; }
h3 { font-size: 17px; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(52,211,192,.35); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- chrome ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(11,13,18,.62); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: var(--text); padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; transition: background .15s ease, color .15s ease; }
.topbar nav a:hover { background: var(--ink-3); text-decoration: none; }
.topbar nav a .pill { margin-left: 4px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(52,211,192,.18), 0 0 18px rgba(52,211,192,.6); }
.brand:hover { text-decoration: none; }
.container { max-width: 960px; margin: 28px auto 64px; padding: 0 clamp(14px, 4vw, 24px); }
.container.narrow { max-width: 480px; margin-top: clamp(28px, 10vh, 96px); }

.card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 22px); margin-bottom: 16px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.card > h3:first-child, .card > .row:first-child > h3 { margin-top: 0; }
.flash {
  background: rgba(52,211,192,.10); border: 1px solid rgba(52,211,192,.35); color: var(--accent);
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.muted { color: var(--muted); }
.error { color: var(--danger); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 160px; }

/* ---- forms ------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; background: var(--ink-3); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(52,211,192,.6); box-shadow: 0 0 0 4px rgba(52,211,192,.15); background: rgba(255,255,255,.10); }
input::placeholder, textarea::placeholder { color: #6b7280; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
select option { background: #151922; color: var(--text); }
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
input[type=search] { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238f95a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px 50%; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #4ce0cd, var(--accent)); color: var(--accent-ink); border: 0;
  padding: 10px 18px; border-radius: 999px; font: 600 14px var(--body); cursor: pointer; margin-top: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 24px -8px rgba(52,211,192,.7);
  transition: transform .08s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px) scale(.99); }
button:disabled { opacity: .45; cursor: default; filter: none; }
button.secondary, .btn.secondary {
  background: var(--ink-3); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
button.secondary:hover, .btn.secondary:hover { background: rgba(255,255,255,.13); filter: none; }
button.danger { background: rgba(251,113,133,.08); color: var(--danger); border: 1px solid rgba(251,113,133,.35); box-shadow: none; }
button.danger:hover { background: rgba(251,113,133,.16); filter: none; }
.row > button, .row > .btn { margin-top: 0; }
form.row { margin-top: 12px; }
form.row > button { margin-top: 0; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* ---- lists & badges ---------------------------------------------------- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font: 600 12px var(--body); letter-spacing: .01em; background: var(--ink-3); color: var(--muted); border: 1px solid var(--line); line-height: 1.4; vertical-align: middle; }
.pill.on { background: rgba(74,222,128,.12); color: var(--ok); border-color: rgba(74,222,128,.3); }
.pill.accent { background: rgba(52,211,192,.14); color: var(--accent); border-color: rgba(52,211,192,.35); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; margin: 0; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.check input[type=radio] { border-radius: 50%; }

/* ---- room -------------------------------------------------------------- */
.speaking { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.transcript pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
.transcript .entry { padding: 14px 0; border-top: 1px solid var(--line); }
.transcript .entry:first-child { border-top: 0; }
.controls button { margin-top: 0; }

/* ---- pickers ----------------------------------------------------------- */
.picklist { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 14px; margin-top: 8px; background: rgba(0,0,0,.18); }
input[type=search] + .picklist { margin-top: 8px; }
.picklist label { padding: 7px 0; border-bottom: 1px solid var(--line); }
.picklist label:last-child { border-bottom: 0; }
.picklist label[hidden] { display: none; }

/* ---- small screens ----------------------------------------------------- */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .topbar nav a { padding: 6px 10px; font-size: 13px; }
  .container { margin-top: 18px; }
  .card { padding: 16px; border-radius: 14px; }
  .row.spread > .row { width: 100%; }
  .row.spread > .row > .btn, .row.spread > .row > button, .row.spread > .row > form { flex: 1; }
  .row.spread > .row > form > button { width: 100%; }
  form.row > button, form.row > .btn { width: 100%; }
  button, .btn { padding: 11px 16px; }
  ul.plain li.row.spread > form { width: 100%; }
  ul.plain li.row.spread > form > button { width: 100%; }
}

/* ---- range slider ------------------------------------------------------ */
.range label output { color: var(--accent); font-weight: 700; }
input[type=range] { width: 100%; margin: 8px 0 0; height: 22px; background: transparent; -webkit-appearance: none; appearance: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), rgba(255,255,255,.14)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.2); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.5); cursor: pointer; }
input[type=range]:focus { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(52,211,192,.35); }
button.small, .btn.small { padding: 6px 12px; font-size: 13px; }
.activity .check .grow { line-height: 1.7; }

/* ---- write-it-as ------------------------------------------------------- */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ink-3); cursor: pointer; margin: 0; font-weight: 400; transition: border-color .15s ease, background .15s ease; }
.mode:hover { background: rgba(255,255,255,.11); }
.mode.on, .mode:has(input:checked) { border-color: rgba(52,211,192,.6); background: rgba(52,211,192,.08); }
.mode input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.mode strong { display: block; font-size: 14px; }
.mode small { display: block; font-size: 12px; line-height: 1.4; margin-top: 2px; }
