/* ===== Design tokens ===== */
:root {
  --navy: #14213D;
  --navy-deep: #0D1730;
  --cream: #F6F1E4;
  --gold: #C9A227;
  --gold-bright: #E0BE4A;
  --brick: #A23B2E;
  --ink: #232323;

  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--navy);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Subtle grain so the navy reads like printed paper, not a flat screen fill */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header, .hero, .categories-wrap, .site-footer {
  position: relative;
  z-index: 1;
}

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

@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-4deg) scale(1.8); }
  60% { opacity: 1; transform: rotate(-4deg) scale(0.92); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* ===== Header ===== */
.site-header {
  background: var(--navy-deep);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
  padding: 20px 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.seal {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.wordmark {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--cream);
}

/* ===== Hero ===== */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.hero__ballot-number {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  margin: 0 0 18px;
  animation: fadeUp 0.6s ease both;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  margin: 0 0 24px;
  max-width: 14ch;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.08s;
}

.hero__sub {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(246, 241, 228, 0.75);
  max-width: 48ch;
  margin: 0 0 32px;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.16s;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.24s;
}

.btn--primary {
  background: var(--gold);
  color: var(--navy-deep);
}

.btn--primary:hover {
  background: var(--gold-bright);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201, 162, 39, 0.35);
}

/* ===== Map ===== */
.map-section {
  padding: 56px 24px 16px;
}

.map-section__sub {
  font-size: 14.5px;
  color: rgba(246, 241, 228, 0.7);
  margin: 0 0 18px;
}

.map {
  height: 360px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  overflow: hidden;
}

.map-popup {
  font-family: var(--font-body);
}

.map-popup__category {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brick);
  margin: 0 0 4px;
}

.map-popup__name {
  font-weight: 600;
  margin: 0 0 4px;
}

.map-popup__address,
.map-popup__votes {
  font-size: 12.5px;
  color: rgba(35, 35, 35, 0.65);
  margin: 0;
}

/* ===== Categories ===== */
.categories-wrap {
  padding: 56px 24px 80px;
}

.group-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--gold-bright);
  margin: 48px 0 20px;
}

.group-title:first-child { margin-top: 0; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.loading {
  color: rgba(246, 241, 228, 0.6);
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Ticket-stub category card */
.ticket {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  border-radius: 6px;
  padding: 20px 20px 18px;
  background-image:
    radial-gradient(circle at 0 50%, var(--navy) 6px, transparent 7px),
    radial-gradient(circle at 100% 50%, var(--navy) 6px, transparent 7px);
  background-position: left center, right center;
  background-repeat: no-repeat;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ticket:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.ticket::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 64px;
  border-right: 1.5px dashed rgba(35, 35, 35, 0.25);
}

.ticket__stub-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(35, 35, 35, 0.5);
}

.ticket__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 6px 0 14px;
  padding-right: 56px;
}

.ticket__toggle {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  background: none;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.ticket__toggle:hover {
  background: var(--navy);
  color: var(--cream);
}

.ticket--voted .ticket__toggle {
  border-color: var(--brick);
  color: var(--brick);
}

/* Expanded business list */
.business-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px dashed rgba(35, 35, 35, 0.25);
}

.business-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.business-row__name {
  font-size: 14.5px;
  font-weight: 500;
}

.business-row__votes {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(35, 35, 35, 0.55);
}

.vote-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--brick);
  color: var(--cream);
  border: none;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.vote-btn:hover:not(:disabled) {
  background: #8b3024;
}

.vote-btn:disabled {
  background: rgba(35, 35, 35, 0.15);
  color: rgba(35, 35, 35, 0.4);
  cursor: default;
}

.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brick);
  border: 1.5px solid var(--brick);
  border-radius: 4px;
  padding: 6px 10px;
  transform: rotate(-4deg);
  animation: stampIn 0.4s ease both;
}

.empty-note {
  font-size: 13.5px;
  color: rgba(35, 35, 35, 0.55);
  font-style: italic;
  margin: 4px 0 12px;
}

.nominate-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(35, 35, 35, 0.2);
}

.nominate-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(35, 35, 35, 0.55);
  margin: 0 0 8px;
}

.nominate-search-wrap {
  position: relative;
}

.nominate-search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 9px 12px;
  border: 1.5px solid rgba(35, 35, 35, 0.25);
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  outline: none;
}

.nominate-search-input:focus {
  border-color: var(--navy);
}

.nominate-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid rgba(35, 35, 35, 0.15);
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  z-index: 100;
  overflow: hidden;
}

.nominate-dropdown-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(35,35,35,0.07);
}

.nominate-dropdown-item:last-child { border-bottom: none; }
.nominate-dropdown-item:hover { background: rgba(201,162,39,0.1); }

.nominate-dropdown-name {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

.nominate-dropdown-address {
  display: block;
  font-size: 11.5px;
  color: rgba(35,35,35,0.55);
  margin-top: 2px;
}

.nominate-dropdown-loading,
.nominate-dropdown-empty {
  font-size: 13px;
  color: rgba(35,35,35,0.5);
  font-style: italic;
  cursor: default;
}

.nominate-dropdown-loading:hover,
.nominate-dropdown-empty:hover { background: none; }

.nominate-selected {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(201,162,39,0.1);
  border-radius: 4px;
  border-left: 3px solid var(--gold);
}

.nominate-selected-name {
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 2px;
  color: var(--ink);
}

.nominate-selected-address {
  font-size: 11.5px;
  color: rgba(35,35,35,0.6);
  margin: 0;
}

.nominate-add-btn {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1.5px solid var(--navy);
  background: var(--navy);
  color: var(--cream);
  cursor: pointer;
}

.nominate-add-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-msg {
  font-size: 12.5px;
  margin: 6px 0 0;
}

.form-msg--error { color: var(--brick); }
.form-msg--ok { color: #2f6b3a; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  padding: 28px 0;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
  color: rgba(246, 241, 228, 0.55);
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.footer-nav a {
  font-size: 13px;
  color: rgba(246, 241, 228, 0.55);
  text-decoration: none;
}

.footer-nav a:hover { color: var(--gold-bright); }

/* ===== Nav ===== */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.site-nav {
  display: flex;
  gap: 6px;
}

.site-nav__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(246, 241, 228, 0.65);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.site-nav__link:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav__link--active {
  color: var(--gold-bright);
  background: rgba(201, 162, 39, 0.1);
}

/* ===== Content pages (Rules, Support) ===== */
.content-page {
  padding: 56px 24px 80px;
  max-width: 720px;
}

.content-page__header {
  margin-bottom: 40px;
}

.content-page__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  margin: 8px 0 0;
  line-height: 1.1;
}

.content-page__body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Rules blocks */
.rule-block {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.rule-number {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  padding-top: 4px;
  letter-spacing: 0.05em;
}

.rule-block h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.rule-block p {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(246, 241, 228, 0.8);
  margin: 0;
}

.rule-block a {
  color: var(--gold-bright);
  text-underline-offset: 3px;
}

/* FAQ blocks */
.faq-block h3,
.contact-block h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 20px;
}

.faq-item {
  padding: 18px 0;
  border-top: 1px solid rgba(201, 162, 39, 0.15);
}

.faq-item:last-child { border-bottom: 1px solid rgba(201, 162, 39, 0.15); }

.faq-q {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px;
}

.faq-a {
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(246, 241, 228, 0.75);
  margin: 0;
}

/* Contact form */
.contact-note {
  font-size: 14.5px;
  color: rgba(246, 241, 228, 0.7);
  margin: 0 0 24px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1.5px solid rgba(246, 241, 228, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  outline: none;
  resize: vertical;
}

.form-row input::placeholder,
.form-row textarea::placeholder { color: rgba(246, 241, 228, 0.3); }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--gold-bright); }

.form-row select option { background: var(--navy-deep); color: var(--cream); }

/* ===== Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .hero__ballot-number,
  .hero__headline,
  .hero__sub,
  .ticket,
  .stamp {
    animation: none;
    transition: none;
  }
}

@media (max-width: 600px) {
  .site-nav { display: none; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}
