/* Field notes: a native modal over the paused chapter. Each lesson reads top to bottom. */
.learn-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 8px;
  max-width: 100%;
  border: 0;
  background: none;
  color: #8d98aa;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .01em;
  text-decoration: underline;
  text-decoration-color: rgba(141, 152, 170, .28);
  text-underline-offset: 4px;
  transition: color .25s, text-decoration-color .25s;
}
.learn-trigger:hover { color: #bdc7d6; text-decoration-color: rgba(189, 199, 214, .6); }
.scene.is-active .learn-trigger[data-reveal] { animation-name: learn-trigger-in; }
@keyframes learn-trigger-in { from { opacity: 0; } to { opacity: 1; } }
.learn-trigger:focus-visible, .education :focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
body.education-open .cursor { opacity: 0; }
.scene__text > .learn-trigger, .stack__head > .learn-trigger { align-self: flex-start; padding-inline: 0; text-align: left; margin-top: 0; }
.stack__head--center > .learn-trigger { align-self: center; }
.cosmos__actions > .learn-trigger { margin: 0; }

/* ───────── The dialog ───────── */
.education {
  --edu-muted: #9dabbe;
  --edu-text: #c9d3df;
  --edu-border: rgba(162, 195, 220, .16);
  --edu-accent: var(--cyan);
  --edu-accent-rgb: var(--cyan-rgb);
  width: min(960px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(157, 194, 222, .26);
  border-radius: 20px;
  color: var(--ink);
  background: radial-gradient(ellipse at 100% 0, rgba(39, 70, 100, .2), transparent 55%), #0a101b;
  box-shadow: 0 40px 160px #000b, 0 0 100px rgba(38, 91, 121, .12);
  font-family: var(--font-body);
  font-weight: 400;
}
.education[open] { display: flex; flex-direction: column; animation: education-in .35s var(--ease-out); }
.education::backdrop { background: rgba(2, 5, 12, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@keyframes education-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.education__header { position: relative; flex-shrink: 0; padding: 24px 32px 22px; border-bottom: 1px solid var(--edu-border); }
.education__eyebrow, .education__progress, .lesson__kicker, .lesson h4 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.education__eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-right: 44px; color: var(--cyan); }
.education__eyebrow > span:first-child { font-size: 18px; line-height: 1; }
.education__chapter { color: var(--edu-muted); border-left: 1px solid var(--edu-border); padding-left: 12px; letter-spacing: .08em; text-transform: none; }
.education__title { margin: 10px 44px 0 0; font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; color: #f4f5f8; }
.education__title:focus { outline: none; }
.education__intro { margin-top: 8px; max-width: 62ch; color: var(--edu-muted); font-size: 14px; line-height: 1.7; }
.education__intro[hidden] { display: none; }
.education__close { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--edu-border); border-radius: 50%; color: var(--edu-muted); font-size: 28px; line-height: 1; transition: color .2s, background .2s; }
.education__close:hover { color: #fff; background: #ffffff0d; }

.education__body { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #40546b transparent; scrollbar-width: thin; }
.education__tabs { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px; background: #090f19; }
.education__tab { display: flex; align-items: baseline; gap: 10px; text-align: left; padding: 13px 12px; min-height: 48px; border: 1px solid transparent; border-radius: 9px; color: var(--edu-muted); font-size: 13px; line-height: 1.45; transition: color .2s, background .2s; }
.education__tab:hover { color: #fff; background: #ffffff05; }
.education__tab[aria-selected="true"] { color: #d6f7ff; background: linear-gradient(110deg, rgba(var(--cyan-rgb), .10), rgba(var(--cyan-rgb), .025)); border-color: rgba(var(--cyan-rgb), .22); }
.education__tab-number { font-family: var(--font-mono); font-size: 10px; color: #8d9fb5; }
.education__tab[aria-selected="true"] .education__tab-number { color: var(--cyan); }
.education__panels { min-width: 0; border-left: 1px solid var(--edu-border); }
.education__panel { padding: 26px 32px 30px; }
.education__panel[hidden] { display: none; }
.education__panel:focus { outline: none; }

.education__footer { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; border-top: 1px solid var(--edu-border); background: #0c1421; }
.education__progress { color: #99abc1; letter-spacing: .1em; }
.education__navigation { display: flex; align-items: center; gap: 20px; }
.education__back, .education__next { min-height: 44px; font-size: 12px; font-weight: 500; }
.education__back { color: #bdcada; }
.education__back:disabled { visibility: hidden; }
.education__next { padding: 0 18px; border: 1px solid rgba(var(--cyan-rgb), .35); border-radius: 8px; background: rgba(var(--cyan-rgb), .08); color: #d3f6ff; }
.education__next:hover { border-color: var(--cyan); background: rgba(var(--cyan-rgb), .15); }

/* ───────── One lesson: kicker, title, idea, figure, story, remember ───────── */
.lesson--story { --edu-accent: var(--gold); --edu-accent-rgb: var(--gold-rgb); }
.lesson__kicker { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; color: var(--edu-muted); }
.lesson__kind { padding-left: 10px; border-left: 1px solid var(--edu-border); color: var(--edu-accent); }
.lesson__title { max-width: 26ch; margin-bottom: 14px; font-family: var(--font-display); font-size: clamp(26px, 2.8vw, 34px); line-height: 1.12; color: #f4f6f9; text-wrap: balance; }
.lesson__idea p, .lesson__story p { max-width: 62ch; color: var(--edu-text); font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.lesson__idea p + p { margin-top: 10px; }

.lesson__figure { margin: 22px 0 0; padding-bottom: 18px; border: 1px solid var(--edu-border); border-radius: 14px; background: #070d17; overflow: hidden; }
.lesson__stage { position: relative; height: clamp(180px, 46vw, 250px); isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--edu-border); background: radial-gradient(ellipse at 55% 45%, #10243b99, #040812 78%); }
.education-animation canvas { width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.education-animation.is-dragging canvas { cursor: grabbing; }
.lesson__stage--still canvas { cursor: default; }
.education-animation::after { position: absolute; inset: 0; z-index: 1; pointer-events: none; content: ''; box-shadow: inset 0 -22px 40px #040812a0; }
.education-animation__pause { position: absolute; z-index: 2; top: 10px; right: 10px; min-width: 70px; min-height: 40px; padding: 6px 12px; border: 1px solid #91c4db3d; border-radius: 999px; background: #070e1bbc; backdrop-filter: blur(8px); color: #c9d8e8; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.education-animation__pause:hover { color: var(--cyan); border-color: var(--cyan); }
.education-animation__hint { position: absolute; z-index: 2; bottom: 12px; left: 16px; right: 16px; pointer-events: none; text-align: center; font-family: var(--font-mono); font-size: 9px; line-height: 1.65; color: #b8cddd; text-shadow: 0 1px 8px #040812; }

.lesson__controls { display: grid; gap: 10px; padding: 16px 20px 0; }
.lesson__control { display: block; color: #b9c6d6; font-size: 13px; line-height: 1.5; }
.lesson__control-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.lesson__control output { color: var(--edu-accent); font-variant-numeric: tabular-nums; text-align: right; }
.lesson__control input { display: block; width: 100%; height: 40px; margin: 0; }
.lesson__question { padding: 16px 20px 8px; color: #b9c6d6; font-size: 13px; line-height: 1.5; }
.lesson__choices { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px; }
.lesson__choices button { flex: 1 1 110px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--edu-border); border-radius: 8px; color: #b8c7d8; font-size: 13px; line-height: 1.4; transition: border-color .2s, color .2s, background .2s; }
.lesson__choices button:hover { border-color: #829db8; color: #fff; }
.lesson__choices [aria-pressed="true"] { border-color: rgba(var(--edu-accent-rgb), .6); background: rgba(var(--edu-accent-rgb), .09); color: var(--edu-accent); }
.lesson__reading { margin: 18px 20px 0; padding: 13px 16px; border-left: 2px solid var(--edu-accent); border-radius: 0 10px 10px 0; background: rgba(var(--edu-accent-rgb), .05); }
.lesson__answer { color: #eef6ff; font-size: 15px; font-weight: 500; line-height: 1.5; }
.lesson__detail { margin-top: 6px; color: #aab8c9; font-size: 14px; line-height: 1.65; }
.lesson__detail[hidden] { display: none; }
.lesson__note { margin: 12px 20px 0; color: #7f8ea2; font-size: 11px; line-height: 1.6; }

.lesson__story, .lesson__remember { margin-top: 22px; }
.lesson h4 { margin: 0 0 6px; color: var(--edu-muted); }
.lesson__story h4 { color: var(--gold); }
.lesson__story p { font-size: 14.5px; }
.lesson__remember { padding: 14px 18px; border: 1px solid rgba(var(--edu-accent-rgb), .22); border-radius: 12px; background: linear-gradient(110deg, rgba(var(--edu-accent-rgb), .07), rgba(var(--edu-accent-rgb), .02)); }
.lesson__remember h4 { color: var(--edu-accent); }
.lesson__remember p { max-width: 62ch; color: #eaf3fb; font-size: 15px; font-weight: 500; line-height: 1.6; text-wrap: pretty; }
.lesson__sources { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--edu-border); font-size: 12px; }
.lesson__sources summary { width: fit-content; padding: 8px 0; color: #aebed1; cursor: pointer; }
.lesson__sources a { display: block; width: fit-content; padding: 8px 0; color: var(--cyan); line-height: 1.6; text-decoration: underline; text-decoration-color: #86e6ff40; text-underline-offset: 4px; }
.lesson__sources a:hover { color: #fff; }

@media (max-width: 760px) {
  .education { width: calc(100% - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .education__header { padding: 20px 20px 18px; }
  .education__title { margin-top: 12px; }
  .education__body { display: block; }
  .education__tabs { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--edu-border); }
  .education__panels { border-left: none; }
  .education__tab { flex: 1 1 calc(50% - 6px); gap: 8px; padding: 9px 10px; min-height: 44px; font-size: 12px; }
  .education__panel { padding: 22px 20px 26px; }
  .education__footer { padding: 12px 18px; gap: 10px; }
  .education__progress { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .education__navigation { justify-content: space-between; width: 100%; gap: 10px; }
  .lesson__controls, .lesson__choices { padding-inline: 14px; }
  .lesson__question { padding-inline: 14px; }
  .lesson__reading, .lesson__note { margin-inline: 14px; }
}
@media (max-width: 420px) {
  .education { width: calc(100% - 12px); max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); }
  .education__header { padding: 18px 16px 15px; }
  .education__eyebrow { font-size: 9px; gap: 8px; letter-spacing: .08em; }
  .education__chapter { padding-left: 8px; }
  .education__close { top: 10px; right: 10px; width: 40px; height: 40px; }
  .education__title { font-size: 28px; margin-right: 36px; }
  .education__tabs { padding: 12px 14px; }
  .education__panel { padding: 20px 14px 24px; }
  .lesson__title { font-size: 25px; }
  .lesson__idea p, .lesson__story p, .lesson__remember p { font-size: 14.5px; }
  .lesson__choices { gap: 6px; }
  .lesson__choices button { flex-basis: 90px; padding: 8px; font-size: 12px; }
  .lesson__remember { padding: 12px 14px; }
}
@media (max-height: 540px) {
  .education { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .education__header { padding-top: 13px; padding-bottom: 12px; }
  .education__title { font-size: 28px; margin-top: 8px; }
  .education__intro { display: none; }
  .education__footer { padding-block: 8px; }
  .education__tabs { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .education[open] { animation: none; }
  .education *, .learn-trigger { transition: none; }
}
