:root {
  --ivory: #f6f0e6;
  --paper: #fffaf1;
  --ink: #232016;
  --muted: #7d735f;
  --forest: #171511;
  --forest-light: #2a251d;
  --wine: #6d1f2d;
  --gold: #b49153;
  --line: rgba(35, 32, 22, 0.15);
  --shadow: 0 22px 80px rgba(35, 32, 22, 0.11);
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(35, 32, 22, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(35, 32, 22, 0.028) 1px, transparent 1px),
    var(--ivory);
  background-size: 38px 38px;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar,
.intro,
.layout,
.leaderboard-card,
.profile-layout,
.profile-stats,
.two-column,
.vote-stepper,
.stepper-controls,
.total-row {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-frame {
  display: grid;
  width: 118px;
  height: 72px;
  place-items: center;
  background: transparent;
  padding: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  line-height: 1;
}

.brand small,
.eyebrow,
.price-card span,
label,
.total-row span,
.notice,
.error {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-link {
  border-bottom: 1px solid var(--gold);
  color: var(--forest);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.intro {
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--wine);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 0.88;
}

h2 {
  margin-bottom: 0;
  font-size: 36px;
  line-height: 1;
}

.price-card {
  min-width: 170px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.74);
  box-shadow: var(--shadow);
}

.price-card strong {
  display: block;
  margin-top: 8px;
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 1;
}

.layout {
  align-items: flex-start;
  gap: 24px;
}

.section-heading {
  margin-bottom: 18px;
}

.leaderboard-section {
  max-width: 960px;
}

.leaderboard-list {
  display: grid;
  gap: 12px;
}

.leaderboard-card {
  align-items: center;
  gap: 18px;
  min-height: 128px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.8);
  box-shadow: var(--shadow);
  padding: 16px;
  text-decoration: none;
}

.leaderboard-card:hover,
.leaderboard-card:focus-visible {
  border-color: var(--gold);
  outline: 2px solid rgba(180, 145, 83, 0.18);
}

.rank {
  min-width: 54px;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.leaderboard-photo {
  width: 82px;
  height: 96px;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.02);
}

.leaderboard-main {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 0;
}

.leaderboard-main strong {
  overflow-wrap: anywhere;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  line-height: 0.95;
}

.leaderboard-main small,
.leaderboard-votes small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.leaderboard-votes {
  display: grid;
  min-width: 112px;
  justify-items: end;
  gap: 2px;
}

.leaderboard-votes strong {
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 46px;
  line-height: 0.9;
}

.light-error {
  border-color: var(--wine);
  color: var(--wine);
}

.profile-layout {
  align-items: flex-start;
  gap: 24px;
}

.profile-card {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.82);
  box-shadow: var(--shadow);
}

.profile-photo {
  width: 100%;
  height: 100%;
  min-height: 650px;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.02);
}

.profile-copy {
  padding: clamp(28px, 5vw, 56px);
}

.profile-copy h1 {
  max-width: 560px;
  margin-bottom: 14px;
  font-size: clamp(44px, 6vw, 76px);
}

.profile-title {
  color: var(--wine);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-bio {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.profile-stats {
  gap: 12px;
  margin: 28px 0 8px;
}

.profile-stats div {
  flex: 1;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-stats strong {
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  line-height: 1.05;
}

.profile-vote-panel {
  width: min(100%, 392px);
}

.text-button {
  margin-top: 18px;
  border: 0;
  border-bottom: 1px solid var(--gold);
  color: var(--forest);
  background: transparent;
  cursor: pointer;
  padding: 0 0 4px;
  font-weight: 800;
}

.contestant-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.contestant-card {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.contestant-card.is-selected {
  border-color: var(--gold);
  outline: 2px solid rgba(180, 145, 83, 0.23);
}

.portrait {
  width: 100%;
  height: 360px;
  object-fit: cover;
  filter: saturate(0.84) contrast(1.02);
}

.contestant-body {
  padding: 22px;
}

.candidate-number {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contestant-body h3 {
  margin-bottom: 4px;
  font-size: 28px;
  line-height: 0.98;
}

.contestant-body p {
  margin-bottom: 20px;
  color: var(--muted);
}

.candidate-bio {
  display: -webkit-box;
  min-height: 116px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  font-size: 14px;
  line-height: 1.38;
  text-transform: none;
}

.vote-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.vote-count span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.vote-count strong {
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  line-height: 1;
}

.select-card {
  width: 100%;
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px solid var(--forest);
  color: var(--forest);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.select-card:hover,
.select-card:focus-visible {
  color: var(--paper);
  background: var(--forest);
}

.vote-panel {
  position: sticky;
  top: 18px;
  width: min(100%, 380px);
  padding: 24px;
  border: 1px solid var(--gold);
  background: var(--forest);
  box-shadow: var(--shadow);
  color: var(--paper);
}

.vote-panel .eyebrow {
  color: #d8bd7b;
}

.vote-panel h2,
.vote-panel label,
.vote-panel .total-row span {
  color: var(--paper);
}

.panel-heading {
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  letter-spacing: 0;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 250, 241, 0.25);
  border-radius: 0;
  color: var(--paper);
  background: rgba(255, 250, 241, 0.08);
  padding: 12px 14px;
  outline: none;
}

select option {
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--gold);
}

input::placeholder {
  color: rgba(255, 250, 241, 0.5);
}

.two-column {
  gap: 12px;
}

.two-column label {
  flex: 1;
}

.vote-stepper {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 18px;
}

.stepper-controls {
  width: 178px;
  height: 48px;
  border: 1px solid rgba(255, 250, 241, 0.25);
}

.stepper-controls button {
  width: 48px;
  border: 0;
  color: var(--paper);
  background: rgba(255, 250, 241, 0.08);
  cursor: pointer;
  font-size: 22px;
}

.stepper-controls button:hover {
  background: rgba(255, 250, 241, 0.16);
}

.stepper-controls input {
  min-height: 46px;
  border: 0;
  text-align: center;
}

.total-row {
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 250, 241, 0.2);
  margin-top: 18px;
  padding-top: 18px;
}

.total-row strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
}

.notice,
.error {
  margin: 18px 0 0;
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  color: #f1dba5;
  letter-spacing: 0;
  text-transform: none;
}

.error {
  border-color: #f5a0a0;
  color: #ffd0d0;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  border: 1px solid var(--gold);
  color: var(--forest);
  background: #d8bd7b;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #ead79e;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.verify-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.centered-brand {
  position: absolute;
  top: 24px;
  left: 24px;
}

.verify-card {
  width: min(560px, 100%);
  border: 1px solid var(--gold);
  background: rgba(255, 250, 241, 0.88);
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 56px);
  text-align: center;
}

.verify-card h1 {
  max-width: none;
  margin-bottom: 12px;
  font-size: clamp(42px, 8vw, 72px);
}

.verify-card p {
  color: var(--muted);
  line-height: 1.7;
}

.loader {
  width: 44px;
  height: 44px;
  margin: 26px auto 6px;
  border: 2px solid rgba(35, 32, 22, 0.14);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.receipt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 24px 0 8px;
  text-align: left;
}

.receipt div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.receipt dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.receipt dd {
  margin: 4px 0 0;
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.secondary-link {
  width: auto;
  padding: 0 28px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .layout,
  .intro,
  .profile-layout {
    display: grid;
  }

  .contestant-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-section {
    max-width: none;
  }

  .contestant-card {
    min-height: auto;
  }

  .candidate-bio {
    min-height: auto;
    -webkit-line-clamp: unset;
  }

  .portrait {
    height: 430px;
  }

  .vote-panel {
    position: static;
    width: 100%;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    height: 520px;
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .topbar {
    padding-bottom: 24px;
  }

  .brand strong {
    font-size: 20px;
  }

  .brand-logo-frame {
    width: 88px;
    height: 56px;
  }

  h1 {
    font-size: 48px;
  }

  .leaderboard-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  .rank {
    font-size: 34px;
  }

  .leaderboard-photo {
    width: 100%;
    height: 220px;
    grid-column: 1 / -1;
  }

  .leaderboard-votes {
    grid-column: 1 / -1;
    justify-items: start;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

  .price-card,
  .vote-panel {
    width: 100%;
  }

  .portrait {
    height: 330px;
  }

  .two-column {
    display: grid;
    gap: 0;
  }

  .centered-brand {
    position: static;
    justify-self: start;
    margin-bottom: 24px;
  }

  .verify-shell {
    display: block;
  }

  .receipt {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    height: 430px;
  }

  .profile-stats,
  .two-column {
    display: grid;
    gap: 0;
  }
}
