/* CivicScore NYC — Styles
   Palette: Bold Slate (Red/White/Blue Patriotic)
   2026-01-31
*/

/* ========================================
   CSS Variables
   ======================================== */
:root {
  /* Core Palette */
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1e3a8a;
  --accent: #dc2626;

  /* Extended Colors */
  --primary-light: #3b82f6;
  --primary-dark: #172554;
  --accent-light: #ef4444;
  --good: #16a34a;
  --good-bg: #dcfce7;
  --bad: #dc2626;
  --bad-bg: #fee2e2;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --section-padding: clamp(4rem, 8vw, 7rem);
  --container-max: 1200px;
  --container-padding: clamp(1rem, 4vw, 2rem);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

/* ========================================
   Reset & Base
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

ul {
  list-style: none;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.section-header p {
  color: var(--muted);
  font-size: 1.125rem;
}

.section-footer {
  text-align: center;
  margin-top: 3rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--text);
}

.logo-icon {
  color: var(--accent);
  font-size: 1.75rem;
}

.logo-accent {
  color: var(--accent);
}

.nav-list {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition-base);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  padding: var(--section-padding) 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero .container {
  display: grid;
  gap: 3rem;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.text-primary {
  color: var(--primary);
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

/* ========================================
   Scorecard
   ======================================== */
.scorecard {
  padding: var(--section-padding) 0;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.scorecard-column {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.column-header {
  text-align: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.column-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.community .column-icon {
  background: var(--good-bg);
  color: var(--good);
}

.corporate .column-icon {
  background: var(--bad-bg);
  color: var(--bad);
}

.column-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.community .column-header h3 {
  color: var(--good);
}

.corporate .column-header h3 {
  color: var(--bad);
}

.column-header p {
  font-size: 0.9rem;
  color: var(--muted);
}

.politician-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.politician-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  border: 1px solid var(--border);
  transition: all var(--transition-base);
}

.politician-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
}

.politician-photo {
  position: relative;
  flex-shrink: 0;
}

.photo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.score-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--bg);
}

.score-badge.good {
  background: var(--good);
  color: #fff;
}

.score-badge.bad {
  background: var(--bad);
  color: #fff;
}

.politician-info {
  flex: 1;
  min-width: 0;
}

.politician-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
}

.politician-title {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.vote-highlights {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.vote-highlights li {
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.vote-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.vote-good::before {
  background: var(--good);
}

.vote-bad::before {
  background: var(--bad);
}

.card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.card-link:hover {
  color: var(--primary-light);
}

.scorecard-footer {
  text-align: center;
  margin-top: 3rem;
}

/* ========================================
   How It Works
   ======================================== */
.how-it-works {
  padding: var(--section-padding) 0;
  background: var(--primary-dark);
  color: #fff;
}

.how-it-works .section-header h2 {
  color: #fff;
}

.how-it-works .section-header p {
  color: rgba(255,255,255,0.7);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.step {
  text-align: center;
  padding: 1.5rem;
}

.step-number {
  display: inline-block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.step h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.step p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

/* ========================================
   Recent Votes
   ======================================== */
.recent-votes {
  padding: var(--section-padding) 0;
  background: var(--surface);
}

.votes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.vote-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  border: 1px solid var(--border);
  transition: all var(--transition-base);
}

.vote-item:hover {
  box-shadow: var(--shadow-md);
}

.vote-date {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 100px;
}

.vote-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.vote-content p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.vote-result {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-tag.passed {
  background: var(--good-bg);
  color: var(--good);
}

.result-tag.failed {
  background: var(--bad-bg);
  color: var(--bad);
}

.vote-link {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
  padding: var(--section-padding) 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-content > p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.cta-form .form-group {
  display: flex;
  gap: 0.75rem;
  max-width: 450px;
  margin: 0 auto;
}

.cta-form input[type="email"] {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1rem;
  transition: all var(--transition-base);
}

.cta-form input[type="email"]::placeholder {
  color: rgba(255,255,255,0.6);
}

.cta-form input[type="email"]:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255,255,255,0.15);
}

.cta-form .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  white-space: nowrap;
}

.cta-form .btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.cta-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* ========================================
   FAQ
   ======================================== */
.faq-section {
  padding: var(--section-padding) 0;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: 1.25rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition-fast);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--muted);
  transition: transform var(--transition-base);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: var(--primary);
}

.faq-item p {
  padding-bottom: 1.25rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 4rem 0 2rem;
}

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

.footer-brand .logo {
  color: #fff;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.95rem;
  max-width: 280px;
}

.footer-links h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
}

.footer-credit a {
  color: #f97316;
  font-weight: 500;
}

.footer-credit a:hover {
  color: #fb923c;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .scorecard-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg);
    box-shadow: var(--shadow-xl);
    padding: 5rem 2rem 2rem;
    transition: right var(--transition-slow);
    z-index: 99;
  }

  .nav.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-link {
    font-size: 1.125rem;
    padding: 0.75rem 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 100;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

  .stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .stat-number {
    font-size: 2rem;
    margin-bottom: 0;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .vote-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .vote-date {
    min-width: auto;
  }

  .cta-form .form-group {
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .politician-card {
    flex-direction: column;
    text-align: center;
  }

  .politician-photo {
    margin: 0 auto;
  }

  .vote-highlights {
    text-align: left;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
