:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --line: #111111;
  --soft-line: #d7d7d7;
  --panel: #f5f5f5;
  --shadow: 12px 12px 0 #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), var(--soft-line) calc(100% - 1px)),
    linear-gradient(transparent 0, transparent calc(100% - 1px), var(--soft-line) calc(100% - 1px));
  background-size: 36px 36px;
  background-color: var(--bg);
  color: var(--fg);
  font-family: "Space Grotesk", sans-serif;
}

button,
input,
label {
  font: inherit;
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero {
  margin-bottom: 32px;
}

.eyebrow,
.question-kicker,
.result-kicker,
.progress-label {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 10ch;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.8rem, 8vw, 7.4rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.lead {
  margin: 20px 0 0;
  max-width: 680px;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
}

.quiz-frame,
.result-panel {
  border: 2px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.quiz-frame {
  padding: 28px;
}

.quiz-meta {
  margin-bottom: 28px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.progress-count {
  font-size: 1rem;
  font-weight: 700;
}

.progress-line {
  width: 100%;
  height: 18px;
  border: 2px solid var(--line);
  background: var(--bg);
}

.progress-line span {
  display: block;
  height: 100%;
  width: 14.285%;
  background: var(--fg);
  transition: width 180ms ease;
}

.quiz-panel {
  display: grid;
  grid-template-columns: minmax(86px, 120px) 1fr;
  gap: 24px;
  align-items: start;
}

.question-index {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 2px solid var(--line);
  background: var(--panel);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.4rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
}

.question-copy h2 {
  margin: 0 0 24px;
  max-width: 18ch;
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  line-height: 1;
  text-transform: uppercase;
}

.answers {
  grid-column: 2;
  display: grid;
  gap: 14px;
}

.answer-option {
  display: block;
}

.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 2px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.answer-card:hover,
.answer-option input:focus-visible + .answer-card {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--line);
}

.answer-option input:checked + .answer-card {
  background: var(--fg);
  color: var(--bg);
}

.answer-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  font-weight: 700;
}

.answer-text {
  font-size: 1rem;
  line-height: 1.5;
}

.quiz-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  min-width: 190px;
  padding: 16px 22px;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.btn:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--line);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result-panel {
  padding: 32px;
}

.hidden {
  display: none;
}

#result-score {
  margin: 0 0 16px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.result-summary {
  margin: 0 0 28px;
  max-width: 620px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.result-method {
  margin: -8px 0 28px;
  max-width: 700px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.result-details {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.result-item {
  padding: 18px;
  border: 2px solid var(--line);
  background: var(--bg);
}

.result-item.top-match {
  background: var(--fg);
  color: var(--bg);
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.result-head strong {
  display: block;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.result-head span {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.9;
  font-weight: 700;
}

.result-bar {
  width: 100%;
  height: 16px;
  margin-bottom: 14px;
  border: 2px solid currentColor;
  background: transparent;
}

.result-fill {
  display: block;
  height: 100%;
  background: currentColor;
}

.result-item p {
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1080px);
    padding: 28px 0 48px;
  }

  .quiz-frame {
    padding: 18px;
    box-shadow: 8px 8px 0 #111111;
  }

  .quiz-panel {
    grid-template-columns: 1fr;
  }

  .question-index,
  .answers,
  .quiz-actions {
    grid-column: auto;
  }

  .question-index {
    min-height: 88px;
  }

  .question-copy h2 {
    max-width: none;
  }

  .answer-card {
    grid-template-columns: 40px 1fr;
    padding: 14px;
  }

  .answer-key {
    width: 40px;
    height: 40px;
  }

  .quiz-actions {
    justify-content: stretch;
  }

  .btn {
    width: 100%;
  }
}
