/* Layout: sharp-cornered blocks echoing the two logo squares; single reading column with wide bands. */
:root {
  --paper: #ffffff;
  --wash: #f5f3ef;
  --ink: #18171c;
  --muted: #5d5a55;
  --line: #e2ddd4;
  --marigold: #f3b03e;
  --red: #db3a26;
  --red-ink: #b92d1b;
  --on-red: #ffffff;
  --tbc-bg: #fff1c9;
  --band: #18171c;
  --on-band: #ffffff;
  --on-band-muted: #c9c4bb;
  --tbc-fg: #6b4a00;
  --display: "Gelasio", Georgia, "Times New Roman", serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Arial, sans-serif;
  --max: 72rem;
  --read: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151418; --wash: #1d1c21; --ink: #efebe4; --muted: #aaa59c; --line: #34313a;
    --red: #e8523d; --red-ink: #f2725f; --tbc-bg: #3a2f12; --tbc-fg: #f6d58a; --band: #0c0b0e; --on-band: #efebe4; --on-band-muted: #aaa59c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151418; --wash: #1d1c21; --ink: #efebe4; --muted: #aaa59c; --line: #34313a;
  --red: #e8523d; --red-ink: #f2725f; --tbc-bg: #3a2f12; --tbc-fg: #f6d58a; --band: #0c0b0e; --on-band: #efebe4; --on-band-muted: #aaa59c; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
img { max-width: 100%; height: auto; }
a { color: var(--red-ink); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--marigold); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0; }
.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stack { display: grid; gap: 1rem; }
.read { max-width: var(--read); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 38rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 1.4rem; height: 0.7rem;
  background: linear-gradient(90deg, var(--marigold) 0 46%, transparent 46% 54%, var(--red) 54% 100%);
}
.tbc { background: var(--tbc-bg); color: var(--tbc-fg); padding: 0 0.25em; font-size: 0.95em; }

/* Header */
.top-strip { background: var(--band); color: var(--on-band); font-size: 0.9rem; }
.top-strip .wrap { padding-block: 0.45rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; justify-content: space-between; }
.top-strip strong { color: var(--marigold); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 3.6rem; height: auto; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1.1; display: block; }
.brand-tag { font-family: var(--display); font-style: italic; color: var(--red-ink); font-size: 0.85rem; display: block; }
.nav-toggle {
  display: none; background: none; border: 2px solid var(--ink); color: var(--ink);
  font: inherit; font-weight: 700; padding: 0.35rem 0.8rem; cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; align-items: center; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem; padding: 0.3rem 0; border-bottom: 3px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--marigold); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); }
.site-nav .btn { border-bottom: 0; padding: 0.55rem 1rem; }
@media (max-width: 1100px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px));
  }
  .site-nav li a { display: block; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .site-nav li:last-child a { margin-top: 0.8rem; text-align: center; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: 0.8rem 1.4rem; border: 2px solid var(--red); background: var(--red); color: var(--on-red);
}
.btn:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
.band { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.band.wash { background: var(--wash); }
.band.ink { background: var(--band); color: var(--on-band); }
.band.ink a { color: var(--marigold); }
.band.ink .lead, .band.ink .eyebrow { color: var(--on-band-muted); }
.section-head { display: grid; gap: 0.75rem; margin-bottom: 2rem; max-width: 46rem; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 2rem + 4vw, 5rem); }
.hero .wrap { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; }
.hero h1 { max-width: 16ch; }
.hero .meta { font-size: 0.95rem; color: var(--muted); font-weight: 700; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* Topic journey: five squares that fill like an answer sheet */
.journey { display: grid; gap: 0.6rem; }
.journey-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.9rem; align-items: center; }
.journey-row .sq { width: 2.6rem; height: 2.6rem; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--display); font-weight: 700; }
.journey-row:nth-child(1) .sq, .journey-row:nth-child(5) .sq { background: var(--marigold); color: #18171c; border-color: var(--marigold); }
.journey-row:nth-child(2) .sq, .journey-row:nth-child(4) .sq { background: var(--ink); color: var(--paper); }
.journey-row:nth-child(3) .sq { background: var(--red); color: var(--on-red); border-color: var(--red); }
.journey-row b { display: block; font-family: var(--display); font-size: 1.1rem; }
.journey-row span { color: var(--muted); font-size: 0.95rem; }
.journey-card { border: 2px solid var(--ink); padding: 1.5rem; background: var(--paper); }
.journey-card .cap { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 1rem; }

/* Programme cards */
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid-4 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.prog {
  display: grid; gap: 0.8rem; align-content: start; padding: 1.6rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); position: relative;
}
.prog::before { content: ""; position: absolute; top: -2px; left: -2px; width: 1.1rem; height: 1.1rem; background: var(--marigold); }
.prog.alt::before { background: var(--red); }
.prog .tag { font-size: 0.85rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.prog .go { font-weight: 700; color: var(--red-ink); }
.prog:hover { background: var(--wash); }

.feature { display: grid; gap: 0.5rem; align-content: start; }
.feature .num { font-family: var(--display); font-size: 2.2rem; font-weight: 700; color: var(--red-ink); line-height: 1; }
.feature p { color: var(--muted); }
.band.ink .feature p { color: var(--on-band-muted); }
.band.ink .feature .num { color: var(--marigold); }

/* Three levels ladder */
.ladder { display: grid; gap: 0.6rem; }
.rung { display: grid; grid-template-columns: minmax(0, 1fr); padding: 1rem 1.2rem; border-left: 0.6rem solid var(--marigold); background: var(--paper); }
.rung:nth-child(2) { margin-left: 1.5rem; border-left-color: #e8763a; }
.rung:nth-child(3) { margin-left: 3rem; border-left-color: var(--red); }
.rung b { font-family: var(--display); font-size: 1.1rem; }
.rung span { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 480px) { .rung:nth-child(2) { margin-left: 0.75rem; } .rung:nth-child(3) { margin-left: 1.5rem; } }

/* Lists and tables */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.ticks li { display: grid; grid-template-columns: 0.8rem minmax(0, 1fr); gap: 0.8rem; }
.ticks li::before { content: ""; width: 0.8rem; height: 0.8rem; background: var(--red); margin-top: 0.45rem; }
.ticks li:nth-child(even)::before { background: var(--marigold); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--wash); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.callout { border: 2px solid var(--ink); padding: 1.4rem 1.5rem; display: grid; gap: 0.6rem; background: var(--paper); }
.callout.note { border-color: var(--marigold); }
.quote { font-family: var(--display); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); line-height: 1.35; max-width: 34ch; }

/* Page head */
.page-head { padding-block: clamp(2rem, 1.6rem + 3vw, 3.75rem); background: var(--wash); border-bottom: 1px solid var(--line); }
.page-head .wrap { display: grid; gap: 1rem; }
.page-head h1 { max-width: 22ch; }
.crumbs { font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Tabs on the JEE page */
.split { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.split > section { border-top: 0.5rem solid var(--marigold); background: var(--paper); padding: 1.6rem; display: grid; gap: 1rem; align-content: start; }
.split > section + section { border-top-color: var(--red); }

/* Exams */
.exam-card { display: grid; gap: 0.7rem; padding: 1.6rem; border: 2px solid var(--ink); background: var(--paper); align-content: start; }
.exam-code { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; }
.exam-card .when { font-weight: 700; color: var(--red-ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0; border: 1px solid var(--line); }
.facts div { background: var(--paper); box-shadow: 0 0 0 0.5px var(--line); padding: 0.9rem 1rem; display: grid; gap: 0.15rem; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; font-weight: 700; font-family: var(--display); font-size: 1.1rem; }
.downloads { display: grid; gap: 0.6rem; }
.dl { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); background: var(--paper); }
.dl .soon { color: var(--muted); font-size: 0.95rem; }

/* Forms */
form.enquiry { display: grid; gap: 1rem; max-width: 40rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 700; }
.field .hint { font-size: 0.9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line);
  padding: 0.7rem 0.8rem; width: 100%; border-radius: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.two { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.check { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 0.6rem; align-items: start; font-size: 0.98rem; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; }
.form-status { padding: 1rem 1.2rem; border-left: 0.5rem solid var(--marigold); background: var(--wash); }

/* Contact */
.contact-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.contact-list { display: grid; gap: 1rem; }
.contact-list dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.contact-list dd { margin: 0.2rem 0 0; font-size: 1.1rem; }

/* Footer */
.site-footer { background: var(--band); color: var(--on-band); padding-block: 3rem 2rem; font-size: 0.95rem; }
.site-footer a { color: var(--on-band); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.foot-brand { display: grid; gap: 0.4rem; }
.foot-brand .name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.foot-brand .line { font-family: var(--display); font-style: italic; color: var(--marigold); }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.foot-legal { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--on-band-muted); display: grid; gap: 0.3rem; font-size: 0.88rem; }
.site-footer h3 { font-family: var(--body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--marigold); margin-bottom: 0.8rem; }

/* Floating WhatsApp */
.wa {
  position: fixed; z-index: 25;
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.1rem;
  background: #1f7a44; color: #ffffff; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
}
.wa svg { width: 1.3rem; height: 1.3rem; }
.wa:hover { background: #17633a; }

.prose { display: grid; gap: 1rem; max-width: var(--read); }
.prose h2 { margin-top: 1.25rem; font-size: 1.5rem; }
.prose ol, .prose ul { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 40; background: var(--band); color: var(--on-band); padding: 0.6rem 1rem; }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(8px + env(safe-area-inset-top, 0px)); }
