@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/libre-franklin-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #22306E;
  --navy-hover: #1A2555;
  --tan: #C08A5E;
  --bg-top: #F7F2EC;
  --bg-bottom: #EFE3D8;
  --surface: #FFFCF8;
  --border: #DFD1C1;
  --rule: #D9C9B8;
  --rule-soft: #E3D6C6;
  --ink: #3F3A30;
  --ink-soft: #4A4438;
  --body: #5B5347;
  --muted: #8E7B68;
  --muted-2: #A2907C;
  --disabled-text: #9A9184;
  --green: #2E6B4E;
  --green-bg: #EAF2ED;
  --green-bg-soft: #EDF4EF;
  --red: #A2453C;
  --red-bg: #F7EBE9;
  --red-bg-soft: #F8EEEC;
  --neutral-surface: #FAF6F1;
  --neutral-border: #E7DCCF;
  --badge-bg: #EFE5D9;
  --badge-bg-muted: #F0E8DD;
  --badge-ink-muted: #B0A493;
  --sans: 'Libre Franklin', Helvetica, Arial, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;

  /* vmin keeps type from growing on landscape phones, where width is
     plentiful but height is what runs out */
  --fs-display-xl: clamp(40px, 6vmin, 52px);
  --fs-display-md: clamp(30px, 4.4vmin, 38px);
  --fs-question: clamp(22px, 3.3vmin, 27px);
  --fs-body: clamp(15px, 2.1vmin, 17px);
  --fs-button: clamp(16px, 2.1vmin, 18px);
  --fs-feedback: clamp(14px, 2vmin, 16px);
  --fs-review: clamp(13px, 1.8vmin, 15px);
  --fs-score: clamp(68px, 9.5vmin, 88px);
  --fs-score-total: clamp(26px, 3.6vmin, 32px);
  --fs-stat: clamp(22px, 3vmin, 26px);

  --shell-width: 460px;
  --page-pad-x: 16px;
  --page-pad-top: 20px;
  --page-pad-bottom: 32px;
  --button-height: 56px;
  --option-height: 58px;
  --option-pad: 12px 14px;
  --badge-size: 26px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-top);
}

body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--page-pad-top);
  padding-left: max(var(--page-pad-x), env(safe-area-inset-left));
  padding-right: max(var(--page-pad-x), env(safe-area-inset-right));
  padding-bottom: max(var(--page-pad-bottom), env(safe-area-inset-bottom));
}

.shell {
  width: 100%;
  max-width: var(--shell-width);
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack--6 { gap: 6px; align-items: flex-start; }
.stack--8 { gap: 8px; }
.stack--14 { gap: 14px; }
.stack--16 { gap: 16px; }

.rule {
  height: 1px;
  width: 100%;
  margin: 0;
  border: none;
  background: var(--rule);
}

/* Header lockup */

.lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.lockup__frame {
  width: 34px;
  height: 44px;
  border: 3px solid var(--navy);
  border-right: none;
  flex: none;
}

.lockup__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-left: -6px;
}

.lockup__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.lockup__name {
  font-size: clamp(19px, 2.6vmin, 23px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--navy);
}

.lockup__years {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: center;
  padding-top: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}

.footer__link {
  padding: 6px 0;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

@media (hover: hover) {
  .footer__link:hover {
    color: var(--tan);
    text-decoration-color: var(--tan);
  }
}

.footer__link:active {
  color: var(--tan);
  text-decoration-color: var(--tan);
}

/* Screens */

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.screen--start {
  gap: 26px;
  justify-content: center;
  padding: 8px 0 24px;
}

.screen--quiz {
  gap: 20px;
}

.screen--done {
  gap: 24px;
  justify-content: center;
  padding-bottom: 24px;
}

/* Typography */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tan);
}

.eyebrow--muted {
  font-size: 11px;
  color: var(--muted);
}

.eyebrow--tight {
  letter-spacing: 0.16em;
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  color: var(--navy);
  text-wrap: pretty;
}

.display--xl {
  font-size: var(--fs-display-xl);
  line-height: 1.08;
}

.display--md {
  font-size: var(--fs-display-md);
  line-height: 1.15;
}

.lede {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--body);
  text-wrap: pretty;
}

/* Start screen */

.stats {
  display: flex;
  gap: 28px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat__value {
  font-size: var(--fs-stat);
  font-weight: 700;
  color: var(--navy);
}

.stat__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Buttons */

.btn {
  width: 100%;
  min-height: var(--button-height);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: var(--fs-button);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease;
}

.btn--primary {
  border: none;
  background: var(--navy);
  color: var(--bg-top);
}

.btn--secondary {
  border: 1.5px solid var(--navy);
  background: transparent;
  color: var(--navy);
}

@media (hover: hover) {
  .btn--primary:hover { background: var(--navy-hover); }
  .btn--secondary:hover { background: var(--navy); color: var(--bg-top); }
}

.btn--primary:active { background: var(--navy-hover); }
.btn--secondary:active { background: var(--navy); color: var(--bg-top); }

/* Quiz meta */

.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.meta__step {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta__score {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tan);
  white-space: nowrap;
}

.progress {
  height: 3px;
  width: 100%;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  background: var(--navy);
  border-radius: 2px;
  transition: width .3s ease;
}

.question {
  margin: 0;
  font-size: var(--fs-question);
  line-height: 1.35;
  font-weight: 600;
  color: var(--navy);
  text-wrap: pretty;
}

/* Options */

.options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--option-height);
  padding: var(--option-pad);
  text-align: left;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, border-color .15s ease;
}

.option:disabled {
  cursor: default;
}

.option__badge {
  flex: none;
  width: var(--badge-size);
  height: var(--badge-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--badge-bg);
  color: var(--muted);
}

.option__text {
  flex: 1;
}

.option__mark {
  flex: none;
  font-size: var(--fs-body);
  font-weight: 700;
}

.option.is-correct {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}

.option.is-correct .option__badge {
  background: var(--green);
  color: #FFFFFF;
}

.option.is-wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

.option.is-wrong .option__badge {
  background: var(--red);
  color: #FFFFFF;
}

.option.is-muted {
  background: var(--neutral-surface);
  border-color: var(--neutral-border);
  color: var(--disabled-text);
}

.option.is-muted .option__badge {
  background: var(--badge-bg-muted);
  color: var(--badge-ink-muted);
}

/* Feedback */

.feedback {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 2px;
}

.feedback__card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-left: 3px solid var(--green);
  background: var(--green-bg-soft);
}

.feedback__card.is-wrong {
  border-left-color: var(--red);
  background: var(--red-bg-soft);
}

.feedback__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.feedback__card.is-wrong .feedback__title {
  color: var(--red);
}

.feedback__body {
  font-size: var(--fs-feedback);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* Result */

.score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.score__value {
  font-weight: 600;
  font-size: var(--fs-score);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--navy);
  font-variant-numeric: lining-nums;
}

.score__total {
  font-weight: 500;
  font-size: var(--fs-score-total);
  color: var(--tan);
  font-variant-numeric: lining-nums;
}

.review {
  list-style: none;
  margin: 0;
  padding: 0;
}

.review__item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.review__mark {
  flex: none;
  width: 18px;
  font-size: var(--fs-review);
  font-weight: 700;
  color: var(--green);
}

.review__item.is-wrong .review__mark {
  color: var(--red);
}

.review__text {
  flex: 1;
  font-size: var(--fs-review);
  line-height: 1.45;
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Wider viewports get a roomier column. Gated on height too, so a phone in
   landscape keeps the compact layout. */
@media (min-width: 600px) and (min-height: 600px) {
  :root {
    --shell-width: 540px;
    --page-pad-x: 24px;
    --page-pad-top: 28px;
    --page-pad-bottom: 40px;
    --button-height: 60px;
    --option-height: 64px;
    --option-pad: 14px 16px;
    --badge-size: 28px;
  }

  .shell { gap: 26px; }
  .screen--start { gap: 30px; }
  .screen--quiz { gap: 24px; }
  .screen--done { gap: 28px; }
  .options { gap: 12px; }
  .lockup__frame { width: 38px; height: 50px; }
}

/* Short viewports (small phones, any phone in landscape): tighten so the
   opening screen still fits without scrolling. */
@media (max-height: 640px) {
  :root {
    --fs-display-xl: clamp(30px, 5.6vmin, 40px);
    --fs-body: 14px;
    --page-pad-top: 14px;
    --page-pad-bottom: 20px;
    --button-height: 52px;
  }

  .shell { gap: 16px; }
  .screen--start { gap: 18px; padding: 0 0 12px; }
  .stack--14 { gap: 10px; }
  .stack--16 { gap: 12px; }
  .lockup__frame { width: 30px; height: 38px; }
}

/* Wide and short (phone in landscape): the opening screen has width to spare
   and no height, so it splits into two columns instead of scrolling. */
@media (max-height: 440px) and (min-width: 680px) {
  :root { --shell-width: 760px; }

  .screen--start {
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }

  .screen--start > .stack--14 { flex: 1.2; }
  .screen--start > .stack--16 { flex: 1; }
  .screen--start > .rule { display: none; }
}

@media (min-width: 1000px) and (min-height: 700px) {
  :root {
    --shell-width: 620px;
    --page-pad-top: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
