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

:root {
  /* Palette: What's Happening Salem. Navy and coral from the logo, sunset orange and gold as accents. */
  --navy: #073349;
  --navy-deep: #052636;
  --paper: #fffdf9;
  --paper-2: #fdf0e3;
  --ink: #0d2733;
  --ink-2: #4c5c67;
  --rule: #e6dfd3;
  --cherry: #f0523f;
  --cherry-dark: #d63f2d;
  --filled: #073349;
  --orange: #f5953b;
  --orange-dark: #c2601a;
  --gold: #fbb92b;
  --focus: #ffffff;
  --radius: 14px;
  --maxw: 640px;
  font-family: 'Inter', system-ui, sans-serif;
  font-optical-sizing: auto;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; }
button, input { font: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.hero :focus-visible, .top :focus-visible, .progress :focus-visible { outline-color: var(--orange); }

/* Shell */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; color: #fff; max-width: 1040px; margin: 0 auto;
}
.top .brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; font-size: 15px; opacity: .92; }
.top .brand span { opacity: .6; font-weight: 500; }
.top nav a { color: var(--orange); opacity: 1; text-decoration: none; margin-left: 18px; font-size: 15px; font-weight: 600; }
.top nav a:hover { opacity: 1; }

.hero {
  color: #fff; padding: 36px 20px 56px; max-width: 1040px; margin: 0 auto;
}
.hero h1 {
  font-size: clamp(44px, 9vw, 96px);
  line-height: .95; letter-spacing: -0.03em; font-weight: 800;
  margin: 0 0 20px; max-width: 12ch;
}
.hero p { font-size: clamp(18px, 2.4vw, 22px); max-width: 44ch; margin: 0 0 28px; opacity: .88; line-height: 1.45; }
.stamp {
  display: inline-block; border: 3px solid var(--orange); color: #fff; background: var(--orange);
  padding: 6px 12px; border-radius: 6px; font-weight: 800; transform: rotate(-3deg);
  font-size: 15px; margin-bottom: 18px; letter-spacing: .01em;
}

/* Paper sheet */
.sheet {
  background: var(--paper); color: var(--ink);
  border-radius: 28px 28px 0 0; padding: 32px 20px 72px; min-height: 50vh;
}
.sheet-inner { max-width: var(--maxw); margin: 0 auto; }
h2 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 20px; margin: 28px 0 8px; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
.muted { color: var(--ink-2); }
.small { font-size: 15px; }

/* Forms */
.field { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.field input[type=email] {
  flex: 1 1 240px; padding: 16px 18px; border: 2px solid var(--rule); border-radius: var(--radius);
  background: #fff; font-size: 18px; min-width: 0;
}
.field input[type=email]:focus, .field input.zip:focus { border-color: var(--navy); outline: none; }
.field input.zip { flex: 0 0 110px; padding: 16px 14px; border: 2px solid var(--rule); border-radius: var(--radius); background: #fff; font-size: 18px; min-width: 0; letter-spacing: .04em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--cherry); color: var(--ink); border: 0; border-radius: var(--radius);
  padding: 16px 24px; font-weight: 700; font-size: 18px; cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: var(--cherry-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.quiet { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.note { background: var(--paper-2); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; color: var(--ink-2); }
.error { color: #9c0b22; font-weight: 600; }
.success { background: #e6f0e7; color: #1f5026; border-radius: var(--radius); padding: 18px; font-weight: 600; }

/* Newsletter opt-in */
.optin { flex: 1 1 100%; display: flex; gap: 12px; align-items: flex-start; margin: 2px 0 6px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.optin input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); flex: 0 0 auto; }

/* How it works rows */
.steps { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.steps li::before {
  counter-increment: s; content: counter(s);
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--orange);
  display: grid; place-items: center; font-weight: 700; color: var(--orange-dark);
}
.steps strong { display: block; }

/* Ballot */
.progress {
  position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff;
  padding: 12px 20px; font-size: 15px; font-weight: 600;
}
.progress .bar { height: 6px; background: rgba(255,255,255,.18); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .25s; }
.section-head {
  margin: 36px 0 6px; padding-bottom: 8px; border-bottom: 3px solid var(--orange);
  display: flex; align-items: baseline; justify-content: space-between;
}
.section-head h2 { margin: 0; font-size: 24px; }
.section-head span { color: var(--ink-2); font-size: 15px; }
.cat { padding: 18px 0 6px; border: 0; border-bottom: 1px solid var(--rule); margin: 0; min-width: 0; }
fieldset.cat legend { display: none; }
.cat h3 { margin: 0 0 10px; font-size: 22px; display: flex; justify-content: space-between; align-items: baseline; }
.cat h3 .done { color: var(--orange-dark); font-size: 14px; font-weight: 600; }
.opt { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.opt:hover { background: var(--paper-2); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.oval {
  flex: 0 0 auto; width: 44px; height: 28px; border: 2.5px solid var(--ink); border-radius: 50%;
  background: #fff; transition: background .12s, border-color .12s;
}
.opt input:checked + .oval { background-color: var(--navy) !important; border-color: var(--navy); }
.opt:has(input:checked) .name { font-weight: 700; }
.opt input:focus-visible + .oval { outline: 3px solid var(--focus); outline-offset: 3px; }
.opt .name { font-size: 18px; }
.writein { display: flex; align-items: center; gap: 14px; padding: 8px 6px; }
.writein input[type=text] {
  flex: 1; border: 0; border-bottom: 2px dashed var(--ink-2); background: transparent; padding: 8px 2px; font-size: 18px; min-width: 0;
}
.writein input[type=text]:focus { outline: none; border-bottom-style: solid; border-color: var(--navy); }
.submit-wrap { position: sticky; bottom: 0; padding: 16px 0 8px; background: linear-gradient(transparent, var(--paper) 30%); }
.submit-wrap .btn { width: 100%; }

/* Results */
.res { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.res h3 { margin: 0 0 8px; }
.row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; padding: 8px 0; font-size: 19px; }
.row.gold { font-weight: 700; }
.medal { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink); background: var(--cherry); border-radius: 6px; padding: 3px 8px; text-align: center; }
.row.silver .medal { background: var(--orange); color: #fff; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.kpi { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; }
.kpi b { display: block; font-size: 30px; letter-spacing: -0.02em; line-height: 1; }
.kpi span { color: var(--ink-2); font-size: 14px; }

footer { color: rgba(255,255,255,.6); font-size: 14px; padding: 28px 20px; max-width: 1040px; margin: 0 auto; }
footer a { color: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* Long categories */
.filter { width: 100%; padding: 12px 14px; border: 2px solid var(--rule); border-radius: 10px; background: #fff; font-size: 16px; margin: 0 0 8px; }
.filter:focus { outline: none; border-color: var(--navy); }
.cat.long .opt.extra { display: none; }
.cat.long.open .opt.extra { display: flex; }
.cat.long .opt[hidden] { display: none; }
.showall { background: none; border: 0; color: var(--orange-dark); font-weight: 700; padding: 10px 6px; cursor: pointer; text-decoration: underline; }
.cat.long.open .showall { display: none; }

/* Title sponsor */
.title-sponsor { display: inline-flex; flex-direction: column; gap: 8px; margin-top: 28px; padding: 12px; background: #fff; border-radius: 16px; text-decoration: none; box-shadow: 0 0 0 4px var(--cherry); }
.title-sponsor span { font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: .01em; padding: 0 2px; }
.title-sponsor img { display: block; width: 280px; max-width: 100%; height: auto; border-radius: 8px; }
.title-sponsor.small { flex-direction: row; align-items: center; gap: 12px; margin-top: 4px; padding: 8px 12px 8px 8px; box-shadow: none; }
.title-sponsor.small img { width: 120px; border-radius: 6px; }
.title-sponsor.small span { order: 2; color: var(--ink-2); font-weight: 600; }
.sheet .title-sponsor { box-shadow: 0 0 0 2px var(--rule); }

/* Write-in suggestion */
.suggest { margin: 0 0 10px 64px; font-size: 15px; color: var(--ink-2); }
.suggest button { background: var(--paper-2); border: 2px solid var(--navy); color: var(--navy); border-radius: 8px; padding: 4px 10px; font-weight: 700; cursor: pointer; margin-left: 4px; }
.writein .wr:checked + .oval { background: var(--navy); border-color: var(--navy); }

/* ---- Landing hero: presented-by, date strip, sponsor card ---- */
.hero-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 48px; } }
.hero-grid .hero-copy h1 { max-width: 11ch; }
.presented-by { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; margin-bottom: 22px; }
.presented-by span { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.presented-by img { height: 64px; width: auto; border-radius: 8px; box-shadow: 0 0 0 3px rgba(255,255,255,.9); }
.round { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); margin: 0 0 10px; opacity: 1; }
.hero .round { font-size: 13px; }
.dates { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 26px; padding: 18px 0 0; border-top: 1px solid rgba(255,255,255,.22); }
.dates dt { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: #fff; }
.dates dd { margin: 2px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.dates .on dt { color: var(--cherry); }
.dates .on dd { opacity: 1; }

.sponsor-card { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 18px; }
.sponsor-card h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; text-align: center; margin: 2px 0 14px; color: var(--navy); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; text-decoration: none; text-align: center; }
.tile span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.tile.title { background: #e9f1ea; border: 2px solid var(--navy); }
.tile.title span { color: var(--navy); }
.tile.title img { width: 100%; height: auto; border-radius: 8px; }
.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tile.open { border: 2px dashed var(--rule); min-height: 92px; justify-content: center; }
.tile.open b { font-size: 14px; color: var(--orange-dark); }
.tile.open:hover { border-color: var(--orange); }

/* ---- Nomination form ---- */
.nomrow { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 560px) { .nomrow { grid-template-columns: 200px 1fr; align-items: center; gap: 16px; } }
.nomrow span { font-weight: 700; font-size: 17px; }
.nomrow input { width: 100%; padding: 12px 14px; border: 2px solid var(--rule); border-radius: 10px; background: #fff; font-size: 17px; min-width: 0; }
.nomrow input:focus { outline: none; border-color: var(--navy); }
.nomrow input:not(:placeholder-shown) { border-color: var(--navy); background: #f4f9f4; }
.finish { margin-top: 36px; padding: 20px; background: var(--paper-2); border-radius: 18px; }
.finish h3 { margin-top: 0; }

/* ---- Sponsor band ---- */
.sponsor-band { background: var(--navy-deep); color: #fff; padding: 56px 20px; text-align: center; }
.band-inner { max-width: 640px; margin: 0 auto; }
.sponsor-band h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 24px; }
.sponsor-band img { width: min(420px, 100%); height: auto; border-radius: 12px; margin: 0 auto 24px; box-shadow: 0 0 0 4px #fff; }
.sponsor-band .fine { font-size: 14px; opacity: .75; margin-top: 22px; }
.sponsor-band .fine a { color: var(--cherry); }
@media (max-width: 560px) { .dates { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px 12px; } .dates dt { font-size: 18px; white-space: nowrap; } .dates dd { font-size: 10px; letter-spacing: .05em; } }

/* Sponsor moments: thank-you screens and the winners page */
.thanks-sponsor, .congrats { display: flex; align-items: center; gap: 16px; padding: 16px; margin: 0 0 16px; background: #fff; border: 2px solid var(--cherry); border-radius: 16px; text-decoration: none; color: var(--ink); }
.thanks-sponsor img, .congrats img { width: 132px; height: auto; border-radius: 8px; flex: 0 0 auto; }
.thanks-sponsor span, .congrats span { font-size: 17px; line-height: 1.4; }
.thanks-sponsor b, .congrats b { display: block; font-size: 20px; color: var(--navy); }
.congrats { margin-bottom: 8px; background: var(--paper-2); }
@media (max-width: 480px) { .thanks-sponsor, .congrats { flex-direction: column; align-items: flex-start; } .thanks-sponsor img, .congrats img { width: 100%; max-width: 260px; } }

/* Share graphics */
.sharebox { display: flex; gap: 18px; align-items: center; margin-top: 22px; padding: 16px; background: var(--paper-2); border-radius: 16px; }
.sharebox img { width: 120px; height: auto; border-radius: 10px; flex: 0 0 auto; }
.sharebox div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sharebox b { flex: 1 1 100%; font-size: 20px; }
.sharebox span { flex: 1 1 100%; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.sharebox .btn { padding: 10px 18px; font-size: 16px; }
.graphics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 8px; }
.graphics a { text-decoration: none; color: var(--navy); font-weight: 700; font-size: 15px; text-align: center; }
.graphics img { width: 100%; height: auto; border-radius: 12px; margin-bottom: 8px; }

/* ---- WHS brand pass ---- */
.btn { color: #fff; }
.btn.ghost { color: var(--navy); }
.top .brand img { height: 44px; width: auto; display: block; }
.top .brand { display: flex; align-items: center; gap: 12px; opacity: 1; }
.top .brand span { color: #fff; opacity: .65; font-weight: 600; }
.dates .on dt { color: var(--gold); }
.medal { background: var(--gold); color: var(--navy); }
.row.silver .medal { background: #cfd9df; color: var(--navy); }
.success { background: #e6f0f4; color: var(--navy); }
.tile.title { background: #eaf1f5; }
.nomrow input:not(:placeholder-shown) { background: #f3f8fa; }
.sponsor-band .fine a { color: var(--gold); }
.thanks-sponsor, .congrats, .title-sponsor { border-color: var(--gold); box-shadow: none; }
.thanks-sponsor, .congrats { border: 2px solid var(--gold); }
.hero .title-sponsor { box-shadow: 0 0 0 3px var(--gold); }
.suggest button { background: var(--paper-2); }
@media (max-width: 560px) { .top .brand span { display: none; } }
