@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplaySemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/MontserratMedium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/MontserratSemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #123c3b;
  --teal: #0f7b86;
  --teal-deep: #0b5962;
  --gold: #b8975a;
  --gold-deep: #8d7040;
  --muted: #7a6a58;
  --line: rgba(184, 151, 90, 0.85);
  --paper: rgba(255, 253, 250, 0.94);
  --soft: #f7f3ec;
  --danger: #8c3d3d;
  --ok: #0f7b86;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: Montserrat, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 16.5px;
  line-height: 1.55;
  background-color: #f3efe8;
  background-image: url("assets/marble.jpg");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

button, input { font: inherit; color: inherit; }

.sheet {
  width: min(920px, calc(100% - 28px));
  margin: 28px auto 40px;
  padding: 36px 40px 32px;
  background: var(--paper);
  border: 1px solid var(--gold);
  box-shadow: 0 24px 60px rgba(18, 60, 59, 0.08);
  position: relative;
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.brand {
  text-align: center;
  margin-bottom: 8px;
}

.brand img {
  width: 84px;
  height: 84px;
  display: block;
  margin: 0 auto 10px;
}

.brand-name {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  letter-spacing: 0.34em;
  font-size: 15px;
  color: var(--ink);
}

.brand-line {
  margin: 6px 0 0;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 600;
}

.brand-line span { padding: 0 0.35em; color: var(--gold); }

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  color: var(--gold-deep);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

h1 {
  text-align: center;
  font-size: clamp(32px, 5vw, 46px);
  margin: 18px 0 8px;
  color: var(--gold);
}

.lede, .quiet {
  text-align: center;
  color: var(--ink);
  margin: 0 auto 22px;
  max-width: 58ch;
}

.quiet { color: var(--muted); font-size: 14px; margin-top: -8px; }

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 8px auto 22px;
  width: min(280px, 70%);
}

.name-row {
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto 26px;
}

label.field-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  border: 1px solid #ddcfb4;
  background: #fff;
  padding: 12px 14px;
  border-radius: 2px;
}

input[type="text"]:focus {
  outline: 2px solid var(--teal);
  border-color: transparent;
}

.courses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.course {
  border: 1px solid #e4d5b8;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.course h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.course p { margin: 0 0 12px; flex: 1; }

.course .meta {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.btn {
  appearance: none;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  padding: 12px 16px;
  cursor: pointer;
  letter-spacing: 0.04em;
  border-radius: 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.btn:hover { background: var(--teal-deep); }

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--gold);
}

.btn.secondary:hover { background: #f8f1e4; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.wide { width: 100%; }

.quiz-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.progress {
  height: 3px;
  background: #efe4d0;
  margin: 12px 0 18px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
}

.prompt {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.35;
}

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

.option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #e3d5bc;
  background: #fff;
  cursor: pointer;
}

.option:hover { border-color: var(--gold); }

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

.option .letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  color: var(--gold-deep);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

.option.selected {
  border-color: var(--teal);
  background: rgba(15, 123, 134, 0.07);
}

.option.selected .letter {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.nav .btn { min-width: 140px; }

.note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.note a { color: var(--teal-deep); }

.note .btn {
  margin-left: 8px;
  padding: 6px 10px;
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 8px 0 0;
  text-align: center;
}

.score-block { text-align: center; padding: 8px 0 4px; }

.score-num {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(56px, 8vw, 84px);
  color: var(--gold);
  line-height: 1;
  margin: 8px 0;
}

.score-num .unit {
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: 0.34em;
  letter-spacing: 0.04em;
  margin-left: 0.12em;
  position: relative;
  top: -0.7em;
}

.badge {
  display: inline-block;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--gold);
  color: var(--gold-deep);
}

.badge.fail { border-color: #d7c3c3; color: var(--danger); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.who {
  text-align: center;
  color: var(--muted);
  margin-top: 0;
}

.loading { text-align: center; color: var(--muted); }

.eyebrow.center { text-align: center; }

.manual h2 {
  text-align: left;
  font-size: clamp(26px, 4vw, 34px);
  margin: 1.45em 0 0.35em;
  color: var(--gold);
}

.manual h3 {
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 1.15em 0 0.3em;
}

.manual p { margin: 0.55em 0; }

.manual ul, .manual ol {
  margin: 0.3em 0 0.85em;
  padding-left: 1.25em;
}

.manual li { margin: 0.32em 0; }

.manual a { color: var(--teal-deep); }

.manual .contents {
  list-style: none;
  padding-left: 0;
  margin: 0.15em 0 0.8em;
}

.manual .contents a { text-decoration: none; }

.manual .contents a:hover { text-decoration: underline; }

.manual-back { text-align: center; margin-top: 28px; }

@media (max-width: 740px) {
  .sheet {
    width: calc(100% - 16px);
    margin: 10px auto 20px;
    padding: 26px 16px 20px;
  }
  .courses { grid-template-columns: 1fr; }
  .nav { flex-direction: column-reverse; }
  .nav .btn { width: 100%; }
  .brand img { width: 72px; height: 72px; }
  .quiz-top { flex-direction: column; gap: 4px; }
}

@media (max-width: 1024px) {
  .quiz-top * {
    margin: 0 auto;
  }

  .note .btn {
    margin-left: 0 !important;
    margin-top: 10px;
    padding: 6px 10px;
  }
}
