@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #fafafa;
  --fg: #171717;
  --muted: #525252;
  --accent: #059669;
  --accent-dark: #047857;
  --highlight: #e07a5f;
  --border: #e5e7eb;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
    scroll-padding-top: auto;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(5, 150, 105, 0.25);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease, text-decoration-thickness 0.2s ease;
}

a:hover {
  color: var(--accent-dark);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

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

/* Header & Nav */
.site-header {
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-title span {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: var(--font-body);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--accent);
  background: rgba(5, 150, 105, 0.04);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--fg);
  text-decoration: none;
}

.site-nav a.active {
  background: rgba(0, 0, 0, 0.03);
  color: var(--accent);
  font-weight: 600;
}

/* Main content */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

p, ul, ol {
  margin-bottom: 1.15rem;
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

/* Intro block */
.intro {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Cards / callouts */
.callout,
.myth-card,
.level-card,
.gear-item,
.rec-card,
.decision-tree .branch {
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.callout:hover,
.myth-card:hover,
.level-card:hover,
.gear-item:hover,
.rec-card:hover,
.decision-tree .branch:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.callout-highlight {
  border-left: 3px solid var(--accent);
  border-radius: 0 16px 16px 0;
}

.callout-warn {
  border-left: 3px solid var(--highlight);
  border-radius: 0 16px 16px 0;
}

.callout-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

/* Math / formula boxes */
.math-box {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

/* Placeholder */
.placeholder {
  background: #fff7ed;
  border: 1px dashed #fed7aa;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.placeholder-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #c2410c;
  margin-bottom: 0.4rem;
}

.placeholder p {
  color: #9a3412;
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Last updated */
.last-updated {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(82, 82, 82, 0.3);
}

.site-footer a:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  background: var(--card);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Mobile nav */
@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.1rem;
    padding-top: 0.5rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.5rem 0.75rem;
    width: 100%;
  }

  body {
    font-size: 1rem;
  }

  main {
    padding: 1.5rem 1rem 3rem;
  }

  .callout,
  .myth-card,
  .level-card,
  .gear-item,
  .rec-card,
  .decision-tree .branch {
    padding: 1.25rem;
    border-radius: 12px;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
  text-decoration: none;
}

.btn-secondary {
  background: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

/* Specific to ev-curious content blocks */

/* Decision tree (parking question) */
.decision-tree {
  margin: 1.5rem 0;
}

.decision-tree .branch {
  margin-bottom: 1rem;
}

.decision-tree .question {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.decision-tree .answer {
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  margin: 0.6rem 0;
  font-size: 0.98rem;
}

.decision-tree .answer.yes {
  border-left-color: var(--accent);
}

.decision-tree .answer.no {
  border-left-color: var(--highlight);
}

/* Myth cards */
.myth-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.myth-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* Level cards (charging) */
.level-card .level-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.level-card .level-tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.level-card p:last-child {
  margin-bottom: 0;
}

/* Gear items */
.gear-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.gear-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gear-price {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Recommendation cards */
.rec-category {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.rec-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  font-weight: 600;
  background: var(--card);
}

.comparison-table tr:last-child td {
  font-weight: 600;
  border-bottom: none;
}

.comparison-table .gas-col {
  color: #be123c;
}

.comparison-table .ev-col {
  color: var(--accent-dark);
}

/* Disclosure */
.disclosure {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* Page-level CTA footer */
.cta-footer {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.cta-footer p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* Contact form */
.question-form {
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.question-form .form-group {
  margin-bottom: 1.25rem;
}

.question-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--fg);
  font-size: 0.95rem;
}

.question-form input,
.question-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.question-form input:focus,
.question-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.question-form textarea {
  resize: vertical;
  min-height: 120px;
}

.question-form .btn {
  width: auto;
}

/* SVG Background Utilities */
.hero-bg {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 0;
  margin: 0 -1.5rem;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-blobs.svg') no-repeat center center;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
}

.hero-bg > * {
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
}

.section-dots {
  background-image: url('../images/dot-grid.svg');
  background-repeat: repeat;
  background-size: 32px 32px;
  padding: 1.5rem;
  border-radius: 16px;
  margin: 1.5rem 0;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

  .callout:hover,
  .myth-card:hover,
  .level-card:hover,
  .gear-item:hover,
  .rec-card:hover,
  .decision-tree .branch:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* Additional SVG Utilities */
.circuit-bg {
  background-image: url('../images/circuit-pattern.svg');
  background-repeat: repeat;
  background-size: 120px 120px;
}

.section-grid {
  background-image: url('../images/line-grid.svg');
  background-repeat: repeat;
  background-size: 80px 80px;
}

.dashed-divider {
  height: 24px;
  background: url('../images/dashed-divider.svg') no-repeat center;
  background-size: 100% 100%;
  color: var(--border);
  margin: 2rem 0;
}

.zigzag-divider {
  height: 40px;
  background: url('../images/zigzag-divider.svg') no-repeat center;
  background-size: 100% 100%;
  color: var(--border);
  margin: 2rem 0;
}

.orb-decoration {
  position: absolute;
  width: 200px;
  height: 200px;
  background: url('../images/gradient-orb.svg') no-repeat center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}

.circle-decoration {
  position: absolute;
  width: 300px;
  height: 300px;
  background: url('../images/circle-accent.svg') no-repeat center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.inline-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-left: 0.2em;
}

.check-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
  margin-right: 0.4em;
  color: var(--accent);
}
