:root {
  color-scheme: light;
  --ink: #122a42;
  --navy: #102c46;
  --navy-dark: #0c2237;
  --gold: #f0dfb6;
  --bronze: #815b1e;
  --paper: #f5f3ee;
  --line: #dfded7;
  --quiet: #46596a;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #aa631b; outline-offset: 3px; }
.skip { position: absolute; top: .7rem; left: 1rem; z-index: 3; background: white; padding: .5rem; transform: translateY(-200%); }
.skip:focus { transform: none; }
.app { min-height: 100dvh; display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; padding: 1.7rem 1.25rem; display: flex; flex-direction: column; gap: 1.7rem; overflow: auto; color: var(--gold); background: var(--navy-dark); }
.brand { display: block; width: min(100%, 12rem); }
.brand img { display: block; width: 100%; height: auto; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a, .sidebar .website { display: block; padding: .6rem .7rem; border-radius: .45rem; text-decoration: none; }
.sidebar a:hover { background: #ffffff19; }
.sidebar .website { margin-top: auto; border: 1px solid #d5bd8c55; }
main { width: min(100%, 82rem); padding: clamp(1.05rem, 3.2vw, 3.4rem); margin-inline: auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 23rem); align-items: center; gap: clamp(1rem, 3.3vw, 3rem); color: white; background: var(--navy); border-radius: 1.05rem; padding: clamp(1.1rem, 3.3vw, 2.4rem); }
.hero h1 { font-size: clamp(2rem, 4vw, 3.7rem); max-width: 13ch; letter-spacing: -.04em; }
.hero > div > p:last-child { color: #eaedf0; margin-top: 1rem; max-width: 34ch; }
.eyebrow { color: var(--gold); font-weight: 720; font-size: .79rem; text-transform: uppercase; letter-spacing: .13em; margin-bottom: .65rem; }
.access { background: white; color: var(--ink); border-radius: .8rem; padding: clamp(1rem, 2.4vw, 1.4rem); min-width: 0; }
.access h2 { font-size: 1.25rem; }
.access p { margin-top: .6rem; }
.access form { display: grid; gap: .6rem; margin-top: .8rem; }
.access label { font-weight: 650; }
.access input, textarea { min-width: 0; width: 100%; padding: .54rem .64rem; border: 1px solid #8e9ba8; border-radius: .45rem; color: var(--ink); background: white; }
#challenge { min-width: 0; max-width: 100%; overflow: auto; }
#clock { font: 750 1.8rem/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
#logout { margin-top: .7rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; border: 1px solid transparent; border-radius: .48rem; padding: .43rem .75rem; font-weight: 680; text-align: center; }
.primary { color: white; background: #1b405e; }
.secondary { background: white; color: var(--navy); border-color: #9cabb8; }
.button:enabled:hover { box-shadow: inset 0 0 0 1px currentColor; }
.button:disabled { background: #ebedf0; color: #526170; border-color: #d7dce0; }
.small { font-size: .86rem; color: var(--quiet); }
.section-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: start; margin: 2rem 0 1rem; }
.section-heading h2 { font-size: clamp(1.48rem, 3vw, 2.12rem); letter-spacing: -.025em; }
.section-heading p { color: var(--quiet); margin-top: .35rem; }
.legend { flex: 0 0 auto; padding: .45rem .65rem; background: #e9e5db; border-radius: .55rem; font-size: .86rem; }
.catalog { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.module { min-width: 0; padding: 1.15rem; border: 1px solid var(--line); background: white; border-radius: .75rem; }
.module h3 { font-size: 1.18rem; margin-bottom: .82rem; }
.resource { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; }
.resource strong, .resource small { display: block; }
.resource small { color: var(--quiet); }
.locked { color: var(--quiet); display: flex; flex-wrap: wrap; align-items: baseline; gap: .38rem; font-size: .9rem; margin-top: .8rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.locked .small { margin-left: auto; }
.tool-list { display: flex; gap: .55rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
dialog { width: min(calc(100vw - 1.3rem), 50rem); max-height: 91dvh; border: 1px solid #b5c2cc; border-radius: .8rem; padding: clamp(.85rem, 3.3vw, 1.6rem); color: var(--ink); }
dialog::backdrop { background: #041527be; }
.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.dialog-top h2 { margin-top: .28rem; font-size: clamp(1.24rem, 4vw, 1.8rem); margin-right: auto; }
.activity { padding: .8rem; margin-block: .7rem; border: 1px solid var(--line); border-radius: .55rem; }
.activity p { margin: .55rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity summary { font-weight: 675; }
.rich-study table { border-collapse: collapse; width: 100%; margin-top: .65rem; }
.rich-study td { padding: .45rem; border: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.demo-figure { display: block; max-width: 100%; height: auto; margin: .75rem auto 0; }
.pendulum-diagram { display: block; width: min(100%, 30rem); height: auto; margin: .55rem auto 0; background: #f7f3e8; border-radius: .45rem; }
.energies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .65rem; margin-block: .8rem; }
.energy-readout { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: .15rem .5rem; }
.energy-readout label { font-weight: 650; }
.energy-readout meter { width: 100%; grid-column: 1 / -1; accent-color: #1b405e; }
.energy-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.board { width: 100%; height: auto; background: white; border: 1px solid #8e9ba8; border-radius: .45rem; display: block; touch-action: none; margin: .7rem 0; }
.notes { margin-top: .7rem; }
.notes label { display: block; margin-bottom: .2rem; }
.plain { margin: 1rem; }
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: none; }
}
@media (max-width: 730px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; padding: .75rem 1rem; gap: .55rem; }
  .brand { width: 9rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .sidebar nav a, .sidebar .website { padding: .35rem .5rem; font-size: .88rem; min-height: 2rem; align-content: center; }
  .sidebar .website { align-self: start; }
  .section-heading { align-items: start; flex-direction: column; gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
