:root {
  --ink: #18232b;
  --muted: #59676f;
  --paper: #f7f3e8;
  --surface: #fffdf7;
  --line: #c8c1b4;
  --night: #101820;
  --red: #b83a2d;
  --red-dark: #7f241d;
  --gold: #d5a83f;
  --green: #286b55;
  --shadow: 0 18px 50px rgba(16, 24, 32, 0.12);
  --radius: 1.1rem;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(213, 168, 63, 0.14), transparent 28rem),
    var(--paper);
  font-size: 1rem;
  line-height: 1.65;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--red-dark);
  text-underline-offset: 0.18em;
}

img {
  display: block;
  max-width: 100%;
}

fieldset {
  min-width: 0;
  margin: 2rem 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-weight: 800;
}

h1,
h2,
h3 {
  max-width: 20ch;
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.9rem);
}

h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

h3 {
  font-size: clamp(1.45rem, 2.5vw, 2.1rem);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--night);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem clamp(1.25rem, 4vw, 4rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  background: rgba(16, 24, 32, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
}

.site-header nav {
  display: flex;
  gap: clamp(0.75rem, 2vw, 2rem);
  flex-wrap: wrap;
}

.site-header nav a {
  color: #f6f0e3;
  font-size: 0.93rem;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
  gap: 4rem;
  align-items: center;
  min-height: calc(100vh - 4.5rem);
  padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 7vw, 8rem);
  color: #fff;
  background:
    linear-gradient(115deg, rgba(16, 24, 32, 0.98), rgba(31, 45, 48, 0.92)),
    radial-gradient(circle, var(--gold), transparent);
}

.hero h1 {
  max-width: 11ch;
  color: #fff;
}

.hero .lead {
  max-width: 48rem;
  font-family: Georgia, serif;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}

.hero-copy > p:not(.eyebrow) {
  max-width: 46rem;
  color: #d9dedb;
}

.hero-mark {
  text-align: center;
}

.mana-ring {
  display: grid;
  width: min(70vw, 22rem);
  aspect-ratio: 1;
  margin: auto;
  place-content: center;
  border: 1px solid rgba(213, 168, 63, 0.65);
  border-radius: 50%;
  box-shadow:
    0 0 0 1.2rem rgba(213, 168, 63, 0.04),
    0 0 0 2.4rem rgba(213, 168, 63, 0.025);
}

.mana-ring span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1;
}

.mana-ring small,
.hero-mark p {
  color: #cbd2cf;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section {
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 6vw, 6rem);
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(17rem, 1.1fr);
  gap: 1rem 4rem;
  max-width: 74rem;
  margin: 0 auto clamp(3rem, 6vw, 5rem);
}

.section-header .eyebrow {
  grid-column: 1 / -1;
}

.section-header > p:not(.eyebrow) {
  align-self: end;
  max-width: 38rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.poll-section {
  background: var(--surface);
}

#poll-form {
  max-width: 76rem;
  margin: auto;
}

.form-step {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 5rem) 0;
  border-top: 1px solid var(--line);
}

.step-number {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 1.35rem;
}

.step-content {
  max-width: 68rem;
}

.choice-card,
.check-option {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: white;
}

.choice-card {
  margin: 0.75rem 0;
}

.choice-card span {
  display: grid;
}

.choice-card small,
.check-line,
.field-help {
  color: var(--muted);
}

.choice-card input:checked + span strong,
.check-option:has(input:checked) {
  color: var(--red-dark);
}

.option-image {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 3.25rem;
  border-radius: 0.4rem;
  object-fit: cover;
  object-position: center 25%;
}

.field {
  margin: 1.5rem 0;
}

.field label,
.search-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

.field input,
.field textarea,
.search-form input {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid #8f9694;
  border-radius: 0.5rem;
  color: var(--ink);
  background: #fff;
}

.field textarea {
  min-height: 10rem;
  resize: vertical;
}

.field-help,
.field-error,
.disclaimer {
  margin: 0.55rem 0;
  font-size: 0.9rem;
}

.field-error {
  color: #9c241c;
  font-weight: 700;
}

.disclaimer {
  max-width: 60rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  background: rgba(213, 168, 63, 0.1);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.deck-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  min-height: 5.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: white;
  box-shadow: 0 5px 18px rgba(16, 24, 32, 0.04);
}

.deck-card:has(input:checked) {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(184, 58, 45, 0.12);
}

.deck-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 5.75rem;
  object-fit: cover;
  object-position: center 25%;
  background: #e7e1d5;
}

.deck-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(5.25rem, 6.5rem);
  gap: 0.5rem 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.65rem 0.75rem;
}

.deck-select {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  font-weight: 800;
}

.deck-select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.percent-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.percent-row input {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.5rem;
  border: 1px solid #8f9694;
  border-radius: 0.4rem;
}

.deck-card.is-selected {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(184, 58, 45, 0.12);
}

.meter-row {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.meter {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #dfdbd2;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.meter.is-invalid span {
  background: var(--red);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.7rem;
}

.radio-stack {
  display: grid;
  gap: 0.65rem;
}

.radio-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.radio-inline .choice-card {
  margin: 0;
}

.button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-primary {
  color: white;
  background: var(--red);
  box-shadow: 0 8px 22px rgba(184, 58, 45, 0.2);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.check-line {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 1.5rem 0;
}

.review {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.review dl,
.response-card dl {
  display: grid;
  grid-template-columns: minmax(9rem, 0.35fr) minmax(0, 0.65fr);
  gap: 0.55rem 1rem;
}

.review dt,
.response-card dt {
  font-weight: 800;
}

.review dd,
.response-card dd {
  margin: 0;
}

.results-section {
  color: #e9eee9;
  background: var(--night);
}

.results-section h2,
.results-section h3 {
  color: white;
}

.results-section .section-header > p:not(.eyebrow),
.results-section .disclaimer {
  color: #c8d0cb;
}

.tab-list {
  display: flex;
  max-width: 74rem;
  margin: 0 auto 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  overflow-x: auto;
}

.tab-list button {
  min-height: 3rem;
  padding: 0.7rem 1.2rem;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #bac3bd;
  background: transparent;
  cursor: pointer;
}

.tab-list button[aria-selected="true"] {
  border-color: var(--gold);
  color: white;
}

.demo-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid #d5a83f;
  border-radius: 999px;
  color: #18130b;
  background: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.results-demo {
  margin-right: auto;
  margin-left: max(0px, calc((100% - 74rem) / 2));
}

.tab-panel {
  max-width: 74rem;
  margin: auto;
}

.chart-block {
  margin: 3rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.fun-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.fun-chart-grid .chart-block {
  min-width: 0;
}

.pie-chart-frame {
  height: 20rem;
}

.chart-frame {
  position: relative;
  width: 100%;
  height: 26rem;
  margin: 1.5rem 0;
}

.chart-filter {
  display: flex;
  justify-content: flex-end;
  margin: 0.25rem 0 0.5rem;
}

.chart-filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #d7ddd9;
  font-size: 0.9rem;
}

.chart-filter select {
  min-height: 2.3rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.45rem;
  color: white;
  background: #18232b;
}

.method-note {
  color: #d7ddd9;
  font-size: 0.9rem;
}

.result-chart {
  width: 100% !important;
  height: 100% !important;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
}

th {
  color: var(--gold);
}

.search-form {
  max-width: 48rem;
  margin-bottom: 2rem;
}

.search-form > div {
  display: flex;
  gap: 0.75rem;
}

.response-list {
  display: grid;
  gap: 1rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.selected-decks-count {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  z-index: 70;
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  color: white;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 1.4rem;
  font-weight: 900;
}

.selected-decks-count.is-complete {
  background: var(--green);
}

.ranking-list {
  max-width: 42rem;
  padding-left: 1.5rem;
}

.ranking-list li {
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.response-card {
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.045);
}

.contact-section,
.privacy-section {
  background: var(--paper);
}

.contact-form {
  max-width: 48rem;
  margin: auto;
}

.honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  max-width: 74rem;
  margin: auto;
}

.policy-grid article {
  padding: 1.4rem;
  border-top: 3px solid var(--red);
  background: var(--surface);
}

.policy-grid h3 {
  font-size: 1.35rem;
}

.site-footer {
  padding: 3rem clamp(1.25rem, 7vw, 7rem);
  color: #c5cbc7;
  background: #090f14;
  font-size: 0.88rem;
}

.site-footer p {
  max-width: 80rem;
}

.submission-result {
  max-width: 76rem;
  margin: 0 auto 3rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.share-row input {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.share-page {
  min-height: 100vh;
  background: var(--paper);
}

.share-main {
  max-width: 64rem;
  margin: auto;
  padding: clamp(3rem, 7vw, 6rem) 1.25rem;
}

.share-main h1 {
  max-width: none;
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.share-section {
  margin: 3rem 0;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.shared-deck-list {
  display: grid;
  gap: 0.65rem;
}

.shared-deck-list article {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.shared-deck-list img {
  width: 5rem;
  height: 3.8rem;
  border-radius: 0.4rem;
  object-fit: cover;
}

.shared-conversion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.shared-conversion-grid article {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.share-cta {
  padding: 2rem;
  border-radius: var(--radius);
  color: white;
  background: var(--night);
  text-align: center;
}

.privacy-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 50;
  display: flex;
  max-width: 64rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: auto;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.privacy-banner p {
  margin: 0;
}

dialog {
  width: min(90vw, 42rem);
  border: 0;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(9, 15, 20, 0.72);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #eee9df;
  cursor: pointer;
}

.status,
.notice {
  padding: 0.75rem 1rem;
  border-radius: 0.55rem;
  background: rgba(40, 107, 85, 0.1);
}

.notice.error,
.status.error {
  color: #7c1711;
  background: #fbe2de;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    width: 100%;
  }

  .hero,
  .section-header {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-mark {
    display: none;
  }

  .form-step {
    grid-template-columns: 1fr;
  }

  .deck-grid {
    grid-template-columns: 1fr;
  }

  .deck-card {
    grid-template-columns: 4.75rem minmax(0, 1fr);
  }

  .deck-body {
    grid-template-columns: minmax(0, 1fr) 5.5rem;
    padding: 0.55rem;
  }

  .chart-frame {
    height: 22rem;
  }

  .fun-chart-grid {
    grid-template-columns: 1fr;
  }

  .step-number {
    margin-bottom: -1rem;
  }

  .review dl,
  .response-card dl {
    grid-template-columns: 1fr;
  }

  .search-form > div,
  .privacy-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-decks-count {
    right: 0.75rem;
    bottom: 10.5rem;
    width: 3.5rem;
    height: 3.5rem;
  }

  .share-row,
  .shared-conversion-grid {
    grid-template-columns: 1fr;
  }

  .shared-deck-list article {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
