@font-face {
    font-family: "Manrope Fallback";
    src: local("Segoe UI"), local("Helvetica Neue"), local("Arial");
    font-weight: 100 700;
    size-adjust: 103%;
    ascent-override: 95%;
    descent-override: 25%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Manrope Fallback";
    src: local("Segoe UI Bold"), local("Helvetica Neue Bold"), local("Arial Bold"), local("Arial");
    font-weight: 800;
    size-adjust: 102%;
    ascent-override: 94%;
    descent-override: 24%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Fraunces Fallback";
    src: local("Georgia"), local("Times New Roman");
    size-adjust: 104%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-800.woff2") format("woff2");
    font-weight: 650 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-600.woff2") format("woff2");
    font-weight: 600 650;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #0a1628;
    --ink-soft: #243247;
    --muted: #5b677a;
    --line: #d7e0ec;
    --paper: #f3f6fa;
    --sheet: #ffffff;
    --accent: #f0a202;
    --accent-ink: #1a1400;
    --teal: #0e7c6b;
    --teal-soft: #e7f5f2;
    --header-bg: #0a1628;
    --header-text: #ffffff;
    --header-muted: rgba(255, 255, 255, .68);
    --empty-bg: #fff8e8;
    --empty-line: #f0d59a;
    --empty-text: #6a4d10;
    --radius: 1rem;
    --radius-sm: .7rem;
    --shadow: 0 12px 30px rgba(10, 22, 40, .08);
    --header: 4.35rem;
    --font-display: "Fraunces", "Fraunces Fallback", Georgia, serif;
    --font-body: "Manrope", "Manrope Fallback", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    --ink: #eef3fb;
    --ink-soft: #c9d4e5;
    --muted: #9aabbf;
    --line: #2a384d;
    --paper: #0b1220;
    --sheet: #121b2c;
    --accent: #f0a202;
    --accent-ink: #1a1400;
    --teal: #4ecdb8;
    --teal-soft: #163532;
    --header-bg: #070d18;
    --header-text: #ffffff;
    --header-muted: rgba(255, 255, 255, .68);
    --empty-bg: #2a2414;
    --empty-line: #5a4a22;
    --empty-text: #f0d59a;
    --shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--teal); text-decoration-thickness: .08em; text-underline-offset: .18em; }

a:hover { color: var(--ink); }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 40;
    background: var(--accent);
    color: var(--accent-ink);
    padding: .55rem .85rem;
    border-radius: .5rem;
    font-weight: 700;
}

.skip:focus { top: .75rem; }

.wrap {
    width: min(72rem, calc(100% - 2rem));
    margin-inline: auto;
}

.masthead {
    background: var(--header-bg);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0;
    background: var(--header-bg);
    border-bottom: 0;
}

.site-header__inner {
    width: min(72rem, calc(100% - 2rem));
    margin-inline: auto;
    min-height: var(--header);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem .75rem;
    padding: .55rem 0;
}

.brand {
    display: grid;
    gap: .1rem;
    color: var(--header-text);
    text-decoration: none;
    min-width: 0;
}

.brand:hover,
.brand:hover .brand__name {
    color: #fff;
}

.brand:hover .brand__name {
    color: var(--accent);
}

.brand__name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.brand__tag {
    color: var(--header-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: .4rem;
    margin-left: auto;
    justify-content: flex-end;
}

.nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    padding: .5rem .75rem;
    border-radius: .45rem;
    border: 1.5px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
    font-size: .84rem;
    font-weight: 650;
    white-space: nowrap;
    text-align: center;
    line-height: 1.25;
}

.nav a:hover {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .38);
    color: #fff;
}

.theme-toggle {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    padding: 0;
}

.theme-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
}

.theme-toggle__moon { display: none; }

html[data-theme="dark"] .theme-toggle__sun { display: none; }

html[data-theme="dark"] .theme-toggle__moon { display: block; }

.search {
    display: flex;
    margin: 0;
}

.search input {
    width: 100%;
    border: 0;
    border-radius: 999px 0 0 999px;
    background: var(--paper);
    color: var(--ink);
    padding: .55rem .85rem;
    font: inherit;
}

.search button {
    border: 0;
    border-radius: 0 999px 999px 0;
    background: var(--accent);
    color: var(--accent-ink);
    padding: .55rem .9rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.search--light {
    max-width: 28rem;
    margin-bottom: 1rem;
}

.hero {
    position: relative;
    margin: 0;
    padding: 0;
    min-height: min(52vh, 26rem);
    display: grid;
    align-items: start;
    color: #fff;
    isolation: isolate;
    overflow: hidden;
    background: transparent;
    width: 100%;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero__shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 22, 40, .88) 0%, rgba(10, 22, 40, .62) 48%, rgba(10, 22, 40, .28) 100%),
        linear-gradient(180deg, rgba(10, 22, 40, .2) 0%, rgba(10, 22, 40, .72) 100%);
}

.hero__inner {
    width: min(72rem, calc(100% - 2rem));
    max-width: none;
    margin-inline: auto;
    padding: 1.15rem 0 2.25rem;
    animation: rise .8s ease both;
}

.hero__inner > * {
    max-width: 40rem;
}

.hero__brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 650;
    letter-spacing: -.03em;
    line-height: 1.05;
}

.hero__mark {
    width: .7rem;
    height: 2.1rem;
    border-radius: 999px;
    background: var(--accent);
    flex: none;
}

.hero h1 {
    margin: 0 0 .9rem;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.4vw, 3.8rem);
    font-weight: 650;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.hero p {
    margin: 0 0 1.5rem;
    max-width: 32rem;
    color: rgba(255, 255, 255, .86);
    font-size: 1.12rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 3rem;
    padding: .75rem 1.15rem;
    border-radius: 999px;
    border: 0;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, color .18s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn--accent {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn--accent:hover { color: var(--accent-ink); background: #ffb41a; }

.btn--ghost {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .28);
}

.btn--ghost:hover { color: #fff; background: rgba(255, 255, 255, .2); }

.btn--solid {
    background: var(--ink);
    color: #fff;
}

.btn--solid:hover { color: #fff; background: #15253d; }

.btn--soft {
    background: var(--teal-soft);
    color: var(--teal);
}

.page {
    padding: 2rem 0 3.5rem;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 650;
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
}

.crumbs a:hover { color: var(--ink); }

.crumbs li:not(:last-child)::after {
    content: "/";
    margin-left: .35rem;
    color: #9aa6b8;
}

.section {
    padding: 3.5rem 0;
}

.section--tight { padding: 2.5rem 0; }

.section__head {
    display: grid;
    gap: .55rem;
    max-width: 38rem;
    margin-bottom: 1.5rem;
}

.section__head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    letter-spacing: -.03em;
    line-height: 1.15;
}

.section__head p {
    margin: 0;
    color: var(--muted);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: stretch;
}

.resource-grid > li {
    display: flex;
    min-height: 0;
}

.resource {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    justify-items: center;
    gap: .55rem;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 1.05rem .75rem 1.1rem;
    text-align: center;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.resource:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
    box-shadow: var(--shadow);
    color: inherit;
}

.resource > .resource__icon {
    width: 3.4rem;
    height: 3.4rem;
    padding: .8rem;
    border-radius: 1.05rem;
    background: var(--teal-soft);
    color: var(--teal);
    display: block;
    align-self: center;
    line-height: 0;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.resource strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.resource span {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.resource em {
    font-style: normal;
    font-size: .82rem;
    font-weight: 800;
    color: var(--teal);
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: .65rem;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: stretch;
}

.class-grid > li {
    display: flex;
    min-height: 0;
}

.class-chip {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: .5rem .6rem .55rem;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.class-chip:hover {
    transform: translateY(-3px);
    border-color: var(--teal);
    background: var(--sheet);
    color: inherit;
}

.class-chip strong {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.class-chip span {
    color: var(--muted);
    font-size: .62rem;
    line-height: 1.25;
    flex: none;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.class-pick {
    margin-top: 1.25rem;
    border-top: .28rem solid var(--teal);
}

.class-pick__head {
    display: grid;
    gap: .4rem;
    max-width: 40rem;
    margin-bottom: 1.15rem;
}

.class-pick__eyebrow {
    margin: 0;
    color: var(--teal);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.class-pick__head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
    letter-spacing: -.03em;
    line-height: 1.15;
}

.class-pick__head p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.45;
}

.class-grid--pick {
    gap: .75rem;
}

.class-chip--pick {
    gap: .35rem;
    min-height: 5.1rem;
    padding: .75rem .8rem .8rem;
    background: linear-gradient(165deg, var(--sheet) 0%, color-mix(in srgb, var(--teal) 8%, var(--sheet)) 100%);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--teal) 12%, transparent);
}

.class-chip--pick strong {
    font-size: 1.12rem;
}

.class-chip--pick span {
    font-size: .7rem;
    line-height: 1.35;
    -webkit-line-clamp: 4;
}

.class-chip--pick:hover {
    background: linear-gradient(165deg, var(--sheet) 0%, color-mix(in srgb, var(--teal) 16%, var(--sheet)) 100%);
    box-shadow: 0 10px 22px rgba(10, 22, 40, .08);
}

.panel {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + .15rem);
    box-shadow: var(--shadow);
    padding: 1.35rem 1.35rem 1.5rem;
}

.page-title {
    margin: 0 0 .7rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -.035em;
    line-height: 1.1;
}

.page-title small {
    font-size: .58em;
    font-weight: 650;
    letter-spacing: -.02em;
    color: var(--muted);
}

.lede {
    margin: 0 0 1.25rem;
    max-width: 40rem;
    color: var(--muted);
    font-size: 1.12rem;
}

.meta-line {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 650;
}

.medium-jump {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
}

.medium-jump__label {
    margin: 0 0 .75rem;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 750;
}

.medium-jump__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: .75rem;
}

.medium-card {
    display: grid;
    gap: .35rem;
    min-height: 5.4rem;
    padding: .95rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.medium-card strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.medium-card span {
    font-size: .78rem;
    font-weight: 700;
    opacity: .82;
    line-height: 1.35;
}

.medium-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(10, 22, 40, .12);
    color: inherit;
}

.medium-card:nth-child(6n + 1) {
    background: linear-gradient(145deg, #e7f5f2 0%, #d4efe9 100%);
    border-color: #9fd4c8;
    color: #0a5c4f;
}

.medium-card:nth-child(6n + 2) {
    background: linear-gradient(145deg, #fff1d6 0%, #ffe3a8 100%);
    border-color: #f0c56a;
    color: #7a4d00;
}

.medium-card:nth-child(6n + 3) {
    background: linear-gradient(145deg, #e8eefc 0%, #d5e0fa 100%);
    border-color: #a8b9e8;
    color: #243a7a;
}

.medium-card:nth-child(6n + 4) {
    background: linear-gradient(145deg, #fde8ef 0%, #f9d0dd 100%);
    border-color: #e8a0b8;
    color: #7a2848;
}

.medium-card:nth-child(6n + 5) {
    background: linear-gradient(145deg, #e9f7e4 0%, #d4efc8 100%);
    border-color: #9dcf88;
    color: #2f5c1c;
}

.medium-card:nth-child(6n + 6) {
    background: linear-gradient(145deg, #efe8fb 0%, #ddd0f5 100%);
    border-color: #b9a3e0;
    color: #4a2f7a;
}

html[data-theme="dark"] .medium-card:nth-child(6n + 1) {
    background: linear-gradient(145deg, #163532 0%, #1a403c 100%);
    border-color: #2f6b62;
    color: #9fe0d2;
}

html[data-theme="dark"] .medium-card:nth-child(6n + 2) {
    background: linear-gradient(145deg, #3a2c12 0%, #4a3816 100%);
    border-color: #8a6a28;
    color: #f0d59a;
}

html[data-theme="dark"] .medium-card:nth-child(6n + 3) {
    background: linear-gradient(145deg, #1a2438 0%, #222e48 100%);
    border-color: #3d5278;
    color: #b8c8e8;
}

html[data-theme="dark"] .medium-card:nth-child(6n + 4) {
    background: linear-gradient(145deg, #351824 0%, #452030 100%);
    border-color: #7a3d55;
    color: #f0b8cc;
}

html[data-theme="dark"] .medium-card:nth-child(6n + 5) {
    background: linear-gradient(145deg, #1c2e18 0%, #253a1f 100%);
    border-color: #4a6e3a;
    color: #b8e0a4;
}

html[data-theme="dark"] .medium-card:nth-child(6n + 6) {
    background: linear-gradient(145deg, #261838 0%, #322048 100%);
    border-color: #5a4080;
    color: #d0b8f0;
}

.pyq-jump {
    margin-top: 1rem;
}

.pyq-jump h2 {
    margin: 0 0 .55rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -.02em;
}

.pyq-jump .lede {
    margin-bottom: 1rem;
}

.medium-section {
    margin-top: 1rem;
    scroll-margin-top: calc(var(--header) + 1rem);
    border-left: .35rem solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.medium-section:target {
    border-left-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(240, 162, 2, .28), var(--shadow);
    background: color-mix(in srgb, var(--accent) 6%, var(--sheet));
}

.group { margin: 1.5rem 0 0; }

.group h2 {
    margin: 0 0 .9rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -.02em;
}

.subject-list {
    display: grid;
    gap: .65rem;
}

.subject-direct {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .85rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 14%, var(--sheet)) 0%, var(--sheet) 72%);
    border-left: .3rem solid var(--teal);
    text-decoration: none;
    color: inherit;
}

.subject-direct:hover {
    color: inherit;
    border-color: var(--teal);
}

.subject-direct:hover .subject-drop__name { color: var(--teal); }

.subject-direct__title {
    display: inline;
    min-width: 0;
}

.subject-direct__book-hint {
    margin-left: .35rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    font-family: var(--font-body, inherit);
    letter-spacing: 0;
}

.subject-drop {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    overflow: hidden;
}

.subject-drop[open] {
    border-color: var(--teal);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal) 35%, transparent);
}

.subject-drop__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    padding: .85rem 1rem;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 14%, var(--sheet)) 0%, var(--sheet) 72%);
    border-left: .3rem solid var(--teal);
}

.subject-drop__summary::-webkit-details-marker { display: none; }

.subject-drop__summary::after {
    content: "";
    width: .55rem;
    height: .55rem;
    border-right: 2px solid var(--teal);
    border-bottom: 2px solid var(--teal);
    transform: rotate(45deg);
    flex: none;
    transition: transform .18s ease;
}

.subject-drop[open] > .subject-drop__summary::after {
    transform: rotate(-135deg);
    margin-top: .25rem;
}

.subject-drop__name {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 650;
    letter-spacing: -.02em;
    color: var(--ink);
}

.subject-drop__meta {
    color: var(--teal);
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
    margin-left: auto;
}

.books {
    list-style: none;
    display: grid;
    gap: .55rem;
    margin: 0;
    padding: 0;
}

.books--nested {
    padding: .55rem .85rem .75rem;
    background: var(--sheet);
    border-top: 1px solid var(--line);
}

.books li {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    align-items: stretch;
    margin: 0;
    padding: 0;
    border-bottom: 0;
}

.books li > div {
    flex: 1;
    min-width: 0;
}

.books__label {
    flex: 1;
    min-width: 0;
}

.books a {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    width: 100%;
    min-width: 0;
    padding: .85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--teal) 28%, var(--line));
    border-left: .28rem solid var(--teal);
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 12%, var(--sheet)) 0%, var(--sheet) 70%);
    color: var(--ink);
    text-decoration: none;
    font-weight: 750;
    line-height: 1.35;
    box-shadow: 0 1px 0 color-mix(in srgb, var(--teal) 8%, transparent);
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}

.books a .count {
    flex: none;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--teal) 14%, var(--sheet));
    color: var(--teal);
    font-size: .78rem;
    font-weight: 750;
    white-space: nowrap;
}

.books a::after {
    content: "";
    flex: none;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--teal) 16%, var(--sheet));
    border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M6 3.5 10.5 8 6 12.5' stroke='%230e7c6b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 55% 50%;
    background-size: .7rem;
    transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}

html[data-theme="dark"] .books a::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M6 3.5 10.5 8 6 12.5' stroke='%234ecdb8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.books a:hover {
    color: var(--teal);
    border-color: var(--teal);
    background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 18%, var(--sheet)) 0%, color-mix(in srgb, var(--teal) 6%, var(--sheet)) 100%);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--teal) 16%, transparent);
    transform: translateY(-1px);
}

.books a:hover::after {
    transform: translateX(.16rem);
    background-color: color-mix(in srgb, var(--teal) 24%, var(--sheet));
    border-color: var(--teal);
}

.count { color: var(--muted); font-size: .9rem; white-space: nowrap; }

.chapter-files {
    display: grid;
    gap: .65rem;
    margin: 0 0 1.15rem;
}

.chapter-readers {
    display: grid;
    gap: 1.25rem;
    margin: 0 0 1.25rem;
}

.page-reader {
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--panel) 92%, var(--teal) 8%);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.page-reader__status {
    margin: 0;
    padding: .85rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 650;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

.page-reader__stage {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: .75rem;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 70%, #d8e4df), var(--panel));
}

.page-reader__page {
    margin: 0;
}

.page-reader__canvas {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 14%, transparent);
    pointer-events: none;
}

.page-reader__stage::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.page-reader__missing {
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--panel) 85%, #c44 15%);
    color: var(--ink);
}

.file {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    max-width: 100%;
    margin: 0;
    padding: .85rem 1.05rem;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    line-height: 1.35;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--teal) 22%, transparent);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.file:hover {
    background: #0b6759;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px color-mix(in srgb, var(--teal) 28%, transparent);
}

html[data-theme="dark"] .file:hover {
    background: #3db8a4;
}

.prose {
    max-width: 44rem;
}

.prose h2 {
    margin: 2.2rem 0 .7rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    letter-spacing: -.02em;
}

.prose h3 {
    margin: 1.4rem 0 .45rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.prose p, .prose li { color: var(--ink-soft); }

.lede--guide { max-width: 46rem; }

.page-title--guide {
    font-size: clamp(1.7rem, 3.2vw, 2.45rem);
}

.guide.panel {
    margin-top: 1.25rem;
    max-width: none;
}

.guide > h2:first-child { margin-top: 0; }

.guide ul,
.guide ol {
    margin: .35rem 0 1.1rem;
    padding-left: 1.25rem;
}

.guide li + li { margin-top: .4rem; }

.guide strong { color: var(--ink); font-weight: 800; }

.guide .table-scroll {
    max-width: 100%;
    margin: .85rem 0 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.guide table {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
}

.guide th,
.guide td {
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    color: var(--ink-soft);
    font-size: .95rem;
    line-height: 1.45;
}

.guide th {
    background: color-mix(in srgb, var(--teal) 12%, var(--sheet));
    color: var(--ink);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.guide tr:last-child td,
.guide tr:last-child th { border-bottom: 0; }

.guide tbody th {
    font-weight: 800;
    color: var(--ink);
    background: transparent;
    font-size: .95rem;
    letter-spacing: 0;
}

.faq h3 { margin-bottom: .2rem; }

.guide code {
    font-size: .92em;
    background: color-mix(in srgb, var(--teal) 10%, var(--sheet));
    padding: .1em .35em;
    border-radius: .3rem;
}

.guide pre {
    margin: .85rem 0 1.25rem;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--teal) 6%, var(--sheet));
    font-size: .88rem;
    line-height: 1.45;
}

.guide pre code {
    background: transparent;
    padding: 0;
}

.toc {
    margin: 1.4rem 0 0;
    padding: 1rem 1.1rem 1.15rem;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.toc strong {
    display: block;
    margin-bottom: .4rem;
    font-family: var(--font-display);
}

.toc ol { margin: .35rem 0 0; padding-left: 1.2rem; }

.chapter-section-title {
    margin: 1.6rem 0 .75rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -.02em;
}

.chapter-facts {
    max-width: 100%;
    margin: 0 0 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.chapter-facts table {
    width: 100%;
    border-collapse: collapse;
}

.chapter-facts th,
.chapter-facts td {
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    color: var(--ink-soft);
    font-size: .95rem;
    line-height: 1.45;
}

.chapter-facts tr:last-child th,
.chapter-facts tr:last-child td {
    border-bottom: 0;
}

.chapter-facts th {
    width: 38%;
    font-weight: 800;
    color: var(--ink);
    background: color-mix(in srgb, var(--teal) 10%, var(--sheet));
}

.chapter-siblings .lede {
    margin: 0 0 1rem;
}

.chapter-siblings .books li.is-current {
    list-style: none;
}

.books__current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--teal) 14%, var(--sheet));
    border: 1px solid color-mix(in srgb, var(--teal) 28%, var(--line));
    font-weight: 750;
}

.chapter-siblings__book {
    margin: 1.1rem 0 0;
}

.chapter-siblings__book a {
    font-weight: 750;
}

.chapter-body {
    margin-top: 1.4rem;
    padding: 1.1rem 1.15rem;
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.chapter-body table { border-collapse: collapse; width: 100%; }

.chapter-body td, .chapter-body th {
    border: 1px solid var(--line);
    padding: .4rem .55rem;
    text-align: left;
}

.pager {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.2rem;
}

.empty {
    padding: 1.2rem 1.25rem;
    background: var(--empty-bg);
    border: 1px solid var(--empty-line);
    border-radius: var(--radius-sm);
    color: var(--empty-text);
}

.stay-banner {
    background: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent-ink) 12%, transparent);
}

.stay-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .95rem 0;
}

.stay-banner__text {
    margin: 0;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--accent-ink);
}

.stay-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.stay-banner .stay-connected__btn--wa { background: #128c7e; }
.stay-banner .stay-connected__btn--tg { background: #006699; }

.stay-connected--inline {
    margin: 1.15rem 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.stay-connected__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.stay-connected__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    min-height: 3.25rem;
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    background: var(--sheet);
    border: 1.5px solid var(--line);
}

.stay-connected__card--wa { border-color: color-mix(in srgb, #25d366 55%, var(--line)); }
.stay-connected__card--tg { border-color: color-mix(in srgb, #229ed9 55%, var(--line)); }

.stay-connected__label {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 750;
    font-size: .95rem;
    color: var(--ink);
}

.stay-connected__ico {
    width: 1.2rem;
    height: 1.2rem;
    flex: none;
}

.stay-connected__card--wa .stay-connected__ico { color: #128c7e; }
.stay-connected__card--tg .stay-connected__ico { color: #1a7aa8; }

.stay-connected__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    padding: .5rem .9rem;
    border-radius: .45rem;
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    font-size: .88rem;
    white-space: nowrap;
}

.stay-connected__btn--wa { background: #128c7e; }
.stay-connected__btn--wa:hover { background: #0f766a; color: #fff; }
.stay-connected__btn--tg { background: #006699; }
.stay-connected__btn--tg:hover { background: #005580; color: #fff; }

@media (max-width: 640px) {
    .stay-connected__grid { grid-template-columns: 1fr; }
    .stay-banner__inner { padding: .85rem 0; }
}

.site-footer {
    margin-top: 2.5rem;
    background: var(--header-bg);
    color: rgba(255, 255, 255, .78);
    padding: 2.2rem 0 2.5rem;
}

.site-footer a { color: rgba(255, 255, 255, .86); text-decoration: none; }

.site-footer a:hover { color: var(--accent); }

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem 1.1rem;
    margin-bottom: .9rem;
}

.site-footer p {
    margin: 0;
    max-width: 42rem;
    font-size: .95rem;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
    .nav a { font-size: .78rem; padding: .45rem .42rem; }
}

@media (max-width: 980px) {
    .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .resource strong { font-size: 1.2rem; }
    .resource span { font-size: .95rem; }
    .class-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .site-header__inner { padding: .55rem 0 .7rem; }
    .nav {
        flex-basis: 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem;
        justify-content: stretch;
    }
    .nav a {
        padding: .65rem .7rem;
        white-space: normal;
        width: 100%;
    }
    .hero { min-height: min(46vh, 22rem); }
    .hero__shade {
        background:
            linear-gradient(180deg, rgba(10, 22, 40, .45) 0%, rgba(10, 22, 40, .86) 100%),
            linear-gradient(90deg, rgba(10, 22, 40, .7), rgba(10, 22, 40, .45));
    }
    .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .class-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .resource-grid, .class-grid { grid-template-columns: 1fr 1fr; }
    .medium-jump__grid { grid-template-columns: 1fr 1fr; }
    .subject-drop__summary {
        flex-wrap: wrap;
        padding: .8rem .85rem;
    }
    .subject-drop__meta {
        order: 3;
        width: 100%;
        margin-left: 0;
        white-space: normal;
    }
    .subject-direct { flex-wrap: wrap; }
}

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

/* Share links */
.share-wrap{margin:1.25rem 0 0}
.share-wrap--end{margin:2rem 0 0;padding-top:1rem;border-top:1px solid color-mix(in srgb, var(--ink) 12%, transparent)}
.share{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.55rem .6rem;
    margin-top: 1.15rem;
    font-size:.9rem;
}
.share__label{
    font-weight:750;
    letter-spacing:.02em;
    color:var(--muted);
    margin-right:.15rem;
}
.share__btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:.4rem;
    min-height:2.35rem;
    padding:.45rem .85rem;
    border-radius:.45rem;
    color:#fff;
    text-decoration:none;
    font-weight:750;
    font-size:.86rem;
    line-height:1.2;
    white-space:nowrap;
}
.share__btn:hover{color:#fff;filter:brightness(1.08)}
.share__ico{width:1.05rem;height:1.05rem;flex:none}
.share__btn--facebook{background:#0b5fcc}
.share__btn--facebook:hover{background:#094fb0}
.share__btn--telegram{background:#006699}
.share__btn--telegram:hover{background:#005580}
.share__btn--whatsapp{background:#128c7e}
.share__btn--whatsapp:hover{background:#0f766a}

.home-seo {
    margin: 0;
}

.home-seo h2 {
    margin-top: 0;
}

.home-seo h3 {
    margin-top: 1.35rem;
}

.sitemap-seo {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--sheet);
}

.sitemap-seo h2 {
    margin-top: 0;
}

.sitemap-seo a {
    word-break: break-all;
    font-weight: 750;
}

.sitemap-list {
    display: grid;
    gap: .35rem .85rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.sitemap-list a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: .18em;
}

.sitemap-list a:hover { color: var(--accent); }

.sitemap-list--classes {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

@media (max-width: 560px) {
    .sitemap-list--classes { grid-template-columns: 1fr 1fr; }
}
