@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   Room 212 — design tokens
   Dark inversion of the Cursor brief in DESIGN.md.
   Warm near-black canvas, warm off-white ink, hairline depth,
   one scarce orange accent, pastel band colours.
   ============================================================ */
:root {
  /* surfaces */
  --canvas: #0d0d0b;
  --canvas-soft: #121210;
  --surface: #161613;
  --surface-2: #1c1c18;
  --surface-3: #232320;

  /* hairlines */
  --hairline: #26251f;
  --hairline-soft: #1d1c17;
  --hairline-strong: #3a3930;

  /* text */
  --ink: #f5f3ea;
  --body: #a5a294;
  --muted: #7d7a6d;
  --muted-soft: #565446;

  /* brand — the only accent */
  --primary: #f54e00;
  --primary-active: #d04200;
  --primary-quiet: rgba(245, 78, 0, 0.12);
  --on-primary: #ffffff;

  /* semantic */
  --error: #e5486b;
  --error-quiet: rgba(229, 72, 107, 0.10);
  --error-line: rgba(229, 72, 107, 0.38);
  --success: #35b98c;

  /* band palette (DESIGN.md timeline pastels) */
  --blue: #9fbbe0;
  --mint: #9fc9a2;
  --lavender: #c0a8dd;
  --peach: #dfa88f;
  --gold: #c08532;

  /* type */
  --sans: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 48px;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--body);
  font: 400 15px/1.5 var(--sans);
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p { margin: 0; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; }
::selection { background: rgba(245, 78, 0, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid rgba(245, 78, 0, 0.55);
  outline-offset: 2px;
}

/* ---------- typography helpers ---------- */

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font: 600 10.5px/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow--mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.display-lg {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.display-md {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: var(--ink);
}

.label {
  font: 500 10.5px/1.4 var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted { color: var(--muted); }
.ink { color: var(--ink); }

/* ---------- surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.card--flush { padding: 0; }
.card--quiet { background: var(--canvas-soft); }

.hr {
  height: 1px;
  border: 0;
  margin: var(--s-6) 0;
  background: var(--hairline);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  font: 500 13.5px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn:disabled { color: var(--muted-soft); border-color: var(--hairline); cursor: not-allowed; }
.btn:disabled:hover { background: transparent; }

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn--primary:hover { background: var(--primary-active); border-color: var(--primary-active); }

.btn--ghost { border-color: transparent; color: var(--body); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn--danger { border-color: var(--error-line); color: var(--error); }
.btn--danger:hover { background: var(--error-quiet); }

.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn--danger:hover { color: var(--error); border-color: var(--error-line); background: var(--error-quiet); }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.input,
.select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--canvas-soft);
  color: var(--ink);
  font: 400 13.5px/1 var(--sans);
  transition: border-color 0.14s ease, background 0.14s ease;
}
.input::placeholder { color: var(--muted-soft); }
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--muted);
  background: var(--surface);
}

.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237d7a6d' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.input[type='date'] { font-family: var(--mono); font-size: 13px; }
.input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(0.72) sepia(0.1) saturate(0.4) hue-rotate(10deg);
  cursor: pointer;
}

/* segmented control */
.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--canvas-soft);
}
.seg button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--sans);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--ink); }

/* ---------- badges & chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: rgba(245, 243, 234, 0.06);
  color: var(--body);
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--outline { background: transparent; border: 1px solid var(--hairline-strong); color: var(--muted); }
.badge--accent { background: var(--primary-quiet); color: #ff8a4d; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- notices ---------- */

.notice {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--canvas-soft);
  color: var(--body);
  font-size: 13px;
  line-height: 1.45;
}
.notice--error {
  border-color: var(--error-line);
  background: var(--error-quiet);
  color: #f4a9ba;
}
.notice--error strong { color: var(--error); font-weight: 600; }
.notice--accent {
  border-color: rgba(245, 78, 0, 0.28);
  background: var(--primary-quiet);
  color: #f0c3ab;
}

.empty-state {
  padding: var(--s-5);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- modal ---------- */

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: rgba(6, 6, 5, 0.76);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: var(--s-6);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.modal h3 { font-size: 17px; letter-spacing: -0.015em; }
.modal-actions { display: flex; gap: var(--s-2); margin-top: var(--s-6); }
.modal-actions .btn { flex: 1; }

/* ---------- misc ---------- */

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
  .card { padding: var(--s-5); }
  .modal { padding: var(--s-5); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
