:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-tertiary: #1a202c;
  --border-color: #273142;
  --border-highlight: #3b475d;
  
  --text-primary: #f0f4fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-orange: #f97316;
  --accent-orange-bg: rgba(249, 115, 22, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-cyan: #06b6d4;
  
  --container-max: 1180px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --border-highlight: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-red: #dc2626;
  --accent-red-bg: rgba(220, 38, 38, 0.08);
  --accent-orange: #ea580c;
  --accent-orange-bg: rgba(234, 88, 12, 0.08);
  --accent-blue: #2563eb;
  --accent-blue-bg: rgba(37, 99, 235, 0.08);
  --accent-green: #059669;
  --accent-green-bg: rgba(5, 150, 105, 0.08);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Ticker */
.top-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticker-tag {
  color: var(--accent-red);
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-red);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.site-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-shield {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 2;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.btn-emergency {
  background-color: var(--accent-red);
  color: #ffffff;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-emergency:hover {
  background-color: #dc2626;
}

/* Hero Section */
.hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 850px;
  margin-bottom: 1.25rem;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 780px;
  margin-bottom: 2rem;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Threat Radar Section */
.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.threat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.threat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.threat-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.threat-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.tag-critical {
  color: var(--accent-red);
  background-color: var(--accent-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-warning {
  color: var(--accent-orange);
  background-color: var(--accent-orange-bg);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.tag-advisory {
  color: var(--accent-blue);
  background-color: var(--accent-blue-bg);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.threat-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.threat-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.threat-footer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
}

/* Essential Eight Section */
.e8-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.e8-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-cyan);
}

.e8-card .e8-num {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

.e8-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.e8-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Software Toolkit */
.software-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

table.software-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

table.software-table th {
  background-color: var(--bg-tertiary);
  padding: 0.9rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

table.software-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

table.software-table tr:last-child td {
  border-bottom: none;
}

.tool-name {
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.tool-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Emergency Triage Section */
.triage-box {
  background: var(--bg-secondary);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
}

.triage-header {
  margin-bottom: 1.5rem;
}

.triage-header h3 {
  font-size: 1.5rem;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.triage-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.step-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-red);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.step-card h4 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.helplines {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.helpline-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.helpline-pill:hover {
  border-color: var(--border-highlight);
  background: var(--bg-secondary);
}

/* Scam Checker Widget */
.checker-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-top: 2rem;
}

.checker-input-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.checker-input {
  flex-grow: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.checker-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.checker-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.checker-btn:hover {
  background: #2563eb;
}

.checker-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  display: none;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  padding: 3.5rem 0 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h5 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .hero h2 { font-size: 1.85rem; }
  .nav-links { display: none; }
  .checker-input-row { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; }
}
