/* Physics for Kids: the common style of the slide lessons (solar system, magnets, gears).
   A sober look for older pupils, like a textbook or a science magazine: Inter for the text,
   Source Serif 4 for the titles, thin rules, a dark title slide over a photo.
   Each page adds its own rules in a <style> after this file, and sets its title photo:
     .slide.hero { background-image: url(photo.jpg); --hero-pos: 70% 50%; }
   Every text exists twice, lang="en" and lang="fr"; only the language of <html> is shown. */
:root {
  --ink: #1a2232; --muted: #5d6779; --line: #dde3ec; --bg: #eef1f5; --paper: #ffffff; --soft: #f5f7fa;
  --accent: #2552a3; --ok: #1f7a55; --bad: #b3362b; --warn: #b4531f;
  --space: #0a0f1d;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
html[lang="en"] [lang="fr"], html[lang="fr"] [lang="en"] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); font-weight: 600; }
b { font-weight: 650; }

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) 0;
}
.back { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.back:hover, .back:focus-visible { color: var(--ink); text-decoration: underline; }

/* Buttons: flat, thin border. */
.chunky {
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
  padding: 6px 14px; font: inherit; font-size: .92em; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: .45em;
  transition: border-color .12s, background .12s; touch-action: manipulation;
}
.chunky:hover:not(:disabled) { border-color: #b8c3d4; background: var(--soft); }
.chunky:disabled { opacity: .4; cursor: default; }
.chunky:focus-visible, .chip:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang { min-width: 46px; justify-content: center; }
.tools { display: flex; gap: 8px; align-items: center; }
.pdf { font-size: 14px; padding: 5px 12px; }
.play { background: var(--ink); color: #fff; border-color: var(--ink); }
.play:hover:not(:disabled) { background: #2a3550; border-color: #2a3550; }
.tryit { margin: 6px 0 0; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 14px clamp(10px, 3vw, 28px) 96px; }
.slide {
  display: none; position: relative; min-height: min(660px, calc(100vh - 150px));
  padding: clamp(18px, 3.2vw, 42px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 14px 34px -12px rgba(16, 24, 40, .12);
}
.slide.active { display: block; }
.slide:focus { outline: none; }

/* Section label: "2 · The eight planets", small capitals in the accent colour. */
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.eyebrow .num { white-space: nowrap; }
.eyebrow .num::after { content: " · "; }

h1 { margin: 0; font-family: var(--serif); font-size: clamp(46px, 7.4vw, 92px); line-height: 1; font-weight: 600; letter-spacing: -.015em; }
h2 { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(28px, 3.3vw, 42px); line-height: 1.12; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 0 0 6px; font-size: 1.05em; line-height: 1.3; font-weight: 650; }
.lead { margin: 0 0 18px; max-width: 64ch; font-size: 1.08em; color: #2b3445; }
.kicker { margin: 0 0 10px; font-size: 13px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.sub { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(20px, 2.3vw, 28px); font-style: italic; font-weight: 400; }
.question { margin: 22px 0 26px; max-width: 34ch; font-size: 1.12em; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 40px); align-items: center; }
.cols.wide-right { grid-template-columns: 1fr 1.25fr; }
.cols.wide-left { grid-template-columns: 1.45fr 1fr; align-items: start; }
.cols.title { grid-template-columns: 1.3fr 1fr; }
.fig { display: block; width: 100%; height: auto; max-height: clamp(260px, calc(100vh - 400px), 470px); }
.cols.wide-left .fig { max-height: clamp(220px, calc(100vh - 520px), 330px); }

ul, ol { margin: 0 0 16px; padding-left: 1.2em; }
li { margin: 0 0 7px; }
ul.dots li::marker { color: var(--accent); }
ul.objects, ul.compact { list-style: none; padding: 0; }
ul.objects li { margin: 0 0 6px; }
ul.compact li { margin: 0 0 4px; padding-left: 14px; position: relative; }
ul.compact li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
ol.plain { list-style: none; padding: 0; }
ol.steps li::marker { color: var(--accent); font-weight: 650; }
ul.tight { margin-top: 12px; }
ul.tight li { margin-bottom: 3px; }
.small { font-size: .85em; color: var(--muted); margin: 8px 0 0; }

/* Side notes: a soft panel with a rule on the left. */
.note {
  margin: 10px 0 14px; padding: 12px 16px; max-width: 62ch;
  background: var(--soft); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
}
.note.wide { max-width: none; }
.note.warn { border-left-color: var(--warn); background: #fbf4ef; }
.note h3 { margin: 0 0 4px; font-size: .95em; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.note.warn h3 { color: var(--warn); }
.note p { margin: 0; }
.rule {
  display: inline-block; margin: 0 0 16px; padding: 10px 16px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--serif); font-size: 1.2em; font-weight: 600; line-height: 1.35;
}

/* Question cards: a question, its answer behind a click. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; margin: 0 0 16px; }
.cards.one { grid-template-columns: minmax(0, 440px); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.card summary { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; row-gap: 3px; cursor: pointer; list-style: none; font-weight: 600; }
.card summary::-webkit-details-marker { display: none; }
.card .em { grid-row: span 2; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #0b1020; }
.card .em.n { display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 16px; }
.card .peek { justify-self: start; font-size: .78em; font-weight: 500; color: var(--muted); }
.card .peek::after { content: " ›"; }
.card[open] { background: #f7faff; border-color: #c9d6ee; }
.card[open] .peek { display: none; }
.card .ans { margin: 8px 0 2px; font-weight: 400; }
.yes { color: var(--ok); } .no { color: var(--bad); }

table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: .93em; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { border-bottom: 2px solid var(--ink); font-weight: 650; vertical-align: bottom; }
tbody th { width: 22%; color: var(--muted); font-weight: 550; }
.tablewrap { overflow-x: auto; }

/* The title slide: dark, over a photo set by the page. */
.slide.hero {
  isolation: isolate; color: #f3f5f9; border-color: #1c2337;
  background-color: var(--space); background-repeat: no-repeat; background-size: cover;
  background-position: var(--hero-pos, 70% 50%);
}
.slide.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(90deg, rgba(8, 12, 24, .96) 0%, rgba(8, 12, 24, .88) 38%, rgba(8, 12, 24, .25) 72%, rgba(8, 12, 24, .1) 100%);
}
.hero .kicker { color: #9fb6e6; }
.hero .sub { color: #f0c27a; }
.hero .question { color: #cdd4e2; }
.hero .titlebox { max-width: 620px; }
.hero .credit { position: absolute; right: 16px; bottom: 10px; max-width: 60%; text-align: right; white-space: normal; font-size: 11px; color: rgba(230, 236, 246, .6); }
.hero .credit a { color: inherit; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; background: rgba(255, 255, 255, .06);
  font: inherit; font-size: 14px; font-weight: 550; color: #f3f5f9;
}
.chip:hover { background: rgba(255, 255, 255, .14); }
.chip .num { color: #f0c27a; font-weight: 700; }

/* Big ideas, numbered. */
.ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 24px; }
.idea { position: relative; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 56px; }
.idea .n {
  position: absolute; top: 14px; left: 14px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; background: var(--accent);
}
.idea p { margin: 0; }
.playtitle { margin: 6px 0 8px; }
.plays { display: flex; flex-wrap: wrap; gap: 10px; }

.pager {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center; align-items: center; gap: 14px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#count { min-width: 64px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.pager .chunky { white-space: nowrap; }

/* Photos: a black frame, a caption and a credit. */
figure { margin: 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 10px; background: #000; }
.photo figcaption, .caption { margin: 6px 0 0; font-size: .8em; line-height: 1.4; color: var(--muted); }
.credit { font-size: .92em; color: #8a93a3; white-space: nowrap; }
.photo figcaption .credit { white-space: normal; }

@media (max-width: 820px) {
  .cols, .cols.wide-right, .cols.wide-left, .cols.title { grid-template-columns: 1fr; }
  .cards.two { grid-template-columns: 1fr; }
  .ideas { grid-template-columns: 1fr; }
  .slide { min-height: 0; }
  .fig { max-height: 360px; }
  .pager { gap: 10px; }
  .pager .chunky { padding: 5px 10px; font-size: 15px; }
  .slide.hero { background-size: 180% auto; background-position: 50% 0; padding-top: 34vw; }
  .slide.hero::before { background: linear-gradient(180deg, rgba(8, 12, 24, .5) 0%, rgba(8, 12, 24, .92) 45%); }
  .hero .credit { position: static; display: block; max-width: none; text-align: left; margin: 18px 0 0; }
}
@media (max-height: 860px) and (min-width: 821px) {
  .slide { padding: 22px 34px; }
  h2 { font-size: clamp(26px, 3vw, 38px); }
  .lead { margin-bottom: 12px; }
  .note { margin: 6px 0 10px; padding: 9px 14px; }
}
@media (prefers-reduced-motion: reduce) { .chunky { transition: none; } }
@media print {
  body { background: #fff; display: block; }
  .top, .pager { display: none; }
  main { padding: 0; max-width: none; }
  .slide { display: block !important; break-after: page; page-break-after: always; break-inside: avoid; box-shadow: none; border: 0; border-radius: 0; min-height: calc(100vh - 2px); }
  .slide:last-child { break-after: auto; page-break-after: auto; }
  .card .peek { display: none; }
}
