/* نذاكر v6 — match nezakr.edu IDEA (soft purple/indigo edtech)
   Gold standard: https://www.nezakr.net/edu/
   Shifted hue: primary #5B4BCC (not 1:1 #443276 / #3730A3)
   Canvas soft · white cards · green download CTAs · Arabic RTL */

@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@500;600;700;800;900&family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  --canvas: #f7f8fc;
  --surface: #ffffff;
  --lilac: #eeebfb;
  --lilac-2: #f5f3ff;
  --lilac-deep: #e4dff8;
  --ink: #1e1b3a;
  --ink-soft: #35324f;
  --muted: #5b6478;
  --line: #dce0ee;
  --line-soft: #ebeaf5;

  --brand: #5b4bcc;
  --brand-mid: #4f3fb8;
  --brand-deep: #3f348f;
  --brand-hero: #372860;
  --brand-hero-2: #241a42;
  --brand-soft: #eeebfb;
  --brand-glow: rgb(91 75 204 / 0.18);

  --gold: #e8c56a;
  --gold-ink: #2a2140;
  --gold-soft: #fbf3dc;

  --success: #0f9f6e;
  --success-deep: #0b7f58;
  --success-soft: #e6f7f0;

  --radius: 1rem;
  --radius-sm: 0.65rem;
  --radius-lg: 1.35rem;
  --radius-xl: 1.85rem;
  --shadow: 0 18px 40px rgb(36 26 66 / 0.08);
  --shadow-sm: 0 4px 14px rgb(36 26 66 / 0.06);
  --shadow-card: 0 1px 2px rgb(30 27 58 / 0.04), 0 10px 24px rgb(30 27 58 / 0.05);
  --max: 80rem;
  --header-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Cairo", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Tajawal", "Cairo", "Segoe UI", Tahoma, sans-serif;

  /* legacy aliases so older page hooks don't break */
  --bg: var(--canvas);
  --warm: var(--canvas);
  --warm-band: var(--lilac-2);
  --navy: var(--brand);
  --navy-mid: var(--brand-mid);
  --navy-soft: var(--brand-deep);
  --cyan: var(--brand);
  --cyan-deep: var(--brand-mid);
  --cyan-soft: var(--brand-soft);
  --cyan-glow: var(--brand-glow);
  --coral: var(--success);
  --coral-deep: var(--success-deep);
  --coral-soft: var(--success-soft);
  --cta: var(--success);
  --cta-deep: var(--success-deep);
  --cta-soft: var(--success-soft);
}

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

html {
  scroll-behavior: smooth;
  font-size: 106.25%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink);
  background: var(--canvas);
  direction: rtl;
  min-height: 100vh;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--brand-deep);
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.35;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ——— Topbar (light seasonal strip) ——— */
.topbar {
  background: var(--brand-deep);
  color: #f3eefc;
  font-size: 0.82rem;
}

.topbar__inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 2.15rem;
  padding-block: 0.35rem;
}

.season-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  color: var(--gold);
  font-weight: 700;
}

/* ——— Header / Nav ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(247 248 252 / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgb(30 27 58 / 0.05);
  background: rgb(255 255 255 / 0.94);
}

.site-header__inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--ink);
  flex-shrink: 0;
}

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

.brand__mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 18px var(--brand-glow);
}

.brand__mark svg {
  width: 1.15rem;
  height: 1.15rem;
}

.header-search {
  flex: 1;
  max-width: 22rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.3rem 0.25rem 0.85rem;
  box-shadow: var(--shadow-sm);
}

.header-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  padding-block: 0.45rem;
}

.header-search input::placeholder {
  color: var(--muted);
}

.header-search button {
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 0.45rem 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.header-search button:hover {
  background: var(--brand-mid);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 0.65rem;
  padding: 0.45rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-inline-start: auto;
}

.nav > a,
.nav-mega__btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 0.65rem;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav > a:hover,
.nav-mega__btn:hover,
.nav > a[aria-current="page"] {
  color: var(--brand);
  background: var(--lilac);
}

.nav-cta {
  background: var(--brand) !important;
  color: #fff !important;
  margin-inline-start: 0.35rem;
}

.nav-cta:hover {
  background: var(--brand-mid) !important;
  color: #fff !important;
}

.nav-mega {
  position: relative;
}

.nav-mega__panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  z-index: 60;
}

.nav-mega.is-open .nav-mega__panel {
  display: grid;
}

.mega-col h4 {
  font-size: 0.85rem;
  color: var(--brand);
  margin-bottom: 0.45rem;
}

.mega-col a {
  display: block;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.mega-col a:hover {
  background: var(--lilac);
  color: var(--brand);
}

/* ——— Hero (nezakr dark violet portal) ——— */
.hero {
  padding: 1.35rem 0 0.5rem;
}

.hero__inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 1.25rem;
  align-items: center;
  min-height: 24rem;
  border-radius: var(--radius-xl);
  padding: 2.15rem 2.5rem 1.5rem;
  background:
    radial-gradient(ellipse at 0% 100%, #5148a0 0%, transparent 55%),
    linear-gradient(125deg, var(--brand-hero), var(--brand-hero-2) 72%);
  color: #fff;
  box-shadow: 0 22px 55px rgb(35 20 60 / 0.18);
}

.hero__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image:
    linear-gradient(#fff 1px, transparent 1px),
    linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
}

.hero__copy,
.hero__visual {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.88rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.85rem, 3.1vw, 2.75rem);
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
  max-width: 38rem;
}

.hero h1 em,
.hero h1 span {
  color: var(--gold);
  font-style: normal;
}

.hero__lead {
  color: #ebe4f7;
  font-size: 1rem;
  line-height: 1.9;
  max-width: 34rem;
  margin: 0.85rem 0 1.15rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.hero__search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #ece5f2;
  border-radius: 1.05rem;
  padding: 0.35rem;
  max-width: 38rem;
  box-shadow: 0 10px 28px rgb(19 9 35 / 0.22);
}

.hero__search input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  height: 2.85rem;
  padding: 0 0.85rem;
  color: var(--ink);
  background: transparent;
  border-radius: 0.75rem;
}

.hero__search input::placeholder {
  color: var(--muted);
}

.hero__search button {
  border: 0;
  border-radius: 0.8rem;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
  min-height: 2.85rem;
  padding: 0 1.25rem;
  cursor: pointer;
  white-space: nowrap;
}

.hero__search button:hover {
  filter: brightness(1.04);
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(156 135 177 / 0.4);
  background: rgb(255 255 255 / 0.06);
  color: #f7efff;
  font-size: 0.86rem;
  font-weight: 600;
}

.hero__links a:hover {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}

.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-panel {
  width: 100%;
  max-width: 22rem;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(179 156 204 / 0.28);
  border-radius: 1.25rem;
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.hero-panel__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  margin-bottom: 0.7rem;
}

.hero-panel__title strong {
  font-size: 1.55rem;
  font-weight: 800;
  display: block;
  line-height: 1.2;
}

.hero-panel__title span {
  font-size: 0.82rem;
  opacity: 0.9;
}

.hero-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.hero-panel__cell {
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(179 156 204 / 0.22);
  border-radius: 0.8rem;
  padding: 0.75rem 0.85rem;
}

.hero-panel__cell strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
}

.hero-panel__cell span {
  font-size: 0.8rem;
  color: #f1e9fa;
}

.hero-panel__wide {
  grid-column: 1 / -1;
  background: rgb(232 197 106 / 0.14);
  border-color: rgb(232 197 106 / 0.28);
}

.hero-panel__wide strong {
  color: var(--gold);
}

/* Stats under hero (when separate) */
.trust {
  padding: 0.85rem 0 0.25rem;
}

.trust__inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.trust__item {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.trust__icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: var(--lilac);
  color: var(--brand);
  flex-shrink: 0;
}

.trust__icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.trust__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.3;
}

.trust__label {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ——— Sections ——— */
.section {
  padding: 3rem 0 1rem;
}

.section--band {
  margin-top: 1.25rem;
  padding: 1.75rem 0 1.5rem;
  background: linear-gradient(180deg, var(--lilac-2), var(--canvas));
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.section__kicker {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.section__head h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.section__sub {
  color: var(--muted);
  font-size: 1.02rem;
  margin-top: 0.35rem;
}

.section__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand);
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.65rem;
  padding: 0.45rem 1.15rem;
  border-radius: 0.8rem;
  font-weight: 800;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s, color 0.15s;
}

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

.btn--cyan,
.btn--brand {
  background: var(--brand);
  color: #fff;
}

.btn--cyan:hover,
.btn--brand:hover {
  background: var(--brand-mid);
  color: #fff;
}

.btn--ghost {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(156 135 177 / 0.45);
  color: #fff;
}

.btn--ghost:hover {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}

.btn--green,
.btn--download {
  background: var(--success);
  color: #fff;
}

.btn--green:hover,
.btn--download:hover {
  background: var(--success-deep);
  color: #fff;
}

.btn--soft {
  background: var(--lilac);
  color: var(--brand);
  border-color: var(--lilac-deep);
}

.btn--block {
  width: 100%;
}

/* Cert tiles */
.cert-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.cert-tile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 10.5rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1.15rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.cert-tile::before {
  content: "";
  position: absolute;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  border: 12px solid var(--brand);
  opacity: 0.06;
  left: -2.5rem;
  top: -2.5rem;
}

.cert-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

.cert-tile__grade {
  display: inline-flex;
  align-self: start;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
}

.cert-tile h3 {
  font-size: 1.2rem;
}

.cert-tile p {
  color: var(--muted);
  font-size: 0.88rem;
}

.cert-tile__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.88rem;
}

.cert-tile--thanawya {
  background: linear-gradient(160deg, #fff, var(--lilac-2));
  border-color: #cfc8f0;
}

.cert-tile--idada {
  background: linear-gradient(160deg, #fff, #eef8f4);
}

.cert-tile--ibt {
  background: linear-gradient(160deg, #fff, var(--gold-soft));
}

/* Stage tabs + grade cards */
.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.stage-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  min-height: 2.5rem;
  padding: 0.35rem 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.stage-tab.is-active,
.stage-tab[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.grade-panel {
  display: none;
}

.grade-panel.is-active {
  display: block;
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem;
}

.grade-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grade-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 6.5rem;
  padding: 1rem 1.05rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
}

.grade-card::before {
  content: "";
  position: absolute;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 10px solid var(--brand);
  opacity: 0.05;
  left: -2rem;
  top: -2rem;
}

.grade-card:hover {
  transform: translateY(-3px);
  border-color: #b8b4d8;
  box-shadow: var(--shadow);
  color: inherit;
}

.grade-card strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.grade-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.grade-card__badge {
  display: inline-flex !important;
  align-self: start;
  margin-top: auto;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--brand) !important;
  font-size: 0.75rem !important;
  font-weight: 800;
}

.grade-card--cert {
  border-color: #c9c2ef;
  background: linear-gradient(165deg, #fff, var(--lilac-2));
}

/* Stage portal cards (nezakr-like) */
.stage-portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stage-portal {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 10.5rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1.2rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.stage-portal:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

.stage-portal__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage-portal__icon {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
}

.stage-portal__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.stage-portal__id {
  color: var(--muted);
  font-size: 0.84rem;
}

.stage-portal strong {
  font-size: 1.15rem;
}

.stage-portal__flow {
  color: var(--muted);
  font-size: 0.84rem;
}

.stage-portal__arrow {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.88rem;
}

/* Filters / chips */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  min-height: 2.35rem;
  padding: 0.3rem 0.95rem;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.discovery-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.discovery-nav button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.discovery-nav button.is-active,
.discovery-nav button[aria-selected="true"] {
  background: var(--lilac-deep);
  border-color: var(--lilac-deep);
  color: var(--brand-deep);
}

.discovery-panel {
  display: none;
}

.discovery-panel.is-active {
  display: block;
}

/* File / resource cards — cover anatomy like nezakr */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.resource-grid > .resource:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.resource {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
  position: relative;
}

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

.resource__visual {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(125deg, #efe8f7, #e1d7ef);
  overflow: hidden;
}

.resource-grid > .resource:first-child .resource__visual {
  aspect-ratio: 5 / 4;
}

.resource__art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #735092;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.45;
  padding: 1rem;
}

.resource--popular .resource__visual {
  background: linear-gradient(125deg, #e9f6ee, #cde4dc);
}

.resource--popular .resource__art {
  color: #386f69;
}

.resource--book .resource__visual {
  background: linear-gradient(125deg, #fbf0dc, #f1dfba);
}

.resource--book .resource__art {
  color: #906c34;
}

.resource__type {
  position: absolute;
  right: 0.85rem;
  bottom: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #48325f;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgb(31 23 37 / 0.12);
}

.resource__copy {
  padding: 1.05rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
}

.resource__copy h3 {
  font-size: 1rem;
  line-height: 1.55;
}

.resource-grid > .resource:first-child .resource__copy h3 {
  font-size: 1.3rem;
}

.resource__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.resource__footer {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.resource__footer .open {
  color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

/* Legacy horizontal file-card (grade/search pages) */
.file-card {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
}

.file-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}

.file-card.is-hidden {
  display: none;
}

.file-cover {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--brand-deep);
  background: linear-gradient(145deg, var(--lilac), var(--lilac-deep));
}

.file-cover--math {
  background: linear-gradient(145deg, #efe8f7, #ddd4f5);
}
.file-cover--ar {
  background: linear-gradient(145deg, #fbf0dc, #f1dfba);
  color: #7a5a22;
}
.file-cover--sci {
  background: linear-gradient(145deg, #e9f6ee, #cde4dc);
  color: #2f6b5f;
}
.file-cover--eng {
  background: linear-gradient(145deg, #e8eefc, #d4ddf7);
  color: #3a4f8f;
}

.file-body h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.tag {
  display: inline-flex;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.75rem;
}

.tag--type {
  background: var(--lilac);
}
.tag--subj {
  background: var(--success-soft);
  color: var(--success-deep);
}

.file-action {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 0.35rem;
}

.file-action .dl {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0.3rem 0.9rem;
  border-radius: 0.65rem;
  background: var(--success);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

.file-action .views {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Teachers */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.teacher {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  min-height: 12.5rem;
  padding: 1.35rem 1rem;
  border-radius: 1.15rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s;
}

.teacher:hover {
  transform: translateY(-3px);
  color: inherit;
}

.teacher__mark {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  background: #f1ebf7;
  color: #674587;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
}

.teacher strong {
  font-size: 1rem;
}

.teacher small,
.teacher p {
  color: var(--muted);
  font-size: 0.84rem;
}

.teacher__footer {
  margin-top: auto;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.86rem;
}

/* Page shells */
.page-hero {
  padding: 1.75rem 0 1.25rem;
  background:
    radial-gradient(ellipse at 100% 0%, rgb(91 75 204 / 0.1), transparent 50%),
    linear-gradient(180deg, var(--lilac-2), var(--canvas));
  border-bottom: 1px solid var(--line-soft);
}

.page-hero h1 {
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  margin-top: 0.55rem;
}

.page-hero p {
  color: var(--muted);
  margin-top: 0.45rem;
  max-width: 40rem;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.82rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.breadcrumb a {
  color: var(--brand);
}

/* Library / grade page */
.library {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0 3rem;
}

.sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.1rem;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}

.sidebar-group {
  margin-bottom: 1.15rem;
}

.sidebar-group h3 {
  font-size: 0.9rem;
  margin-bottom: 0.55rem;
  color: var(--brand-deep);
}

.sidebar-group label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.library-main {
  min-width: 0;
}

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.library-toolbar strong {
  font-family: var(--font-display);
}

/* Download page */
.download-layout {
  display: grid;
  grid-template-columns: 1fr 18rem;
  gap: 1.25rem;
  padding: 1.5rem 0 3.5rem;
}

.download-main,
.download-side {
  min-width: 0;
}

.download-preview {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}

.preview-cover {
  aspect-ratio: 3 / 4;
  border-radius: 0.9rem;
  background: linear-gradient(145deg, var(--lilac), var(--lilac-deep));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.9rem;
  color: var(--brand-deep);
}

.pdf-badge {
  align-self: start;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
}

.preview-cover .title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.45;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0;
}

.meta-item {
  background: var(--lilac-2);
  border-radius: 0.7rem;
  padding: 0.65rem 0.75rem;
}

.meta-item dt {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}

.meta-item dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.download-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1.2rem;
  height: fit-content;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.download-side h2 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.download-side .hint {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.75rem;
}

/* Search page */
.search-hero-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0.4rem;
  max-width: 40rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.search-hero-form input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  height: 2.85rem;
  padding: 0 0.9rem;
  background: transparent;
}

.search-hero-form button {
  border: 0;
  border-radius: 0.85rem;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  min-height: 2.85rem;
  padding: 0 1.25rem;
  cursor: pointer;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 0 2.5rem;
  background: #eeebf6;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.site-footer__inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
}

.site-footer .brand {
  margin-bottom: 0.55rem;
}

.site-footer p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 24rem;
}

.site-footer h4 {
  font-size: 0.92rem;
  margin-bottom: 0.55rem;
  color: var(--brand-deep);
}

.site-footer a {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 0.25rem 0;
}

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

.site-footer__bottom {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sticky-cta {
  display: none;
}

body.has-sticky-cta .sticky-cta {
  display: flex;
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  background: rgb(255 255 255 / 0.96);
  border-top: 1px solid var(--line);
  padding: 0.65rem 1rem;
  gap: 0.65rem;
  justify-content: center;
  box-shadow: 0 -8px 24px rgb(30 27 58 / 0.08);
}

/* Stages hub centered intro */
.stages-intro {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.stages-intro h1 {
  margin-top: 0.65rem;
}

.stages-intro p {
  color: var(--muted);
  margin-top: 0.55rem;
}

.stage-block {
  margin-bottom: 2rem;
}

.stage-block__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.stage-block__head h2 {
  font-size: 1.2rem;
}

.stage-block__head p {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 1100px) {
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .resource-grid > .resource:first-child {
    grid-column: span 2;
    grid-row: auto;
  }
  .grade-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .teacher-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cert-tiles,
  .stage-portal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem 1.25rem;
  }
  .hero__visual {
    order: -1;
  }
  .hero-panel {
    max-width: none;
  }
  .trust__inner {
    grid-template-columns: 1fr 1fr;
  }
  .library,
  .download-layout {
    grid-template-columns: 1fr;
  }
  .download-side {
    position: static;
  }
  .download-preview {
    grid-template-columns: 1fr;
  }
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
  .header-search {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
    margin-inline-start: auto;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav.is-open {
    display: flex;
  }
  .nav-mega__panel {
    position: static;
    min-width: 0;
    box-shadow: none;
    border: 0;
    padding: 0.35rem 0 0.35rem 0.5rem;
    grid-template-columns: 1fr;
  }
  .site-header__inner {
    position: relative;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .wrap,
  .hero__inner,
  .trust__inner,
  .site-header__inner,
  .topbar__inner,
  .site-footer__inner,
  .site-footer__bottom {
    width: min(var(--max), calc(100% - 1.5rem));
  }
  .grade-grid,
  .grade-grid--3,
  .resource-grid,
  .teacher-grid,
  .trust__inner {
    grid-template-columns: 1fr;
  }
  .resource-grid > .resource:first-child {
    grid-column: auto;
  }
  .file-card {
    grid-template-columns: 4.5rem 1fr;
  }
  .file-action {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .meta-grid {
    grid-template-columns: 1fr;
  }
}
