:root {
  --bg: #f8f6f2;
  --bg-card: #ffffff;
  --text: #1a1f24;
  --text-muted: #5c6570;
  --accent: #1e4d3a;
  --accent-light: #e8f2ed;
  --accent-hover: #163a2c;
  --border: #e2ddd4;
  --highlight: #c45c26;
  --highlight-bg: #fdf3ed;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26, 31, 36, 0.06);
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { left: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 246, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-left: auto;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  margin-left: auto;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

.disclaimer-banner {
  background: var(--highlight-bg);
  border-bottom: 1px solid #f0d9cc;
  padding: 0.5rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b4423;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.view { display: none; }
.view.view-active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 em { font-style: italic; color: var(--accent); }

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 auto 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.feature-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.feature-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.section-header {
  margin-bottom: 1.5rem;
}
.section-header h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}
.section-header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 50rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent-light); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }

fieldset {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}
fieldset label {
  display: block;
  margin: 0.35rem 0;
  cursor: pointer;
}
.field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: -0.25rem 0 0.5rem;
}

select, input[type="date"], textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
  background: #fff;
}

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

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}
.inline-form label {
  flex: 1 1 160px;
  font-weight: 500;
  font-size: 0.875rem;
}

.hidden { display: none !important; }

.comparison-table-wrap { margin-top: 1.5rem; }
.table-scroll { overflow-x: auto; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comparison-table th {
  background: var(--accent-light);
  font-weight: 600;
}
.comparison-table tr.recommended {
  background: #f0faf5;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.entity-details-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.entity-detail h3 {
  margin: 0 0 0.75rem;
  color: var(--accent);
}
.entity-detail h4 {
  margin: 1rem 0 0.35rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.entity-detail ul {
  margin: 0;
  padding-left: 1.25rem;
}
.entity-detail li { margin: 0.25rem 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.summary-text { color: var(--text-muted); }

.checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist-items li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.checklist-items li.done label { text-decoration: line-through; color: var(--text-muted); }
.checklist-items input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
}
.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.save-hint { font-size: 0.8125rem; color: var(--text-muted); margin: 1rem 0 0; }

.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.doc-tabs button {
  font-family: inherit;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.875rem;
}
.doc-tabs button[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.doc-article h2 { margin-top: 0; font-family: var(--serif); }
.doc-article section { margin: 1.25rem 0; }

.translator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .translator-layout { grid-template-columns: 1fr; }
}
.translation-result p { margin: 0.5rem 0; }
.highlight-list { list-style: none; padding: 0; margin: 0; }
.highlight-list li {
  padding: 0.65rem 1rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  border-left: 4px solid var(--highlight);
  background: var(--highlight-bg);
  font-size: 0.9375rem;
}
.highlight-list .type {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}
.muted { color: var(--text-muted); }

.lesson-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.lesson-picker button {
  font-family: inherit;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  cursor: pointer;
}
.lesson-picker button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.lesson-panel .lesson-step { display: none; }
.lesson-panel .lesson-step.active { display: block; }
.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.progress-dots {
  display: flex;
  gap: 0.35rem;
  margin: 1rem 0;
}
.progress-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.progress-dots span.done { background: var(--accent); }
.progress-dots span.current { background: var(--accent); transform: scale(1.2); }

.funding-grid {
  display: grid;
  gap: 1rem;
}
.funding-card h3 { margin: 0 0 0.5rem; color: var(--accent); }
.funding-card p { margin: 0; color: var(--text-muted); }

.calendar-events { list-style: none; padding: 0; margin: 0; }
.calendar-events li {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.calendar-date {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.calendar-events .event-title { font-weight: 600; margin: 0; }
.calendar-events .event-desc { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--text-muted); }

.state-select-label {
  display: block;
  max-width: 280px;
  margin-bottom: 1rem;
  font-weight: 500;
}
.state-resources h3 { margin-top: 0; }
.resource-links { list-style: none; padding: 0; }
.resource-links a {
  color: var(--accent);
  word-break: break-all;
}

.mistakes-list { display: grid; gap: 1rem; }
.mistake-card h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}
.mistake-card .fix {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent-light);
  border-radius: 8px;
  font-size: 0.9375rem;
}

.community-col .bar-chart { margin: 1rem 0; }
.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0;
  font-size: 0.875rem;
}
.bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

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

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    margin-left: 0;
  }
  .main-nav.open { display: flex; }
  .header-inner { position: relative; flex-wrap: wrap; }
}
