/* TOBY Leadership Awards ballot: engraved-invitation look.
   Ink navy + brass on warm paper; Fraunces display, Atkinson Hyperlegible body (chosen for readability). */
:root {
  --ink: #13203b;
  --ink-2: #2b3a5c;
  --paper: #f5efe3;
  --card: #fffdf8;
  --line: #e3d8c3;
  --brass: #b8924a;
  --brass-hi: #dcc07f;
  --brass-lo: #8a6a2e;
  --muted: #6b6457;
  --ok: #2f6b4f;
  --err: #a23a2a;
  --r: 14px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; color: var(--ink); font: 400 17.5px/1.6 var(--body);
  background:
    radial-gradient(1200px 500px at 85% -10%, #fff8e8 0%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(19,32,59,.018) 0 1px, transparent 1px 4px),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
h1 em, h2 em { font-style: italic; font-weight: 400; }
a { color: var(--ink-2); }
.eyebrow { font: 700 12.5px/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--brass-hi); margin: 0 0 14px; }
.eyebrow.dark { color: var(--brass-lo); }
.opt { font: 400 13px var(--body); color: var(--muted); letter-spacing: 0; text-transform: none; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #f3ead6; text-align: center;
  background:
    radial-gradient(700px 300px at 50% 120%, rgba(220,192,127,.22), transparent 70%),
    radial-gradient(circle at 50% 50%, #1c2c4f 0%, var(--ink) 70%);
  padding: 64px 0 74px;
  border-bottom: 3px double var(--brass);
}
.hero::before, .hero::after {           /* engraved guilloche rings */
  content: ""; position: absolute; left: 50%; top: 50%; width: 760px; height: 760px; translate: -50% -50%;
  border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 17px, rgba(220,192,127,.08) 17px 18px);
  mask: radial-gradient(circle, transparent 30%, #000 60%, transparent 72%);
}
.hero::after { width: 1200px; height: 1200px; opacity: .6; animation: turn 240s linear infinite; background: repeating-conic-gradient(from 0deg, rgba(220,192,127,.07) 0 1deg, transparent 1deg 6deg); }
@keyframes turn { to { rotate: 360deg; } }
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(40px, 7.5vw, 72px); margin: 0 0 18px; color: #fbf4e4; font-weight: 400; }
.hero h1 em { color: var(--brass-hi); }
.hero-sub { font-size: 18px; margin: 0 auto; max-width: 34em; color: #d9d1bf; }
.deadline {
  display: inline-block; margin: 26px 0 0; padding: 10px 22px; border: 1px solid rgba(220,192,127,.55); border-radius: 999px;
  font-size: 15.5px; color: #efe5cd; background: rgba(0,0,0,.18);
}
.deadline b { color: var(--brass-hi); }
.hero .eyebrow, .hero h1, .hero-sub, .deadline { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero h1 { animation-delay: .08s; } .hero-sub { animation-delay: .18s; } .deadline { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 30px clamp(18px, 4vw, 38px); margin: 26px 0;
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -28px rgba(19,32,59,.35);
  position: relative;
}
.card > h2, .cat-head h2 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 6px; }
main > .card:first-child { margin-top: -38px; position: relative; z-index: 2; }

.how h2 { margin-bottom: 14px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 56px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font: 600 18px var(--display); color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #f6e6b8, var(--brass) 70%, var(--brass-lo));
  box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--brass);
}
.pill { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--brass-hi); font: 700 14px var(--body); }
details.after { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
details > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--brass); transition: transform .2s; }
details[open] > summary::before { transform: rotate(90deg); }
details.after ul { margin: 12px 0 0; }
details.after li { margin-bottom: 6px; }

/* ---------- inputs ---------- */
label { display: block; font-weight: 700; font-size: 15.5px; margin: 12px 0 0; }
input, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: 400 17px var(--body); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(184,146,74,.18); }
input.bad { border-color: var(--err); box-shadow: 0 0 0 4px rgba(162,58,42,.14); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- jump nav ---------- */
.jump { position: sticky; top: 0; z-index: 20; margin: 0 -20px; padding: 10px 20px; background: rgba(245,239,227,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.jump-inner { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.jump-inner::-webkit-scrollbar { display: none; }
.jump a {
  flex: none; display: flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); background: var(--card); font-size: 14.5px; color: var(--ink-2); transition: all .15s;
}
.jump a b { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.jump a.complete b { color: var(--ok); }
.jump a.on { background: var(--ink); color: #f3ead6; border-color: var(--ink); }
.jump a.on b { color: var(--brass-hi); }

/* ---------- award category ---------- */
.cat { animation: rise .6s both; }
.cat-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 8px; }
.aka { margin: 4px 0 0; color: var(--muted); font-style: italic; }
.cat-meta { display: flex; gap: 16px; align-items: center; margin: 12px 0 4px; }
.count { font-weight: 700; font-size: 15px; padding: 3px 12px; border-radius: 999px; background: #f1e9d8; color: var(--ink-2); }
.count.complete { background: #e2efe6; color: var(--ok); }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font: 400 15px var(--body); cursor: pointer; }
details.crit { margin-top: 10px; }
details.crit > div, details.crit > p, details.crit > h4, details.crit > ul { font-size: 15.5px; }
details.crit[open] { background: #faf5ea; border-radius: 10px; padding: 12px 16px; margin-left: -16px; margin-right: -16px; }
details.crit h4 { font: 700 13px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--brass-lo); margin: 16px 0 4px; }
details.crit ul { margin: 0; padding-left: 20px; }

.noms { list-style: none; margin: 0; padding: 0; }
.nom { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.nom:last-child { border-bottom: 0; }
.nom h3 { font-size: 22px; margin: 6px 0 2px; }
.co { margin: 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { font: 700 11.5px var(--body); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: #efe6d3; color: var(--brass-lo); }
.tag.floor { background: var(--ink); color: var(--brass-hi); }

/* medallion rank picker: native <select> overlaid on the medal so phones get the native wheel */
.rank { position: relative; width: 58px; height: 58px; margin: 0; cursor: pointer; }
.medal {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  font: 600 26px var(--display); color: #b9ae98; background: #fff;
  border: 2px dashed #d5c7aa; transition: transform .25s cubic-bezier(.3,1.6,.5,1), background .2s, color .2s;
}
.rank select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 18px; }
.rank:hover .medal { border-color: var(--brass); color: var(--brass); }
.rank:focus-within .medal { box-shadow: 0 0 0 4px rgba(184,146,74,.3); }
.nom.ranked .medal {
  border: 0; color: #fbf4e4; transform: scale(1.04);
  background: radial-gradient(circle at 35% 28%, #3a4d78, var(--ink) 70%);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brass), 0 6px 14px -6px rgba(19,32,59,.6);
}
.nom[data-rank="1"] .medal { color: var(--ink); background: radial-gradient(circle at 35% 28%, #fbf0c9, var(--brass-hi) 45%, var(--brass) 75%, var(--brass-lo)); }
.nom[data-rank="2"] .medal { color: var(--ink); background: radial-gradient(circle at 35% 28%, #fff, #d9dde3 50%, #a5acb7); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px #a5acb7, 0 6px 14px -6px rgba(19,32,59,.5); }
.nom[data-rank="3"] .medal { color: #fff7ec; background: radial-gradient(circle at 35% 28%, #e8b98c, #b27744 55%, #7d4f27); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px #b27744, 0 6px 14px -6px rgba(19,32,59,.5); }
.nom.swapped { animation: swap .9s ease; }
@keyframes swap { 0%, 100% { background: transparent; } 25% { background: #fbf1d8; } }

details.read { margin-top: 8px; }
details.read > summary { font-size: 15.5px; }
.nomination { margin: 14px 0 0; padding: 0; }
.nomination blockquote { margin: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--brass-hi); font-size: 16.5px; }
.nomination blockquote p { margin: 0 0 10px; }
.nomination figcaption { font-size: 14px; color: var(--muted); padding-left: 21px; }
.via { display: block; font-style: italic; }

.order { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 16px 0 0; padding: 12px 14px; background: #faf5ea; border-radius: 10px; font-size: 15px; }
.order:empty { display: none; }
.order .lbl { width: 100%; font: 700 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--brass-lo); }
.order b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--brass-hi); font-size: 12.5px; margin-right: 4px; }

.writeins { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.writeins h3 { font-size: 19px; margin: 0 0 6px; }
.wi { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 14px; margin: 10px 0; background: #fffefa; }
.wi .link { margin-top: 10px; }

/* ---------- special ---------- */
.special .sub { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 6px; }
.special h3 { font-size: 23px; margin: 14px 0 6px; }
fieldset.choices { border: 0; padding: 0; margin: 14px 0 0; }
fieldset.choices legend { font-weight: 700; margin-bottom: 10px; }
.choices label { display: inline-flex; margin: 0 8px 8px 0; font-weight: 400; cursor: pointer; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices span { padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; transition: all .15s; }
.choices input:checked + span { background: var(--ink); color: #f6ecd5; border-color: var(--ink); }
.choices input:focus-visible + span { box-shadow: 0 0 0 4px rgba(184,146,74,.3); }

/* ---------- submit bar ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: 700 17px var(--body); letter-spacing: .02em;
  padding: 14px 30px; border-radius: 999px; color: var(--ink);
  background: linear-gradient(180deg, #f1dca2, var(--brass) 60%, #a07c38);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 18px -8px rgba(138,106,46,.8);
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn.ghost { background: transparent; border: 1.5px solid var(--ink-2); color: var(--ink-2); box-shadow: none; }
.btn.small { padding: 9px 18px; font-size: 15px; }
.submitbar { position: sticky; bottom: 0; z-index: 20; margin: 30px -20px 0; background: var(--ink); color: #e9dfc8; border-top: 2px solid var(--brass); }
.sb-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.sb-status { font-size: 15px; display: flex; flex-direction: column; }
.sb-status b { color: var(--brass-hi); font-size: 18px; }
.sb-status .prior { color: #b9b09c; font-size: 13.5px; }
.sb-status .err { color: #ffb4a3; font-weight: 700; }

/* ---------- done ---------- */
.done { text-align: center; }
.done:focus { outline: none; }
.seal {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; color: var(--ink);
  background: radial-gradient(circle at 35% 28%, #fbf0c9, var(--brass-hi) 45%, var(--brass) 75%, var(--brass-lo));
  box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--brass); animation: pop .6s cubic-bezier(.3,1.6,.5,1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.summary { text-align: left; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 24px 0; }
.sum-cat { background: #faf5ea; border-radius: 10px; padding: 12px 16px; }
.sum-cat h4 { margin: 0 0 6px; font: 600 16px var(--display); }
.sum-cat ol { margin: 0; padding-left: 22px; font-size: 15px; }
.sum-cat p { margin: 0; font-size: 15px; }

dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 26px 30px; max-width: 460px; color: var(--ink); background: var(--card); box-shadow: 0 30px 80px -20px rgba(19,32,59,.6); }
dialog::backdrop { background: rgba(19,32,59,.55); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 10px; font-size: 24px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

.foot { text-align: center; color: var(--muted); font-size: 13.5px; padding: 30px 0 40px; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .nom { grid-template-columns: 54px 1fr; gap: 14px; }
  .rank { width: 50px; height: 50px; }
  .medal { font-size: 22px; }
  .nom h3 { font-size: 20px; margin-top: 4px; }
  .sb-inner { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .sb-status { font-size: 13.5px; }
  .submitbar .btn { padding: 12px 18px; font-size: 16px; flex: none; }
  .done .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- results page ---------- */
.results .wrap { max-width: 1000px; }
.r-head { padding: 40px 0 6px; }
.r-head h1 { font-size: 48px; margin: 0 0 10px; }
.results .eyebrow { color: var(--brass-lo); }
.r-meta { color: var(--muted); margin: 6px 0; }
.r-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 26px; margin: 20px 0; }
.r-card h2 { margin: 0 0 6px; font-size: 26px; }
.r-card h3 { font-size: 18px; margin: 18px 0 6px; }
.r-table { width: 100%; border-collapse: collapse; font-size: 15.5px; margin-top: 8px; }
.r-table th { text-align: left; font: 700 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--line); padding: 8px; }
.r-table td { padding: 9px 8px; border-bottom: 1px solid #efe7d6; }
.r-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.r-table tr.fin td { background: #fbf3df; }
.tag.fin { background: var(--ink); color: var(--brass-hi); }
.tag.late { background: #f6dcd5; color: var(--err); }
.r-list li { margin-bottom: 8px; }
