/* The interactive explainers (/learn/...), light theme. learn-dark.css
   overrides it for the dark theme (linked with data-theme-dark; see the note
   at the top of dark.css). The figures are SVG drawn by the learn island
   (web/src/learn): every color comes from the lx-* classes here, because the
   Content-Security-Policy forbids style attributes. Space figures sit on a
   night panel in both themes; charts follow the theme. */

.lx-page {
  --lx-night: #0b1130;
  --lx-night-2: #18224a;
  --lx-ink-night: #e7ebfa;
  --lx-muted-night: #a9b3d8;
  --lx-sun: #ffcc66;
  --lx-sun-edge: #f29d38;
  --lx-earth-day: #4f8fe8;
  --lx-earth-night: #1b2b55;
  --lx-moon-lit: #efe9da;
  --lx-moon-sea: #c8c0ad;
  --lx-moon-dark: #262b40;
  --lx-day-sky: #cfe3f7;
  --lx-day-sky-2: #e9f2fb;
  --lx-ground: #9bb07a;
  --lx-curve: var(--accent-moon);
  --lx-curve-alt: var(--accent-sun);
  --lx-accent: #c2560f;
  --lx-chart-grid: #e7e3d9;
  --lx-panel: #f3f1ea;
}

/* ---- Heading, short answer, tabs and section chips ---- */
.lx-intro { margin-bottom: 18px; }
.lx-kicker { color: var(--accent-moon); font-size: 0.8rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; margin: 6px 0 4px; }
.lx-answer { margin-top: 10px; max-width: 46em; font-size: 1.08rem; line-height: 1.55; }
.lx-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lx-tabs a {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}
.lx-tabs a:hover { color: var(--text); border-color: var(--muted); }
.lx-tabs a[aria-current="page"] { background: var(--accent-moon-soft); border-color: var(--accent-moon); color: var(--text); font-weight: 600; }
.lx-tabs a:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.lx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lx-chips a {
  font-size: 0.88rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.lx-chips a:hover { border-color: var(--muted); }

/* ---- Cards ---- */
.lx-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 0 0 18px;
  scroll-margin-top: 12px;
}
.lx-card > h2, .lx-card-head h2 { font-size: 1.3rem; letter-spacing: -0.005em; margin-bottom: 6px; }
.lx-card h3 { font-size: 1.02rem; margin: 0 0 4px; }
.lx-lede { color: var(--muted); max-width: 46em; margin-bottom: 14px; }
/* Paragraphs that hold an (i) are divs: a <details> cannot sit inside a <p>. */
.lx-card :is(p, .lx-p) + :is(p, .lx-p) { margin-top: 10px; }
@media (max-width: 560px) { .lx-card { padding: 18px 16px; } }

/* ---- The lab: controls, figures, readouts ---- */
.lx-nojs { padding: 10px 14px; border-radius: 12px; background: var(--accent-moon-soft); color: var(--text); margin: 6px 0 14px; font-size: 0.93rem; }
.lx-live .lx-nojs { display: none; }
.lx-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px 22px; margin: 10px 0 16px; }
.lx-controls[hidden], [data-lx-js][hidden] { display: none; }
.lx-control { min-width: 0; }
.lx-control label, .lx-control .lx-control-name { display: flex; justify-content: space-between; gap: 8px; font-size: 0.86rem; color: var(--muted); margin-bottom: 2px; }
.lx-control output, .lx-control .lx-value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lx-control input[type="range"] { width: 100%; margin: 4px 0 2px; accent-color: var(--accent-moon); }
.lx-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lx-btn {
  font: inherit;
  font-size: 0.84rem;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.lx-btn:hover { border-color: var(--muted); }
.lx-btn[aria-pressed="true"] { background: var(--accent-moon-soft); border-color: var(--accent-moon); font-weight: 600; }
.lx-btn:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.lx-btn[hidden] { display: none; }
.lx-btn-strong { background: var(--accent-moon); border-color: var(--accent-moon); color: #fff; font-weight: 600; }
.lx-btn-strong:hover { filter: brightness(1.08); border-color: var(--accent-moon); }

.lx-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 14px; }
.lx-figs > .lx-wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .lx-figs { grid-template-columns: minmax(0, 1fr); } }
.lx-fig { margin: 0; min-width: 0; }
.lx-fig figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.lx-svg { display: block; width: 100%; border-radius: 14px; touch-action: pan-y; }
.lx-night .lx-svg { background: radial-gradient(130% 120% at 75% 15%, var(--lx-night-2) 0%, var(--lx-night) 60%, #070a1f 100%); }
.lx-chart .lx-svg { background: var(--lx-panel); }
.lx-day .lx-svg { background: var(--lx-day-sky-2); }
/* Heights: the island draws to the box it is given. */
.lx-h-orbit { height: clamp(230px, 40vw, 380px); }
.lx-h-globe { height: clamp(240px, 34vw, 320px); }
.lx-h-beam { height: clamp(220px, 30vw, 300px); }
.lx-h-chart { height: clamp(190px, 26vw, 250px); }
.lx-h-tall { height: clamp(300px, 46vw, 470px); }
.lx-h-moon { height: clamp(240px, 32vw, 320px); }
.lx-h-strip { height: 120px; }
.lx-h-scene { height: clamp(280px, 42vw, 440px); }
.lx-drag { cursor: grab; }
.lx-drag:active { cursor: grabbing; }

.lx-readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5em, 1fr)); gap: 10px 18px; margin: 4px 0 6px; }
.lx-readouts[hidden] { display: none; }
.lx-readouts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; min-width: 0; }
.lx-readouts dt { color: var(--muted); font-size: 0.8rem; }
.lx-readouts dd { margin: 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lx-verdict { margin: 4px 0 12px; padding: 10px 14px; border-left: 3px solid var(--accent-sun); background: var(--accent-sun-soft); border-radius: 0 10px 10px 0; font-size: 0.97rem; }
.lx-verdict:empty { display: none; }
.lx-sub { font-size: 1.05rem; margin: 18px 0 6px; }
.lx-result { min-height: 1.5em; margin: 8px 0 0; font-size: 1rem; font-weight: 600; }

/* The eight phases as buttons. */
.lx-phases { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 4px 0 14px; padding: 0; list-style: none; }
.lx-phases button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%; padding: 8px 2px; font: inherit; font-size: 0.74rem; line-height: 1.2; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--lx-night); color: var(--lx-ink-night); cursor: pointer;
}
.lx-phases button[aria-pressed="true"] { border-color: var(--lx-sun); box-shadow: 0 0 0 1px var(--lx-sun) inset; }
.lx-phases button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.lx-phases svg { width: 40px; height: 40px; }
@media (max-width: 640px) { .lx-phases { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- SVG parts ---- */
.lx-label { fill: var(--text); font-size: 13px; font-family: inherit; }
.lx-small { font-size: 11.5px; }
.lx-muted { fill: var(--muted); }
.lx-accent { fill: var(--lx-accent); font-weight: 600; }
.lx-night .lx-label, .lx-on-night { fill: var(--lx-ink-night); }
.lx-night .lx-muted { fill: var(--lx-muted-night); }
.lx-night .lx-accent { fill: #ffb36b; }
.lx-orbit { fill: none; stroke: #8c9bd6; stroke-width: 1.3; stroke-opacity: 0.75; }
.lx-tick { stroke: #8c9bd6; stroke-width: 1.2; }
.lx-chart .lx-tick { stroke: var(--muted); }
.lx-sun { fill: var(--lx-sun); stroke: var(--lx-sun-edge); stroke-width: 1.5; }
.lx-sun-glow { fill: var(--lx-sun); opacity: 0.22; }
.lx-apsis { fill: #ffd27a; }
.lx-axis { stroke: #ffffff; stroke-width: 2; stroke-linecap: round; }
.lx-axis-n { font-weight: 700; }
.lx-ghost { opacity: 0.38; }
.lx-earth-day { fill: var(--lx-earth-day); }
.lx-earth-night { fill: var(--lx-earth-night); stroke: #3d5491; stroke-width: 0.8; }
.lx-sunline { stroke: var(--lx-sun); stroke-opacity: 0.45; stroke-dasharray: 3 5; }
.lx-ray { stroke: var(--lx-sun); stroke-width: 1.4; stroke-opacity: 0.75; }
.lx-ray-head { fill: var(--lx-sun); }
.lx-lat { fill: none; stroke: #ffffff; stroke-opacity: 0.55; stroke-width: 1; }
.lx-lat-day { stroke: #ffcf5a; stroke-width: 3; stroke-linecap: round; }
.lx-lat-night { stroke: #7d8fd0; stroke-width: 3; stroke-linecap: round; }
.lx-hidden { stroke-dasharray: 2 4; stroke-opacity: 0.35; }
.lx-sky { fill: var(--lx-day-sky); }
.lx-day-sky { fill: var(--lx-day-sky-2); }
.lx-ground { fill: var(--lx-ground); }
.lx-horizon { fill: none; stroke: #5d7442; stroke-width: 1.5; }
.lx-compass { font-weight: 700; fill: #2f3d1f; }
.lx-zenith { fill: var(--muted); }
.lx-beam { fill: var(--lx-sun); fill-opacity: 0.28; }
.lx-footprint { stroke: var(--lx-accent); stroke-width: 4; stroke-linecap: round; }
.lx-overhead { stroke: var(--accent-moon); stroke-width: 3; stroke-dasharray: 5 4; }
.lx-shadow { stroke: #3a4a2a; stroke-opacity: 0.55; stroke-width: 6; stroke-linecap: round; }
.lx-person circle, .lx-person line { fill: #2b2f3a; stroke: #2b2f3a; stroke-width: 3; stroke-linecap: round; }
.lx-grid { fill: none; stroke: var(--lx-chart-grid); stroke-width: 1; }
.lx-day .lx-grid { stroke: #9fb8d4; stroke-opacity: 0.45; }
.lx-zero { stroke: var(--muted); stroke-width: 1; }
.lx-curve { fill: none; stroke: var(--lx-curve); stroke-width: 2.4; stroke-linejoin: round; }
.lx-curve-alt { fill: none; stroke: var(--lx-curve-alt); stroke-width: 2; stroke-dasharray: 6 5; }
.lx-part-tilt { fill: none; stroke: #2a9d8f; stroke-width: 1.8; stroke-dasharray: 6 4; }
.lx-part-orbit { fill: none; stroke: var(--lx-curve-alt); stroke-width: 1.8; stroke-dasharray: 2 4; stroke-linecap: round; }
.lx-now-line { stroke: var(--lx-accent); stroke-opacity: 0.5; stroke-width: 1.2; }
.lx-now-dot { fill: var(--lx-accent); stroke: var(--surface); stroke-width: 2; }
.lx-panel { fill: var(--surface); stroke: var(--line); }
.lx-solstice { stroke: var(--muted); stroke-dasharray: 4 4; }
.lx-analemma { fill: none; stroke: #c2560f; stroke-width: 2.2; stroke-linejoin: round; }
.lx-night .lx-analemma, .lx-chart .lx-analemma { stroke: var(--lx-accent); }
.lx-month-dot { fill: #c2560f; }
.lx-turning { fill: #ffffff; stroke: #c2560f; stroke-width: 2; }
.lx-shadow-cone { fill: #000000; fill-opacity: 0.32; }
.lx-spin { fill: none; stroke: var(--lx-muted-night); stroke-width: 1.2; }
.lx-sight { stroke: var(--lx-muted-night); stroke-dasharray: 3 4; }
.lx-near-half { fill: none; stroke: #7fe0c0; stroke-width: 2.5; stroke-linecap: round; }
.lx-handle { fill: transparent; stroke: #ffffff; stroke-opacity: 0.25; stroke-dasharray: 2 4; }
.lx-night-sky { fill: transparent; }
.lx-night-band { fill: #1e2747; }
.lx-day-band { fill: #ffe2a3; }
.lx-chart .lx-night-band { fill: #3b4670; }
.lx-moon-band { fill: var(--lx-moon-lit); stroke: #8a8270; stroke-width: 1; }
.lx-faint { fill-opacity: 0.35; }

/* The Moon. */
.lx-moon-lit { fill: var(--lx-moon-lit); }
.lx-moon-seas ellipse { fill: var(--lx-moon-sea); fill-opacity: 0.7; }
.lx-moon-dark { fill: var(--lx-moon-dark); }
.lx-moon-shine { fill: #3c4462; }
.lx-moon-rim { fill: none; stroke: #ffffff; stroke-opacity: 0.12; }

/* The illusion's night scene. */
.lx-stop-top { stop-color: #070a1f; }
.lx-stop-low { stop-color: #2a3a6e; }
.lx-star { fill: #ffffff; fill-opacity: 0.75; }
.lx-hill-far { fill: #1d2546; }
.lx-ground-night { fill: #0d1226; }
.lx-road { fill: #20253a; }
.lx-road-line { stroke: #b9b39a; stroke-width: 2; stroke-linecap: round; }
.lx-pole { stroke: #05070f; stroke-width: 2.2; stroke-linecap: round; }
.lx-tree, .lx-tree-near { fill: #05070f; }
.lx-house { fill: #070a16; }
.lx-window { fill: #f6c56a; }
.lx-truth { fill: none; stroke: #7fe0c0; stroke-width: 1.6; stroke-dasharray: 5 4; }
.lx-chart .lx-truth { stroke: #1f8f6e; }
.lx-real-sky { fill: none; stroke: var(--lx-muted-night); stroke-dasharray: 4 5; }
.lx-dome { fill: #4a5a8c; fill-opacity: 0.22; stroke: #9fb0e6; stroke-width: 1.6; }
.lx-cone { fill: #ffffff; fill-opacity: 0.12; }
.lx-observer { fill: #ffcf5a; }
.lx-ring { fill: #9fb0e6; fill-opacity: 0.85; }
.lx-chart .lx-ring { fill: #8c9bd6; }
.lx-super { fill: none; stroke: #ffcf5a; stroke-width: 1.4; stroke-dasharray: 2 4; }

/* ---- Source tips: details/summary, so they work without JavaScript ---- */
.lx-cite { position: relative; display: inline-block; vertical-align: middle; margin-left: 2px; }
.lx-cite summary {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font: italic 600 11px/1 Georgia, serif;
  cursor: pointer;
  list-style: none;
  opacity: 0.75;
}
.lx-cite summary::-webkit-details-marker { display: none; }
.lx-cite[open] summary, .lx-cite summary:hover { opacity: 1; color: var(--accent-moon); border-color: var(--accent-moon); }
.lx-cite summary:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.lx-cite-body {
  position: absolute;
  z-index: 20;
  left: -8px;
  top: 24px;
  width: min(340px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.14);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.45;
}
.lx-cite-body a { color: var(--accent-moon); }
@media (max-width: 640px) {
  .lx-cite { position: static; }
  .lx-cite-body { left: 12px; right: 12px; width: auto; top: auto; margin-top: 6px; }
}

/* ---- The articles ---- */
.lx-articles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px 26px; }
.lx-articles article p, .lx-articles article .lx-p { line-height: 1.55; }
.lx-mixups { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.lx-mixups li { padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); line-height: 1.5; }
.lx-mixups strong { display: block; margin-bottom: 2px; }
.lx-myth::before { content: "\2717  "; color: #b3261e; font-weight: 700; }

/* ---- For teachers ---- */
.lx-teach { border-top: 4px solid var(--accent-moon); }
.lx-teach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px 26px; }
.lx-teach ol, .lx-teach ul { margin: 6px 0 0; padding-left: 1.25em; line-height: 1.5; }
.lx-teach li + li { margin-top: 4px; }
.lx-standards { margin-top: 14px; font-size: 0.92rem; color: var(--muted); }
.lx-print { margin-top: 12px; }

/* ---- Check yourself ---- */
.lx-quiz { display: grid; gap: 8px; }
.lx-q { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.lx-q summary { padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 10px; }
.lx-q summary::-webkit-details-marker { display: none; }
.lx-q summary::before { content: "Q"; color: var(--accent-moon); font-weight: 700; }
.lx-q[open] summary { border-bottom: 1px solid var(--line); }
.lx-q summary:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; border-radius: 12px; }
.lx-q > div { padding: 10px 14px 12px; line-height: 1.5; }

/* ---- Keep exploring and the method ---- */
.lx-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; padding: 0; margin: 8px 0 0; list-style: none; }
.lx-more a { display: block; height: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; background: var(--bg); }
.lx-more a:hover { border-color: var(--accent-moon); }
.lx-more span { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.lx-method { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.lx-refs { margin-top: 14px; }
.lx-sources { padding-left: 1.4em; line-height: 1.5; }
.lx-sources li + li { margin-top: 6px; }

/* ---- Print: the text, the figures as they stand, no controls ---- */
@media print {
  .site-header, .site-footer, .lx-tabs, .lx-chips, .lx-controls, .lx-buttons, .lx-print, .lx-phases, .lx-cite, .consent { display: none !important; }
  .lx-card { box-shadow: none; break-inside: avoid; border-color: #bbb; }
  .lx-q { break-inside: avoid; }
  .lx-q > div { display: block; }
  .lx-night .lx-svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
