:root {
  --navy: #0f2c4a;
  --navy-2: #133b66;
  --sun: #ffc233;
  --sun-2: #ffd966;
  --ink: #14202e;
  --muted: #5a6a7a;
  --line: #e3e8ef;
  --bg: #f7f9fc;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --good: #1f9a5d;
  --bad: #d63a3a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,44,74,.05), 0 12px 28px -16px rgba(15,44,74,.18);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

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

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.brand-name { color: var(--navy); }
.primary-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.primary-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
}
.primary-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  background: linear-gradient(180deg, #fff 0%, var(--accent-soft) 100%);
  padding: 56px 0 56px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--navy-2);
  margin: 0 0 14px;
  padding: 6px 12px;
  background: rgba(15,44,74,.06);
  border-radius: 999px;
}
h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.lead {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 56ch;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(15,44,74,.6);
}
.btn-primary:hover { background: var(--navy-2); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: rgba(15,44,74,.18);
}
.btn-ghost:hover { background: rgba(15,44,74,.05); text-decoration: none; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.hero-stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  color: var(--navy);
  line-height: 1;
}
.hero-stats span { color: var(--muted); font-size: 14px; margin-top: 4px; }
.hero-art img {
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* Page head */
.page-head {
  background: linear-gradient(180deg, #fff 0%, var(--accent-soft) 100%);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(28px, 3.8vw, 44px); margin-bottom: 14px; }

/* Sections */
.section { padding: 56px 0; }
.section--alt { background: #fff; border-block: 1px solid var(--line); }
.section--cta { background: var(--navy); color: #fff; padding: 56px 0; text-align: center; }
.section--cta h2 { color: #fff; font-family: var(--font-display); font-size: 36px; margin: 0 0 12px; }
.section--cta p { color: #cad6e3; max-width: 60ch; margin: 0 auto 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 8px; }
.section-head h2 { font-family: var(--font-display); font-weight: 900; color: var(--navy); font-size: clamp(24px, 2.4vw, 32px); margin: 0; }
.section-link { font-weight: 600; color: var(--accent); font-size: 14px; }
.section-sub { color: var(--muted); margin: 0 0 28px; max-width: 60ch; }
.section-title { font-family: var(--font-display); font-weight: 900; color: var(--navy); font-size: 28px; margin: 0 0 24px; }

/* State grid */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.state-grid--full { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.state-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.state-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 16px -10px rgba(37,99,235,.45);
  text-decoration: none;
  transform: translateY(-1px);
}
.state-card-abbr {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.state-card-body { display: flex; flex-direction: column; min-width: 0; }
.state-card-name { font-weight: 600; font-size: 15px; }
.state-card-meta { font-size: 12px; color: var(--muted); }

/* Topic / article cards */
.topic-grid, .article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.topic-card, .article-card {
  display: block;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.topic-card:hover, .article-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateY(-2px);
}
.topic-card h3, .article-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
  font-size: 20px;
}
.topic-card p, .article-card p { color: var(--muted); margin: 0 0 12px; }
.read-more { color: var(--accent); font-weight: 600; font-size: 14px; }

/* Sign cards */
.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.sign-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sign-card--link { text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease; }
.sign-card--link:hover { border-color: var(--navy); box-shadow: 0 12px 28px -16px rgba(15,44,74,.35); transform: translateY(-2px); text-decoration: none; }
.sign-card--link .read-more { margin-top: 8px; }
.sign-card h3 { font-family: var(--font-display); font-weight: 700; color: var(--navy); margin: 14px 0 6px; font-size: 18px; }
.sign-card p { margin: 0 0 6px; color: var(--ink); font-size: 14px; }
.sign-card .sign-meta { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.sign-card .sign-detail { color: var(--muted); font-size: 13px; }
.sign-card-shape {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  text-align: center; padding: 6px;
}
.sign-shape--octagon { clip-path: polygon(30% 0,70% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%); }
.sign-shape--triangle-down { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.sign-shape--diamond { transform: rotate(45deg); width: 60px; height: 60px; }
.sign-shape--diamond span { transform: rotate(-45deg); }
.sign-shape--rect-v { width: 56px; height: 80px; border-radius: 6px; }
.sign-shape--rect-h { width: 92px; height: 56px; border-radius: 6px; }
.sign-shape--pentagon { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.sign-shape--circle { border-radius: 50%; }
.sign-shape--crossbuck { background: transparent !important; color: var(--navy); border: none; }
.sign-color--red { background: #d8252b; color: #fff; }
.sign-color--yellow { background: #ffc801; color: #1a1a1a; }
.sign-color--green { background: #1f7a3d; color: #fff; }
.sign-color--blue { background: #1758a3; color: #fff; }
.sign-color--orange { background: #f08019; color: #1a1a1a; }
.sign-color--brown { background: #6e3a1f; color: #fff; }
.sign-color--white { background: #fff; color: #1a1a1a; border: 2px solid #1a1a1a; }
.sign-color--yellow-green { background: #c5d62b; color: #1a1a1a; }
.sign-color--black { background: #1a1a1a; color: #fff; }

/* Quiz */
.quiz-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 18px; }
.quiz-meta strong { color: var(--ink); }
.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: flex-start;
}
.quiz-main { min-width: 0; }
.quiz-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.side-card h3 { font-family: var(--font-display); font-weight: 700; color: var(--navy); margin: 0 0 10px; font-size: 18px; }
.side-card p { margin: 4px 0; font-size: 14px; color: var(--ink); }
.side-card .btn { margin-top: 12px; width: 100%; }
.side-links { list-style: none; padding: 0; margin: 0; }
.side-links li { margin: 6px 0; font-size: 14px; }

.quiz-form { display: flex; flex-direction: column; gap: 18px; }
.quiz-q {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin: 0;
}
.quiz-q legend {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0 8px 0 0;
}
.quiz-q-text { font-size: 18px; font-weight: 600; color: var(--navy); margin: 8px 0 16px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.quiz-option:hover { background: var(--accent-soft); border-color: var(--accent); }
.quiz-option input { margin-top: 4px; accent-color: var(--accent); }
.quiz-option-letter {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  width: 22px;
  flex: 0 0 22px;
}
.quiz-option-text { color: var(--ink); }
.quiz-option.is-correct { background: #ecfaf2; border-color: var(--good); }
.quiz-option.is-correct .quiz-option-letter { color: var(--good); }
.quiz-option.is-wrong { background: #fdecec; border-color: var(--bad); }
.quiz-option.is-wrong .quiz-option-letter { color: var(--bad); }
.quiz-explain {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--ink);
}
.quiz-submit { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; }
.quiz-submit-note { color: var(--muted); font-size: 13px; }
.quiz-result {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
}
.quiz-result h2 { font-family: var(--font-display); font-size: 28px; margin: 0 0 6px; color: var(--sun); }
.quiz-result p { margin: 0 0 14px; color: #cad6e3; }
.quiz-result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-result-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.quiz-result-actions .btn-ghost:hover { background: rgba(255,255,255,.08); }

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: flex-start;
}
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: none; }
.prose h2 { font-family: var(--font-display); color: var(--navy); font-weight: 800; font-size: 24px; margin: 28px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--font-display); color: var(--navy); font-weight: 700; font-size: 19px; margin: 22px 0 10px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--navy); }

/* Footer */
.site-footer { background: #0b1f33; color: #cad6e3; margin-top: 56px; padding: 40px 0 18px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand--footer { color: #fff; }
.brand--footer .brand-name { color: #fff; }
.footer-tag { color: #93a4b8; max-width: 32ch; margin: 12px 0 0; font-size: 14px; }
.footer-grid h4 { color: #fff; font-family: var(--font-display); font-weight: 700; margin: 0 0 12px; font-size: 16px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 6px 0; font-size: 14px; }
.footer-grid a { color: #b9c7d8; }
.footer-grid a:hover { color: #fff; }
.copyright { color: #7c8da3; font-size: 12px; margin-top: 18px; }

.cta-inner h2 { font-size: clamp(26px, 3vw, 38px); }
.cta-inner .btn-primary { background: var(--sun); color: var(--navy); }
.cta-inner .btn-primary:hover { background: var(--sun-2); }

/* ====================================================================
   Polished v2 — distinctive branding, hero progress, state tile grid,
   PBN-friendly sidebar/footer, sign hero, mobile refinements.
   ==================================================================== */

/* Distinctive top accent bar — navy → amber gradient, full-bleed under header */
.site-header { box-shadow: 0 1px 0 var(--line); }
.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 38%, var(--sun) 100%);
}

/* Brand mark — emboss the logo tile so it feels purpose-built */
.brand img {
  background: var(--navy);
  padding: 4px;
  box-shadow: 0 0 0 2px var(--sun) inset;
}

/* Hero — more generous whitespace, layered art, animated progress accent */
.hero { padding: 72px 0 88px; position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  right: -160px; top: -160px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,194,51,.18), transparent 60%);
  pointer-events: none;
}
.hero-grid { gap: 64px; }
.hero-art { position: relative; }
.hero-art img { border: 1px solid var(--line); }

.hero-progress {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  width: min(420px, 92%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 18px 36px -18px rgba(15,44,74,.35);
}
.hero-progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.hero-progress-foot { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.progress-bar {
  height: 10px;
  background: var(--accent-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--sun) 100%);
  border-radius: 999px;
  transition: width .3s ease;
}

/* Quiz progress sticky bar */
.quiz-progress {
  position: sticky;
  top: 60px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  z-index: 20;
  box-shadow: 0 6px 18px -14px rgba(15,44,74,.35);
}
.quiz-progress-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.quiz-progress-label strong { color: var(--navy); font-family: var(--font-display); font-size: 16px; }

/* State tile grid — homepage 50-state grid */
.state-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.state-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.state-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--sun);
  border-radius: 12px 0 0 12px;
  opacity: 0;
  transition: opacity .15s ease;
}
.state-tile:hover {
  border-color: var(--navy);
  box-shadow: 0 12px 28px -16px rgba(15,44,74,.35);
  transform: translateY(-2px);
  text-decoration: none;
}
.state-tile:hover::before { opacity: 1; }
.state-tile-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--sun);
  background: var(--navy);
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
}
.state-tile-name { font-weight: 700; color: var(--navy); font-size: 16px; line-height: 1.2; margin-top: 4px; }
.state-tile-meta { color: var(--muted); font-size: 12px; }

/* Sign hero (sign detail page) */
.sign-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.sign-tile--lg .sign-card-shape {
  width: 140px; height: 140px;
  font-size: 18px;
}
.sign-tile--lg .sign-shape--diamond { width: 110px; height: 110px; }

/* Footer — 6-column on wide screens, smart collapse */
.footer-grid { grid-template-columns: 1.4fr repeat(5, 1fr); }
.footer-recommended a { color: var(--sun-2); }
.footer-recommended a:hover { color: var(--sun); }
.related-links a { color: var(--accent); font-weight: 500; }

/* Prose CTA box */
.prose-cta {
  margin-top: 28px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-radius: 12px;
  font-size: 16px;
  border-left: 4px solid var(--sun);
}
.prose-cta a { color: var(--sun); font-weight: 700; text-decoration: underline; }
.prose-cta a:hover { color: var(--sun-2); }

/* Article cards — slight upgrade */
.article-card { border-top: 3px solid var(--sun); }

/* Topic cards — distinct look from articles */
.topic-card { background: linear-gradient(180deg, #fff 0%, #fafcff 100%); }
.topic-card h3::before {
  content: "→ ";
  color: var(--sun);
  font-weight: 900;
}

/* Mobile refinements */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1.2fr repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .hero-grid, .quiz-layout, .article-layout, .sign-hero { grid-template-columns: 1fr; }
  .quiz-side { position: static; order: 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .primary-nav { gap: 16px; }
  .primary-nav a { font-size: 14px; }
  .header-inner { flex-wrap: wrap; padding: 12px 18px; }
  .hero { padding: 48px 0 72px; }
  .hero-stats { gap: 22px; }
  .hero-stats strong { font-size: 26px; }
  .hero-art { order: -1; }
  .hero-progress { position: static; transform: none; width: 100%; margin-top: 16px; }
  .sign-hero { padding: 22px; gap: 18px; }
  .sign-tile--lg .sign-card-shape { width: 110px; height: 110px; }
  .prose { padding: 22px; }
  .quiz-progress { top: 0; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 56px; }
  .section { padding: 36px 0; }
  .container { padding: 0 18px; }
  .state-tile-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .state-tile { padding: 12px; }
  .state-tile-name { font-size: 14px; }
  h1 { font-size: clamp(28px, 8vw, 38px); }
  .lead { font-size: 16px; }
  .btn-lg { padding: 12px 22px; font-size: 15px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; }
  .quiz-meta { gap: 10px; font-size: 13px; }
  .prose h2 { font-size: 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
