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

:root {
  --primary: #1e3a5f;
  --accent: #d97706;
  --light: #f8fafc;
  --neutral: #64748b;
  --border: #e2e8f0;
  --text: #0f172a;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1, h2, h3 {
  font-family: 'Crimson Text', serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }

/* Navigation */
nav {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

nav .logo {
  font-family: 'Crimson Text', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
}

nav .nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

nav a:hover {
  opacity: 0.8;
}

nav a.active {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2d5a8c 100%);
  color: white;
  padding: 5rem 2rem;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.hero h1 {
  margin-bottom: 1rem;
  color: white;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.92;
  max-width: 680px;
  margin: 0 auto 2rem;
}

.hero-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}

.hero-btn:hover {
  background: #b86200;
}

/* Mission */
.mission {
  background: white;
  padding: 4rem 2rem;
}

.mission .container {
  max-width: 900px;
}

.mission h2 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.mission p {
  font-size: 1.05rem;
  color: var(--neutral);
  text-align: center;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Tiles */
.tiles {
  padding: 4rem 2rem;
  background: var(--light);
}

.tiles h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 3rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tile {
  background: white;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  display: block;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  border-color: var(--accent);
}

.tile h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.tile p {
  color: var(--neutral);
  font-size: 0.95rem;
  line-height: 1.6;
}

.tile-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.tile-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.tile-tag {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--light);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}

/* Page Header (non-hero, inner pages) */
.page-header {
  background: var(--primary);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
}

.page-header h1 {
  font-size: 2.8rem;
  color: white;
  margin-bottom: 0.5rem;
}

.page-header p {
  opacity: 0.88;
  font-size: 1.05rem;
}

/* District Filter Bar */
.filter-bar {
  background: white;
  padding: 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filter-bar .container {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 220px;
}

.filter-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.filter-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  background: white;
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.lookup-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
  white-space: nowrap;
}

.lookup-btn:hover {
  background: #152d47;
}

.district-help {
  font-size: 0.8rem;
  color: var(--neutral);
}

/* Candidates Section */
.candidates-section {
  padding: 3rem 2rem;
}

.results-meta {
  margin-bottom: 1.5rem;
  color: var(--neutral);
  font-size: 0.9rem;
}

.results-meta strong {
  color: var(--text);
}

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

/* Candidate Card */
.candidate-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
  animation: slideUp 0.4s ease-out both;
}

.candidate-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

.candidate-photo {
  width: 100%;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
}

.candidate-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.candidate-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Text', serif;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -1px;
}

.candidate-content {
  padding: 1.5rem;
}

.candidate-name {
  font-size: 1.5rem;
  font-family: 'Crimson Text', serif;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.candidate-office {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.candidate-detail {
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.candidate-detail-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.2rem;
}

.candidate-detail-value {
  color: var(--neutral);
}

.candidate-bio {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--neutral);
}

.candidate-bio strong {
  color: var(--text);
}

.candidate-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.candidate-link {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: var(--light);
  color: var(--primary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.83rem;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.candidate-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* States */
.state-message {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--neutral);
}

.state-message p {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.state-message .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Footer */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.75);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.8;
}

footer a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

footer a:hover {
  color: white;
}

footer .footer-logo {
  font-family: 'Crimson Text', serif;
  font-size: 1.3rem;
  color: white;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.8rem; }

  nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    position: static;
  }

  .filter-bar {
    position: static;
  }

  .filter-bar .container {
    flex-direction: column;
  }

  .candidates-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3.5rem 1.5rem;
  }
}
