:root {
  --bg:           #F8F5F0;
  --surface:      #FFFFFF;
  --text:         #1A1614;
  --text-muted:   #6B6058;
  --text-subtle:  #A8A098;
  --accent:       #C84B24;
  --accent-dark:  #A33B1A;
  --accent-bg:    #FEF0EA;
  --border:       #E3DDD6;
  --border-light: #EDE9E3;

  --bg-rgb:    248, 245, 240;

  --shadow-sm: 0 1px 3px rgba(26,22,20,.05), 0 1px 2px rgba(26,22,20,.06);
  --shadow-md: 0 4px 12px rgba(26,22,20,.08), 0 2px 4px rgba(26,22,20,.04);

  --radius:    8px;
  --radius-sm: 4px;
  --radius-xl: 16px;
  --pill:      9999px;

  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --nav-h:      64px;
  --page-max:   1080px;
  --gap:        48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(160deg, #FFFFFF 0%, var(--bg) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--accent-dark); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(var(--bg-rgb), 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 28px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text) !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-brand:hover { color: var(--accent) !important; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  padding: 6px 14px;
  border-radius: var(--pill);
  letter-spacing: 0.01em;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text) !important; background: var(--border-light); }
.nav-link.active { color: var(--text) !important; background: var(--border); }

/* Hero */
.hero {
  padding: 120px 28px 96px;
  max-width: var(--page-max);
  margin: 0 auto;
}
.hero-inner { max-width: 720px; }
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  font-weight: 400;
  margin-bottom: 24px;
}
.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border); }
.btn-full { width: 100%; }

/* Sections */
.section { padding: 72px 28px; }
.section-tight { padding: 48px 28px; }
.section-muted { background: rgba(var(--bg-rgb), 0.6); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: var(--page-max); margin: 0 auto; }
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
  margin-bottom: 14px;
}
.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
}
.privacy-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 10px;
  font-weight: 400;
}
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Dashboard */
.dash-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dash-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}
.link-arrow {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-compact { gap: 12px; }
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}
.card-date { color: var(--text-subtle); font-family: var(--font-mono); }
.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.3;
}
.card-desc { color: var(--text-muted); font-size: 0.95rem; }
.card-metric {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.metric-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent);
  margin-right: 8px;
}
.metric-label { color: var(--text-muted); font-size: 0.85rem; }

/* Badges & Tags */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--pill);
}
.badge-success { background: #EAF5EE; color: #1F7A3D; }
.badge-warn { background: #FFF7E6; color: #A65C00; }
.badge-soft { background: var(--border-light); color: var(--text-muted); }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 4px 10px;
  border-radius: var(--pill);
}

/* Logs */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.log-list-full { gap: 22px; }
.log-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.log-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.log-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-subtle);
}
.log-content { color: var(--text); }

/* Case studies */
.case-list { display: flex; flex-direction: column; gap: 28px; }
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.case-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 12px;
}
.case-summary { color: var(--text-muted); margin-bottom: 20px; }
.case-subheading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.finding-list { padding-left: 20px; }
.finding-list li {
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.5;
}
.finding-list li::marker { color: var(--accent); }

/* Auth */
.auth-section {
  min-height: calc(100vh - var(--nav-h) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.auth-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 6px;
}
.auth-subtitle { color: var(--text-muted); margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.alert-error { background: #FDEDEC; color: #922B21; border: 1px solid #F5B7B1; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 28px;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  color: var(--text-subtle);
  font-size: 0.85rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 720px) {
  .site-nav { gap: 0; }
  .nav-link { padding: 6px 10px; font-size: 0.8rem; }
  .hero { padding: 80px 20px 64px; }
  .section, .section-tight { padding: 48px 20px; }
  .auth-card { padding: 28px; }
}
