:root {
  color-scheme: light;
  --navy: #0b1f44;
  --blue: #034bb7;
  --ink: #152746;
  --muted: #4c5b73;
  --line: #d9e2ef;
  --paper: #f4f7fc;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { background: var(--navy); color: white; border-bottom: 3px solid var(--blue); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; font-weight: 700; }
.masthead a { display: flex; padding-block: 8px; }
.masthead img { width: 124px; height: auto; display: block; }
main { min-height: 70vh; padding-block: 30px 50px; }
main:focus { outline: none; }
footer { padding-block: 20px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
a { color: var(--blue); }
a:focus-visible, summary:focus-visible { outline: 3px solid #4384db; outline-offset: 4px; }
.skip { position: absolute; inset: 6px auto auto 10px; z-index: 2; padding: 8px; background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); letter-spacing: -.025em; }
.hero {
  display: grid; grid-template-columns: 1fr .75fr; overflow: hidden; isolation: isolate;
  color: white; background: linear-gradient(115deg, #0b1f44 28%, #123d80 100%);
  border-radius: 22px; min-height: 342px;
}
.hero-copy { padding: clamp(26px, 5vw, 62px); align-self: center; }
.label { font-size: .88rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; color: var(--blue); }
.hero .label { color: #c7deff; }
.hero h1 { font-size: clamp(3.4rem, 8vw, 6.25rem); letter-spacing: -.068em; line-height: .9; margin-block: 16px 20px; }
.hero h1 span { color: #88bbff; }
.hero-copy > p:last-child { color: #deebff; max-width: 29ch; font-size: 1.08rem; }
.hero-art {
  display: grid; place-items: center; position: relative;
  background-image: linear-gradient(#91bbfb22 1px, transparent 1px), linear-gradient(90deg, #91bbfb22 1px, transparent 1px);
  background-size: 29px 29px;
  mask-image: linear-gradient(to right, transparent, black 19%);
}
.code-window {
  width: min(74%, 315px); aspect-ratio: 1.5; position: relative;
  transform: rotate(-8deg); border: 1px solid #769ee5; border-radius: 15px;
  background: #0b2552; box-shadow: 18px 18px 0 #4a85dc36;
}
.window-bar { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid #5279b4; }
.window-bar i { width: 7px; height: 7px; border-radius: 50%; background: #8ab9ff; }
.code-lines { display: grid; gap: 10px; width: 52%; padding: 16px 12px; }
.code-lines i { height: 5px; border-radius: 5px; background: #629df3; }
.code-lines i:nth-child(even) { width: 67%; background: #a8c9ff; margin-left: 15%; }
.code-window > span { position: absolute; bottom: 6%; right: 8%; color: #afd0ff; font: bold clamp(1.5rem, 4vw, 3.7rem) monospace; }
.chooser { margin-top: 32px; }
.grade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.grade-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 23px; border: 1px solid var(--line); border-top: 4px solid var(--blue); background: white; border-radius: 13px; }
.grade-7 { border-top-color: #2f72c9; }
.grade-8 { border-top-color: var(--navy); }
.grade-card h3 { font-size: 1.35rem; }
.grade-card p:not(.label) { color: var(--muted); flex: 1; }
.button { background: var(--blue); color: white; text-decoration: none; padding: 9px 14px; border-radius: 8px; font-weight: 700; margin-top: 5px; }
.button:hover { background: var(--navy); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 5px 10px; padding: 0; margin: 0 0 22px; list-style: none; font-size: .94rem; }
.crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--muted); }
.page-heading { background: #e5efff; padding: clamp(22px, 5vw, 48px); border-radius: 18px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.045em; margin-top: 7px; }
.intro { color: #344967; font-size: 1.12rem; margin-top: 10px; max-width: 68ch; }
.rows { display: grid; gap: 10px; list-style: none; padding: 0; margin: 14px 0 0; }
.rows a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 14px 18px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.rows a:hover { border-color: var(--blue); background: #edf4ff; }
.rows strong { font-size: 1.07rem; }
.rows .meta { margin-left: auto; }
.meta { color: var(--muted); font-size: .92rem; }
.lesson-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 15px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 20px; }
.panel + .panel { margin-top: 12px; }
.panel h2 { font-size: 1.2rem; margin-bottom: 12px; }
.steps, .finish { padding-left: 22px; margin: 0; }
.steps li + li, .finish li + li { margin-top: 10px; }
details { margin-top: 12px; }
summary { color: var(--blue); font-weight: 700; cursor: pointer; }
details p { margin-top: 5px; }
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr .55fr; min-height: 280px; }
  .grade-grid, .lesson-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .wrap { width: calc(100% - 28px); }
  .masthead img { width: 100px; }
  .masthead { min-height: 64px; }
  .hero { display: block; min-height: 0; }
  .hero-art { display: none; }
  .hero h1 { font-size: clamp(2.75rem, 13vw, 3.65rem); }
  .rows .meta { margin-left: 0; }
}
