/* O/L Literature Help — site styles. Colours are taken from the RCF Creations logo. */
:root {
  --ink: #18212f;
  --muted: #5a6474;
  --paper: #f7f8fb;
  --card: #ffffff;
  --line: #e2e6ee;
  --brand: #1f5fa8;        /* logo blue */
  --brand-deep: #163f70;
  --brand-soft: #e9f1fb;
  --accent: #6aa531;       /* logo green */
  --accent-soft: #eef6e4;
  --heart: #d63a4a;        /* logo heart */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 6px 20px rgba(16, 32, 64, .07);
  --read: "Literata", Georgia, "Times New Roman", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sinhala: "Noto Sans Sinhala", "Iskoola Pota", var(--ui);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7ebf2; --muted: #a3adbd; --paper: #0f141c; --card: #171e29; --line: #283243;
    --brand: #6ea8ec; --brand-deep: #9cc4f3; --brand-soft: #172a42; --accent: #93cc5c; --accent-soft: #1b2b14;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--ui); line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { color: var(--brand-deep); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header & navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .site-header { background: rgba(23,30,41,.94); } }
.bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 62px; height: auto; border-radius: 8px; background: #fff; }
.brand b { display: block; font-family: var(--read); font-size: 1.15rem; line-height: 1.1; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: .76rem; }
.brand { min-width: 0; } .brand span { min-width: 0; }
@media (max-width: 440px) {
  .bar { gap: .5rem; }
  .brand img { width: 46px; }
  .brand b { font-size: 1rem; }
  .brand small { display: none; }
  .menu-toggle { padding: .55rem .7rem; }
}
.nav { margin-left: auto; }
.nav > ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; }
.nav a, .nav button { font: 600 .92rem/1 var(--ui); color: var(--ink); text-decoration: none; background: none; border: 0; padding: .7rem .7rem; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: .3rem; }
.nav a:hover, .nav button:hover, .nav [aria-current="page"], .nav .active > a { background: var(--brand-soft); color: var(--brand-deep); }
.nav li { position: relative; }
.nav .caret { width: .7em; height: .7em; transition: transform .15s; }
.nav .sub { display: none; position: absolute; top: 100%; left: 0; min-width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; list-style: none; margin: .25rem 0 0; }
.nav .sub a { font-weight: 500; padding: .55rem .7rem; line-height: 1.3; }
.nav .sub .overview a { font-weight: 700; color: var(--brand); }
.nav li.mega .sub { columns: 3; column-gap: .5rem; width: min(820px, 92vw); left: 50%; transform: translateX(-50%); }
.nav li.mega .sub li { break-inside: avoid; }
.nav li.open > .sub { display: block; }
.nav li.open > button .caret { transform: rotate(180deg); }
@media (hover: hover) and (min-width: 1201px) { .nav li:hover > .sub { display: block; } }
.menu-toggle { display: none; margin-left: auto; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: .6rem .85rem; font: 600 .95rem var(--ui); gap: .45rem; align-items: center; cursor: pointer; }
@media (max-width: 1200px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 64px); overflow-y: auto; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; padding: .5rem 16px 1rem; }
  .nav a, .nav button { width: 100%; padding: .85rem .6rem; font-size: 1rem; justify-content: space-between; }
  .nav .sub, .nav li.mega .sub { position: static; transform: none; width: auto; columns: 1; box-shadow: none; border: 0; border-left: 3px solid var(--brand-soft); border-radius: 0; margin: 0 0 .4rem .6rem; padding: 0 0 0 .4rem; min-width: 0; }
}

/* ---------- Home ---------- */
.hero { background: linear-gradient(135deg, var(--brand-deep), var(--brand) 60%, #2a7fc4); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(106,165,49,.35), transparent 40%), radial-gradient(circle at 10% 90%, rgba(214,58,74,.18), transparent 35%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: clamp(2.5rem, 7vw, 5rem); display: grid; gap: 1.5rem; }
.eyebrow { font: 700 .78rem/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: #cfe6b4; }
.hero h1 { font-family: var(--read); font-size: clamp(2.1rem, 5.5vw, 3.6rem); line-height: 1.05; margin: 0; letter-spacing: -.02em; max-width: 16ch; }
.hero p { font-size: clamp(1.02rem, 2.2vw, 1.2rem); max-width: 60ch; margin: 0; color: #e3eefb; }
.hero .notice { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: .8rem 1rem; font-size: .95rem; max-width: 60ch; }
.hero .notice a { color: #fff; font-weight: 700; }
.cta { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .8rem 1.15rem; border-radius: 11px; font: 700 .97rem var(--ui); text-decoration: none; border: 2px solid transparent; }
.btn-light { background: #fff; color: var(--brand-deep); }
.btn-light:hover { background: #eef5ff; color: var(--brand-deep); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-deep); color: #fff; }
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section h2.title { font-family: var(--read); font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0 0 .35rem; letter-spacing: -.01em; }
.section p.lede { color: var(--muted); margin: 0 0 1.5rem; max-width: 65ch; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card { display: flex; flex-direction: column; gap: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.2rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--ink); }
.card .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.card:nth-child(3n+2) .ico { background: var(--accent-soft); color: var(--accent); }
.card h3 { margin: .3rem 0 0; font: 700 1.08rem/1.25 var(--ui); }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card .count { margin-top: auto; padding-top: .4rem; font: 600 .8rem var(--ui); color: var(--brand); }
.list-cards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.list-cards a { display: flex; align-items: center; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.list-cards a:hover { border-color: var(--brand); }
.list-cards .num { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: .85rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow); }

/* ---------- Article pages ---------- */
.page-head { background: var(--card); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: 1.4rem; padding-bottom: 1.6rem; }
.crumbs { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .7rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.page-head h1 { font-family: var(--read); font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.15; margin: 0; letter-spacing: -.015em; max-width: 30ch; }
.page-head .kicker { display: inline-block; font: 700 .75rem/1 var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: .55rem; }
.layout { display: grid; gap: 2rem; padding-top: 1.8rem; padding-bottom: 3rem; }
@media (min-width: 1100px) { .layout.has-aside { grid-template-columns: minmax(0, 1fr) 280px; } }
.aside { align-self: start; position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; max-height: calc(100vh - 110px); overflow: auto; }
.aside h2 { font: 700 .8rem var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .2rem .4rem .6rem; }
.aside ul { list-style: none; margin: 0; padding: 0; }
.aside a { display: block; padding: .45rem .55rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem; line-height: 1.3; }
.aside a:hover { background: var(--brand-soft); }
.aside a[aria-current="page"] { background: var(--brand); color: #fff; }
@media (max-width: 1099px) { .aside { display: none; } }

.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 4vw, 2.6rem); box-shadow: var(--shadow); font-family: var(--read); font-size: 1.1rem; line-height: 1.78; overflow-wrap: anywhere; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1rem; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--read); line-height: 1.3; margin: 2rem 0 .7rem; color: var(--brand-deep); }
.prose h2 { font-size: 1.55rem; } .prose h3 { font-size: 1.32rem; } .prose h4 { font-size: 1.15rem; } .prose h5, .prose h6 { font-size: 1.05rem; }
.prose b, .prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.prose li { margin: .25rem 0; }
.prose li > p { margin: 0; }
.prose blockquote { margin: 1.2rem 0; padding: .3rem 0 .3rem 1.1rem; border-left: 4px solid var(--accent); color: var(--ink); }
.prose pre { font-family: var(--read); white-space: pre-wrap; background: var(--brand-soft); padding: 1rem 1.2rem; border-radius: 12px; font-size: 1.05rem; line-height: 1.7; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose img { display: block; margin: 1.2rem auto; border-radius: 12px; max-height: 520px; width: auto; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-family: var(--ui); font-size: .97rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .75rem; text-align: left; vertical-align: top; }
.prose th { background: var(--brand-soft); }
.prose a { overflow-wrap: anywhere; }
.prose .si, .prose :lang(si) { font-family: var(--sinhala); }
.prose sup { line-height: 0; }

/* Video embeds */
.video { position: relative; aspect-ratio: 16 / 9; margin: 1.4rem 0; border-radius: 14px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Download cards (replace Yola's file boxes) */
.file { display: flex; align-items: center; gap: .9rem; margin: .8rem 0; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); font-family: var(--ui); line-height: 1.3; }
.file:hover { border-color: var(--brand); color: var(--ink); }
.file .tag { flex-shrink: 0; width: 3.1rem; height: 3.1rem; border-radius: 10px; display: grid; place-items: center; font: 800 .72rem var(--ui); letter-spacing: .04em; color: #fff; background: var(--brand); }
.file .tag.pdf { background: #c8463d; } .file .tag.pptx { background: #d0742a; } .file .tag.jpg { background: var(--accent); }
.file .name { font-weight: 650; overflow-wrap: anywhere; }
.file .meta { display: block; color: var(--muted); font-size: .84rem; margin-top: .15rem; }
.files { display: grid; gap: .1rem; }

/* Scanned-page gallery */
.gallery { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); margin: 1.4rem 0; font-family: var(--ui); }
.gallery a { display: block; text-decoration: none; color: var(--muted); font-size: .8rem; text-align: center; }
.gallery img { margin: 0 0 .35rem; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; max-height: none; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(5, 10, 20, .86); }
.lightbox img { max-width: 96vw; max-height: 86vh; border-radius: 10px; display: block; }
.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #fff; font: 600 .9rem var(--ui); padding: .5rem 0; }
.lightbox button, .lightbox .lb-bar a { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: .5rem .8rem; font: 600 .9rem var(--ui); cursor: pointer; text-decoration: none; }

/* Contact box (replaces the Yola form) */
.contact { display: grid; gap: .8rem; margin: 1.2rem 0; padding: 1.2rem; border-radius: 14px; background: var(--accent-soft); font-family: var(--ui); }
.contact .btn { justify-self: start; background: #25a244; color: #fff; }

/* Prev / next */
.pager { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; margin-top: 1.6rem; font-family: var(--ui); }
.pager a { display: block; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--brand); }
.pager small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* ---------- Footer ---------- */
.site-footer { background: #0f2a4a; color: #c9d6e8; margin-top: 2rem; }
.site-footer .wrap { padding-top: 2.4rem; padding-bottom: 2rem; display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-footer h2 { font: 700 .8rem var(--ui); text-transform: uppercase; letter-spacing: .1em; color: #fff; margin: 0 0 .7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.site-footer a { color: #e6eefa; text-decoration: none; }
.site-footer li a { display: inline-block; padding: .4rem 0; min-height: 32px; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer .fine { border-top: 1px solid rgba(255,255,255,.12); padding: 1rem 16px; text-align: center; font-size: .82rem; color: #9fb1c9; }
.site-footer .heart { color: #ff7b88; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 4rem 0; }
.notfound h1 { font-family: var(--read); font-size: 2.2rem; margin: 0 0 .5rem; }

@media print {
  .site-header, .site-footer, .aside, .pager, .video, .rcf-quiz { display: none !important; }
  .prose { border: 0; box-shadow: none; padding: 0; }
}
@media (max-width: 360px) {
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .brand b { font-size: .95rem; }
}

/* ---------- O/L study guides ---------- */
.toc { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.6rem; padding: 0 0 1.2rem; border-bottom: 1px solid var(--line); font-family: var(--ui); }
.toc a { font-size: .85rem; font-weight: 600; text-decoration: none; padding: .4rem .75rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); }
.toc a:hover { background: var(--brand); color: #fff; }
.guide h2 { font-size: 1.6rem; padding-top: .6rem; border-top: 1px solid var(--line); margin-top: 2.4rem; }
.guide h2:first-of-type { border-top: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-family: var(--ui); font-size: .98rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.4rem; }
.facts dt { font-weight: 700; color: var(--muted); } .facts dd { margin: 0; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .4rem; } }
.ll { margin: 1.3rem 0; }
.ll blockquote { margin: 0 0 .5rem; border-left-color: var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; padding: .6rem 1rem; font-style: italic; }
.ll blockquote small { display: block; font-style: normal; font-family: var(--ui); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.box { border-radius: 12px; padding: 1rem 1.2rem; margin: 1.3rem 0; font-family: var(--ui); font-size: 1rem; line-height: 1.6; border: 1px solid; }
.box > :last-child { margin-bottom: 0; }
.box .box-title { display: block; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }
.box.remember { background: var(--accent-soft); border-color: #cfe4b5; }
.box.remember .box-title { color: var(--accent); }
.box.exam { background: var(--brand-soft); border-color: #c7dbf4; }
.box.exam .box-title { color: var(--brand); }
.box.warn { background: #fff5e6; border-color: #f2d3a2; color: #5b3d0c; }
.box.warn .box-title { color: #b36b00; }
@media (prefers-color-scheme: dark) { .box.remember { border-color: #2f4a1c; } .box.exam { border-color: #22406a; } .box.warn { background: #2c2110; border-color: #5a4219; color: #f1d9a8; } }
.terms { font-family: var(--ui); font-size: .98rem; }
.terms td:first-child { font-weight: 700; white-space: nowrap; }
.q { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; margin: 1.2rem 0; background: var(--paper); font-family: var(--ui); font-size: 1rem; line-height: 1.6; }
.q .q-tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .25rem .55rem; border-radius: 6px; margin-bottom: .55rem; background: var(--brand-soft); color: var(--brand-deep); }
.q .q-tag.official { background: #fde7e9; color: #a3202f; }
.q blockquote { font-family: var(--read); font-style: italic; margin: .5rem 0 .8rem; }
.q ol, .q ul { margin: .3rem 0 .6rem; }
.q .marks { float: right; font-size: .8rem; font-weight: 700; color: var(--muted); }
.q details { margin-top: .7rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.q summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.q summary:hover { color: var(--brand-deep); }
.q details[open] summary { margin-bottom: .5rem; }
.q .answer { font-family: var(--read); font-size: 1.04rem; line-height: 1.75; }
.q .answer p { margin: 0 0 .8rem; }
.list-cards .badge { margin-left: auto; font: 700 .7rem var(--ui); text-transform: uppercase; letter-spacing: .05em; padding: .25rem .5rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.archive-note { font-family: var(--ui); font-size: .93rem; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 1.2rem 0; color: var(--muted); }
.ad-slot { margin: 1.8rem 0; min-height: 100px; text-align: center; }
.ad-slot.ad-aside { margin: 1rem 0 0; }
@media print { .toc, .ad-slot, .archive-note { display: none !important; } .q details { display: block; } }
@media (max-width: 420px) { .terms td:first-child { white-space: normal; } .facts, .q, .box { overflow-wrap: anywhere; } .q { padding: .9rem; } }

/* ---------- Modern colour palette for cards ---------- */
:root {
  --c1: #4f46e5; --c1s: #eef0ff;   /* indigo */
  --c2: #0d9488; --c2s: #e6f7f5;   /* teal */
  --c3: #d97706; --c3s: #fff4e3;   /* amber */
  --c4: #e11d48; --c4s: #ffecf0;   /* rose */
  --c5: #7c3aed; --c5s: #f3edff;   /* violet */
  --c6: #059669; --c6s: #e7f8f0;   /* emerald */
  --c7: #0284c7; --c7s: #e6f4fc;   /* sky */
  --c8: #ea580c; --c8s: #fff0e6;   /* orange */
}
@media (prefers-color-scheme: dark) {
  :root {
    --c1: #8b8cf8; --c1s: #1e1d3d; --c2: #2dd4bf; --c2s: #10302d; --c3: #fbbf24; --c3s: #33270f;
    --c4: #fb7185; --c4s: #3a1620; --c5: #a78bfa; --c5s: #261a40; --c6: #34d399; --c6s: #0f2f24;
    --c7: #38bdf8; --c7s: #0d2a3b; --c8: #fb923c; --c8s: #3a2010;
  }
}
.cards > :nth-child(8n+1), .themes > :nth-child(8n+1), .facts > :nth-child(8n+1), .study-path li:nth-child(5n+1) { --k: var(--c1); --ks: var(--c1s); }
.cards > :nth-child(8n+2), .themes > :nth-child(8n+2), .facts > :nth-child(8n+2), .study-path li:nth-child(5n+2) { --k: var(--c2); --ks: var(--c2s); }
.cards > :nth-child(8n+3), .themes > :nth-child(8n+3), .facts > :nth-child(8n+3), .study-path li:nth-child(5n+3) { --k: var(--c3); --ks: var(--c3s); }
.cards > :nth-child(8n+4), .themes > :nth-child(8n+4), .facts > :nth-child(8n+4), .study-path li:nth-child(5n+4) { --k: var(--c4); --ks: var(--c4s); }
.cards > :nth-child(8n+5), .themes > :nth-child(8n+5), .facts > :nth-child(8n+5), .study-path li:nth-child(5n+5) { --k: var(--c5); --ks: var(--c5s); }
.cards > :nth-child(8n+6), .themes > :nth-child(8n+6), .facts > :nth-child(8n+6) { --k: var(--c6); --ks: var(--c6s); }
.cards > :nth-child(8n+7), .themes > :nth-child(8n+7), .facts > :nth-child(8n+7) { --k: var(--c7); --ks: var(--c7s); }
.cards > :nth-child(8n+8), .themes > :nth-child(8n+8), .facts > :nth-child(8n+8) { --k: var(--c8); --ks: var(--c8s); }

/* Home section cards */
.card { position: relative; overflow: hidden; border-top: 4px solid var(--k, var(--brand)); background: linear-gradient(180deg, var(--ks, var(--card)) 0%, var(--card) 55%); }
.card .ico, .card:nth-child(3n+2) .ico { background: linear-gradient(135deg, var(--k, var(--brand)), color-mix(in srgb, var(--k, var(--brand)) 65%, #fff)); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--k, var(--brand)) 30%, transparent); }
.card .count { color: var(--k, var(--brand)); }
.card:hover { border-color: var(--k, var(--brand)); box-shadow: 0 10px 28px color-mix(in srgb, var(--k, var(--brand)) 22%, transparent); }
.card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--k, var(--brand)); opacity: .07; }

/* Guide page header */
.guide-head { background: linear-gradient(120deg, var(--brand-deep), var(--brand) 55%, var(--c5)); color: #fff; border-bottom: 0; position: relative; overflow: hidden; }
.guide-head::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 92% 10%, rgba(255,255,255,.18), transparent 35%), radial-gradient(circle at 5% 120%, rgba(106,165,49,.35), transparent 40%); pointer-events: none; }
.guide-head .wrap { position: relative; z-index: 1; padding-top: 1.6rem; padding-bottom: 2.2rem; }
.guide-head .crumbs, .guide-head .crumbs a { color: rgba(255,255,255,.8); }
.guide-head .kicker { color: #d9f2bf; }
.guide-head h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 3rem); }

/* Study path: Learn, Understand, Practise, Answer, Revise */
.study-path { margin: 0 0 1.8rem; font-family: var(--ui); }
.study-path ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.study-path li { background: var(--ks); border: 1px solid color-mix(in srgb, var(--k) 25%, transparent); border-radius: 14px; padding: .8rem; position: relative; margin: 0; }
.study-path .step { display: flex; gap: .6rem; align-items: center; text-decoration: none; color: var(--ink); }
.study-path .step-n { flex-shrink: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--k); box-shadow: 0 4px 10px color-mix(in srgb, var(--k) 35%, transparent); }
.study-path .step b { display: block; color: var(--k); font-size: 1rem; }
.study-path .step small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.study-path .step-links { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.study-path .step-links a { font-size: .76rem; font-weight: 600; text-decoration: none; padding: .22rem .5rem; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid color-mix(in srgb, var(--k) 20%, transparent); }
.study-path .step-links a:hover { background: var(--k); color: #fff; }

/* Section headings with icons and step label */
.guide h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.guide h2 .h-ico { width: 2.2rem; height: 2.2rem; padding: .45rem; border-radius: 11px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.guide h2[data-step="Learn"] .h-ico { background: var(--c1s); color: var(--c1); }
.guide h2[data-step="Understand"] .h-ico { background: var(--c2s); color: var(--c2); }
.guide h2[data-step="Practise"] .h-ico { background: var(--c3s); color: var(--c3); }
.guide h2[data-step="Answer"] .h-ico { background: var(--c4s); color: var(--c4); }
.guide h2[data-step="Revise"] .h-ico { background: var(--c5s); color: var(--c5); }
.guide h2[data-step]::after { content: attr(data-step); margin-left: auto; font: 800 .68rem var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .6rem; }

/* Quick facts as coloured cards */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .7rem; background: none; border: 0; padding: 0; }
.facts .fact { background: var(--ks); border-left: 4px solid var(--k); border-radius: 10px; padding: .65rem .85rem; }
.facts .fact dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--k); font-weight: 800; }
.facts .fact dd { margin: .15rem 0 0; font-weight: 600; line-height: 1.35; }

/* Themes as coloured cards */
.guide ul.themes { list-style: none; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); font-family: var(--ui); font-size: .97rem; line-height: 1.55; }
.guide ul.themes li { margin: 0; background: var(--ks); border-radius: 14px; padding: 1rem 1.05rem; border: 1px solid color-mix(in srgb, var(--k) 22%, transparent); }
.guide ul.themes li strong:first-child { display: block; color: var(--k); font-size: 1.02rem; margin-bottom: .25rem; }

/* Structure strip (poems) */
.strip { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); margin: 1.2rem 0 1.6rem; font-family: var(--ui); }
.strip > div { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .75rem .75rem; font-size: .88rem; line-height: 1.35; }
.strip > div b { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .2rem; }
.strip > div:nth-child(5n+1) { border-top: 4px solid var(--c1); } .strip > div:nth-child(5n+2) { border-top: 4px solid var(--c2); }
.strip > div:nth-child(5n+3) { border-top: 4px solid var(--c3); } .strip > div:nth-child(5n+4) { border-top: 4px solid var(--c4); }
.strip > div:nth-child(5n+5) { border-top: 4px solid var(--c5); }

/* Timeline (stories, novels, drama) */
.timeline { list-style: none; margin: 1.2rem 0 1.6rem; padding: 0 0 0 1.6rem; position: relative; font-family: var(--ui); font-size: 1rem; line-height: 1.55; }
.timeline::before { content: ""; position: absolute; left: .55rem; top: .3rem; bottom: .3rem; width: 3px; border-radius: 3px; background: linear-gradient(var(--c1), var(--c2), var(--c3), var(--c4), var(--c5)); }
.timeline li { position: relative; margin: 0 0 1rem; padding-left: .6rem; }
.timeline li::before { content: ""; position: absolute; left: -1.38rem; top: .35rem; width: .9rem; height: .9rem; border-radius: 50%; background: var(--card); border: 3px solid var(--brand); }
.timeline li b:first-child { display: block; color: var(--brand-deep); }

/* Character cards (drama, novels) */
.chars { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin: 1.2rem 0; font-family: var(--ui); font-size: .96rem; line-height: 1.5; }
.chars > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.chars .who { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; margin-bottom: .4rem; }
.chars .avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.chars > div:nth-child(4n+1) .avatar { background: var(--c1); } .chars > div:nth-child(4n+2) .avatar { background: var(--c2); }
.chars > div:nth-child(4n+3) .avatar { background: var(--c4); } .chars > div:nth-child(4n+4) .avatar { background: var(--c3); }

/* Technique tables become cards on phones */
@media (max-width: 640px) {
  .terms, .terms tbody, .terms tr, .terms td { display: block; width: 100%; }
  .terms thead { display: none; }
  .terms tr { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 .7rem; overflow: hidden; background: var(--card); }
  .terms td { border: 0; border-bottom: 1px solid var(--line); padding: .5rem .8rem; }
  .terms td:last-child { border-bottom: 0; }
  .terms td::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
  .terms td:first-child { background: var(--brand-soft); color: var(--brand-deep); }
}

/* Flashcard-style quick revision */
.flash { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin: 1rem 0 1.4rem; font-family: var(--ui); font-size: .95rem; line-height: 1.5; }
.flash > div { border-radius: 14px; padding: .9rem 1rem; color: #fff; box-shadow: var(--shadow); }
.flash > div b:first-child { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; margin-bottom: .3rem; }
.flash > div:nth-child(5n+1) { background: linear-gradient(135deg, #4f46e5, #6d64f0); }
.flash > div:nth-child(5n+2) { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.flash > div:nth-child(5n+3) { background: linear-gradient(135deg, #c2410c, #f97316); }
.flash > div:nth-child(5n+4) { background: linear-gradient(135deg, #be123c, #f43f5e); }
.flash > div:nth-child(5n+5) { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }

/* Reading progress and back-to-top */
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3)); transform-origin: 0 50%; transform: scaleX(0); }
.to-top { position: fixed; right: 16px; bottom: 18px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--brand-deep); color: #fff; }

/* Question cards */
.q { border-left: 4px solid var(--c3); }
.q:has(.q-tag.official) { border-left-color: var(--c4); }

/* Home: study path banner and latest guides */
.path-banner { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); list-style: none; padding: 0; margin: 0; font-family: var(--ui); }
.path-banner li { background: var(--ks); border-radius: 14px; padding: 1rem; border: 1px solid color-mix(in srgb, var(--k) 25%, transparent); }
.path-banner li:nth-child(1) { --k: var(--c1); --ks: var(--c1s); } .path-banner li:nth-child(2) { --k: var(--c2); --ks: var(--c2s); }
.path-banner li:nth-child(3) { --k: var(--c3); --ks: var(--c3s); } .path-banner li:nth-child(4) { --k: var(--c4); --ks: var(--c4s); }
.path-banner li:nth-child(5) { --k: var(--c5); --ks: var(--c5s); }
.path-banner .n { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--k); color: #fff; font-weight: 800; margin-bottom: .5rem; }
.path-banner b { display: block; color: var(--k); font-size: 1.05rem; }
.path-banner span:last-child { color: var(--muted); font-size: .9rem; }
@media print { .read-progress, .to-top, .study-path { display: none !important; } }

/* ---------- Home hero (animated) ---------- */
.hero-v2 { background: linear-gradient(110deg, #0a2a5e 0%, #15468f 34%, #2f6fc2 56%, #8fb9eb 76%, #d4e5f8 100%); color: #fff; }
.hero-v2::after { background: radial-gradient(circle at 18% 30%, rgba(255,255,255,.10), transparent 40%), radial-gradient(circle at 70% 90%, rgba(255,255,255,.12), transparent 45%); }
@keyframes heroShift { 0% { background-position: 0% 40%; } 100% { background-position: 100% 60%; } }
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-bg::before, .hero-bg::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); }
.hero-bg::before { width: 46vw; height: 46vw; left: -10vw; top: -20vw; background: rgba(86,140,230,.35); animation: glow1 16s ease-in-out infinite alternate; }
.hero-bg::after { width: 38vw; height: 38vw; left: 30vw; bottom: -22vw; background: rgba(140,190,255,.28); animation: glow2 20s ease-in-out infinite alternate; }
@keyframes glow1 { to { transform: translate(14vw, 8vw) scale(1.15); } }
@keyframes glow2 { to { transform: translate(-12vw, -6vw) scale(.9); } }
.hero-bg .dot { position: absolute; bottom: -12px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 0 10px rgba(255,255,255,.8); animation: rise linear infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: .9; } 90% { opacity: .6; } 100% { transform: translateY(-560px) translateX(30px); opacity: 0; } }
.hero-bg .d1 { left: 4%; animation-duration: 14s; animation-delay: -2s; } .hero-bg .d2 { left: 9%; animation-duration: 19s; animation-delay: -9s; width: 4px; height: 4px; }
.hero-bg .d3 { left: 15%; animation-duration: 16s; animation-delay: -5s; } .hero-bg .d4 { left: 22%; animation-duration: 22s; animation-delay: -14s; width: 3px; height: 3px; }
.hero-bg .d5 { left: 28%; animation-duration: 17s; animation-delay: -1s; } .hero-bg .d6 { left: 34%; animation-duration: 21s; animation-delay: -11s; width: 4px; height: 4px; }
.hero-bg .d7 { left: 41%; animation-duration: 15s; animation-delay: -7s; } .hero-bg .d8 { left: 47%; animation-duration: 24s; animation-delay: -17s; width: 3px; height: 3px; }
.hero-bg .d9 { left: 53%; animation-duration: 18s; animation-delay: -3s; } .hero-bg .d10 { left: 59%; animation-duration: 20s; animation-delay: -12s; width: 5px; height: 5px; }
.hero-bg .d11 { left: 65%; animation-duration: 16s; animation-delay: -6s; } .hero-bg .d12 { left: 71%; animation-duration: 23s; animation-delay: -15s; width: 3px; height: 3px; }
.hero-bg .d13 { left: 77%; animation-duration: 17s; animation-delay: -4s; } .hero-bg .d14 { left: 83%; animation-duration: 21s; animation-delay: -10s; width: 4px; height: 4px; }
.hero-bg .d15 { left: 88%; animation-duration: 15s; animation-delay: -8s; } .hero-bg .d16 { left: 93%; animation-duration: 25s; animation-delay: -19s; width: 3px; height: 3px; }
.hero-bg .d17 { left: 12%; animation-duration: 26s; animation-delay: -21s; width: 5px; height: 5px; } .hero-bg .d18 { left: 62%; animation-duration: 27s; animation-delay: -23s; width: 5px; height: 5px; }
.hero-bg .plane { position: absolute; width: 54px; filter: drop-shadow(0 6px 10px rgba(10,40,90,.25)); opacity: .9; }
.hero-bg .plane svg { display: block; width: 100%; height: auto; }
.hero-bg .p1 { top: 18%; left: -8%; animation: fly1 28s linear infinite; }
.hero-bg .p2 { top: 4%; left: -8%; width: 38px; animation: fly2 36s linear infinite; animation-delay: -14s; opacity: .7; }
.hero-bg .p3 { top: 10%; left: -8%; width: 30px; animation: fly1 44s linear infinite; animation-delay: -30s; opacity: .55; }
@keyframes fly1 { 0% { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(60vw, -30px) rotate(4deg); } 100% { transform: translate(120vw, 10px) rotate(-2deg); } }
@keyframes fly2 { 0% { transform: translate(0, 0) rotate(6deg); } 50% { transform: translate(55vw, 40px) rotate(-3deg); } 100% { transform: translate(120vw, -20px) rotate(5deg); } }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 1rem; padding-top: clamp(2.2rem, 6vw, 4rem) !important; padding-bottom: 0 !important; }
.hero-copy { padding-bottom: clamp(2rem, 6vw, 4rem); }
.hero-v2 h1 { font-family: var(--ui); font-weight: 800; font-size: clamp(2.3rem, 6vw, 4.1rem); letter-spacing: -.025em; line-height: 1.02; max-width: none; margin: 0; text-shadow: 0 2px 18px rgba(5,20,50,.25); }
.hero-v2 .tagline { font-family: var(--read); font-style: italic; font-size: clamp(1.35rem, 3.2vw, 2.05rem); margin: .55rem 0 0; color: #f1f6ff; }
.hero-rule { display: block; width: 70px; height: 2px; background: rgba(255,255,255,.7); margin: 1.2rem 0; border-radius: 2px; }
.hero-v2 .hero-text { font-size: clamp(1rem, 2vw, 1.15rem); color: #e4eefc; max-width: 46ch; margin: 0 0 1.6rem; }
.btn-primary { background: #1a5fd0; color: #fff; box-shadow: 0 8px 20px rgba(10,40,100,.35); }
.btn-primary:hover { background: #1550b3; color: #fff; transform: translateY(-1px); }
.btn svg { transition: transform .15s; } .btn:hover svg { transform: translateX(3px); }
.hero-art { position: relative; align-self: end; justify-self: end; width: 100%; max-width: 620px; animation: floatArt 7s ease-in-out infinite alternate; }
.hero-art img { display: block; width: 100%; height: auto;
  /* Soft oval fade on every side so the photo's own background dissolves into the banner gradient. */
  -webkit-mask-image: radial-gradient(closest-side at 52% 55%, #000 58%, rgba(0,0,0,.85) 70%, transparent 100%);
  mask-image: radial-gradient(closest-side at 52% 55%, #000 58%, rgba(0,0,0,.85) 70%, transparent 100%);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
@keyframes floatArt { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.site-notice { font-family: var(--ui); font-size: .92rem; background: var(--brand-soft); color: var(--brand-deep); border-radius: 12px; padding: .7rem 1rem; margin: 0 0 1.8rem; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { padding-bottom: 1.2rem; }
  .hero-art { justify-self: center; max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-v2, .hero-bg .dot, .hero-bg .plane, .hero-art, .hero-art img, .plant-sway, .hero-bg::before, .hero-bg::after { animation: none !important; }
  .hero-bg .plane { display: none; }
}

/* ---------- About page ---------- */
.about-hero { background: linear-gradient(110deg, #0a2a5e 0%, #15468f 40%, #2f6fc2 70%, #8fb9eb 100%); color: #fff; position: relative; overflow: hidden; }
.about-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 40%); pointer-events: none; }
.about-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.about-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 6px solid rgba(255,255,255,.9); box-shadow: 0 18px 40px rgba(5,20,50,.35); background: #fff; }
.about-intro h1 { font-family: var(--ui); font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem); margin: .3rem 0 .2rem; letter-spacing: -.02em; }
.about-role { font-family: var(--read); font-style: italic; font-size: 1.15rem; color: #dbe8fb; margin: 0 0 1rem; }
.about-intro > p:not(.about-role) { color: #e8f0fc; max-width: 58ch; margin: 0 0 1.4rem; font-size: 1.05rem; }
.quals .card { cursor: default; }
.quals .card:hover { transform: none; }
.about-why { margin-top: 1.4rem; font-family: var(--ui); }
.about-why h3 { margin-top: 0; }
.about-why li { margin: .5rem 0; line-height: 1.6; }
.about-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; font-size: 1.05rem; line-height: 1.75; }
.about-cols > div:first-child p { font-family: var(--read); margin: 0 0 1rem; }
.about-cols .panel { font-family: var(--ui); font-size: .98rem; line-height: 1.6; }
.about-note { font-family: var(--ui); font-size: .82rem; color: var(--muted); margin-top: 1.6rem; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-photo { max-width: 220px; margin: 0 auto; }
  .about-intro > p:not(.about-role) { margin-left: auto; margin-right: auto; }
  .about-intro .cta { justify-content: center; }
  .about-cols { grid-template-columns: 1fr; }
}
.nav > ul > li > a, .nav > ul > li > button { white-space: nowrap; padding-left: .6rem; padding-right: .6rem; }

/* ---------- Ad containers: present on every page, hidden until AdSense is enabled ---------- */
.ad-slot.ad-off { display: none; }
.ad-slot.ad-top { margin: 1rem auto 0; max-width: 1160px; padding: 0 16px; }

/* ---------- Poem lines (original pages): tight spacing, clear stanza gaps ---------- */
.poem-lines { margin: 0 0 1.2rem; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--brand-soft); }
.poem-lines p { margin: 0; line-height: 1.6; }

/* ---------- Illustrations ---------- */
.illus { display: block; width: 100%; height: auto; border-radius: 16px; }
.illus.photo { aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 40%; background: var(--brand-soft); }
.page-head.has-art .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 1.5rem; align-items: center; }
.head-art { filter: drop-shadow(0 10px 24px rgba(10, 30, 70, .22)); }
.guide-head .head-art .illus { border: 3px solid rgba(255,255,255,.65); }
@media (max-width: 640px) {
  .page-head.has-art .wrap { grid-template-columns: minmax(0, 1fr) 96px; gap: .8rem; }
  .head-art .illus { border-radius: 12px; }
}
.list-cards a.with-art { display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto; column-gap: .8rem; row-gap: .3rem; align-items: center; align-content: center; padding: .6rem .8rem .6rem .6rem; }
.list-cards .thumb { flex-shrink: 0; width: 72px; grid-row: 1 / span 2; align-self: center; }
.list-cards .thumb .illus { border-radius: 10px; }
.list-cards .lc-label { flex: 1; min-width: 0; line-height: 1.3; }
/* The study-guide badge sits under the title so it never squeezes the title. */
.list-cards a.with-art .badge { grid-column: 2; justify-self: start; margin-left: 0; }
.list-cards a.with-art:not(:has(.badge)) .thumb { grid-row: 1; }

/* Home: "Scroll down" prompt at the bottom of the banner */
.hero-v2 { position: relative; }
.scroll-down { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: .15rem; color: #fff; text-decoration: none; font: 700 .9rem var(--ui); letter-spacing: .03em; padding: .45rem 1.1rem .35rem; border-radius: 999px; background: transparent; border: 1px solid rgba(255,255,255,.4); text-shadow: 0 1px 3px rgba(5,20,50,.35); }
.scroll-down:hover, .scroll-down:focus-visible { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }
.scroll-down svg { animation: scroll-bob 1.8s ease-in-out infinite; }
@keyframes scroll-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
#explore { scroll-margin-top: 72px; }
@media (max-width: 760px) { .hero-v2 { padding-bottom: 4.2rem; } .scroll-down { bottom: .8rem; font-size: .8rem; padding: .35rem .9rem .25rem; } }
@media (prefers-reduced-motion: reduce) { .scroll-down svg { animation: none; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Installable app: phone bar, iOS help, menu item */
.install-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: flex; align-items: center; gap: .7rem; padding: .7rem .75rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(10, 30, 70, .25); font-family: var(--ui); animation: install-in .35s ease-out; }
.install-bar img { border-radius: 10px; flex-shrink: 0; }
.install-bar span { flex: 1; min-width: 0; line-height: 1.25; }
.install-bar b { display: block; font-size: .92rem; }
.install-bar small { display: block; color: var(--muted); font-size: .78rem; }
.install-bar .install-go { flex-shrink: 0; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: .6rem .9rem; font: 700 .9rem var(--ui); cursor: pointer; }
.install-bar .install-x { flex-shrink: 0; background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: .2rem .35rem; cursor: pointer; }
@keyframes install-in { from { transform: translateY(120%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .install-bar { animation: none; } }
.install-help { border: 0; border-radius: 16px; padding: 1.4rem; max-width: min(420px, 92vw); font-family: var(--ui); color: var(--ink); background: var(--card); }
.install-help::backdrop { background: rgba(5, 15, 35, .6); }
.install-help h2 { margin: 0 0 .7rem; font-size: 1.2rem; }
.install-help ol { padding-left: 1.2rem; margin: 0 0 1rem; line-height: 1.6; }
.install-help svg { vertical-align: -3px; color: var(--brand); }
.nav .nav-install button { color: var(--brand); }
@media (min-width: 1081px) { .nav .nav-install { display: none; } }
.has-install-bar .to-top { bottom: 96px; }

/* Home: the potted plant's leaves sway gently. A copy of the leaf area of the photo sits exactly
   over the plant (positions are in % of the photo, which is 566 x 435) and rocks from the pot rim. */
.plant-sway { position: absolute; left: 63.25%; top: 63.45%; width: 23.67%; height: 16.09%;
  background: url(/assets/img/hero-student.jpg) no-repeat 82.87% 75.62% / 422.4% 621.4%;
  transform-origin: 50% 100%; opacity: .96; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 62% at 50% 64%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 62% at 50% 64%, #000 62%, transparent 100%);
  animation: plantSway 5.5s ease-in-out infinite; }
@keyframes plantSway { 0%, 100% { transform: rotate(0deg) skewX(0deg); } 30% { transform: rotate(1.6deg) skewX(-1deg); } 65% { transform: rotate(-1.2deg) skewX(.8deg); } }

/* ---------- RCF Practice Papers 2026 ---------- */
.pp-focus { margin: .5rem 0 0; font-family: var(--ui); font-size: 1rem; opacity: .9; }
.pp-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; }
.pp-tools .btn { cursor: pointer; padding: .6rem .95rem; font-size: .9rem; border-color: var(--line); background: var(--card); color: var(--ink); }
.pp-tools .btn.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.pp h3.pp-group { font-family: var(--ui); font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-deep); margin: 1.6rem 0 .2rem; }
.pp h3.pp-group small { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); }
.pp .pp-marks { font-family: var(--ui); font-size: .85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pp ul.pp-sub { list-style: none; padding-left: 0; }
.pp ul.pp-sub li { margin: .35rem 0; }
.pp .pp-l { color: var(--brand-deep); margin-right: .15rem; }
@media print {
  .pp-tools, .page-head .crumbs { display: none !important; }
  .pp .q details:not([open]) { display: none; }
  .pp .q { break-inside: avoid; }
}

/* ---------- Announcement pop-up ---------- */
.announce { border: 0; border-radius: 18px; padding: 0; max-width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(5, 20, 50, .35); background: var(--card); color: var(--ink); }
.announce::backdrop { background: rgba(5, 20, 50, .45); }
.announce .an-top { background: linear-gradient(135deg, #0a2a5e, #1f5fa8); color: #fff; padding: 1.3rem 1.4rem 1.1rem; }
.announce .an-top small { display: block; font: 800 .72rem var(--ui); letter-spacing: .1em; text-transform: uppercase; color: #d9f2bf; margin-bottom: .35rem; }
.announce h2 { margin: 0; font-family: var(--read); font-size: 1.45rem; line-height: 1.2; }
.announce .an-body { padding: 1rem 1.4rem 1.3rem; font-family: var(--ui); }
.announce .an-body p { margin: 0 0 1rem; line-height: 1.55; }
.announce .an-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.announce .an-actions .btn { cursor: pointer; }
.announce .an-later { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.announce .an-x { position: absolute; top: .5rem; right: .6rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 1.3rem; cursor: pointer; }
.pp .q-tag .pp-ref { text-transform: none; }

/* Downloads on the practice-paper pages, and the printed / PDF versions */
.pp-downloads { margin: 0 0 1.3rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-family: var(--ui); }
.pp-downloads .box-title { display: block; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: .3rem; }
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  html, body { background: #fff !important; color: #111 !important; }
  .pp-downloads, .announce, .install-bar, .skip { display: none !important; }
  .page-head.guide-head { background: none !important; color: #111 !important; border-bottom: 2px solid #1f5fa8; }
  .page-head.guide-head h1, .page-head.guide-head .pp-focus { color: #111 !important; }
  .page-head.guide-head .kicker { color: #1f5fa8 !important; }
  .page-head .wrap { padding-top: 0; padding-bottom: .8rem; }
  .pp .pp-note { display: block !important; }
  .pp .q summary { display: none; }
  .pp .q details[open] { border-top: 1px dashed #999; }
  .pp .q { background: #fff; border-color: #bbb; }
  .pp h2 { break-after: avoid; }
  .pp-print-questions .pp .q details { display: none !important; }
  .pp-print-questions #paper-2 { break-before: page; }
}
@media print {
  .guide-head::after, .guide-head::before { display: none !important; }
  /* Ruled writing space on the question paper (dotted rules, so every PDF reader shows them). */
  .pp-print-questions .pp .pp-write { display: block; clear: both; margin: .2rem 0 .5rem; }
  .pp-print-questions .pp .pp-write span { display: block; height: 1.75em; border-bottom: 1px dotted #777; }
  .pp-print-questions .pp .q { break-inside: auto; }
  .pp-print-questions .pp ul.pp-sub li { break-inside: avoid; }
}

.pp .pp-write { display: none; }
@media print {
  html.pp-print { font-size: 13.5px; }
  .pp-print-answers .pp .q { break-inside: auto; }
  .pp-print .pp .q li, .pp-print .pp .q blockquote, .pp-print .pp .q > p { break-inside: avoid; }
  .pp-print .pp .q .q-tag, .pp-print .pp h3.pp-group { break-after: avoid; }
}

/* Practice papers in the Past Papers library, and the link box on other pages */
.pp-library { margin: 0 0 2rem; padding: 1.1rem 1.2rem 1.2rem; border: 1px solid #c7dbf4; border-radius: 14px; background: var(--brand-soft); font-family: var(--ui); }
.pp-library .box-title { display: block; font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: .2rem; }
.pp-library h2 { margin: 0 0 .4rem; }
.pp-library h2 small { font-size: .6em; font-weight: 600; color: var(--muted); }
.pp-library > p { margin: 0 0 .9rem; line-height: 1.55; }
.pp-lib-list { display: grid; gap: .7rem; }
.pp-lib-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
.pp-lib-title { font-weight: 800; font-size: 1.05rem; text-decoration: none; }
.pp-lib-focus { display: block; color: var(--muted); font-size: .9rem; margin: .1rem 0 .3rem; }
.pp-link-box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #c7dbf4; border-radius: 12px; background: var(--brand-soft); color: var(--ink); text-decoration: none; font-family: var(--ui); }
.pp-link-box:hover { border-color: var(--brand); }
.pp-link-box b { display: block; line-height: 1.3; }
.pp-link-box small { display: block; color: var(--muted); font-size: .88rem; margin-top: .1rem; }
.pp-link-tag { font: 800 .7rem var(--ui); text-transform: uppercase; letter-spacing: .06em; padding: .3rem .5rem; border-radius: 6px; background: var(--brand); color: #fff; }
.pp-link-go { font-size: 1.3rem; color: var(--brand); }
@media (prefers-color-scheme: dark) { .pp-library, .pp-link-box { border-color: #22406a; } }
.pp-lib-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.pp-lib-pdfs { display: flex; flex-wrap: wrap; gap: .4rem; }
.pp-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .6rem .35rem .4rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .88rem; }
.pp-pill:hover { border-color: var(--brand); }
.pp-pill small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.pp-pill .tag { font: 800 .62rem var(--ui); letter-spacing: .04em; padding: .22rem .35rem; border-radius: 5px; background: #c0392b; color: #fff; }
.pp-pill-web { padding-left: .6rem; color: var(--brand); }
/* The single "Practice Papers 2026" item in the Poetry menu */
.nav .sub .nav-new a { font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: .45rem; }
.nav .new-badge { font: 800 .62rem var(--ui); letter-spacing: .06em; text-transform: uppercase; padding: .18rem .4rem; border-radius: 5px; background: #e0457b; color: #fff; }
/* Section card with its own picture (e.g. Syllabus) */
.card.has-photo .card-photo { display: block; width: 112px; box-shadow: 0 6px 14px rgba(10, 40, 100, .18); border-radius: 11px; }
.card.has-photo .card-photo .illus.photo { border-radius: 11px; aspect-ratio: 3 / 2; object-position: 50% 50%; }
