/* Unit Plans. Design idea: a teacher's desk. Pages are white paper on a cool grid-paper desk,
   units are duo-tang folders whose spine colour is the subject, and the one bold moment is
   the hero stack of real pages from a unit. Type: Zilla Slab (textbook headings) + Lexend
   (built for reading ease). */
:root {
  --desk: #e8eef3;
  --grid: #d9e2ea;
  --paper: #ffffff;
  --ink: #14213d;
  --muted: #4a5872;
  --line: #c9d4de;
  --math: #2b6cb0;
  --language: #c53030;
  --science: #2f855a;
  --sticky: #ffe066;
  --focus: #f6ad55;
  --head: 'Zilla Slab', Georgia, serif;
  --body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --paper-shadow: 0 1px 1px rgba(20, 33, 61, 0.08), 0 6px 18px -8px rgba(20, 33, 61, 0.25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.6 var(--body);
  background-color: var(--desk);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(36px, 5.2vw, 58px); }
h2 { font-size: clamp(27px, 3.2vw, 36px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; margin-top: 1.2em; }
p { margin: 0 0 1em; }
a { color: var(--math); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [role=tab]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.lede { font-size: 19px; color: var(--muted); max-width: 62ch; }
.small { font-size: 14.5px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* header + footer */
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 23px var(--head); }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; }
.top nav a:hover { color: var(--math); }
.foot { background: var(--ink); color: #dfe6ee; padding: 44px 0 28px; margin-top: 64px; }
.foot a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.brand-foot { display: flex; align-items: center; gap: 10px; font: 700 21px var(--head); color: #fff; }
.fine { font-size: 13.5px; color: #a9b6c6; margin-top: 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 6px; border: 2px solid var(--ink); background: var(--ink); color: #fff; font: 600 16.5px var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: #22325a; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.ghost:hover { background: #f3f6f9; }
.btn.wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.text-link { font-weight: 600; }

/* hero: the stack of real pages */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { max-width: 14ch; }
.stack { position: relative; height: 470px; }
.mini { position: absolute; width: 300px; min-height: 380px; padding: 22px 22px 18px; background: var(--paper); box-shadow: var(--paper-shadow); font-size: 11.5px; line-height: 1.45; color: var(--ink); border-radius: 2px; overflow: hidden; }
.mini b { display: block; font: 700 15px var(--head); color: var(--math); border-bottom: 2px solid var(--math); padding-bottom: 4px; margin-bottom: 10px; }
.mini i { display: block; font-style: normal; font-weight: 600; margin-top: 8px; }
.mini p { margin: 2px 0; }
.mini ol { margin: 0; padding-left: 18px; }
.mini li { margin-bottom: 7px; }
.mini-cal { left: 0; top: 30px; transform: rotate(-5deg); }
.mini-cal ol { list-style: none; padding: 0; }
.mini-cal li { display: flex; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.mini-cal span { font-weight: 600; min-width: 18px; color: var(--muted); }
.mini-lesson { left: 120px; top: 0; transform: rotate(2deg); }
.mini-sheet { left: 230px; top: 64px; transform: rotate(6deg); }
.mini .blank { display: block; height: 18px; border-bottom: 1px dashed var(--line); }
.sticky { position: absolute; right: 8px; bottom: 6px; background: var(--sticky); padding: 16px 18px; font: 700 18px/1.2 var(--head); width: 140px; transform: rotate(-4deg); box-shadow: 0 6px 14px -8px rgba(20, 33, 61, 0.45); }
@media (prefers-reduced-motion: no-preference) {
  .stack .mini, .stack .sticky { animation: deal 0.7s cubic-bezier(.2, .7, .2, 1) both; }
  .stack .mini-lesson { animation-delay: 0.12s; }
  .stack .mini-sheet { animation-delay: 0.24s; }
  .stack .sticky { animation-delay: 0.5s; }
  @keyframes deal { from { opacity: 0; translate: 0 24px; } }
}

/* bands */
.band { padding: 56px 0; }
.band > .wrap { background: var(--paper); box-shadow: var(--paper-shadow); padding-top: 44px; padding-bottom: 40px; border-radius: 3px; }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
.contents { list-style: none; counter-reset: c; margin: 0; padding: 0; }
.contents li { counter-increment: c; display: grid; grid-template-columns: 34px 1fr; padding: 11px 0; border-bottom: 1px solid var(--line); }
.contents li::before { content: counter(c); font: 700 18px var(--head); color: var(--math); grid-row: span 2; }
.c-title { font-weight: 600; }
.c-desc { color: var(--muted); font-size: 15.5px; }
.reasons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 40px; }
.reasons h3 { font-size: 21px; margin-top: 10px; }
.licences { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 20px; margin: 20px 0 12px; }
.licence { border: 2px solid var(--ink); border-radius: 4px; padding: 22px; }
.licence h3 { margin-bottom: 4px; }
.amount { font: 700 38px var(--head); margin: 0 0 6px; }
.amount span { font: 400 15px var(--body); color: var(--muted); }
.fine-note { color: var(--muted); font-size: 15px; }

/* unit cards: duo-tang folders, spine = subject colour */
.unit-grid { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.unit-card a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 18px 16px 30px; background: var(--paper); border: 1px solid var(--line); border-left: 12px solid var(--tab); border-radius: 3px 8px 8px 3px; color: var(--ink); text-decoration: none; }
.unit-card a:hover { border-color: var(--tab); }
.unit-card strong { font: 700 24px/1.15 var(--head); }
.card-grade { font-size: 14.5px; color: var(--muted); }
.card-meta { font-size: 14.5px; color: var(--muted); }
.card-price { margin-top: auto; padding-top: 10px; font-weight: 600; color: var(--tab); }
.unit-card.planned a { background: transparent; border-style: dashed; border-left-style: solid; border-left-color: var(--line); }
.unit-card.planned .card-price { color: var(--muted); }

/* inner pages */
.page { padding-top: 26px; }
.page > section, .band-inline { background: var(--paper); box-shadow: var(--paper-shadow); padding: 30px 32px; margin: 26px 0; border-radius: 3px; }
.crumbs { font-size: 14.5px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.unit-head { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 3px 10px; font-size: 14px; }
.buy { background: var(--paper); box-shadow: var(--paper-shadow); padding: 24px; border-top: 6px solid var(--math); border-radius: 3px; position: sticky; top: 16px; }
.buy fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.buy legend { font-weight: 600; margin-bottom: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 6px; margin-bottom: 8px; cursor: pointer; font-size: 15.5px; }
.opt:has(input:checked) { border-color: var(--math); background: #eef4fb; }
.opt input, .check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--math); flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-bottom: 12px; }
.field input { font: 16px var(--body); padding: 12px; border: 1.5px solid #9aa9b9; border-radius: 6px; }
.check { display: flex; gap: 10px; font-size: 14.5px; margin-bottom: 14px; }
.notice { background: #fff8d6; border-left: 4px solid #d69e2e; padding: 10px 14px; font-size: 15px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; }
.tabs [role=tab] { font: 600 15px var(--body); padding: 10px 16px; border: 1px solid var(--line); border-bottom: 0; background: var(--desk); color: var(--muted); border-radius: 6px 6px 0 0; cursor: pointer; }
.tabs [role=tab][aria-selected=true] { background: var(--paper); color: var(--ink); box-shadow: inset 0 3px 0 var(--math); }
.sheet { border: 1px solid var(--line); padding: 26px; background: var(--paper); }
.sheet h3 { color: var(--math); border-bottom: 2px solid var(--math); padding-bottom: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
thead th { background: #eef4fb; }
.table-scroll { overflow-x: auto; }
.rubric { min-width: 640px; }
.qs li { margin-bottom: 14px; }
.dia svg { max-width: 100%; height: auto; }
.lesson-list { padding-left: 24px; }
.lesson-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lesson-list b, .lesson-list span { display: block; }
.lesson-list span { color: var(--muted); font-size: 15.5px; }
.lesson-list .codes { font-size: 14px; }
.exp { display: grid; grid-template-columns: 64px 1fr; gap: 8px 14px; margin: 0; }
.exp dt { font-weight: 600; color: var(--math); }
.exp dd { margin: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17.5px; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.downloads { list-style: none; padding: 0; display: grid; gap: 10px; margin: 20px 0 28px; }
.dl { display: block; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--math); border-radius: 3px; font-weight: 600; text-decoration: none; color: var(--ink); }
.dl:hover { border-color: var(--math); }
.prose h2 { font-size: 24px; margin-top: 1.4em; }

@media (max-width: 900px) {
  .hero-grid, .two-col, .unit-head { grid-template-columns: 1fr; }
  .stack { height: 430px; max-width: 520px; }
  .buy { position: static; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 36px; }
  .hero { overflow-x: clip; }
  .stack { height: 330px; transform: scale(0.62); transform-origin: top left; }
  .reasons, .licences { grid-template-columns: 1fr; }
  .band > .wrap, .page > section, .band-inline { padding-left: 18px; padding-right: 18px; }
  .top nav { gap: 14px; }
  .hide-sm { display: none; }
  .sheet { padding: 16px; }
}
