:root {
  --red: #cc2200;
  --red-light: #ff3d1a;
  --bg: #f5f0e8;
  --surface: #ede8dc;
  --surface2: #e4dfd2;
  --border: #c8c2b2;
  --text: #1a1714;
  --text-muted: #6b6560;
  --green: #1a7a3c;
  --risk-high: #cc2200;
  --risk-medium: #c87000;
  --risk-low: #1a7a3c;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 10px; height: 10px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
}

nav { display: flex; gap: 24px; align-items: center; }
nav a { color: var(--text); font-size: 0.9rem; font-weight: 500; }
nav a:hover { color: var(--red); text-decoration: none; }

/* Main */
main { flex: 1; padding: 48px 0; }

/* Hero */
.hero {
  text-align: center;
  padding: 64px 24px;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 { font-size: 3rem; margin-bottom: 16px; }
.hero h1 span { color: var(--red); }
.hero p { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 32px; }

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-light); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text); text-decoration: none; }

/* Stats */
.stats-row {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 48px 0;
}

.stat-box {
  flex: 1;
  background: var(--surface);
  padding: 24px;
  text-align: center;
}

.stat-box .num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
}

.stat-box .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s;
  cursor: pointer;
}

.card:hover { border-color: var(--red); }

.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { font-size: 0.88rem; color: var(--text-muted); }

.risk-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.risk-high { background: #fde8e8; color: var(--risk-high); }
.risk-medium { background: #fff3e0; color: var(--risk-medium); }
.risk-low { background: #e8f5e9; color: var(--risk-low); }

/* Section headings */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.section-head h2 { font-size: 1.5rem; }

/* Form styles */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--red);
}

.form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 440px;
  margin: 0 auto;
}

.form-box h2 { font-size: 1.5rem; margin-bottom: 24px; }

/* Inline form (newsletter footer) */
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text);
}
.inline-form button {
  padding: 8px 16px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Search bar */
.search-bar {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 24px;
}

.search-bar:focus { outline: none; border-color: var(--red); }

/* Thread list */
.thread-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.thread-item:hover { border-color: var(--red); }
.thread-item h3 { font-size: 1rem; margin-bottom: 4px; }
.thread-item .meta { font-size: 0.8rem; color: var(--text-muted); }

/* Profile detail */
.profile-detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  max-width: 900px;
}

.profile-detail img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.profile-img-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}

/* Alert/message */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.9rem;
}

.alert-error { background: #fde8e8; color: var(--risk-high); border: 1px solid #fca5a5; }
.alert-success { background: #e8f5e9; color: var(--green); border: 1px solid #86efac; }

/* Page title */
.page-title { margin-bottom: 32px; }
.page-title h1 { font-size: 2rem; }
.page-title p { color: var(--text-muted); margin-top: 8px; }

/* About / static pages */
.prose { max-width: 700px; }
.prose h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.prose p { margin-bottom: 16px; color: var(--text-muted); line-height: 1.7; }

/* Loading */
.loading { color: var(--text-muted); padding: 48px; text-align: center; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-grid strong { font-family: var(--font-head); display: block; margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; }
.footer-grid p { color: var(--text-muted); font-size: 0.88rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; font-size: 0.85rem; color: var(--text-muted); }

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .stats-row { flex-direction: column; gap: 0; }
  .profile-detail { grid-template-columns: 1fr; }
  nav { gap: 12px; }
}
