:root {
  color-scheme: light;
  --ink: #171412;
  --muted: #6f6258;
  --paper: #f7efe2;
  --cream: #fffaf0;
  --red: #d94135;
  --blue: #244f9e;
  --gold: #c89b38;
  --green: #3f7050;
  --line: rgba(23, 20, 18, 0.16);
  --shadow: 0 18px 50px rgba(39, 28, 18, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(36, 79, 158, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(217, 65, 53, 0.16), transparent 24rem),
    linear-gradient(135deg, #f9f1e7 0%, #f4e3c9 42%, #e7edf6 100%);
}

main,
section,
article,
p,
h1,
h2,
button,
span {
  max-width: 100%;
}

button {
  border: 0;
  font: inherit;
}

.shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
  overflow-x: hidden;
}

.hero {
  min-height: clamp(260px, 42vh, 390px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.label {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 span {
  display: block;
}

.intro {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.stamp {
  width: 176px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 5px double rgba(217, 65, 53, 0.65);
  border-radius: 50%;
  color: var(--red);
  transform: rotate(9deg);
  background: rgba(255, 250, 240, 0.7);
}

.stamp span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1;
}

.stamp small {
  max-width: 98px;
  margin-top: -28px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.meter-panel,
.result {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.meter-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

#scoreText {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 8vw, 5rem);
  line-height: 0.85;
}

#scoreName {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.meter {
  height: 16px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(36, 79, 158, 0.18), rgba(217, 65, 53, 0.18));
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cream) 48%, var(--red));
  transition: width 300ms ease;
}

.quiz {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.question {
  min-height: 164px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.68);
}

.question h2 {
  margin: 0 0 14px;
  font-size: 1.03rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(23, 20, 18, 0.15);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
  cursor: pointer;
  text-align: left;
  overflow-wrap: anywhere;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.option:hover,
.option:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(36, 79, 158, 0.55);
  outline: 0;
}

.option.selected {
  border-color: rgba(217, 65, 53, 0.55);
  background: rgba(217, 65, 53, 0.08);
}

.dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.option.selected .dot {
  background: var(--red);
  color: var(--red);
}

.result.hidden {
  display: none;
}

.result h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
}

.result p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.badge {
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.badge:nth-child(2n) {
  background: var(--blue);
}

.badge:nth-child(3n) {
  background: var(--red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.actions button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.actions button + button {
  color: var(--ink);
  background: rgba(23, 20, 18, 0.1);
}

@media (max-width: 760px) {
  .shell {
    width: min(calc(100vw - 20px), 520px);
    padding-top: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 48px 0 24px;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.35rem);
    line-height: 0.98;
  }

  .eyebrow {
    max-width: 28ch;
    line-height: 1.35;
  }

  .stamp {
    width: 118px;
    justify-self: start;
  }

  .stamp span {
    font-size: 2.8rem;
  }

  .stamp small {
    margin-top: -18px;
    font-size: 0.55rem;
  }

  .meter-head {
    display: block;
  }

  #scoreName {
    margin-top: 10px;
    text-align: left;
  }

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

  .question {
    min-height: 0;
  }
}
