/* ──────────────────────────────────────────────────────────
   Unofficial Exit Interviews
   A flat, calm, readable design. Two colors. Strong type.
   ────────────────────────────────────────────────────────── */

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --border: #e8e6df;
  --border-strong: #d4d2c8;
  --text: #1a1a17;
  --text-muted: #6b6963;
  --text-soft: #94928a;
  --accent: #1a1a17;
  --accent-soft: #f1efe8;

  --r-1-bg: #fbe7e7; --r-1-fg: #7a1f1f;
  --r-2-bg: #fae7dc; --r-2-fg: #75321a;
  --r-3-bg: #f7ecd5; --r-3-fg: #6b4e0a;
  --r-4-bg: #e3f0e5; --r-4-fg: #1f5530;
  --r-5-bg: #d8ebd9; --r-5-fg: #1b4423;

  --radius: 10px;
  --radius-lg: 14px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--text-muted); }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ───── Header ───── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.logo {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* ───── Buttons ───── */
.btn {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--accent-soft); }
.btn-primary {
  background: var(--accent); color: var(--surface); border-color: var(--accent);
}
.btn-primary:hover { background: #2c2c28; border-color: #2c2c28; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ───── Hero ───── */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
}
.hero .lede {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto 28px;
}
.searchbar {
  display: flex; gap: 8px;
  max-width: 460px; margin: 0 auto;
}
.searchbar input {
  flex: 1;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 15px;
  color: var(--text);
}
.searchbar input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26,26,23,0.08);
}
.searchbar button {
  background: var(--accent); color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0 18px;
  font-family: inherit; font-size: 14px;
  cursor: pointer;
}
.searchbar button:hover { background: #2c2c28; }

/* ───── Trending ───── */
.trending {
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 0 0 28px;
}
.section-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.trending-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.trend-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.trend-pill:hover { border-color: var(--border-strong); }
.trend-pill .count { color: var(--text-soft); font-size: 12px; }

/* ───── Tabs ───── */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 18px;
}
.tab {
  background: none; border: none;
  padding: 10px 14px;
  font-family: inherit; font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }

/* ───── Filters ───── */
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 0 0 18px;
}
.filters select {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 7px 10px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 14px;
  color: var(--text);
}
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.chip.active {
  background: var(--accent); color: var(--surface); border-color: var(--accent);
}

/* ───── Feed ───── */
.feed {
  display: flex; flex-direction: column; gap: 12px;
  margin: 0 0 28px;
}
.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.story-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  margin: 0 0 8px;
}
.story-company { font-size: 16px; font-weight: 500; color: var(--text); }
.dot { color: var(--text-soft); }
.rating-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  margin-left: auto;
}
.r-1 { background: var(--r-1-bg); color: var(--r-1-fg); }
.r-2 { background: var(--r-2-bg); color: var(--r-2-fg); }
.r-3 { background: var(--r-3-bg); color: var(--r-3-fg); }
.r-4 { background: var(--r-4-bg); color: var(--r-4-fg); }
.r-5 { background: var(--r-5-bg); color: var(--r-5-fg); }

.story-body {
  font-size: 15px; line-height: 1.65;
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.story-footer {
  display: flex; gap: 14px; align-items: center;
  font-size: 12.5px; color: var(--text-soft);
}
.story-footer .timestamp { margin-left: auto; }

/* ───── Empty / loading states ───── */
.feed-status {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
}
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
}
.empty-state h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0 0 8px;
  font-size: 20px;
}
.empty-state p { color: var(--text-muted); margin: 0 0 16px; }

/* ───── Modal ───── */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,20,18,0.45);
}
.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  padding: 28px 28px 24px;
  z-index: 1;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 24px; line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.modal h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 24px; margin: 0 0 6px;
}
.modal-lede { color: var(--text-muted); margin: 0 0 18px; font-size: 14px; }

/* ───── Form ───── */
form label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}
form input[type="text"],
form select,
form textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit; font-size: 15px;
  color: var(--text);
  background: var(--surface);
}
form textarea { resize: vertical; }
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26,26,23,0.08);
}
.row { display: flex; gap: 10px; }
.row > label { flex: 1; }
.hint { display: block; font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.rating-field {
  border: none; padding: 0; margin: 0 0 14px;
}
.rating-field legend {
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px; padding: 0;
}
.rating-row { display: flex; flex-direction: column; gap: 6px; }
.rating-row label {
  font-size: 14px; color: var(--text); margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.checkbox input { margin-top: 4px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}

.submit-success { text-align: center; padding: 20px 0; }
.submit-success h3 { font-family: var(--font-serif); font-weight: 500; font-size: 22px; margin: 0 0 6px; }

/* ───── Footer ───── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ───── Responsive ───── */
@media (max-width: 540px) {
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 28px; }
  .row { flex-direction: column; gap: 0; }
  .rating-badge { margin-left: 0; }
  .filters { gap: 8px; }
  .modal-panel { padding: 24px 18px 20px; }
}
