/* Energy Sources Lab. Static, CSP-safe (style-src 'self'). */
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url("assets/fonts/fraunces-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("assets/fonts/inter-latin-400.woff2?v=8909904ab6") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("assets/fonts/inter-latin-600.woff2?v=f9a06e79cd") format("woff2"); }

:root {
  --paper: #F7F3EA;
  --ink: #16241E;
  --brick: #A8412A;
  --panel: #0C1424;
  --panel-2: #111C2F;
  --copper: #D7B08B;
  --line: rgba(22, 36, 30, 0.14);
  --panel-line: rgba(215, 176, 139, 0.45);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", "Iowan Old Style", Palatino, serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.5; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 20; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; padding: 22px 28px 8px; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.05; }
.model-note { max-width: 42rem; color: var(--ink); font-size: 1rem; }
.eyebrow { margin: 0 0 6px; color: var(--brick); font-weight: 600; font-size: 0.86rem; letter-spacing: 0.08em; text-transform: uppercase; }

main { padding: 8px 28px 28px; }
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.pill { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 44px; font-weight: 600; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 16px; align-items: start; }
.stage { background: var(--panel); color: var(--paper); border-radius: 22px; padding: 16px; border: 1px solid var(--panel-2); min-height: 420px; }
.stage svg { width: 100%; height: auto; display: block; }
.stage text { font-family: var(--font); }
.side { background: #fffdf8; border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 18px; display: grid; gap: 12px; }
.side h2 { font-size: 1.7rem; }
.side h3 { font-size: 1.25rem; }
.copper { color: var(--copper); }
.side .copper { color: var(--brick); }
.part { cursor: pointer; }
.part:focus-visible { outline: 3px solid var(--copper); }
.part.is-on { filter: drop-shadow(0 0 6px rgba(215, 176, 139, 0.85)); }
.choices, .steps, .tools { display: flex; flex-wrap: wrap; gap: 8px; }
.choice, .step, .tool { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; min-height: 44px; padding: 8px 14px; font-weight: 600; }
.choice[aria-pressed="true"], .step[aria-pressed="true"], .tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.status { min-height: 3.2em; }
.status.ok { color: #1d4a32; font-weight: 600; }
.status.try { color: var(--brick); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend button { background: var(--panel-2); color: var(--paper); border: 1px solid var(--panel-line); border-radius: 999px; min-height: 44px; padding: 8px 12px; font-weight: 600; }
.legend button[aria-pressed="true"] { background: var(--copper); color: var(--ink); border-color: var(--copper); }
.check { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.check legend { font-weight: 600; padding: 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 28px 22px; color: var(--ink); }
.foot p { max-width: 46rem; font-size: 0.95rem; }
dialog { border: 0; border-radius: 18px; padding: 0; background: var(--paper); color: var(--ink); max-width: min(640px, 94vw); }
dialog::backdrop { background: rgba(12, 20, 36, 0.72); }
.dialog-card { padding: 18px 18px 22px; display: grid; gap: 10px; }
.dialog-card h2 { font-size: 1.8rem; }
.dialog-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.dialog-card a { color: var(--brick); }
.counts { display: flex; gap: 16px; flex-wrap: wrap; }
.counts strong { font-family: var(--display); font-size: 1.6rem; }
.zoom-caption { color: var(--copper); font-weight: 600; }
@media (max-width: 800px) {
  .top, main, .foot { padding-left: 16px; padding-right: 16px; }
  .workspace { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}
@media (max-width: 600px) {
  .top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .model-note { max-width: none; }
  .stage { padding: 10px; }
  .stage svg text { font-size: 28px; }
}

.diagram-caption { display: none; }
@media (max-width: 600px) {
  .stage { min-height: 0; padding: 12px; }
  .stage svg { margin: 0 auto; }
  .stage .energy-diagram text { font-size: 19px; }
  .diagram-caption { display: block; margin: 10px 2px 0; color: var(--paper); font-size: 1rem; line-height: 1.45; font-weight: 600; }
}

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

.big-card { font-size: 2rem; padding: 48px 12px; }
input[type="range"] { width: 100%; height: 44px; accent-color: #A8412A; }
