/* =====================================================================
   Maestr — Global Stylesheet
   ---------------------------------------------------------------------
   Single source of visual truth. Everything is driven by the CSS
   variables in :root below — change a course accent or the whole brand
   palette here and it cascades everywhere. No per-page color values.

   Sections:
     1. Brand tokens (colors, type, spacing, radius, shadow)
     2. Base / reset
     3. Layout primitives (container, header, footer)
     4. Hero
     5. Category nav (big "Learn" / "Teaching Tools" cards)
     6. Filter bar (category + subject + grade pills, search)
     7. Catalog grid + cards
     8. States (empty, loading)
     9. Responsive refinements
   ===================================================================== */

/* ============================ 1. TOKENS ============================ */
:root {
  /* --- Neutrals (clean, apple-esque) --- */
  --bg:        #FBFBFD;   /* page background            */
  --surface:   #FFFFFF;   /* cards, header              */
  --surface-2: #F5F5F7;   /* subtle wells, hovers       */
  --ink:       #1D1D1F;   /* primary text               */
  --ink-2:     #5B5B61;   /* secondary text             */
  --ink-3:     #8A8A8F;   /* tertiary / meta            */
  --hairline:  #E6E6EB;   /* borders, dividers          */

  /* --- Brand accents (scholarly) --- */
  --brand:        #25426B;   /* deep academic ink-blue  */
  --brand-strong: #1A2F4D;   /* hover / pressed         */
  --brand-tint:   #EDF1F8;   /* light wash backgrounds  */
  --gold:         #B0883E;   /* scholarly gold, sparing */
  --gold-tint:    #F6EFE1;

  /* --- Subject accent colors (color-coding) ---
     Used by cards via --accent; manifest can override per subject. */
  --accent-science: #2D6CDF;
  --accent-health:  #1F9E6E;
  --accent-math:    #7C4DD1;
  --accent-english: #C0563B;
  --accent-history: #9A7B2E;
  --accent-default: var(--brand);
  --accent-sim:     #0891B2;   /* simulation / timer teal */

  /* --- Typography --- */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
                "Segoe UI", Roboto, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Fluid type scale (min .. max via viewport) */
  --fs-hero:  clamp(2.2rem, 1.4rem + 3.6vw, 3.9rem);
  --fs-h2:    clamp(1.4rem, 1.1rem + 1.2vw, 1.95rem);
  --fs-lead:  clamp(1.02rem, 0.95rem + 0.5vw, 1.2rem);
  --fs-body:  1rem;
  --fs-meta:  0.82rem;

  /* --- Spacing / shape --- */
  --gutter:  clamp(1.1rem, 0.6rem + 2.4vw, 2.75rem);
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --pill: 999px;

  /* --- Elevation (soft, diffuse) --- */
  --shadow-sm: 0 1px 2px rgba(20,28,46,.04), 0 1px 3px rgba(20,28,46,.06);
  --shadow-md: 0 4px 14px rgba(20,28,46,.07), 0 2px 6px rgba(20,28,46,.05);
  --shadow-lg: 0 18px 48px rgba(20,28,46,.12);

  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ============================ 2. BASE ============================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2.5px solid var(--accent-default);
  outline-offset: 3px;
  border-radius: 6px;
}

.serif { font-family: var(--font-serif); font-optical-sizing: auto; }
.muted { color: var(--ink-2); }

/* Material Symbols — the site icon system. Size via font-size on the element. */
.material-symbols-rounded {
  font-variation-settings: 'opsz' 24, 'wght' 400, 'GRAD' 0, 'FILL' 0;
  font-size: 1.25em; line-height: 1; user-select: none;
  vertical-align: middle; flex: none;
}

/* ========================= 3. LAYOUT ============================= */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Sticky translucent header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,251,253,.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}
.brand-lockup { display: flex; align-items: center; gap: .6rem; }
.brand-lockup__mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}
.brand-lockup__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lockup__name { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.brand-lockup__by { font-size: .64rem; font-weight: 500; color: var(--ink-3); letter-spacing: .01em; }

/* ---- Hamburger drawer menu (built by assets/nav.js, on every page) ---- */
.nav-toggle .material-symbols-rounded { font-size: 20px; }

.menu-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(29,29,31,.4);
  backdrop-filter: saturate(140%) blur(3px);
  -webkit-backdrop-filter: saturate(140%) blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .24s var(--ease);
}
.menu-scrim.is-open { opacity: 1; pointer-events: auto; }

/* Dark-blue frosted glass panel — deliberately breaks from the site's white
   surfaces for contrast. `rgb(from var(--brand) r g b / a)` pulls the R/G/B
   channels straight from the brand token (the exact blue used in the "M" logo
   mark) and only adds alpha — a plain color-mix(brand, transparent) actually
   darkens/shifts the hue slightly once composited, since it interpolates RGB
   *and* alpha together. This keeps the panel pixel-identical in hue to the
   logo, just translucent. Text/icon colors below are the light-on-dark
   counterparts of the normal (light-panel) tokens. */
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(320px, 86vw);
  background: rgb(from var(--brand) r g b / 88%);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-left: 1px solid rgba(255,255,255,.14);
  box-shadow: -18px 0 48px rgba(10,16,28,.35);
  transform: translateX(102%);
  transition: transform .28s var(--ease);
  display: flex; flex-direction: column;
  padding: 1.1rem 1rem 1.4rem;
  overflow-y: auto;
}
.menu.is-open { transform: none; }
body.menu-open { overflow: hidden; }

.menu__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.menu__brand { display: flex; align-items: center; gap: .55rem; }
.menu__brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--gold); color: var(--brand-strong); font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem;
}
.menu__brand-name { font-size: 1.05rem; font-weight: 700; color: #fff; }
.menu__close {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.menu__close:hover { background: rgba(255,255,255,.18); color: #fff; }
.menu__close .material-symbols-rounded { font-size: 22px; }

.menu__nav { display: flex; flex-direction: column; gap: .12rem; }
.menu__label {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.55); margin: 1rem 0 .35rem .7rem;
}
.menu__link {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .75rem; border-radius: var(--r-sm);
  font-size: .96rem; font-weight: 600; color: rgba(255,255,255,.92);
  border-left: 3px solid transparent;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.menu__link .material-symbols-rounded { font-size: 22px; color: rgba(255,255,255,.55); transition: color .15s var(--ease); }
.menu__link:hover { background: rgba(255,255,255,.1); }
.menu__link:hover .material-symbols-rounded { color: var(--gold); }
/* Current page uses the CONTRASTING gold accent so it stands out from the dark-blue panel. */
.menu__link.is-current {
  background: rgba(176,136,62,.22); color: var(--gold); border-left-color: var(--gold);
}
.menu__link.is-current .material-symbols-rounded { color: var(--gold); }
.menu__foot { margin-top: auto; padding-top: 1.2rem; font-size: var(--fs-meta); color: rgba(255,255,255,.5); }

.site-header__right { display: flex; align-items: center; gap: .9rem; }
.site-header__meta { font-size: var(--fs-meta); color: var(--ink-3); }
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 4rem;
  padding-block: 2rem 2.6rem;
  color: var(--ink-3);
  font-size: var(--fs-meta);
}
.site-footer a { color: var(--ink-2); }

/* ============================ 4. HERO ============================ */
/* padding-block-start minimum raised to 4rem so the eyebrow pill sits
   comfortably below the 60px sticky header on every viewport. */
.hero { padding-block: clamp(4rem, 2rem + 5vw, 5.5rem) clamp(1.6rem,1rem+2vw,2.6rem); }

/* Scroll targets — offset so sticky header (60px) never covers the anchor */
#catalog-section, #category-nav, .hero { scroll-margin-top: 72px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--fs-meta); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand);
  background: var(--brand-tint);
  padding: .4rem .8rem; border-radius: var(--pill);
}
.hero__title {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: var(--fs-hero);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 1rem 0 .6rem;
  max-width: 16ch;
}
.hero__title em { color: var(--brand); font-style: italic; }
.hero__lead {
  font-size: var(--fs-lead);
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}
.hero__sub { font-size: .96rem; color: var(--ink-2); max-width: 58ch; margin: .55rem 0 0; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1.8rem; }
.stat__num { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: var(--ink); }
.stat__label { font-size: var(--fs-meta); color: var(--ink-3); }

/* ===================== 5. CATEGORY NAV ========================== */
.category-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(.9rem, .4rem + 1.4vw, 1.4rem);
  margin: 1.6rem 0 2.2rem;
}
.category-card {
  font: inherit;
  text-align: left;
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.2rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-top: 4px solid var(--accent, var(--brand));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
/* Large, high-contrast icon badge tinted to the category accent */
.category-card__icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 30px;
  background: color-mix(in srgb, var(--accent, var(--brand)) 14%, white);
  color: var(--accent, var(--brand));
}
.category-card__text { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 0; }
.category-card__label { font-family: var(--font-serif); font-weight: 600; font-size: 1.18rem; color: var(--ink); }
.category-card__blurb { font-size: .9rem; color: var(--ink-2); }
.category-card__count { font-size: var(--fs-meta); color: var(--accent, var(--brand)); font-weight: 600; margin-top: .15rem; }
.category-card__go {
  flex: none; align-self: center; color: var(--ink-3);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.category-card:hover .category-card__go { color: var(--accent, var(--brand)); transform: translateX(3px); }

/* ========================= 6. FILTER BAR ======================== */
.controls { margin-top: .5rem; }
.search {
  position: relative;
  margin-bottom: 1.1rem;
  max-width: 480px;
}
.search input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: .8rem 1rem .8rem 2.6rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); outline: none; }
.search svg { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

/* Filter groups sit side-by-side and wrap; only the ones with a real choice
   are rendered (see catalog.js), so this row stays light. */
.filters { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.filter-group { margin-bottom: .3rem; }
.filter-group__label {
  font-size: var(--fs-meta); font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem;
}
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-btn {
  font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--ink-2);
  padding: .42rem .9rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: all .18s var(--ease);
}
.pill-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.pill-btn[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: var(--shadow-sm);
}
.pill-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--brand)); }
.pill-btn[aria-pressed="true"] .dot { background: rgba(255,255,255,.85); }

/* ===================== 7. CATALOG + CARDS ====================== */
.catalog-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin: 2rem 0 1rem; flex-wrap: wrap;
}
.catalog-head h2 { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-h2); margin: 0; letter-spacing: -.01em; }
.result-count { font-size: var(--fs-meta); color: var(--ink-3); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
  gap: clamp(1.3rem, .8rem + 1.8vw, 2rem);   /* airy breathing room */
}

/* ---- Grouped catalog sections (default home view) ---- */
.cat-section { margin: 2.4rem 0 0; scroll-margin-top: 78px; }
.cat-section:first-child { margin-top: 1rem; }
.cat-section__head {
  display: flex; align-items: center; gap: .85rem;
  margin: 0 0 1.1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--hairline);
}
.cat-section__icon {
  flex: none; width: 42px; height: 42px; border-radius: 12px; font-size: 24px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--brand)) 13%, white);
  color: var(--accent, var(--brand));
}
.cat-section__text { flex: 1; min-width: 0; }
.cat-section__title { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-h2); margin: 0; letter-spacing: -.01em; line-height: 1.1; }
.cat-section__blurb { font-size: .9rem; color: var(--ink-2); margin: .15rem 0 0; }
.cat-section__count { flex: none; font-size: var(--fs-meta); font-weight: 600; color: var(--ink-3); white-space: nowrap; }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card:hover .card__icon { transform: scale(1.06) rotate(-3deg); }
/* "Coming soon" state — greyed out, no hover lift */
.card--soon { opacity: .6; filter: saturate(.4); }
.card--soon:hover { transform: none; box-shadow: var(--shadow-sm); filter: saturate(.4); cursor: default; }
.card__accent { height: 3px; background: var(--accent, var(--brand)); }
.card__body { padding: 1rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
/* Accent icon chip — the card's contrasting pop of color */
.card__icon {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: .15rem;
  display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--accent, var(--brand)) 15%, white);
  color: var(--accent, var(--brand));
  transition: transform .22s var(--ease);
}
.card__icon .material-symbols-rounded { font-size: 24px; }
.card__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  padding: .18rem .55rem; border-radius: var(--pill);
  background: var(--surface-2); color: var(--ink-2);
}
.tag--subject { background: color-mix(in srgb, var(--accent, var(--brand)) 12%, white); color: var(--accent, var(--brand)); }
.tag--category { background: var(--gold-tint); color: var(--gold); }
.card__title { font-size: 1.02rem; font-weight: 700; line-height: 1.28; letter-spacing: -.01em; color: var(--ink); }
.card__desc { font-size: .855rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
.card__foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card__type { font-size: var(--fs-meta); color: var(--ink-3); display: inline-flex; align-items: center; gap: .35rem; }
.card__cta { font-size: .82rem; font-weight: 700; color: var(--accent, var(--brand)); display: inline-flex; align-items: center; gap: .3rem; }
.card:hover .card__cta { gap: .55rem; }
.card__link { position: absolute; inset: 0; } /* whole-card click target */

.badge-soon {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gold); background: var(--gold-tint);
  padding: .2rem .5rem; border-radius: var(--pill);
}

/* ========================= 8. STATES ========================== */
.empty {
  text-align: center; padding: 3.5rem 1rem; color: var(--ink-3);
  border: 1px dashed var(--hairline); border-radius: var(--r-lg);
  background: var(--surface);
}
.empty h3 { font-family: var(--font-serif); color: var(--ink); margin: .4rem 0 .3rem; }
.btn-reset {
  margin-top: 1rem; font: inherit; font-weight: 600; font-size: .88rem;
  color: #fff; background: var(--brand); border: none; cursor: pointer;
  padding: .5rem 1.1rem; border-radius: var(--pill); transition: background .15s var(--ease);
}
.btn-reset:hover { background: var(--brand-strong); }
.site-footer__tag { color: var(--ink-2); font-weight: 600; }
.skeleton { background: linear-gradient(100deg, var(--surface-2) 30%, #ececef 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ====================== 9. RESPONSIVE ======================== */
@media (max-width: 540px) {
  .hero__stats { gap: 1.3rem; }
}

/* ===================== 10. CONTENT PAGES ====================== */
/* Shared by About, Blog, and blog posts. */
.page { padding-block: clamp(2.2rem, 1.4rem + 3vw, 3.4rem) 1rem; }
.page__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--fs-meta); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand);
  background: var(--brand-tint); padding: .4rem .8rem; border-radius: var(--pill);
}
.page__title {
  font-family: var(--font-serif); font-weight: 600; font-optical-sizing: auto;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); line-height: 1.05; letter-spacing: -.02em;
  margin: 1rem 0 .5rem; max-width: 20ch;
}
.page__title em { color: var(--brand); font-style: italic; }
.page__lead { font-size: var(--fs-lead); color: var(--ink-2); max-width: 60ch; margin: 0; }

.prose { max-width: 68ch; margin-top: 2rem; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 {
  font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -.01em;
  color: var(--ink); margin-top: 2.4rem; margin-bottom: .2rem;
}
.prose h3 { font-size: 1.12rem; font-weight: 700; color: var(--ink); margin-top: 1.6rem; }
.prose p, .prose li { color: var(--ink-2); font-size: 1.02rem; line-height: 1.7; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-top: .4rem; }
.prose a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }

/* Callout / value cards on the About page */
.value-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(1rem, .6rem + 1.4vw, 1.5rem); margin-top: 2rem;
}
.value-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 1.4rem 1.4rem; box-shadow: var(--shadow-sm);
}
.value-card__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 26px;
  background: var(--brand-tint); color: var(--brand); margin-bottom: .8rem;
}
.value-card:nth-child(2n) .value-card__icon { background: var(--gold-tint); color: var(--gold); }
.value-card h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); margin: 0 0 .35rem; }
.value-card p { font-size: .92rem; color: var(--ink-2); margin: 0; line-height: 1.6; }

/* Blog post list */
.post-list { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 2rem; max-width: 760px; }
.post-card {
  position: relative; display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.post-card:not(.post-card--soon):hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.post-card--soon { opacity: .6; }
.post-card__icon {
  flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 24px;
  background: var(--brand-tint); color: var(--brand);
}
.post-card__meta { font-size: var(--fs-meta); color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }
.post-card__title { font-family: var(--font-serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); margin: .2rem 0 .3rem; letter-spacing: -.01em; }
.post-card__excerpt { font-size: .92rem; color: var(--ink-2); margin: 0; line-height: 1.6; }
.post-card__link { position: absolute; inset: 0; }
.post-card__cta { display: inline-block; margin-top: .55rem; font-size: .85rem; font-weight: 700; color: var(--brand); }

.page .breadcrumb {
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
  font-size: .82rem; color: var(--ink-3); margin-bottom: 1rem;
}
.page .breadcrumb a { color: var(--ink-2); font-weight: 600; }
.page .breadcrumb a:hover { color: var(--brand); }

.back-link {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: 1.4rem;
  font-size: .9rem; font-weight: 600; color: var(--ink-2);
}
.back-link:hover { color: var(--brand); }
.back-link .material-symbols-rounded { font-size: 20px; }

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

/* ============ 11. SHARED MODAL + NOTEBOOK + COIN COLLECTIBLES ============
   Site-wide component classes used by assets/profile.js and
   assets/notebook.js (both load on every page, unlike a course's own
   engine CSS, which only loads inside that course's lesson pages). Named
   `.modal*` / `.btn*` (not `.hr-*`) on purpose — these are NOT the
   heredity-engine's course-scoped `.hr-modal*` styles, which stay put
   in that course's own CSS. Some duplication between the two is a
   deliberate tradeoff: a site-wide script can't depend on a single
   course's asset folder. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
  padding: 1.2rem; background: rgba(20, 28, 46, .48); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s var(--ease);
}
.modal-overlay.is-shown { opacity: 1; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); max-width: 440px; width: 100%;
  padding: clamp(1.4rem, 5vw, 2.2rem); text-align: center; box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.97); transition: transform .25s var(--ease);
  max-height: 85vh; overflow-y: auto;
}
.modal-overlay.is-shown .modal { transform: none; }
.modal__icon { font-size: 3rem; margin-bottom: .3rem; }
.modal__title { font-family: var(--font-serif); font-size: 1.5rem; margin: 0 0 .5rem; color: var(--ink); }
.modal p { font-size: .92rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 1rem; }

.btn {
  font-family: var(--font-sans); font-weight: 700; font-size: .85rem;
  border-radius: var(--pill); border: 1px solid var(--hairline);
  background: var(--surface); color: var(--ink); padding: .5rem 1rem;
  cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .4; cursor: default; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-strong); }
.field-input {
  font-family: var(--font-sans); font-size: .95rem; width: 100%;
  padding: .6rem .85rem; border-radius: var(--r-sm); border: 1.5px solid var(--hairline);
  color: var(--ink); background: var(--surface);
}
.field-input:focus { outline: none; border-color: var(--brand); }
.modal__actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.modal__actions .btn { flex: 1 1 140px; }

/* ---- coin collectible (vocabulary-term reward) ---------------------------
   Small gold coin badge appended to a `.vocab-term` the first time it's
   collected, plus a brief pop/float animation the moment it's earned. */
.vocab-coin {
  display: inline-block; margin-left: .2rem; font-size: .78em; line-height: 1;
  transform-origin: center; vertical-align: -0.05em;
}
.vocab-coin.is-new { animation: coin-pop .5s var(--ease); }
@keyframes coin-pop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  55%  { transform: scale(1.35) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.coin-toast {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 2000;
  display: flex; align-items: center; gap: .6rem; background: var(--ink); color: #fff;
  padding: .7rem 1rem; border-radius: var(--r); box-shadow: var(--shadow-lg);
  transform: translateY(140%); transition: transform .35s var(--ease); max-width: 280px; font-size: .88rem;
}
.coin-toast.is-shown { transform: translateY(0); }
.coin-toast__icon { font-size: 1.4rem; }

/* ---- notebook page --------------------------------------------------- */
.notebook-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-3); }
.notebook-course { margin: 2.2rem 0 0; }
.notebook-course:first-child { margin-top: 1rem; }
.notebook-course__title { font-family: var(--font-serif); font-weight: 600; font-size: 1.3rem; color: var(--ink); margin: 0 0 .2rem; }
.notebook-module { margin: 1.1rem 0 0 0; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.notebook-module__title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 0 0 .7rem; }
.notebook-words { display: flex; flex-wrap: wrap; gap: .6rem; }
.notebook-word {
  display: flex; align-items: center; gap: .5rem; background: var(--gold-tint); color: var(--ink);
  border-radius: var(--r); padding: .5rem .8rem; font-size: .88rem; max-width: 260px;
}
.notebook-word__coin { font-size: 1.1rem; flex: none; }
.notebook-word__term { font-weight: 700; }
.notebook-word__def { display: block; font-size: .78rem; color: var(--ink-2); font-weight: 400; }
.notebook-profile-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--brand-tint); border-radius: var(--r-lg); padding: 1rem 1.3rem; margin-top: 1.5rem;
}
.notebook-profile-bar__name { font-weight: 700; color: var(--brand); }
.notebook-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---- PWA install button (assets/pwa.js) --------------------------------
   Small, dismissible, bottom-left so it never covers primary content or
   collides with the hamburger menu (top-right). */
.pwa-install-btn {
  position: fixed; left: 1.1rem; bottom: 1.1rem; z-index: 1500;
  display: flex; align-items: center; gap: .3rem;
  background: var(--ink); border-radius: var(--pill); box-shadow: var(--shadow-lg);
  transform: translateY(140%); transition: transform .35s var(--ease);
}
.pwa-install-btn.is-shown { transform: translateY(0); }
.pwa-install-btn__go {
  font-family: var(--font-sans); font-weight: 700; font-size: .82rem; color: #fff;
  background: transparent; border: none; padding: .65rem 1rem .65rem 1.1rem; cursor: pointer;
}
.pwa-install-btn__x {
  font-size: .75rem; color: rgba(255,255,255,.6); background: transparent; border: none;
  cursor: pointer; padding: .65rem 1rem .65rem .3rem;
}
.pwa-install-btn__x:hover { color: #fff; }
