/* Roomies. Warm paper and ink, one accent, a colour per side. */
:root {
  color-scheme: light dark;
  --bg: #f4efe4;
  --surface: #fffdf7;
  --surface-2: #f9f5ea;
  --ink: #1d1a15;
  --muted: #6a6354;
  --faint: #8d8574;
  --line: #e2daC8;
  --line-strong: #cfc5ad;
  --accent: #d4441a;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --warn: #a35a00;
  --bad: #b3261e;
  --s1: #0d7a6a;
  --s2: #b4600a;
  --s3: #6a4bc0;
  --s4: #c02a68;
  --shadow: 0 1px 0 rgba(29, 26, 21, 0.04), 0 8px 24px -12px rgba(29, 26, 21, 0.18);
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120e;
    --surface: #1c1913;
    --surface-2: #231f18;
    --ink: #f2ede1;
    --muted: #a9a190;
    --faint: #857e6e;
    --line: #322d23;
    --line-strong: #463f31;
    --accent: #ff7a4d;
    --accent-ink: #1a0f08;
    --ok: #5fd39a;
    --warn: #f0a24b;
    --bad: #ff8a80;
    --s1: #3cc4ab;
    --s2: #f0a24b;
    --s3: #a98bff;
    --s4: #ff7aa8;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; }

/* ── header ── */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 19px/1 var(--serif); letter-spacing: -0.01em; text-decoration: none; }
.brand svg { width: 30px; height: 20px; flex: none; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a { padding: 7px 12px; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--muted); }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }

/* ── type ── */
h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 40em; margin: 18px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }

/* ── controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--sans); padding: 12px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--ink); color: var(--bg); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 6px; font-size: 13px; }
input[type="text"], input[type="search"], input[type="password"], textarea {
  width: 100%; font: 16px/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px;
}
textarea { resize: vertical; min-height: 92px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input.code-input { font: 600 28px/1 var(--mono); letter-spacing: 0.22em; text-align: center; padding: 16px 12px; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; min-height: 1.2em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
main > .card + .card { margin-top: 16px; }

.codebox {
  position: relative; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px;
  padding: 16px 16px 16px 16px; font: 14px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink);
}
.codebox-copy { margin-top: 12px; }

/* ── home ── */
main { padding-bottom: 72px; }
.hero { padding: 40px 0 28px; }
.hero h1 { max-width: 15em; margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; margin-top: 30px; }
.steps { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 14px/1 var(--mono); margin-bottom: 12px; }
.steps b { display: block; font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 14.5px; }
.promises { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.promises li { padding-left: 22px; position: relative; color: var(--muted); font-size: 15px; }
.promises li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 10px; height: 10px; border-radius: 50%; background: var(--s1); }
.section { margin-top: 56px; }
.demo { margin-top: 0; }
.demo .entry + .entry { margin-top: 14px; }
footer.site-footer { padding: 28px 0 44px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line); margin-top: 56px; }

/* ── entries: used by the demo and the room ── */
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.entry { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--faint)) 16%, var(--surface)); color: var(--c, var(--muted)); border: 1.5px solid var(--c, var(--line-strong)); display: grid; place-items: center; font: 700 14px/1 var(--serif); }
.entry-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.entry-head .who { font-weight: 700; color: var(--c, var(--ink)); }
.entry-head .when { color: var(--faint); font-size: 12.5px; }
.badge { font: 600 11px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.you { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.badge.question { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.entry-body { margin-top: 4px; overflow-wrap: anywhere; }
.entry-body > :first-child { margin-top: 0; }
.entry-body > :last-child { margin-bottom: 0; }
.entry-body p { margin: 0 0 8px; }
.entry-body ul { margin: 0 0 8px; padding-left: 20px; }
.entry-body code { font: 13px/1.4 var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.entry-body pre { margin: 8px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; overflow-x: auto; }
.entry-body pre code { background: none; border: 0; padding: 0; font-size: 12.5px; white-space: pre; }
.entry-body a { color: var(--accent); }
.entry.note .entry-body { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 9px 12px; background: var(--surface-2); }
.entry.human .avatar { border-radius: 10px; }
details.evidence { margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
details.evidence > summary { cursor: pointer; padding: 8px 12px; font-size: 14px; color: var(--muted); list-style: none; display: flex; gap: 8px; align-items: center; }
details.evidence > summary::-webkit-details-marker { display: none; }
details.evidence > summary::before { content: "▸"; font-size: 13px; line-height: 1; transition: transform 0.12s; }
details.evidence[open] > summary::before { transform: rotate(90deg); }
details.evidence .entry-body { padding: 0 12px 10px; margin: 0; }
.needs { margin-top: 6px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border-radius: 10px; padding: 10px 12px; font-size: 15px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.sysline { text-align: center; color: var(--faint); font-size: 13px; padding: 2px 0; }
.sysline span { padding: 0 10px; }

/* ── room ── */
.room-head { display: flex; align-items: center; gap: 14px; padding: 14px 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.room-head h1 { font-size: clamp(20px, 3vw, 26px); flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.chip { font: 600 12px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.chip.open { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.chip.paused { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.chip.concluded { color: var(--s3); border-color: color-mix(in srgb, var(--s3) 45%, transparent); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; padding: 22px 0 90px; align-items: start; }
.board { min-width: 0; }
.feed { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; min-height: 120px; }
.empty { color: var(--muted); text-align: center; padding: 38px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.banners { display: grid; gap: 10px; margin-bottom: 18px; }
.banners:empty { display: none; }
.banner { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); background: var(--surface); display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 15px; }
.banner.waiting { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.banner.paused { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.banner.done { border-color: color-mix(in srgb, var(--s3) 50%, var(--line)); background: color-mix(in srgb, var(--s3) 9%, var(--surface)); }
.composer { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 72%, transparent); padding: 16px 0 14px; margin-top: 10px; }
.composer-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.composer textarea { border: 0; background: transparent; min-height: 54px; max-height: 220px; padding: 6px 8px; resize: none; }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 4px 0; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: 600 13px/1 var(--sans); border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.aside { display: grid; gap: 14px; position: sticky; top: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 { font: 700 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.person { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--c, var(--faint)); position: relative; }
.dot.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot.live::after { animation: none; } .btn { transition: none; } }
.person .name { font-weight: 700; }
.person .sub { color: var(--muted); font-size: 13.5px; }
.person .need { color: var(--warn); font-size: 13.5px; font-weight: 600; }
.person.gone { opacity: 0.55; }
.link-btn { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.link-btn:hover { color: var(--bad); }
.invite-code { font: 700 34px/1 var(--mono); letter-spacing: 0.14em; text-align: center; padding: 14px 6px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; }
.invite-meta { text-align: center; font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.proposal-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; margin-bottom: 12px; }
.votes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.vote { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.vote.approve { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.vote.changes { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.stack { display: grid; gap: 8px; }
.meta-list { margin: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.meta-list div { display: flex; justify-content: space-between; gap: 10px; }
.tabs { display: none; }
.newpill { position: sticky; bottom: 128px; display: flex; margin: 0 auto; width: max-content; z-index: 5; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.gate { max-width: 480px; margin: 60px auto; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .promises { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 12px; }
  .aside { position: static; }
  .tabs { display: flex; gap: 6px; padding: 10px 0 0; }
  .tabs button { flex: 1; font: 600 14px/1 var(--sans); padding: 11px 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
  .tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .layout[data-tab="board"] .aside { display: none; }
  .layout[data-tab="room"] .board > .feed, .layout[data-tab="room"] .composer, .layout[data-tab="room"] .newpill { display: none !important; }
  .layout[data-tab="room"] .banners { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .steps { grid-template-columns: 1fr; }
  .site-nav a:not(.keep) { display: none; }
  input.code-input { font-size: 24px; }
}
