/*
 * Painless Programming design system (see .claude/skills/painless-design/SKILL.md).
 * Bold colour per subject, sections that bleed into each other, motion that
 * teaches. Tokens, the site header and footer (every page), and redesigned
 * templates. Old-design pages still load site.css underneath until they are
 * converted, so header and footer set their own fonts and sizes.
 */

@font-face {
    font-family: 'Archivo';
    src: url('/fonts/Archivo-var.woff2') format('woff2');
    font-weight: 500 900;
    font-stretch: 100% 125%;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/fonts/IBMPlexSans-var.woff2') format('woff2');
    font-weight: 100 700;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Mono';
    src: url('/fonts/IBMPlexMono-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Mono';
    src: url('/fonts/IBMPlexMono-500.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

:root {
    /* Brand */
    --navy: #0b2340;
    --blue: #2f7fd8;
    --blue-ink: #1d63b8;
    --amber: #ffb020;
    --teal: #12a29b;
    --coral: #ff6b57;
    /* Soft bands */
    --sky: #e6f1fd;
    --butter: #fff3d6;
    --mint: #dff5f3;
    --blush: #ffe9e5;
    /* Neutrals */
    --white: #ffffff;
    --ink: #0f1d2e;
    --muted: #4d5d70;
    --line: #d6dfe9;
    /* Subjects */
    --subject-exam: var(--blue);
    --subject-python: var(--amber);
    --subject-cpp: var(--teal);
    --subject-ai: var(--coral);
    --subject-misc: var(--navy);
    /* Type */
    --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
    --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
    /* Shape */
    --radius: 12px;
    --radius-lg: 18px;
    --hard: 5px 5px 0 var(--navy);
    --page: 1180px;
    --gutter: 24px;
    --ease-pop: cubic-bezier(.3, 1.6, .5, 1);
}

/* Base for redesigned pages ------------------------------------------------ */

body.is-redesigned {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font: 400 17px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
:where(.is-redesigned) *, :where(.is-redesigned) *::before, :where(.is-redesigned) *::after { box-sizing: border-box; }
:where(.is-redesigned:not(.is-legacy)) :where(h1, h2, h3, h4) { margin: 0; color: var(--navy); font-family: var(--display); font-stretch: 112%; font-weight: 800; line-height: 1.08; text-wrap: balance; }
:where(.is-redesigned:not(.is-legacy)) p { margin: 0; }
:where(.is-redesigned:not(.is-legacy)) a { color: var(--blue-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:where(.is-redesigned:not(.is-legacy)) a:hover { color: var(--navy); }
:where(.is-redesigned) img { max-width: 100%; height: auto; }

:where(.site-header, .site-footer, .is-redesigned) :focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 4px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    padding: 10px 16px; background: var(--navy); color: #fff;
    font: 600 15px/1.4 var(--font); border-radius: var(--radius); text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.page-width {
    max-width: var(--page);
    margin: 0 auto;
    padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Buttons: chunky, with a solid shadow that collapses when pressed. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 24px;
    border: 2px solid var(--navy); border-radius: var(--radius);
    background: var(--white); color: var(--navy);
    font: 700 17px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
    box-shadow: var(--hard);
    transition: transform .12s ease-out, box-shadow .12s ease-out, background-color .15s ease-out;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--navy); color: var(--navy); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--navy); }
.btn--amber { background: var(--amber); }
.btn--navy { background: var(--navy); color: #fff; box-shadow: 5px 5px 0 var(--white); }
.btn--navy:hover { color: #fff; box-shadow: 6px 6px 0 var(--white); }
.btn--navy:active { box-shadow: 1px 1px 0 var(--white); }

/* Subject tags: a coloured square and a word. */
.subject-tag {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    color: var(--muted); font: 600 13px/1.3 var(--font); white-space: nowrap;
}
.subject-tag::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--subject-misc); }
.subject-tag--exam::before { background: var(--subject-exam); }
.subject-tag--python::before { background: var(--subject-python); }
.subject-tag--cpp::before { background: var(--subject-cpp); }
.subject-tag--ai::before { background: var(--subject-ai); }

/* Header ------------------------------------------------------------------- */

.site-header {
    position: relative; z-index: 50;
    background: var(--white);
    border-bottom: 2px solid var(--navy);
    font: 400 15px/1.4 var(--font);
    color: var(--ink);
}
.site-header *, .site-header *::before, .site-header *::after { box-sizing: border-box; }
.site-header__inner {
    display: flex; align-items: center; gap: 24px;
    max-width: var(--page); min-height: 76px; margin: 0 auto;
    padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
}
.site-header__logo { display: block; flex: none; line-height: 0; transition: transform .2s var(--ease-pop); }
.site-header__logo:hover { transform: rotate(-4deg) scale(1.04); }
.site-header__logo img { display: block; width: 79px; height: 52px; }

.site-nav { display: flex; align-items: center; flex: 1; gap: 14px; }
.site-nav__list { display: flex; align-items: center; gap: 2px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.site-nav__item { position: relative; margin: 0; }
.site-nav__link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 12px; border: 0; border-radius: 10px; background: none;
    color: var(--navy); font: 600 15px/1.4 var(--font); text-decoration: none; cursor: pointer;
    transition: background-color .15s ease-out;
}
.site-nav__link:hover { background: var(--sky); color: var(--navy); }
.site-nav__link[aria-current="page"], .site-nav__link.is-current { background: var(--butter); box-shadow: inset 0 -3px 0 var(--amber); }
.site-nav__chevron { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s var(--ease-pop); }
[data-submenu-toggle][aria-expanded="true"] .site-nav__chevron { transform: rotate(180deg); }

.site-nav__menu {
    display: none;
    position: absolute; top: calc(100% + 10px); left: 0;
    width: 310px; padding: 8px;
    background: var(--white); border: 2px solid var(--navy); border-radius: var(--radius);
    box-shadow: var(--hard);
}
[data-submenu-toggle][aria-expanded="true"] + .site-nav__menu { display: block; animation: menu-in .16s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.site-nav__menu ul { margin: 0; padding: 0; list-style: none; }
.site-nav__menu-link {
    display: block; padding: 10px 12px 10px 14px; border-radius: 8px;
    border-left: 4px solid transparent;
    color: var(--ink); text-decoration: none;
    transition: background-color .15s ease-out, border-color .15s ease-out;
}
.site-nav__menu-link:hover { background: var(--sky); border-left-color: var(--blue); color: var(--ink); }
.site-nav__menu-link[aria-current="page"] { border-left-color: var(--amber); }
.site-nav__menu-label { display: block; font-weight: 600; color: var(--navy); }
.site-nav__menu-desc { display: block; margin-top: 1px; color: var(--muted); font-size: 13.5px; }
.site-nav__menu-all {
    display: block; margin: 6px -8px -8px; padding: 12px 22px;
    border-top: 2px solid var(--navy); border-radius: 0 0 10px 10px;
    background: var(--sky); color: var(--navy); font-weight: 700; text-decoration: none;
}
.site-nav__menu-all:hover { background: var(--butter); color: var(--navy); }

.site-search { position: relative; flex: none; margin: 0; }
.site-search__icon {
    position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
    fill: none; stroke: var(--navy); stroke-width: 1.8; pointer-events: none;
}
.site-search__input {
    width: 190px; height: 42px; padding: 0 12px 0 36px;
    border: 2px solid var(--navy); border-radius: 10px; background: var(--white);
    color: var(--ink); font: 400 15px/1 var(--font);
    transition: width .2s ease-out, box-shadow .15s ease-out;
}
.site-search__input::placeholder { color: var(--muted); }
.site-search__input:focus { outline: none; width: 230px; box-shadow: 3px 3px 0 var(--amber); }

.site-header__menu-button {
    display: none; align-items: center; gap: 10px;
    margin-left: auto; padding: 10px 16px;
    border: 2px solid var(--navy); border-radius: 10px; background: var(--amber);
    color: var(--navy); font: 700 15px/1 var(--font); cursor: pointer;
    box-shadow: 3px 3px 0 var(--navy);
}
.site-header__menu-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.site-header__menu-icon, .site-header__menu-icon::before, .site-header__menu-icon::after {
    display: block; width: 16px; height: 2px; background: currentColor; position: relative; border-radius: 1px;
}
.site-header__menu-icon::before, .site-header__menu-icon::after { content: ''; position: absolute; left: 0; }
.site-header__menu-icon::before { top: -5px; }
.site-header__menu-icon::after { top: 5px; }

@media (max-width: 1099px) {
    .site-header__inner { flex-wrap: wrap; min-height: 68px; gap: 0 16px; }
    .site-header__logo img { width: 64px; height: 42px; }
    .site-header__menu-button { display: inline-flex; }
    .site-nav {
        display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0;
        margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter) 20px;
        border-top: 2px solid var(--navy);
    }
    .nav-open .site-nav { display: flex; }
    .site-search { order: -1; margin: 10px 0 12px; }
    .site-search__input, .site-search__input:focus { width: 100%; height: 48px; font-size: 16px; }
    .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
    .site-nav__item { border-bottom: 1px solid var(--line); }
    .site-nav__link { width: 100%; justify-content: space-between; padding: 14px 4px; font-size: 17px; border-radius: 0; }
    .site-nav__link:hover, .site-nav__link[aria-current="page"], .site-nav__link.is-current { background: none; box-shadow: none; color: var(--blue-ink); }
    .site-nav__menu { display: block; position: static; width: auto; padding: 0 0 12px; border: 0; box-shadow: none; animation: none; }
    .site-nav__item--menu .site-nav__link { pointer-events: none; color: var(--muted); font-size: 14px; padding-bottom: 6px; }
    .site-nav__chevron { display: none; }
    .site-nav__menu-all { margin: 6px 0 0; border: 2px solid var(--navy); border-radius: 10px; }
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
    position: relative;
    margin-top: 72px;
    background: var(--navy);
    color: #c3d2e5;
    font: 400 15px/1.6 var(--font);
}
.site-footer *, .site-footer *::before, .site-footer *::after { box-sizing: border-box; }
.site-footer__wave { position: absolute; left: 0; top: -69px; display: block; width: 100%; height: 70px; }
.site-footer__wave path { fill: var(--navy); }
.site-footer__inner {
    display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 40px;
    max-width: var(--page); margin: 0 auto;
    padding: 36px max(var(--gutter), env(safe-area-inset-right, 0px)) 40px max(var(--gutter), env(safe-area-inset-left, 0px));
}
/* Dark-background version of the logo (public/images/logo-on-dark.png): sits straight on the navy. */
.site-footer__logo { display: inline-block; margin-bottom: 16px; line-height: 0; }
.site-footer__logo img { width: 91px; height: 60px; }
.site-footer__about p { max-width: 34ch; margin: 0; }
.site-footer__heading { margin: 0 0 12px; color: var(--white); font: 800 16px/1.3 var(--display); font-stretch: 112%; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0 0 8px; }
.site-footer a { color: #c3d2e5; text-decoration: none; transition: color .15s ease-out; }
.site-footer a:hover { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__base {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    width: min(100% - 2 * var(--gutter), var(--page) - 2 * var(--gutter)); margin: 0 auto; padding: 20px 0 28px;
    border-top: 1px solid rgb(255 255 255 / .15); font-size: 14px;
}
.site-footer__base p { margin: 0; }
.site-footer__social { display: flex; gap: 20px; }
.site-footer__social li { margin: 0; }

@media (max-width: 960px) {
    .site-footer__inner { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
    .site-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .site-footer__inner { grid-template-columns: 1fr; }
    .site-footer__wave { height: 40px; top: -39px; }
}

/* Home: bands -------------------------------------------------------------- */

.band { position: relative; padding-block: 72px; }
.band--sky { background: var(--sky); }
.band--white { background: var(--white); }
.band--amber { background: var(--amber); }
.band__title { font-size: clamp(30px, 3.6vw, 44px); }
.band__sub { max-width: 62ch; margin-top: 10px; color: var(--muted); font-size: 18px; }

/* Hero */
.hero { position: relative; background: var(--navy); color: var(--white); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-block: 72px 36px; }
.hero h1 { color: var(--white); font-size: clamp(38px, 5.6vw, 68px); font-weight: 850; letter-spacing: -0.01em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero__lead { max-width: 52ch; margin-top: 22px; color: #c8d6e8; font-size: 19px; }
.hero__search { display: flex; gap: 12px; margin-top: 30px; max-width: 540px; }
.hero__search input {
    flex: 1; min-width: 0; height: 52px; padding: 0 16px;
    border: 2px solid var(--white); border-radius: var(--radius);
    background: var(--white); color: var(--ink); font: 400 16px var(--font);
}
.hero__search input::placeholder { color: #6a7d95; }
.hero__search input:focus { outline: 3px solid var(--amber); outline-offset: 2px; }
.hero__search .btn { box-shadow: 5px 5px 0 var(--blue); }
.hero__search .btn:hover { box-shadow: 6px 6px 0 var(--blue); }
.hero__search .btn:active { box-shadow: 1px 1px 0 var(--blue); }
.hero__hills { display: block; width: 100%; height: 90px; margin-bottom: -1px; }
.hill-back { fill: var(--sky); opacity: .45; }
.hill-front { fill: var(--sky); }

/* Binary card */
.bits-card {
    background: var(--white); color: var(--ink);
    border: 2px solid var(--navy); border-radius: var(--radius-lg);
    padding: 24px 24px 20px; box-shadow: 9px 9px 0 var(--amber);
}
.bits-card__title { font-size: 22px; }
.bits-card__hint { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.bits { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.bit { display: grid; gap: 5px; justify-items: center; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.bit__place { font: 500 11px/1 var(--mono); color: var(--muted); }
.bit__digit {
    display: grid; place-items: center; width: 100%; max-width: 54px; aspect-ratio: 1 / 1.15;
    border: 2px solid var(--navy); border-radius: 10px; background: var(--white);
    font: 500 22px/1 var(--mono); color: var(--navy);
    transition: background-color .18s ease-out, color .18s ease-out, transform .25s var(--ease-pop), box-shadow .18s ease-out;
}
.bit:hover .bit__digit { box-shadow: 0 3px 0 var(--navy); }
.bit[aria-pressed="true"] .bit__digit { background: var(--blue); color: var(--white); transform: translateY(-4px); box-shadow: 0 4px 0 var(--navy); }
.bits-card__sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 2px dashed var(--line); }
.bits-card__eq { min-width: 0; font: 400 14px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.bits-card__total { font: 850 48px/1 var(--display); font-stretch: 112%; color: var(--navy); font-variant-numeric: tabular-nums; }
.bits-card__link { display: inline-block; margin-top: 12px; font-size: 14.5px; font-weight: 600; }

/* Exam cards straddle the sky and white bands. */
.band--sky { padding-block: 24px 0; }
.exams { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 32px 0 -84px; }
.exam {
    display: flex; flex-direction: column; padding: 22px 20px 20px;
    background: var(--white); border: 2px solid var(--navy); border-radius: var(--radius-lg);
    color: var(--ink); text-decoration: none; box-shadow: var(--hard);
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.exam:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--navy); color: var(--ink); }
.exam:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--navy); }
.exam__code { font: 850 46px/1 var(--display); font-stretch: 120%; color: var(--blue); letter-spacing: -0.01em; transition: color .15s ease-out; }
.exam:hover .exam__code { color: var(--navy); }
.exam__name { margin-top: 12px; color: var(--navy); font-weight: 700; font-size: 18px; line-height: 1.3; }
.exam__meta { margin-top: 3px; color: var(--muted); font-size: 14.5px; }
.exam__bar { display: block; height: 6px; margin-top: 16px; border-radius: 3px; background: var(--sky); overflow: hidden; }
.exam__bar i { display: block; width: 30%; height: 100%; border-radius: 3px; background: var(--blue); transition: width .45s ease-out; }
.exam:hover .exam__bar i { width: 100%; }
.band--after-overlap { padding-top: 148px; }

/* Course cards: each acts out its topic on hover/focus. */
.courses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.course {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--white); border: 2px solid var(--navy); border-radius: var(--radius-lg);
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.course:hover, .course:focus-within { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--navy); }
.course__art { color: inherit; text-decoration: none; display: grid; place-items: center; height: 180px; border-bottom: 2px solid var(--navy); }
.course--python .course__art { background: var(--amber); }
.course--cpp .course__art { background: var(--teal); }
.course--ai .course__art { background: var(--coral); }
.course__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 20px 22px 22px; }
.course__name { font-size: 28px; }
.course__name a { color: var(--navy); text-decoration: none; }
.course__summary { color: var(--muted); font-size: 16px; }
.course__lessons { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: lesson; }
.course__lessons li { counter-increment: lesson; display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.course__lessons li::before { content: counter(lesson); flex: none; width: 1.2em; color: var(--muted); font: 500 13px/1.75 var(--mono); }
.course__lessons a { color: var(--ink); text-decoration: none; }
.course__lessons a:hover { color: var(--blue-ink); text-decoration: underline; }
.course__all { margin-top: auto; padding-top: 10px; color: var(--navy); font-weight: 700; text-decoration: none; }
.course__all span { display: inline-block; transition: transform .2s var(--ease-pop); }
.course__all:hover { color: var(--navy); }
.course__all:hover span { transform: translateX(5px); }

.art-term {
    display: grid; width: 80%; padding: 14px 16px;
    background: var(--navy); color: #e7eef7; border-radius: 10px;
    font: 400 13.5px/1.55 var(--mono); box-shadow: 4px 4px 0 rgb(11 35 64 / .35);
}
.art-term .kw { color: var(--amber); }
.art-term__out { color: #9fd3ff; opacity: 0; transform: translateY(4px); transition: opacity .2s ease-out, transform .2s ease-out; }
.course--python:is(:hover, :focus-within) .art-term__out { opacity: 1; transform: none; }
.course--python:is(:hover, :focus-within) .art-term__out:nth-child(4) { transition-delay: .25s; }
.course--python:is(:hover, :focus-within) .art-term__out:nth-child(5) { transition-delay: .5s; }

.art-pointer { width: 84%; height: auto; overflow: visible; }
.art-box { fill: var(--white); stroke: var(--navy); stroke-width: 2.5; }
.art-label { font: 500 12px var(--mono); fill: var(--navy); }
.art-value { font: 500 15px var(--mono); fill: var(--navy); }
.art-pointer__arrow, .art-pointer__head { fill: none; stroke: var(--navy); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-pointer__arrow { stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset .55s ease-out; }
.art-pointer__head { opacity: 0; transition: opacity .15s ease-out .5s; }
.course--cpp:is(:hover, :focus-within) .art-pointer__arrow { stroke-dashoffset: 0; }
.course--cpp:is(:hover, :focus-within) .art-pointer__head { opacity: 1; }

.art-tree { width: 70%; height: auto; }
.art-tree__edges line { stroke: var(--navy); stroke-width: 2.5; }
.art-tree__nodes circle { fill: var(--white); stroke: var(--navy); stroke-width: 2.5; transition: fill .2s ease-out; }
.art-tree__order text { font: 600 12px var(--mono); fill: var(--navy); text-anchor: middle; opacity: 0; transition: opacity .2s ease-out; }
.course--ai:is(:hover, :focus-within) .art-tree__nodes circle { fill: var(--amber); }
.course--ai:is(:hover, :focus-within) .art-tree__order text { opacity: 1; }
.art-tree__nodes circle:nth-child(2), .art-tree__order text:nth-child(2) { transition-delay: .15s; }
.art-tree__nodes circle:nth-child(3), .art-tree__order text:nth-child(3) { transition-delay: .3s; }
.art-tree__nodes circle:nth-child(4), .art-tree__order text:nth-child(4) { transition-delay: .45s; }
.art-tree__nodes circle:nth-child(5), .art-tree__order text:nth-child(5) { transition-delay: .6s; }
.art-tree__nodes circle:nth-child(6), .art-tree__order text:nth-child(6) { transition-delay: .75s; }
.art-tree__nodes circle:nth-child(7), .art-tree__order text:nth-child(7) { transition-delay: .9s; }

/* Reading lists */
.band--reads { padding-top: 24px; }
.reads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.reads__title { font-size: 28px; margin-bottom: 14px; }
.read-list { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--navy); }
.read-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 4px; border-bottom: 1px solid var(--line); transition: background-color .15s ease-out; }
.read-list li:hover { background: var(--sky); }
.read-list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.read-list a:hover { color: var(--navy); text-decoration: underline; }

/* GPA band: the white above cuts into it with a curve. */
.band--amber { padding-block: 110px 80px; }
.band__curve-in { position: absolute; left: 0; top: -1px; width: 100%; height: 60px; }
.band__curve-in path { fill: var(--white); }
.gpa { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.gpa .band__title { color: var(--navy); }
.gpa__text { max-width: 54ch; margin: 14px 0 26px; color: #3a2a00; font-size: 18px; }
.receipt {
    max-width: 420px; justify-self: end; width: 100%;
    padding: 20px 22px; background: var(--white);
    border: 2px solid var(--navy); border-radius: var(--radius-lg);
    font: 400 15px/1.5 var(--mono); box-shadow: var(--hard);
    transform: rotate(1.5deg); transition: transform .25s var(--ease-pop);
}
.receipt:hover { transform: rotate(0deg); }
.receipt__row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.receipt__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; font: 600 15px var(--font); }
.receipt__total b { font: 850 40px/1 var(--display); font-stretch: 112%; color: var(--navy); }

/* Study guides: the amber dips into the white band. */
.band--after-amber { padding-top: 104px; }
.band__dip { position: absolute; left: 0; top: -1px; width: 100%; height: 60px; }
.band__dip path { fill: var(--amber); }
.books { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; margin: 32px 0 0; padding: 0; list-style: none; }
.book { display: flex; flex-direction: column; gap: 12px; color: var(--ink); text-decoration: none; }
.book__cover {
    position: relative; display: flex; flex-direction: column; justify-content: space-between;
    aspect-ratio: 3 / 4; padding: 18px 16px 14px 22px;
    border: 2px solid var(--navy); border-radius: 6px 14px 14px 6px;
    box-shadow: var(--hard); overflow: hidden;
    transition: transform .2s var(--ease-pop), box-shadow .2s ease-out;
}
.book__cover::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: rgb(11 35 64 / .25); }
.book__cover--exam { background: var(--blue); color: var(--white); }
.book__cover--python { background: var(--amber); color: var(--navy); }
.book__cover--cpp { background: var(--teal); color: var(--white); }
.book__cover--ai { background: var(--coral); color: var(--navy); }
.book:hover .book__cover { transform: translateY(-6px) rotate(-1.5deg); box-shadow: 8px 10px 0 var(--navy); }
.book__title { font: 850 21px/1.1 var(--display); font-stretch: 108%; text-wrap: balance; }
.book__brand { font: 500 11px/1 var(--mono); opacity: .8; }
.book__price { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.book__price del { margin-right: 6px; color: var(--muted); font-weight: 400; }

/* Story */
.band--story { padding-top: 24px; }
.story {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 40px;
    padding: 44px 48px; background: var(--butter);
    border: 2px solid var(--navy); border-radius: 24px;
}
.story__title { font-size: clamp(30px, 3.4vw, 42px); }
.story__text { display: grid; gap: 14px; font-size: 18px; line-height: 1.7; }
.story__sign { color: var(--muted); font-size: 16px; }
.story__sign strong { color: var(--navy); font: 800 20px var(--display); font-stretch: 112%; margin-right: 4px; }

@media (max-width: 1024px) {
    .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .hero__inner, .gpa, .story { grid-template-columns: 1fr; }
    .exams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .courses { grid-template-columns: 1fr; max-width: 560px; }
    .reads { grid-template-columns: 1fr; gap: 40px; }
    .receipt { justify-self: start; }
}
@media (max-width: 600px) {
    :root { --gutter: 16px; }
    body.is-redesigned { font-size: 16px; }
    .band { padding-block: 56px; }
    .hero__inner { padding-block: 44px 24px; gap: 36px; }
    .hero__lead { font-size: 17px; }
    .hero__search { flex-direction: column; }
    .hero__search input { flex: none; }
    .hero__hills { height: 48px; }
    .band--sky { padding-block: 16px 0; }
    .exams { grid-template-columns: 1fr; gap: 14px; margin-bottom: -60px; }
    .exam__code { font-size: 38px; }
    .band--after-overlap { padding-top: 110px; }
    .bits { gap: 4px; }
    .bit__digit { font-size: 17px; border-radius: 8px; }
    .bits-card { padding: 20px 16px 16px; box-shadow: 6px 6px 0 var(--amber); }
    .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .book__title { font-size: 17px; }
    .band--amber { padding-block: 76px 60px; }
    .band__curve-in, .band__dip { height: 34px; }
    .band--after-amber { padding-top: 72px; }
    .receipt { transform: none; }
    .story { padding: 28px 22px; border-radius: 18px; }
    .story__text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .site-header *, .site-footer *, .is-redesigned *, .is-redesigned *::before { transition: none !important; animation: none !important; }
}

/* About -------------------------------------------------------------------- */

.hero__inner--single { grid-template-columns: minmax(0, 1fr); padding-block: 72px 28px; }
.hero--about h1 { max-width: 16ch; }
.hero--about .hero__lead { max-width: 62ch; }
.about__byline { margin-top: 22px; color: #c8d6e8; font-size: 16px; }
.about__byline strong { color: var(--amber); font: 800 20px var(--display); font-stretch: 112%; margin-right: 4px; }

.about-origin { padding-block: 40px 80px; }
.about-origin__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.about-prose { display: grid; gap: 16px; font-size: 18px; line-height: 1.7; }
.about-prose .band__title { margin-bottom: 4px; }

.notepad {
    margin-top: 12px; overflow: hidden;
    background: var(--white); border: 2px solid var(--navy); border-radius: var(--radius-lg);
    box-shadow: 9px 9px 0 var(--blue); transform: rotate(-1deg);
    transition: transform .3s var(--ease-pop);
}
.notepad:hover { transform: rotate(0deg); }
.notepad__tabs { display: flex; gap: 4px; padding: 10px 10px 0; overflow: hidden; background: var(--sky); border-bottom: 2px solid var(--navy); }
.notepad__tab {
    flex: none; padding: 7px 12px 6px; border: 2px solid var(--navy); border-bottom: 0; border-radius: 8px 8px 0 0;
    background: #cfe2f7; color: var(--muted); font: 400 12.5px/1.2 var(--mono); white-space: nowrap;
}
.notepad__tab.is-active { background: var(--white); color: var(--navy); font-weight: 500; margin-bottom: -2px; padding-bottom: 8px; }
.notepad__body { display: grid; gap: 2px; padding: 20px 22px 24px; font: 400 15px/1.6 var(--mono); color: var(--ink); white-space: pre-wrap; }
.notepad__caret { display: block; width: 9px; height: 18px; margin-top: 2px; background: var(--navy); }

.process { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin: 36px 0 0; padding: 0; list-style: none; counter-reset: none; }
.process__step {
    position: relative; display: grid; align-content: start; gap: 8px;
    padding: 20px 18px 22px; background: var(--white);
    border: 2px solid var(--navy); border-radius: var(--radius-lg); box-shadow: var(--hard);
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.process__step:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--navy); }
.process__step:not(:last-child)::after {
    content: ''; position: absolute; right: -16px; top: 42px; width: 14px; height: 14px;
    border-top: 3px solid var(--navy); border-right: 3px solid var(--navy); transform: rotate(45deg);
}
.process__n {
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 2px solid var(--navy); border-radius: 12px; background: var(--subject-misc); color: var(--white);
    font: 850 22px/1 var(--display); font-stretch: 112%;
}
.process__step--python .process__n { background: var(--amber); color: var(--navy); }
.process__step--exam .process__n { background: var(--blue); }
.process__step--cpp .process__n { background: var(--teal); }
.process__step--ai .process__n { background: var(--coral); color: var(--navy); }
.process__step h3 { margin-top: 4px; font-size: 19px; }
.process__step p { color: var(--muted); font-size: 15.5px; line-height: 1.55; }

.about-changes { padding-top: 24px; }
.changes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 32px; }
.change { display: grid; gap: 12px; padding: 24px 26px; border: 2px solid var(--navy); border-radius: var(--radius-lg); }
.change--butter { background: var(--butter); }
.change--mint { background: var(--mint); }
.change--sky { background: var(--sky); }
.change--blush { background: var(--blush); }
.change__said { color: var(--navy); font: 800 22px/1.2 var(--display); font-stretch: 108%; }
.change__did { font-size: 16.5px; line-height: 1.6; }
.change__did strong { color: var(--navy); }

.timeline { position: relative; display: grid; gap: 0; max-width: 760px; margin: 32px 0 0; padding: 0 0 0 34px; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--navy); }
.timeline li { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 12px 0; }
.timeline li::before {
    content: ''; position: absolute; left: -32px; top: 17px; width: 17px; height: 17px;
    border: 3px solid var(--navy); border-radius: 50%; background: var(--white);
    transition: transform .2s var(--ease-pop), background-color .15s ease-out;
}
.timeline li:hover::before { transform: scale(1.25); background: var(--blue); }
.timeline time { color: var(--navy); font: 800 18px/1.5 var(--display); font-stretch: 108%; }
.timeline p { color: #2d2100; font-size: 17px; }
.timeline__now { margin-top: 8px; padding: 14px 18px !important; background: var(--white); border: 2px solid var(--navy); border-radius: var(--radius); box-shadow: var(--hard); }
.timeline__now::before { left: -32px !important; top: 21px !important; background: var(--navy) !important; }
.timeline__now p { color: var(--ink); font-weight: 600; }

.about-close .story { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; }
.about-close .btn { margin-top: 6px; }

@media (max-width: 1024px) {
    .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .process__step:not(:last-child)::after { display: none; }
}
@media (max-width: 960px) {
    .about-origin__grid, .changes, .about-close .story { grid-template-columns: 1fr; }
    .notepad { transform: none; }
}
@media (max-width: 600px) {
    .hero__inner--single { padding-block: 44px 16px; }
    .about-prose { font-size: 17px; }
    .process { grid-template-columns: 1fr; }
    .change__said { font-size: 19px; }
    .timeline li { grid-template-columns: 1fr; gap: 2px; }
    .notepad__body { font-size: 13.5px; padding: 16px; }
}

/* Tones: a band in a subject colour ----------------------------------------- */

.tone-misc { --tone: var(--navy); --tone-ink: var(--white); --tone-soft: #c8d6e8; --tone-shadow: var(--amber); }
.tone-exam { --tone: var(--blue); --tone-ink: var(--white); --tone-soft: #e3efff; --tone-shadow: var(--navy); }
.tone-python { --tone: var(--amber); --tone-ink: var(--navy); --tone-soft: #3a2a00; --tone-shadow: var(--navy); }
.tone-cpp { --tone: var(--teal); --tone-ink: var(--white); --tone-soft: #e4fbf9; --tone-shadow: var(--navy); }
.tone-ai { --tone: var(--coral); --tone-ink: var(--navy); --tone-soft: #3b130c; --tone-shadow: var(--navy); }

/* Page hero (every template except home) ------------------------------------ */

.page-hero { position: relative; background: var(--tone); color: var(--tone-ink); }
.page-hero__inner { padding-block: 56px 20px; }
.page-hero__title { max-width: 22ch; color: var(--tone-ink) !important; font-size: clamp(32px, 4.6vw, 54px); font-weight: 850; letter-spacing: -0.01em; }
.page-hero__lead { max-width: 62ch; margin-top: 16px; color: var(--tone-soft); font-size: 18.5px; }
.page-hero__extra { margin-top: 22px; }
.page-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--tone-soft); font-size: 15px; }
.hero-chip { display: inline-block; padding: 4px 11px; border: 2px solid var(--navy); border-radius: 9px; background: var(--white); color: var(--navy); font-weight: 700; font-size: 14px; box-shadow: 3px 3px 0 var(--tone-shadow); }
.page-hero .hero__search { margin-top: 4px; }
.page-hero__hills { display: block; width: 100%; height: 70px; margin-bottom: -1px; }
.page-hero__hills .hill-front, .page-hero__hills .hill-back { fill: var(--white); }
.page-hero__hills .hill-back { opacity: .35; }
@media (max-width: 600px) {
    .page-hero__inner { padding-block: 36px 12px; }
    .page-hero__lead { font-size: 17px; }
    .page-hero__hills { height: 40px; }
}

/* Article body (posts written as plain HTML) -------------------------------- */

.prose { max-width: 72ch; margin: 24px 0 0; font-size: 18px; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose :where(h2, h3, h4) { color: var(--navy); margin-top: 1.8em; margin-bottom: -0.2em; }
.prose h2 { font-size: 30px; }
.prose h3 { font-size: 23px; }
.prose h4 { font-size: 19px; }
.prose :where(ul, ol) { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--blue); font-weight: 700; }
.prose a { color: var(--blue-ink); font-weight: 500; }
.prose strong { color: var(--navy); }
.prose :not(pre) > code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--sky); color: var(--navy); font: 500 .88em var(--mono); }
.prose pre { overflow-x: auto; padding: 18px 20px; border: 2px solid var(--navy); border-radius: var(--radius); background: var(--navy) !important; color: #e7eef7 !important; font: 400 15px/1.6 var(--mono) !important; box-shadow: var(--hard); }
.prose pre code, .prose pre * { background: none !important; color: inherit; font: inherit !important; }
.prose blockquote { margin-left: 0; padding: 16px 20px; border: 2px solid var(--navy); border-radius: var(--radius); background: var(--butter); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; border: 2px solid var(--navy); border-radius: var(--radius); font-size: 16px; }
.prose th { background: var(--navy); color: var(--white); text-align: left; }
.prose :where(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose img { border: 2px solid var(--navy); border-radius: var(--radius); }
.prose hr { border: 0; border-top: 2px dashed var(--line); margin-block: 2em; }
@media (max-width: 600px) { .prose { font-size: 17px; } .prose h2 { font-size: 25px; } }

/* Post footer: tags and keep reading ---------------------------------------- */

.post-footer { margin-top: 56px; }
.post-footer__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 22px; border-top: 2px dashed var(--line); }
.post-footer__label { color: var(--muted); font-size: 15px; }
.tag-link { padding: 5px 10px; border: 2px solid var(--navy); border-radius: 9px; text-decoration: none; transition: background-color .15s ease-out; }
.tag-link:hover { background: var(--sky); }
.tag-link .subject-tag { color: var(--navy); }
.keep-reading { margin-top: 44px; }
.keep-reading__title { font-size: 28px; margin-bottom: 18px; }
.keep-reading__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.keep-reading__card {
    display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 18px 20px 20px;
    border: 2px solid var(--navy); border-radius: var(--radius-lg); background: var(--white);
    color: var(--ink); text-decoration: none; box-shadow: var(--hard);
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.keep-reading__card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--navy); color: var(--ink); }
.keep-reading__name { color: var(--navy); font: 800 19px/1.25 var(--display); font-stretch: 106%; }
.keep-reading__go { margin-top: auto; font-weight: 700; color: var(--blue-ink); }
@media (max-width: 900px) { .keep-reading__list { grid-template-columns: 1fr; } }

/* Listings: category and search --------------------------------------------- */

.listing { margin-top: 24px; }
.listing__count { color: var(--muted); margin-bottom: 14px; }
.post-rows { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; max-width: 860px; }
.post-row {
    display: grid; gap: 6px; padding: 18px 22px 20px;
    border: 2px solid var(--navy); border-radius: var(--radius-lg); background: var(--white);
    color: var(--ink); text-decoration: none;
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.post-row:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--navy); color: var(--ink); }
.post-row__top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.post-row__title { color: var(--navy); font: 800 21px/1.25 var(--display); font-stretch: 106%; }
.post-row__text { color: var(--muted); font-size: 16px; }
.pagination { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 32px; }
.pagination__where { color: var(--muted); }
.empty-state { max-width: 640px; padding: 28px; border: 2px solid var(--navy); border-radius: var(--radius-lg); background: var(--butter); }
.empty-state h2 { font-size: 26px; margin-bottom: 8px; }

/* Shop and product ----------------------------------------------------------- */

.shop { margin-top: 28px; }
.books--shop { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.shop__notes { margin-top: 48px; }
@media (max-width: 1024px) { .books--shop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .books--shop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.product-top { position: relative; background: var(--tone); color: var(--tone-ink); }
.product-top__inner { padding-block: 24px 16px; }
.breadcrumbs { font-size: 14.5px; color: var(--tone-soft); }
.breadcrumbs a { color: var(--tone-ink); font-weight: 600; }
.product-top__grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 48px; align-items: center; margin-top: 18px; }
.book__cover--big { display: flex; width: 100%; max-width: 320px; }
.book__cover--big .book__title { font-size: 32px; }
.product-top__title { color: var(--tone-ink) !important; font-size: clamp(28px, 3.6vw, 42px); }
.product-top__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; font-size: 18px; }
.product-top__price del { opacity: .75; }
.product-top__price strong { font: 850 36px/1 var(--display); font-stretch: 112%; }
.product-top__save { padding: 3px 10px; border: 2px solid var(--navy); border-radius: 8px; background: var(--white); color: var(--navy); font-weight: 700; font-size: 14px; }
.product-top__excerpt { max-width: 60ch; margin-top: 16px; font-size: 17px; }
.product-top__excerpt p + p { margin-top: 10px; }
.product-top__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 24px; }
.product-top__refund { color: var(--tone-ink); font-weight: 600; }
.product-description { max-width: 860px; }
@media (max-width: 760px) {
    .product-top__grid { grid-template-columns: 1fr; gap: 28px; }
    .book__cover--big { max-width: 220px; }
    .book__cover--big .book__title { font-size: 24px; }
}

/* 404 ------------------------------------------------------------------------- */

.bits--static { grid-template-columns: repeat(9, minmax(0, 1fr)); max-width: 520px; margin: 0; }
.bits--static .bit { cursor: default; }
.bits--static .bit__place { color: #c8d6e8; }
.start-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 22px 0 0; padding: 0; list-style: none; max-width: 900px; }
.start-card {
    display: block; padding: 22px 22px; border: 2px solid var(--navy); border-radius: var(--radius-lg);
    background: var(--tone); color: var(--tone-ink); font: 800 20px/1.2 var(--display); font-stretch: 108%;
    text-decoration: none; box-shadow: var(--hard); transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.start-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--navy); color: var(--tone-ink); }
@media (max-width: 760px) { .start-cards { grid-template-columns: 1fr; } }

/* Legacy layer --------------------------------------------------------------
 * Imported notes pages keep their own markup and <style>; LegacySkin swaps their
 * palette and fonts at render time, and these rules restyle the shared "pp-"
 * components into the site design. Page styles come later in the document with
 * equal specificity, so properties that must win are marked !important.
 */

.is-legacy .legacy { overflow-x: clip; }
.is-legacy .legacy :is(h1, h2, h3) { font-family: var(--display) !important; font-stretch: 110%; font-weight: 800 !important; letter-spacing: -0.005em !important; }

/* Things that go entirely */
.is-legacy .pp-read-bar { display: none !important; }
.is-legacy .pp-reveal { opacity: 1 !important; transform: none !important; }
.is-legacy .pp-hl::after, .is-legacy .pp-hero::before { display: none !important; }
.is-legacy .pp-section h3::before { display: none !important; }

/* Hero: a full-width navy band ending in a hill line */
.is-legacy .pp-hero {
    position: relative !important; overflow: visible !important;
    margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important;
    padding: 56px max(24px, calc(50vw - 560px)) 96px !important;
    background: var(--navy) !important; color: var(--white) !important; text-align: left !important;
    border: 0 !important; border-radius: 0 !important;
}
.is-legacy .pp-hero::after {
    content: "" !important; display: block !important; position: absolute !important;
    left: 0 !important; right: 0 !important; top: auto !important; bottom: -1px !important;
    width: auto !important; height: 64px !important; transform: none !important; border-radius: 0 !important; opacity: 1 !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 70' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' opacity='.35' d='M0 30 C160 6 300 14 420 26 C560 40 680 46 800 34 C920 22 1040 4 1200 14 L1200 70 L0 70 Z'/%3E%3Cpath fill='%23ffffff' d='M0 46 C140 24 260 22 380 36 C500 50 600 58 720 50 C860 40 960 18 1080 22 C1140 24 1170 30 1200 28 L1200 70 L0 70 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat !important;
}
.is-legacy .pp-hero-inner { max-width: 1132px; margin: 0 auto; }
.is-legacy .pp-hero h1 { color: var(--white) !important; font-size: clamp(32px, 4.8vw, 56px) !important; line-height: 1.05 !important; max-width: 22ch; margin-left: 0 !important; }
.is-legacy .pp-hl { color: var(--amber) !important; white-space: normal !important; }
.is-legacy .pp-eyebrow {
    display: block !important; margin-bottom: 14px !important; color: #9fc3ee !important;
    font: 600 15px/1.4 var(--font) !important; letter-spacing: 0 !important; text-transform: none !important;
}
.is-legacy :is(.pp-hero-sub, .pp-sub, .pp-hero p) { color: #c8d6e8 !important; margin-left: 0 !important; margin-right: 0 !important; max-width: 62ch !important; font-size: 18px !important; }
.is-legacy :is(.pp-hero-meta, .pp-hero .pp-meta) { justify-content: flex-start !important; color: #c8d6e8 !important; font: 500 14.5px/1.5 var(--font) !important; letter-spacing: 0 !important; text-transform: none !important; }
.is-legacy .pp-hero .pp-dot { background: var(--amber) !important; }
@media (max-width: 600px) {
    .is-legacy .pp-hero { padding: 36px 16px 64px !important; }
    .is-legacy .pp-hero::after { height: 36px !important; }
}

/* Labels written as uppercase monospace eyebrows become plain bold labels */
.is-legacy :is(.pp-toc-title, .pp-note-head, .pp-a-label, .pp-output-label, .pp-anim-tag, .pp-related-title, .pp-allchaps-title, .pp-fl-dir, .pp-nextup-label, .pp-goals-title, .pp-code-label, .pp-chapnav-home) {
    font-family: var(--font) !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 700 !important;
}

/* Section numbers */
.is-legacy :is(.pp-sec-num, .pp-toc-num, .pp-ac-num) {
    background: var(--amber) !important; color: var(--navy) !important;
    border: 2px solid var(--navy) !important; box-shadow: 3px 3px 0 var(--navy) !important;
    font-family: var(--display) !important; font-stretch: 112%; font-weight: 850 !important;
}
.is-legacy :is(.pp-toc-num, .pp-ac-num) { box-shadow: none !important; }

/* Dividers */
.is-legacy .pp-divider { height: 0 !important; background: none !important; border: 0 !important; border-top: 2px dashed var(--line) !important; }

/* Chapter navigation and contents */
.is-legacy :is(.pp-chapnav, .pp-ainav, .pp-toc, .pp-allchaps) {
    background: var(--sky) !important; border: 2px solid var(--navy) !important; border-radius: 16px !important; box-shadow: var(--hard) !important;
}
.is-legacy .pp-toc-title, .is-legacy .pp-allchaps-title { color: var(--navy) !important; font: 800 21px/1.2 var(--display) !important; font-stretch: 110% !important; }
.is-legacy :is(.pp-chapnav-chips, .pp-ainav-chips) a { border: 2px solid var(--navy) !important; color: var(--navy) !important; background: var(--white) !important; }
.is-legacy :is(.pp-chapnav-chips, .pp-ainav-chips) a:is(.pp-current, :hover) { background: var(--amber) !important; }
.is-legacy :is(.pp-chapnav-home, .pp-ainav-home) { color: var(--navy) !important; }
.is-legacy .pp-toc-list li a { color: var(--navy) !important; }
.is-legacy .pp-toc-list li a:hover { background: var(--white) !important; }
.is-legacy .pp-allchaps-grid a { border: 2px solid var(--navy) !important; background: var(--white) !important; color: var(--navy) !important; }
.is-legacy .pp-allchaps-grid a:hover { box-shadow: 4px 4px 0 var(--navy) !important; }
.is-legacy .pp-allchaps-grid a.pp-ac-current { background: var(--butter) !important; }

/* Callouts: whole border, a tint per meaning, no side stripe */
.is-legacy .pp-note { border: 2px solid var(--navy) !important; border-radius: 14px !important; background: var(--sky) !important; box-shadow: none !important; }
.is-legacy .pp-note.pp-tip { background: var(--mint) !important; }
.is-legacy .pp-note.pp-warn { background: var(--blush) !important; }
.is-legacy .pp-note.pp-exam { background: var(--butter) !important; }
.is-legacy .pp-note-head { color: var(--navy) !important; font-size: 15.5px !important; }

/* Code */
.is-legacy .pp-code-wrap { border-radius: 14px !important; }
.is-legacy .pp-code-wrap pre, .is-legacy .legacy pre {
    background: var(--navy) !important; color: #e7eef7 !important;
    border: 2px solid var(--navy) !important; border-radius: 14px !important; box-shadow: var(--hard) !important;
    font-family: var(--mono) !important;
}
.is-legacy .legacy pre .kw { color: #ffc95c !important; }
.is-legacy .legacy pre .st { color: #9fe6c4 !important; }
.is-legacy .legacy pre .cm { color: #8ca0b8 !important; }
.is-legacy .legacy pre .fn { color: #7fc0ff !important; }
.is-legacy .legacy pre .nm { color: #ff9e8f !important; }
.is-legacy .pp-code-label { color: #9fb4cc !important; font-size: 12.5px !important; }
.is-legacy .pp-copy-btn {
    background: var(--amber) !important; color: var(--navy) !important; border: 2px solid var(--white) !important;
    border-radius: 8px !important; font: 700 12.5px/1 var(--font) !important; text-transform: none !important; letter-spacing: 0 !important;
}
.is-legacy .pp-output { background: var(--white) !important; border: 2px solid var(--navy) !important; border-radius: 12px !important; font-family: var(--mono) !important; }
.is-legacy .pp-output-label { color: var(--teal) !important; }

/* Tables */
.is-legacy .pp-table-wrap { border: 2px solid var(--navy) !important; border-radius: 14px !important; box-shadow: var(--hard) !important; }
.is-legacy .legacy thead, .is-legacy .legacy thead th { background: var(--navy) !important; color: var(--white) !important; }
.is-legacy .legacy th { font-family: var(--font) !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 700 !important; font-size: 14px !important; }
.is-legacy .legacy tbody tr:hover td { background: var(--sky) !important; }

/* Exam questions, worked examples, cards */
.is-legacy .pp-qa { border: 2px solid var(--navy) !important; border-radius: 14px !important; box-shadow: var(--hard) !important; overflow: hidden; }
.is-legacy .pp-q { background: var(--navy) !important; color: var(--white) !important; }
.is-legacy .pp-q-mark { background: var(--amber) !important; color: var(--navy) !important; font-family: var(--font) !important; font-weight: 700 !important; }
.is-legacy :is(.pp-worked, .pp-exercise) { border: 2px solid var(--navy) !important; border-radius: 14px !important; background: var(--white) !important; box-shadow: none !important; }
.is-legacy .pp-ans { background: var(--mint) !important; border: 2px solid var(--navy) !important; color: var(--navy) !important; box-shadow: 3px 3px 0 var(--navy) !important; }
.is-legacy .pp-steps-calc { background: var(--sky) !important; border-radius: 10px !important; }
.is-legacy :is(.pp-card, .pp-dev, .pp-es-part, .pp-layer) { border: 2px solid var(--navy) !important; border-radius: 14px !important; box-shadow: none !important; }

/* Calls to action and next steps */
.is-legacy .pp-cta { background: var(--amber) !important; color: var(--navy) !important; border: 2px solid var(--navy) !important; border-radius: 18px !important; box-shadow: var(--hard) !important; }
.is-legacy :is(.pp-cta-title, .pp-cta-desc) { color: var(--navy) !important; }
.is-legacy .pp-cta-title { font: 850 24px/1.15 var(--display) !important; font-stretch: 110% !important; }
.is-legacy :is(.pp-cta-btn, .pp-nextup-btn) {
    background: var(--navy) !important; color: var(--white) !important; border: 2px solid var(--navy) !important;
    border-radius: 12px !important; box-shadow: 4px 4px 0 var(--white) !important; transition: transform .12s ease-out, box-shadow .12s ease-out !important;
}
.is-legacy :is(.pp-cta-btn, .pp-nextup-btn):active { transform: translate(3px, 3px) !important; box-shadow: 1px 1px 0 var(--white) !important; }
.is-legacy .pp-nextup { background: var(--butter) !important; border: 2px solid var(--navy) !important; border-radius: 18px !important; box-shadow: var(--hard) !important; }
.is-legacy .pp-foot-link {
    background: var(--white) !important; border: 2px solid var(--navy) !important; border-radius: 14px !important;
    box-shadow: var(--hard) !important; transition: transform .15s ease-out, box-shadow .15s ease-out !important;
}
.is-legacy .pp-foot-link:hover { transform: translate(-2px, -2px) !important; box-shadow: 7px 7px 0 var(--navy) !important; }
.is-legacy .pp-fl-title { color: var(--navy) !important; font-family: var(--display) !important; font-stretch: 108%; font-weight: 800 !important; }
.is-legacy .pp-related-grid a { border: 2px solid var(--navy) !important; border-radius: 12px !important; background: var(--white) !important; color: var(--navy) !important; }
.is-legacy .pp-related-grid a:hover { background: var(--sky) !important; }

/* Interactive widgets and quizzes */
.is-legacy :is(.pp-anim, .pp-quiz, .pp-calc) { border: 2px solid var(--navy) !important; border-radius: 18px !important; background: var(--white) !important; box-shadow: var(--hard) !important; }
.is-legacy .pp-canvas, .is-legacy .legacy canvas { border-radius: 12px; }
.is-legacy .pp-anim-tag { background: var(--sky) !important; color: var(--navy) !important; border: 2px solid var(--navy) !important; }
.is-legacy .pp-btn {
    border: 2px solid var(--navy) !important; border-radius: 10px !important; background: var(--white) !important; color: var(--navy) !important;
    font: 700 14.5px/1 var(--font) !important; box-shadow: 3px 3px 0 var(--navy) !important;
    transition: transform .12s ease-out, box-shadow .12s ease-out !important;
}
.is-legacy .pp-btn:active { transform: translate(2px, 2px) !important; box-shadow: 1px 1px 0 var(--navy) !important; }
.is-legacy .pp-btn-primary { background: var(--amber) !important; }
.is-legacy .pp-quiz-opts button, .is-legacy .pp-quiz-opts .pp-opt {
    border: 2px solid var(--navy) !important; border-radius: 12px !important; background: var(--white) !important; color: var(--ink) !important;
}
.is-legacy .pp-quiz-opts button:hover { background: var(--sky) !important; }
.is-legacy .pp-quiz-bar-fill { background: var(--amber) !important; }
.is-legacy .pp-quiz-bar-track { background: var(--sky) !important; }
.is-legacy .pp-readout { font-family: var(--mono) !important; }

/* Uppercase, letter-spaced labels (an AI tell) read as normal labels */
.is-legacy .legacy :is([class*="-head"], [class*="-label"], [class*="-title"], [class*="eyebrow"], [class*="-tag"], [class*="-badge"], [class*="-kicker"]) {
    text-transform: none !important; letter-spacing: normal !important;
}
.is-legacy .pp-worked-head { font-family: var(--font) !important; font-weight: 700 !important; color: var(--teal) !important; }

/* Pages from the other hand-made designs use a plain .hero: same navy band */
.is-legacy .legacy .hero {
    position: relative !important; overflow: visible !important;
    width: auto !important; max-width: none !important;
    margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; margin-top: 0 !important;
    padding: 56px max(24px, calc(50vw - 560px)) 96px !important;
    background: var(--navy) !important; color: var(--white) !important; text-align: left !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.is-legacy .legacy .hero::before { display: none !important; }
.is-legacy .legacy .hero::after {
    content: "" !important; display: block !important; position: absolute !important;
    left: 0 !important; right: 0 !important; top: auto !important; bottom: -1px !important;
    width: auto !important; height: 64px !important; transform: none !important; border-radius: 0 !important; opacity: 1 !important; filter: none !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 70' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' opacity='.35' d='M0 30 C160 6 300 14 420 26 C560 40 680 46 800 34 C920 22 1040 4 1200 14 L1200 70 L0 70 Z'/%3E%3Cpath fill='%23ffffff' d='M0 46 C140 24 260 22 380 36 C500 50 600 58 720 50 C860 40 960 18 1080 22 C1140 24 1170 30 1200 28 L1200 70 L0 70 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat !important;
}
.is-legacy .legacy .hero > * { max-width: 1132px; margin-left: auto !important; margin-right: auto !important; }
.is-legacy .legacy .hero h1 { color: var(--white) !important; font-size: clamp(32px, 4.8vw, 56px) !important; line-height: 1.05 !important; }
.is-legacy .legacy .hero h1 :is(span, em) { color: var(--amber) !important; font-style: normal !important; }
.is-legacy .legacy .hero :is(p, [class*="desc"], [class*="sub"]) { color: #c8d6e8 !important; font-size: 18px !important; }
.is-legacy .legacy .hero :is([class*="badge"], [class*="eyebrow"], [class*="chapter-tag"], [class*="kicker"]) {
    display: block !important; width: auto !important; padding: 0 !important; margin-bottom: 14px !important;
    background: none !important; border: 0 !important; box-shadow: none !important;
    color: #9fc3ee !important; font: 600 15px/1.4 var(--font) !important; letter-spacing: 0 !important; text-transform: none !important;
}
.is-legacy .legacy .hero :is([class*="chip"], [class*="pill"]) {
    background: var(--white) !important; color: var(--navy) !important; border: 2px solid var(--navy) !important;
    border-radius: 9px !important; box-shadow: 3px 3px 0 var(--amber) !important; font-family: var(--font) !important; font-weight: 600 !important;
}
.is-legacy .legacy :is(.hero, .pp-hero) :is(.dot, [class*="orb"], [class*="blob"], [class*="particle"], [class*="glow"], [class*="sparkle"], [class*="float"]) { display: none !important; }
@media (max-width: 600px) {
    .is-legacy .legacy .hero { padding: 36px 16px 64px !important; }
    .is-legacy .legacy .hero::after { height: 36px !important; }
}

/* Old pages' own fade-in-on-scroll code: content is simply visible */
.is-legacy .legacy :is([class*="reveal"], [class*="fade-up"], [class*="fade-in"], [class*="animate-on"], [data-aos], [class*="scroll-anim"]) { opacity: 1 !important; transform: none !important; }
/* Old pages that let text run the full screen width get a readable column */
.is-legacy .legacy > :is(.content, .container, main, .wrapper) { max-width: 1132px !important; margin-left: auto !important; margin-right: auto !important; padding-left: max(24px, env(safe-area-inset-left, 0px)) !important; padding-right: max(24px, env(safe-area-inset-right, 0px)) !important; }
/* Blog posts repeated the date and author inside the content; the page header shows them now */
.is-redesigned :is(.prose, .legacy) .post-meta { display: none !important; }

/* A Level chapter pages (badge, title, subtitle in a row): one navy band */
.is-legacy .legacy :is(.pp-chapter-badge, .pp-chapter-title, .pp-chapter-subtitle) {
    display: block !important; margin: 0 calc(50% - 50vw) !important; width: auto !important; max-width: none !important;
    padding-left: max(24px, calc(50vw - 566px)) !important; padding-right: max(24px, calc(50vw - 566px)) !important;
    background: var(--navy) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.is-legacy .legacy .pp-chapter-badge { padding-top: 56px !important; padding-bottom: 12px !important; color: #9fc3ee !important; font: 600 15px/1.4 var(--font) !important; letter-spacing: 0 !important; text-transform: none !important; }
.is-legacy .legacy .pp-chapter-title { padding-top: 0 !important; padding-bottom: 14px !important; color: var(--white) !important; font-size: clamp(32px, 4.8vw, 56px) !important; line-height: 1.05 !important; }
.is-legacy .legacy .pp-chapter-subtitle { position: relative; padding-top: 0 !important; padding-bottom: 96px !important; margin-bottom: 8px !important; color: #c8d6e8 !important; font-size: 18px !important; }
.is-legacy .legacy .pp-chapter-subtitle::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 64px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 70' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' opacity='.35' d='M0 30 C160 6 300 14 420 26 C560 40 680 46 800 34 C920 22 1040 4 1200 14 L1200 70 L0 70 Z'/%3E%3Cpath fill='%23ffffff' d='M0 46 C140 24 260 22 380 36 C500 50 600 58 720 50 C860 40 960 18 1080 22 C1140 24 1170 30 1200 28 L1200 70 L0 70 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
.is-legacy .legacy .pp-chapter-subtitle + .pp-divider { display: none !important; }
.is-legacy .legacy .pp-notes { padding-top: 0 !important; }
@media (max-width: 600px) {
    .is-legacy .legacy .pp-chapter-badge { padding-top: 36px !important; }
    .is-legacy .legacy .pp-chapter-subtitle { padding-bottom: 60px !important; }
    .is-legacy .legacy .pp-chapter-subtitle::after { height: 36px; }
}

/* Dark-themed pages keep their navy ground inside the content area */
.is-legacy .legacy { position: relative; }

/* Vanity stats rows in old heroes (a recognised AI tell) */
.is-legacy .legacy :is(.pp-hero-stats, :has(> .pp-hstat)) { display: none !important; }

/* ---------- Product box on posts (partials/product-box) and the line near the top (partials/product-hook) ---------- */
.product-box {
    display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: center;
    max-width: 820px; margin: 48px auto 8px; padding: 26px 28px;
    background: var(--butter); border: 2px solid var(--navy); border-radius: var(--radius-lg); box-shadow: var(--hard);
    scroll-margin-top: 96px;
}
.product-box--exam { background: var(--sky); }
.product-box--cpp { background: var(--mint); }
.product-box--ai { background: var(--blush); }
.product-box__cover { display: block; text-decoration: none; }
.product-box__cover .book__cover { transition: transform .2s var(--ease-pop), box-shadow .2s ease-out; }
.product-box:hover .product-box__cover .book__cover { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 7px 9px 0 var(--navy); }
.product-box__cover .book__title { font-size: 18px; }
.product-box__kicker { margin: 0 0 8px; }
.product-box__title { margin: 0 0 8px; font: 820 24px/1.15 var(--display); font-stretch: 110%; text-wrap: balance; }
.product-box__title a { color: var(--navy); text-decoration: none; }
.product-box__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.product-box__pitch { margin: 0 0 18px; color: var(--ink); }
.product-box__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.product-box__more { font-weight: 600; color: var(--blue-ink); }
.product-hook {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
    max-width: 70ch; margin: 0 auto 28px; padding: 12px 16px;
    background: var(--butter); border: 2px solid var(--navy); border-radius: var(--radius);
    font-size: 16px; line-height: 1.5;
}
.product-hook--exam { background: var(--sky); }
.product-hook--cpp { background: var(--mint); }
.product-hook--ai { background: var(--blush); }
.product-hook a { font-weight: 700; color: var(--navy); white-space: nowrap; text-underline-offset: 3px; }
@media (max-width: 640px) {
    .product-box { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; }
    .product-box__cover { width: 120px; }
    .product-box__title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
    .product-box__cover .book__cover { transition: none; }
}
/* On full-width (imported) posts the line sits above the page's own header. */
.product-hook-bar { padding-top: 18px; }
.product-hook-bar .product-hook { margin-bottom: 4px; max-width: 920px; }
