:root {
  --accent: #ff631e;
  --bg: #e8edf2;
  --ink: #1f1f1f;
  --muted: #55606b;
  --navy: #14213a;
  --ok: #25bb64;
  --ko: #d84738;
  --gold: #ffc857;
  --radius: 20px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.progress { position: fixed; inset: 0 0 auto; height: 4px; z-index: 50; background: transparent; }
.progress__bar { height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; cursor: pointer; font: 600 1rem var(--font); padding: .9rem 1.8rem; border-radius: 999px; text-decoration: none; transition: transform .15s, background .2s, opacity .2s, box-shadow .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 10px 30px -10px rgba(255, 99, 30, .7); }
.btn--dark { background: var(--navy); color: #fff; }
.btn--ghost { background: transparent; color: var(--navy); border: 2px solid currentColor; padding: .7rem 1.5rem; }
.btn--continue { background: var(--gold); color: var(--navy); letter-spacing: .12em; font-weight: 800; padding: 1rem 3rem; }

/* Cover */
.cover { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden; color: #fff; text-align: center; }
.cover__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
.cover__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 33, 58, .55), rgba(20, 33, 58, .88)); }
.cover__content { position: relative; max-width: 820px; padding: 2rem 1.5rem; animation: rise .9s ease both; }
.cover__eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; font-weight: 600; color: var(--gold); margin: 0 0 1rem; }
.cover h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; margin-bottom: 1.2rem; }
.cover__author { margin: 0 0 2.2rem; opacity: .9; }

/* Lesson */
.lesson { max-width: 860px; margin: 0 auto; padding: 4rem 1.25rem 2rem; }
.block { margin: 0 0 3.5rem; }
.card { background: #fff; border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: 0 20px 50px -30px rgba(20, 33, 58, .35); }

.welcome { position: relative; text-align: center; }
.welcome__img { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; object-position: center 45%; border-radius: var(--radius); }
.welcome__tab { display: inline-block; background: var(--bg); padding: 1rem 2.5rem .25rem; margin-top: -3.2rem; position: relative; border-radius: 48px 0 0 0; }
.welcome__tab h2 { font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 800; }
.welcome__text { font-size: 1.1rem; margin: .5rem auto 0; max-width: 620px; }

.objectives h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1.5rem; }
.objectives ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.objectives li { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg); border-radius: 14px; padding: 1rem 1.2rem; }
.objectives li p { margin: 0; }
.icon { font-size: 1.4rem; line-height: 1.2; }

.impact { margin: 0; padding: 2rem 2.25rem; border-left: 6px solid var(--accent); background: #fff; border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.2rem; }
.impact p { margin: 0 0 .6rem; }
.impact p:last-child { margin: 0; }

.tip { display: flex; gap: 1.5rem; align-items: flex-start; background: var(--navy); color: #fff; border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); }
.tip__icon { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 2rem; }
.tip h3 { font-size: 1.4rem; margin-bottom: .75rem; }
.tip p { margin: 0 0 .6rem; opacity: .92; }

/* Quiz */
.quiz { padding-top: 0; overflow: hidden; }
.quiz__img { width: calc(100% + 2 * clamp(1.5rem, 4vw, 2.75rem)); max-width: none; margin: 0 calc(-1 * clamp(1.5rem, 4vw, 2.75rem)) 1.75rem; aspect-ratio: 16 / 8; object-fit: cover; }
.quiz__q { font-size: 1.2rem; font-weight: 600; text-align: center; margin: 0 0 1.5rem; }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .75rem; }
.choice { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.2rem; border: 2px solid #d8dee5; border-radius: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.choice:hover { border-color: var(--navy); }
.choice input { accent-color: var(--accent); width: 1.2rem; height: 1.2rem; flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: #fff6f1; }
.choice.is-correct { border-color: var(--ok); background: #effbf4; }
.choice.is-wrong { border-color: var(--ko); background: #fdf1f0; }
.quiz[data-locked] .choice { pointer-events: none; }
.quiz > .btn { display: flex; margin: 0 auto; }
.feedback { margin-top: 1.5rem; padding: 1.25rem 1.5rem; border-radius: 14px; animation: rise .4s ease both; }
.feedback p { margin: .4rem 0 0; }
.feedback--ok { background: #effbf4; border-left: 5px solid var(--ok); }
.feedback--ok > strong { color: var(--ok); }
.feedback--ko { background: #fdf1f0; border-left: 5px solid var(--ko); }
.feedback--ko > strong { color: var(--ko); }
.feedback .btn { margin-top: 1rem; }
.feedback[hidden] { display: none; }

.big-heading { font-size: clamp(1.5rem, 3.6vw, 2.4rem); font-weight: 700; text-align: center; }

.continue { text-align: center; }
.continue__hint { color: var(--muted); font-size: .9rem; margin-top: .75rem; }
.continue.is-done { display: none; }

/* Flashcards */
.subheading { text-align: center; font-weight: 700; font-size: 1.2rem; margin: 0 0 1.75rem; }
.flashcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.flash { all: unset; cursor: pointer; perspective: 1200px; height: 380px; display: block; border-radius: var(--radius); }
.flash:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.flash__inner { position: relative; width: 100%; height: 100%; transition: transform .7s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.flash[aria-pressed="true"] .flash__inner { transform: rotateY(180deg); }
.flash__face { position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 1.75rem; overflow: auto; }
.flash__front { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #fff; }
.flash__front h4 { font-size: 1.75rem; font-weight: 800; margin: .5rem 0 .75rem; }
.flash__front p { margin: 0; opacity: .9; font-style: italic; }
.flash__num { font-size: .85rem; font-weight: 700; letter-spacing: .2em; opacity: .7; }
.f1 { background: linear-gradient(145deg, #14213a, #2c4370); }
.f2 { background: linear-gradient(145deg, #ff631e, #ff9a5a); }
.f3 { background: linear-gradient(145deg, #2b6c7f, #3fa3a8); }
.f4 { background: linear-gradient(145deg, #6b3fa0, #9a6fd0); }
.flash__back { background: #fff; transform: rotateY(180deg); font-size: .95rem; box-shadow: inset 0 0 0 2px #d8dee5; }
.flash__back p { margin: 0 0 .75rem; font-weight: 600; }
.flash__back ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; }
.flash-count { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1.25rem; }

.done { text-align: center; }
.done__check { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.done h3 { font-size: 1.6rem; margin-bottom: .5rem; }
.done p { max-width: 560px; margin: 0 auto 1.5rem; }

.footer { text-align: center; padding: 2rem 1rem 3rem; color: var(--muted); font-size: .9rem; }

/* Entrance animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .tip { flex-direction: column; }
  .welcome__img { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .flash__inner { transition: none; }
}
