:root {
  color-scheme: light;
  --paper: #f3eddf;
  --ink: #173c34;
  --soft-ink: #52665f;
  --line: rgba(23, 60, 52, .18);
  --accent: #d98c40;
  --card: rgba(255, 252, 244, .78);
  --shadow: 0 18px 55px rgba(38, 45, 35, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 6%, rgba(217, 140, 64, .14), transparent 30rem),
    linear-gradient(135deg, rgba(255,255,255,.35), transparent 45%),
    var(--paper);
  color: var(--ink);
  font-family: ui-serif, "Songti SC", "Noto Serif CJK SC", serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 58px 0 50px; }
.hero { max-width: 800px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 11px; color: var(--accent); font: 700 12px/1.3 ui-monospace, SFMono-Regular, monospace; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(38px, 8vw, 78px); font-weight: 500; line-height: .98; letter-spacing: -.04em; }
.intro { max-width: 660px; color: var(--soft-ink); font-size: 18px; line-height: 1.75; }
.date-line { display: flex; gap: 14px; align-items: center; color: var(--soft-ink); font: 13px/1.4 ui-monospace, SFMono-Regular, monospace; }
.date-line span { padding-left: 14px; border-left: 1px solid var(--line); }

.card-context { margin: 28px 0 52px; padding: 20px 22px; border-left: 4px solid var(--accent); background: rgba(255,255,255,.27); }
.card-context span { display: block; margin-bottom: 8px; color: var(--soft-ink); font-size: 13px; }
.card-context strong { display: block; font-size: 22px; }
.card-context p { margin: 7px 0 0; color: var(--soft-ink); }

.section-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin: 54px 0 22px; }
.section-heading h2 { margin-bottom: 0; font-size: 30px; font-weight: 500; }
.section-heading > p { max-width: 300px; margin-bottom: 0; color: var(--soft-ink); font-size: 14px; line-height: 1.6; }
.message { padding: 16px 0; color: var(--soft-ink); }
.message.is-error { color: #9b382d; }

.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.candidate { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.candidate:hover { transform: translateY(-2px); }
.candidate.is-selected { border-color: var(--accent); outline: 3px solid rgba(217, 140, 64, .18); }
.candidate img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #dcd5c7; }
.candidate-body { padding: 20px; }
.candidate-index { color: var(--accent); font: 12px/1.4 ui-monospace, SFMono-Regular, monospace; }
.candidate h3 { margin: 8px 0 10px; font-size: 25px; font-weight: 500; }
.candidate-copy { min-height: 3.2em; color: var(--soft-ink); line-height: 1.65; }
.vote-button { width: 100%; margin-top: 8px; padding: 14px 16px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 700 15px/1 system-ui, sans-serif; cursor: pointer; }
.vote-button:hover, .candidate.is-selected .vote-button { background: var(--ink); color: var(--paper); }
.vote-button:disabled { cursor: wait; opacity: .6; }

.result-panel { margin-top: 44px; padding: 30px; background: var(--ink); color: var(--paper); }
.result-panel h2 { font-size: 30px; font-weight: 500; }
.result-panel > p:not(.eyebrow) { color: rgba(243,237,223,.74); }
.result-list { display: grid; gap: 10px; margin-top: 22px; }
.result-row { display: grid; grid-template-columns: minmax(90px, 1fr) 3fr auto; gap: 12px; align-items: center; font: 14px/1.4 system-ui, sans-serif; }
.result-track { height: 9px; overflow: hidden; background: rgba(255,255,255,.12); border-radius: 99px; }
.result-fill { height: 100%; background: var(--accent); border-radius: inherit; }
footer { margin-top: 58px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--soft-ink); font-size: 13px; line-height: 1.7; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 24px, 580px); padding-top: 32px; }
  h1 { font-size: 48px; }
  .candidate-grid { grid-template-columns: 1fr; gap: 18px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .candidate-body { padding: 17px; }
  .candidate-copy { min-height: auto; }
  .result-panel { padding: 24px 18px; }
  .result-row { grid-template-columns: 90px 1fr auto; }
}
