/* ExamenClaro: tokens and components. DESIGN.md is the source of truth for every value here. */

@font-face { font-family: "Cabinet Grotesk"; src: url("/assets/fonts/cabinet-grotesk-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("/assets/fonts/cabinet-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("/assets/fonts/cabinet-grotesk-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  /* colour roles */
  --bg: #ffd249;          /* caution yellow: page ground and hero */
  --surface: #f5c63c;     /* one step down from the ground */
  --ink: #0a0a0a;
  --muted: #4a3a08;       /* secondary notes on yellow */
  --accent: #f53fd6;      /* magenta: actions only */
  --accent-ink: #0a0a0a;
  --paper: #ffffff;
  --paper-ink: #0a0a0a;
  --paper-muted: #3d3d3d;
  --pink: #ffc4ef;
  --cyan: #a4f6f8;
  --orange: #f9a21f;
  --night: #0a0a0a;
  --night-ink: #ffffff;
  --night-muted: #d9d9d9;
  --option: #efefef;      /* neutral answer option on paper */
  --ok: #0f6b35;
  --ok-soft: #d8f0df;
  --bad: #b3261e;
  --bad-soft: #fbe1de;
  --field: #fff6d6;       /* form inputs on orange */

  /* type */
  --font: "Cabinet Grotesk", system-ui, sans-serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.2rem + 4.6vw, 5.5rem);
  --step-display: clamp(2.9rem, 12vw, 11rem);

  /* space */
  --margin: clamp(1rem, 2.2vw, 1.75rem);
  --section: clamp(4rem, 10vw, 9rem);
  --radius: 0;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.foot :focus-visible, .band :focus-visible { outline-color: var(--bg); }
.no-reserve .nav-reserve { display: none; }
a.target { display: inline-block; padding-block: 0.2rem; }
:target { scroll-margin-top: 1.5rem; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -4rem; background: var(--ink); color: var(--bg); padding: 0.75rem 1rem; z-index: 10; }
.skip:focus { top: 0.75rem; }
.wrap { padding-inline: var(--margin); }

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.5rem; padding: 0 1.5rem; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: var(--step-body); text-decoration: none; border-radius: var(--radius); text-align: center; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button-alt { background: var(--ink); color: var(--bg); }
.button-small { min-height: 2.75rem; padding: 0 1rem; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--ink); color: var(--bg); }
  .button-alt:hover { background: var(--accent); color: var(--accent-ink); }
}

/* header */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.mark { font-weight: 800; font-size: 1.375rem; letter-spacing: -0.03em; text-decoration: none; }
.nav-links { display: none; gap: 2rem; font-weight: 500; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
@media (min-width: 60em) { .nav-links { display: flex; } }

/* shared section heading */
.head { font-weight: 800; font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.035em; }
.lead { font-size: var(--step-lead); line-height: 1.3; font-weight: 500; max-width: 34ch; }
.head + .lead, .head + p { margin-top: 1.25rem; }
.section { padding-block: var(--section); }

/* hero */
.hero { position: relative; overflow: hidden; padding-bottom: 3.5rem; }
.hero h1 { font-weight: 800; font-size: var(--step-display); line-height: 0.88; letter-spacing: -0.035em; margin-top: clamp(1.5rem, 5vw, 4rem); }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .line > span { display: block; }
.hero-body { display: grid; gap: 2.25rem; margin-top: 2rem; }
.hero-text > p:first-child { font-size: var(--step-lead); line-height: 1.3; font-weight: 500; max-width: 32ch; }
.hero-actions { display: grid; gap: 0.75rem; margin-top: 1.75rem; }
.hero-note { margin-top: 1rem; max-width: 38ch; }
.hero-photo { width: min(70%, 420px); justify-self: end; margin-right: 1.25rem; transform: rotate(4deg); }
.hero-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: grayscale(1) contrast(1.1); }
@media (min-width: 30em) { .hero-actions { display: flex; flex-wrap: wrap; } }
@media (min-width: 60em) {
  .hero { min-height: 100svh; }
  .hero-body { grid-template-columns: 5fr 4fr; align-items: start; }
  .hero-photo { margin-top: -9vw; width: 100%; max-width: 30vw; margin-right: 2vw; }
}

/* figures */
.figures { background: var(--pink); }
.figures .head { margin-bottom: 1.75rem; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; min-height: 14rem; }
.tile .n { font-weight: 800; font-size: var(--step-head); line-height: 0.9; letter-spacing: -0.04em; }
.tile p { font-weight: 500; max-width: 24ch; }
.tile-a { grid-column: 1 / -1; background: var(--bg); min-height: 56vw; }
.tile-b { background: var(--night); color: var(--night-ink); }
.tile-c { background: var(--orange); margin-top: 2rem; }
.figures-note { margin-top: 1.75rem; max-width: 60ch; }
@media (min-width: 60em) {
  .tiles { grid-template-columns: 6fr 3fr 3fr; align-items: start; }
  .tile-a { grid-column: auto; min-height: 66vh; }
  .tile-b { margin-top: 12vh; min-height: 44vh; }
  .tile-c { margin-top: 24vh; min-height: 34vh; }
}

/* sample questions */
.questions { background: var(--paper); color: var(--paper-ink); }
.questions-intro { display: grid; gap: 1.25rem; }
.questions-list { display: grid; gap: clamp(3rem, 7vw, 5rem); margin-top: clamp(2.5rem, 6vw, 4rem); }
.question { display: grid; gap: 1.25rem; }
.question-head { display: grid; gap: 0.75rem; }
.question h3 { font-weight: 800; font-size: var(--step-lead); line-height: 1.1; letter-spacing: -0.02em; }
.question-text { font-size: var(--step-body); line-height: 1.45; font-weight: 500; max-width: 46ch; }
.choices { display: grid; gap: 8px; padding: 0; list-style: none; }
.choice { width: 100%; min-height: 4rem; padding: 0.9rem 1rem; background: var(--option); color: var(--paper-ink); text-align: left; display: grid; grid-template-columns: 2.25rem 1fr; align-items: center; column-gap: 0.75rem; row-gap: 0.35rem; font-weight: 500; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.choice:active { transform: scale(0.985); }
.choice-letter { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; background: var(--paper); font-weight: 800; }
.choice-mark { grid-column: 2; display: none; align-items: center; gap: 0.4rem; font-weight: 800; }
.choice-mark .icon { width: 1.25rem; height: 1.25rem; flex: none; }
.choice[data-state="correct"] { background: var(--ok-soft); }
.choice[data-state="correct"] .choice-letter { background: var(--ok); color: var(--paper); }
.choice[data-state="correct"] .choice-mark { display: inline-flex; color: var(--ok); }
.choice[data-state="wrong"] { background: var(--bad-soft); }
.choice[data-state="wrong"] .choice-letter { background: var(--bad); color: var(--paper); }
.choice[data-state="wrong"] .choice-mark { display: inline-flex; color: var(--bad); }
.choice[data-state="other"] { color: var(--paper-muted); }
.choice[aria-disabled="true"] { cursor: default; }
@media (hover: hover) and (pointer: fine) { .choice:not([aria-disabled="true"]):hover { background: #e2e2e2; } }
.answer { display: grid; gap: 0.75rem; padding: 1.25rem; background: var(--option); max-width: 62ch; }
.answer h4 { font-weight: 800; font-size: var(--step-lead); line-height: 1.1; }
.answer-result { font-weight: 800; }
.answer-result:empty { display: none; }
.source { color: var(--paper-muted); }
.again { justify-self: start; margin-top: 0.25rem; }
/* The result line takes focus after an answer so screen readers read it; it is not a control, so no ring. */
.answer-result:focus { outline: none; }
.quiz-ready .answer { display: none; }
.quiz-ready .question.is-answered .answer { display: grid; }
.quiz-ready .no-js-only { display: none; }
.js-only { display: none; }
.quiz-ready .js-only { display: inline-flex; }
@media (min-width: 60em) {
  .questions-intro { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: end; }
  .question { grid-template-columns: 5fr 7fr; column-gap: 4rem; align-items: start; }
  .question > .question-head { grid-column: 1; grid-row: 1 / span 2; }
  .question > .choices, .question > .answer { grid-column: 2; }
}

.questions-cta { display: grid; gap: 1.25rem; margin-top: clamp(3rem, 7vw, 5rem); padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--bg); }
.questions-cta .hero-actions { margin-top: 0; }

/* photo band */
.band { display: grid; grid-template-columns: 1fr 1fr; background: var(--night); color: var(--night-ink); }
.band figure { display: flex; flex-direction: column-reverse; overflow: hidden; }
.band figure:first-child { grid-column: 1 / -1; }
.band picture { display: block; }
.band img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.band figure:first-child img { aspect-ratio: 4 / 3; }
.band figcaption { background: var(--bg); color: var(--ink); padding: 0.75rem var(--margin) 1rem; font-weight: 500; }
/* One photograph across the full width, in colour so the sky stays blue; the crop keeps the sky above the crew. */
.band-single { grid-template-columns: 1fr; }
.band-single figure:first-child img { aspect-ratio: 4 / 3; object-position: 50% 30%; filter: none; }
@media (min-width: 40em) {
  .band { grid-template-columns: repeat(3, 1fr); }
  .band figure:first-child { grid-column: auto; }
  .band figure:first-child img { aspect-ratio: 4 / 5; }
  .band-single { grid-template-columns: 1fr; }
  .band-single figure:first-child img { aspect-ratio: 16 / 7; object-position: 50% 38%; }
}

/* price */
.price { background: var(--cyan); }
.price .head .tag { background: var(--accent); padding: 0 0.15em; }
.price-row { display: grid; gap: 1.75rem; margin-top: 2.5rem; }
.price-row .lead { max-width: 36ch; }
.price-row p + p { margin-top: 0.75rem; }
.price-action { display: grid; gap: 0.75rem; }
.price-action .button { width: 100%; }
.promise { font-weight: 800; max-width: 34ch; }
@media (min-width: 60em) {
  .price-row { grid-template-columns: 1fr minmax(20rem, auto); align-items: end; gap: 4rem; }
}

/* signup */
.signup-section { background: var(--orange); }
.signup-grid { display: grid; gap: 2rem; }
.signup { display: grid; gap: 1.25rem; max-width: 40rem; }
.signup .group { display: grid; gap: 0.4rem; }
.signup label, .signup legend { font-weight: 800; }
.signup input[type="email"], .signup select { width: 100%; min-height: 3.5rem; padding: 0.75rem 1rem; background: var(--field); border: 2px solid var(--ink); border-radius: var(--radius); font-size: max(1rem, var(--step-body)); }
.signup select { appearance: none; background-image: none; }
.signup .select { position: relative; }
.signup .select::after { content: ""; position: absolute; right: 1.1rem; top: 50%; width: 0.6rem; height: 0.6rem; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.signup fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 0.5rem; }
.signup fieldset p { font-weight: 500; }
.signup .radio { display: flex; align-items: center; gap: 0.75rem; min-height: 3rem; padding: 0.5rem 1rem; background: var(--field); font-weight: 500; cursor: pointer; }
.signup .radio input { width: 1.375rem; height: 1.375rem; accent-color: var(--ink); margin: 0; flex: none; }
.signup .button { width: 100%; }
.signup-note { max-width: 44ch; }
@media (min-width: 60em) { .signup-grid { grid-template-columns: 5fr 7fr; gap: 4rem; } .signup .button { width: auto; justify-self: start; } }

/* faq */
.faq { background: var(--paper); color: var(--paper-ink); }
.faq-grid { display: grid; gap: 2rem; }
.faq-list { display: grid; gap: 8px; }
.faq details { background: var(--option); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 4.5rem; padding: 1rem 1.25rem; font-weight: 500; font-size: var(--step-body); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { position: relative; width: 1rem; height: 1rem; flex: none; }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; left: 0; top: calc(50% - 1.5px); width: 1rem; height: 3px; background: currentColor; transition: transform var(--t-hover) var(--ease-out); }
.faq summary .plus::after { transform: rotate(90deg); }
.faq details[open] { background: var(--bg); }
.faq details[open] summary .plus::after { transform: rotate(0deg); }
.faq details > div { padding: 0 1.25rem 1.25rem; max-width: 60ch; display: grid; gap: 0.75rem; }
@media (min-width: 60em) {
  .faq-grid { grid-template-columns: 4fr 8fr; gap: 4rem; }
  .faq-grid > .head { position: sticky; top: 2rem; align-self: start; }
}

/* english block */
.english { background: var(--bg); }
.english-grid { display: grid; gap: 1.5rem; }
.english h2 { font-weight: 800; font-size: var(--step-lead); line-height: 1.1; letter-spacing: -0.02em; max-width: 22ch; }
.english p { max-width: 62ch; }
.english p + p { margin-top: 1rem; }
@media (min-width: 60em) { .english-grid { grid-template-columns: 5fr 7fr; gap: 4rem; } }

/* home */
.exam-list { display: grid; gap: 8px; padding: 0; list-style: none; margin-top: 2rem; }
.exam { display: grid; gap: 0.5rem; padding: 1.5rem; background: var(--paper); }
.exam h3 { font-weight: 800; font-size: var(--step-lead); line-height: 1.1; letter-spacing: -0.02em; }
.exam p { max-width: 50ch; }
.exam-live { background: var(--paper); }
.exam-soon { background: var(--surface); }
@media (min-width: 60em) { .exam { grid-template-columns: 1fr auto; align-items: center; column-gap: 2rem; padding: 2rem; } }
.how { background: var(--pink); }
.how-grid { display: grid; gap: 1rem; }
@media (min-width: 60em) { .how-grid { grid-template-columns: 4fr 8fr; gap: 4rem; align-items: start; } .how-grid .exam-list { margin-top: 0; } }

/* reading pages: privacy, terms, refunds, credits */
.doc { background: var(--paper); color: var(--paper-ink); padding-block: clamp(3rem, 8vw, 6rem); }
.doc-inner { max-width: 44rem; margin-inline: auto; }
.doc h1 { font-weight: 800; font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); line-height: 0.95; letter-spacing: -0.035em; }
.doc .doc-lead { margin-top: 1.25rem; }
.doc .doc-meta { margin-top: 1rem; color: var(--paper-muted); }
.doc h2 { font-weight: 800; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); line-height: 1.1; letter-spacing: -0.02em; margin-top: 2.75rem; }
.doc p, .doc ul { margin-top: 1rem; }
.doc ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.doc a { font-weight: 500; }
.credit-list { padding-left: 1.25rem; display: grid; gap: 0.75rem; margin-top: 1.5rem; }

/* thank-you and 404: the hero composition with a shorter headline size */
.done h1 { font-size: clamp(2.6rem, 10.5vw, 8.5rem); }
.done-body { display: grid; gap: 1rem; max-width: 40rem; align-content: start; }
.done-body .lead { max-width: 36ch; }
.done .button { justify-self: start; margin-top: 1rem; }

/* footer */
.foot { background: var(--night); color: var(--night-ink); overflow: hidden; padding-top: 4rem; }
.foot-grid { display: grid; gap: 2rem; }
.foot-main { display: grid; gap: 1rem; max-width: 62ch; }
.foot-main p:not(.foot-claim) { color: var(--night-muted); }
.foot-claim { font-size: var(--step-lead); line-height: 1.3; font-weight: 500; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.5rem; font-weight: 500; }
.foot-links a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.foot-credits { color: var(--night-muted); max-width: 80ch; }
.foot-name { font-weight: 800; font-size: 30vw; line-height: 0.8; letter-spacing: -0.05em; white-space: nowrap; transform: translateY(18%); color: var(--bg); margin-top: 2.5rem; }
@media (min-width: 60em) { .foot-grid { grid-template-columns: 7fr 5fr; } .foot-links { justify-content: flex-end; align-self: start; } .foot-credits { grid-column: 1 / -1; } }

/* motion: content is visible without script; the travel is dropped for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .js .hero h1 .line > span { transform: translateY(105%); animation: line-rise 900ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
  .js [data-rise] { opacity: 0; transform: translateY(18px); animation: rise 700ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 380ms); }
  .js .hero-photo[data-rise] { transform: translateY(40px) rotate(4deg); animation-name: rise-tilt; }
  .reveal-ready [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 650ms var(--ease-out), transform 850ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }
  .band img { transition: transform 1600ms var(--ease-out); }
  .band figure.is-in img { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .button:active, .choice:active { transform: none; }
}
@keyframes line-rise { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes rise-tilt { to { opacity: 1; transform: rotate(4deg); } }
