/* ==========================================================================
   EXPERT CLASSES · MY LESSONS
   Table of contents
   1. Design tokens
   2. Reset and base
   3. Typography
   4. Navigation
   5. Photo placeholders
   6. Home page
      6a. Hero and ticker
      6b. Intro
      6c. Fun facts game
      6d. Lessons grid and cards
      6e. Footer
   7. Lesson page
   8. Responsive (tablet and up)
   9. Accessibility
   ========================================================================== */


/* 1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg: #ebe6d8;
  --ink: #7d1512;
  --text: #2b1a17;
  --card: #7d1512;
  --card-text: #f3ede0;
  --soft: #d9d1bd;
  --paper: #f6f1e4;

  /* Fonts */
  --font-display: 'Bodoni Moda', Georgia, serif;
  --font-script: 'Pinyon Script', 'Bodoni Moda', cursive;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Keep content clear of phone system bars */
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark mode: follows the device, unless the page forces light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b0e0d;
    --ink: #e2857b;
    --text: #eadfd0;
    --soft: #2c1917;
  }
}

:root[data-theme="dark"] {
  --bg: #1b0e0d;
  --ink: #e2857b;
  --text: #eadfd0;
  --soft: #2c1917;
}


/* 2. RESET AND BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font-body);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}


/* 3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
.serif {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  letter-spacing: 0;
}


/* 4. NAVIGATION
   -------------------------------------------------------------------------- */
nav {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

nav a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

nav .links {
  display: flex;
  gap: 18px;
}


/* 5. PHOTO PLACEHOLDERS
   Use <span class="ph p0"> for a placeholder (p0 to p3 = color variants),
   or put an <img> inside it for a real photo.
   -------------------------------------------------------------------------- */
.ph {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(155deg, var(--a), var(--b));
}

.ph::before {                      /* soft circle decoration */
  content: "";
  position: absolute;
  inset: auto -10% -35% 25%;
  height: 70%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.ph::after {                       /* label */
  content: attr(data-l);
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: #f3ede0;
  font-size: 11px;
  opacity: 0.8;
}

.ph img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ph:has(img)::before,
.ph:has(img)::after {              /* hide decoration on real photos */
  display: none;
}

/* Color variants */
.p0 { --a: #9b1c1a; --b: #4b0d0c; }
.p1 { --a: #b4362b; --b: #5b1512; }
.p2 { --a: #7d1512; --b: #2b0a0a; }
.p3 { --a: #a5261f; --b: #63201a; }


/* 6. HOME PAGE
   -------------------------------------------------------------------------- */

/* 6a. Hero and ticker */
.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 22px 56px;
}

.hero .eyebrow {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(52px, 14vw, 104px);
}

.hero h1 .script {
  display: block;
  margin-top: 8px;
  font-size: 1.05em;
  line-height: 1;
}

.hero-sub {
  max-width: 400px;
  margin: 24px 0 28px;
}

.btn {
  display: inline-block;
  padding: 14px 30px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
}

.btn:hover {
  opacity: 0.85;
}

/* Arched photo with a spinning badge */
.hero-photo {
  position: relative;
  justify-self: center;
  width: min(78vw, 380px);
}

.arch {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  box-shadow: 8px 9px 0 rgba(0, 0, 0, 0.35);
}

.arch .ph {
  position: absolute;
  inset: 0;
  height: auto;
}

.badge {
  position: absolute;
  right: -10%;
  bottom: 6%;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--card);
  color: var(--card-text);
}

.badge text {
  fill: currentColor;
  font: 500 10px var(--font-body);
}

.badge .num {
  font: 700 30px var(--font-display);
}

.badge .ring {
  transform-origin: 60px 60px;
  animation: spin 18s linear infinite;
}

/* Scrolling strip of lesson titles */
.ticker {
  overflow: hidden;
  padding: 14px 0;
  background: var(--card);
  color: var(--card-text);
}

.ticker .track {
  display: flex;
  width: max-content;
  animation: scroll 45s linear infinite;
}

.ticker .group {
  display: flex;
}

.ticker span {
  padding: 0 22px;
  font: italic 500 22px var(--font-display);
  white-space: nowrap;
}

.ticker span::after {
  content: "\2726";
  margin-left: 44px;
  font-style: normal;
  opacity: 0.6;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* 6b. Intro */
.intro {
  display: grid;
  gap: 48px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 22px 76px;
}

.polaroid {
  position: relative;
  justify-self: center;
  width: min(78vw, 340px);
  padding: 12px 12px 56px;
  background: var(--paper);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
}

.polaroid::before {                      /* piece of tape */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 96px;
  height: 28px;
  background: rgba(125, 21, 18, 0.55);
  transform: translateX(-50%) rotate(3deg);
}

.polaroid .ph {
  height: 340px;
}

.polaroid figcaption {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  color: #7d1512;
  font-size: 28px;
  text-align: center;
}

.about h2 {
  font-size: clamp(38px, 9vw, 60px);
}

.about h2 .script {
  display: block;
  margin-top: 6px;
  font-size: 1.1em;
}

.about > p {
  max-width: 460px;
  margin: 20px 0 28px;
}

.steps {
  display: grid;
  gap: 16px;
  max-width: 460px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  color: var(--ink);
  font: 700 34px/1 var(--font-display);
}

.steps strong {
  display: block;
  color: var(--ink);
  font: 700 19px var(--font-display);
}

/* 6c. Fun facts game */
.fun {
  padding: 64px 22px;
  background: var(--soft);
}

.fun > div {
  max-width: 760px;
  margin: 0 auto;
}

.fun h2 {
  font-size: clamp(34px, 8vw, 56px);
}

.fun h2 .script {
  font-size: 1.1em;
}

.fun .lead {
  max-width: 460px;
  margin: 14px 0 26px;
}

.tl {
  display: grid;
  gap: 12px;
}

.tl button {
  padding: 16px 18px;
  border: 1.5px solid var(--ink);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tl button:hover,
.tl button.win {
  background: var(--ink);
  color: var(--card-text);
}

.tl button.lose {
  opacity: 0.55;
  text-decoration: line-through;
}

.res {
  min-height: 28px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 22px;
}
/* 6c. Note to the reader */
.note {
  padding: 64px 22px;
  background: var(--soft);
  text-align: center;
}

.note > div {
  max-width: 560px;
  margin: 0 auto;
}

.note h2 {
  font-size: clamp(34px, 8vw, 56px);
}

.note h2 .script {
  font-size: 1.1em;
}

.note p {
  margin-top: 18px;
}

.note .sign {
  margin-top: 20px;
  color: var(--ink);
  font-size: 24px;
}

/* 6d. Lessons grid and cards */
.lessons {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 22px 40px;
}

.lessons h2 {
  margin-bottom: 8px;
  font-size: clamp(38px, 9vw, 64px);
}

.lessons h2 .script {
  font-size: 1.1em;
}

.lessons .sub {
  margin-bottom: 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 22px;
}

.grid:not(.open) .extra {                /* lessons 7 to 12 start hidden */
  display: none;
}

.card {
  display: block;
  padding: 12px 12px 22px;
  background: var(--card);
  color: var(--card-text);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover,
.card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 8px 0 rgba(0, 0, 0, 0.4);
}

.card .ph {
  height: 200px;
}

.card .n {
  display: block;
  margin: 14px 6px 0;
  font-size: 12px;
  opacity: 0.75;
}

.card h3 {
  margin: 18px 6px 8px;
  font: 700 24px/1.05 var(--font-display);
  letter-spacing: -0.01em;
}

.card p {
  margin: 0 6px;
  font-size: 13px;
  opacity: 0.9;
}

.more {
  display: block;
  margin: 38px auto 0;
  padding: 14px 34px;
  border: 1.5px solid var(--ink);
  background: none;
  color: var(--ink);
  font: 500 14px var(--font-body);
  cursor: pointer;
}

.more:hover {
  background: var(--ink);
  color: var(--card-text);
}

/* 6e. Footer */
footer {
  padding: 60px 20px 40px;
  color: var(--ink);
  font-size: 36px;
  text-align: center;
}


/* 7. LESSON PAGE
   -------------------------------------------------------------------------- */
.lp {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 22px 40px;
}

.lp .back {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.lp h1 {
  margin: 22px 0 10px;
  font-size: clamp(44px, 11vw, 88px);
}

.lp .tag {
  display: block;
  margin-bottom: 26px;
  color: var(--ink);
  font-size: clamp(28px, 6vw, 40px);
}

.lp .cover {
  height: min(60vw, 380px);
  margin-bottom: 38px;
}

.lp h2 {
  margin: 34px 0 12px;
  color: var(--ink);
  font: 700 28px/1 var(--font-display);
}

.lp p,
.lp ul {
  max-width: 62ch;
}

.lp ul {
  padding-left: 20px;
}

.lp li {
  margin: 8px 0;
}

/* Previous / next links */
.pn {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1.5px solid var(--ink);
}

.pn a {
  max-width: 46%;
  color: var(--ink);
  font: 700 20px var(--font-display);
}

.pn a:last-child {
  margin-left: auto;
  text-align: right;
}

.pn small {
  display: block;
  color: var(--text);
  font: 400 12px var(--font-body);
}


/* 8. RESPONSIVE (tablet and up)
   -------------------------------------------------------------------------- */
@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding-top: 40px;
  }

  .intro {
    grid-template-columns: 0.9fr 1.1fr;
    padding: 90px 32px 100px;
  }
}


/* 9. ACCESSIBILITY
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Lesson page quiz */
.quiz {
  margin: 28px 0 40px;
}

.quiz-progress {
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.quiz-q {
  display: none;
}

.quiz-q.active {
  display: block;
}

.quiz-q .q {
  margin-bottom: 12px;
  font-weight: 500;
}

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

.opts button {
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.quiz-q.answered .opts button {
  cursor: default;
}

.opts button.correct {
  background: var(--ink);
  color: var(--card-text);
}

.opts button.wrong {
  border-color: var(--ink);
  opacity: 0.55;
  text-decoration: line-through;
}

.quiz-q.answered .opts button:not(.correct):not(.wrong) {
  opacity: 0.55;
}

.explain {
  display: none;
  margin-top: 12px;
  color: var(--ink);
  font-size: 14px;
}

.quiz-q.answered .explain {
  display: block;
}

.quiz-next {
  display: block;
  margin-top: 20px;
  padding: 14px 30px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--card-text);
  font: 500 14px var(--font-body);
  cursor: pointer;
}

.quiz-next:hover {
  opacity: 0.85;
}

.quiz-result {
  color: var(--ink);
  font: 700 28px var(--font-display);
}

.feedback {
  display: none;
  margin-top: 10px;
  font-weight: 700;
}

.quiz-q.answered .feedback {
  display: block;
}

.feedback.is-correct {
  color: #2f7a3d;
}

.feedback.is-wrong {
  color: var(--ink);
}


/* Klikbare afbeelding */
.image-trigger {
  position: relative;
  padding: 0;
  border: 0;
  cursor: zoom-in;
}

.image-trigger img {
  transition: transform 0.3s ease;
}

.image-trigger:hover img {
  transform: scale(1.03);
}

/* Tekst op de afbeelding */
.image-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font: 500 13px var(--font-body);
}

/* Overlay met grote afbeelding */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 40px;
  border: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Kruisje rechtsboven */
.lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-close:focus-visible {
  outline: 2px solid white;
}