/* MathPert components.css — styled to existing class names (no HTML changes). */

/* =====================================================================
 * Topbar / nav
 * ===================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-width: 160px;
  max-width: 240px;
  text-decoration: none;
}
.brand img {
  width: 100%;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-links a {
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-ink);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-brand-primary);
  background: rgba(217, 160, 62, 0.08);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: var(--color-brand-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.nav-cta:hover {
  background: var(--color-brand-dark);
  color: #fff;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.6);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 99px;
  transition: transform var(--duration-base) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 799px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute;
    inset: 76px 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-5);
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .nav-menu.is-open { display: flex; }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }
  .nav-links a { padding: var(--space-3) var(--space-4); }
  .nav-cta { justify-content: center; width: 100%; }
}

/* =====================================================================
 * Jump strip
 * ===================================================================== */
.jump-strip {
  background: var(--color-surface-muted);
  border-block: 1px solid var(--color-border);
}
.jump-strip-inner {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: var(--space-3);
}
.jump-strip-inner::-webkit-scrollbar { display: none; }
.jump-strip a {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--color-border);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}
.jump-strip a:hover {
  color: #fff;
  background: var(--color-brand-primary);
  border-color: transparent;
}

/* =====================================================================
 * Hero
 * ===================================================================== */
.hero,
.home-hero,
.page-hero {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}
.hero-copy { max-width: 60ch; }
.headline {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin-block: var(--space-4);
  color: var(--color-ink);
}
.section-dark .headline,
.hero.section-dark .headline { color: #fff; }

.hero-note {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  margin-block-start: var(--space-6);
  max-width: 48rem;
}
.hero-visual {
  margin: 0;
}
.hero-visual figure,
figure.hero-visual {
  transform: rotate(-2deg);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-visual img {
  border-radius: var(--radius-lg);
  width: 100%;
  height: auto;
}

/* =====================================================================
 * Section primitives
 * ===================================================================== */
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-brand-primary);
  margin-block-end: var(--space-3);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  max-width: 24ch;
  margin-block: 0 var(--space-4);
  color: var(--color-ink);
  line-height: 1.15;
}
.subheadline {
  font-size: var(--text-lg);
  color: var(--color-ink-muted);
  max-width: 60ch;
  margin-block-end: var(--space-6);
  line-height: 1.55;
}

/* =====================================================================
 * Cards
 * ===================================================================== */
.card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-brand-primary);
}
.card h3 {
  font-size: var(--text-lg);
  margin-block-end: var(--space-3);
  color: var(--color-ink);
}
.card p {
  color: var(--color-ink-muted);
  margin-block-end: var(--space-4);
}
.card p:last-child { margin-block-end: 0; }

.tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-brand-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  margin-block-end: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.text-link {
  color: var(--color-brand-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: text-decoration-thickness var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.text-link:hover {
  text-decoration-thickness: 2px;
  color: var(--color-brand-dark);
}
.section-dark .text-link { color: var(--color-brand-primary); }

/* =====================================================================
 * Stats / proof / schedule cards
 * ===================================================================== */
.stats-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.stats-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-brand-primary);
  margin-block-end: var(--space-2);
  line-height: 1.1;
}
.stats-card p {
  margin-block-end: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.proof-card {
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.proof-card blockquote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  border-left: 3px solid var(--color-brand-primary);
  padding-left: var(--space-4);
  margin-block: var(--space-4);
  color: var(--color-ink);
  line-height: 1.45;
}
.proof-card img {
  border-radius: var(--radius-md);
  margin-block: var(--space-4);
  width: 100%;
  height: auto;
}
.proof-card p { color: var(--color-ink-muted); font-size: var(--text-sm); }
.proof-card--text { display: grid; align-content: center; }

.testimonial-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.schedule-card {
  padding: var(--space-6);
  background: var(--color-surface-muted);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.schedule-card table {
  width: 100%;
  border-collapse: collapse;
}
.schedule-card th {
  text-align: left;
  font-weight: 600;
  padding: var(--space-3);
  border-bottom: 2px solid var(--color-brand-primary);
  color: var(--color-ink);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.schedule-card td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-ink-muted);
}
.schedule-card tr:last-child td { border-bottom: 0; }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.table-wrap table { min-width: 520px; }
.table-wrap th,
.table-wrap td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.table-wrap th {
  background: rgba(217, 160, 62, 0.12);
  color: var(--color-ink);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.table-wrap td { color: var(--color-ink-muted); }

/* =====================================================================
 * Buttons
 * ===================================================================== */
.button,
.button-secondary,
.button-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  line-height: 1.2;
  border: 1.5px solid transparent;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.button {
  background: var(--color-brand-primary);
  color: #fff;
}
.button:hover {
  background: var(--color-brand-dark);
  color: #fff;
  transform: translateY(-1px);
}

.button-secondary {
  background: transparent;
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}
.button-secondary:hover {
  background: var(--color-brand-primary);
  color: #fff;
  transform: translateY(-1px);
}
.section-dark .button-secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.section-dark .button-secondary:hover {
  background: #fff;
  color: var(--color-brand-dark);
  border-color: #fff;
}

.button-light {
  background: #fff;
  color: var(--color-brand-primary);
  border-color: #fff;
}
.button-light:hover {
  background: var(--color-brand-primary);
  color: #fff;
  border-color: var(--color-brand-primary);
  transform: translateY(-1px);
}

/* =====================================================================
 * FAQ
 * ===================================================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  width: 100%;
  padding: var(--space-4) 0;
  background: transparent;
  border: 0;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}
.faq-question:hover { color: var(--color-brand-primary); }
.faq-icon {
  font-size: var(--text-xl);
  color: var(--color-brand-primary);
  transition: transform var(--duration-base) var(--ease-out);
  line-height: 1;
}
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-answer {
  padding-block: 0 var(--space-4);
  color: var(--color-ink-muted);
  max-width: 70ch;
  line-height: 1.65;
}
.faq-answer[hidden] { display: none; }
.faq-answer p { color: var(--color-ink-muted); }

/* =====================================================================
 * Footer + floating WA
 * ===================================================================== */
.footer {
  background: var(--color-brand-dark);
  color: rgba(255, 255, 255, 0.85);
  padding-block: clamp(3rem, 6vw, 5rem) var(--space-8);
}
.footer p { color: rgba(255, 255, 255, 0.8); }
.footer .eyebrow { color: var(--color-brand-primary); background: transparent; }

.footer-grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.2fr 2fr; }
}

.footer-brand img {
  max-width: 200px;
  margin-block-end: var(--space-4);
  display: block;
}
.footer-small {
  font-size: var(--text-sm);
  opacity: 0.75;
}
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: rgba(245, 234, 208, 0.08);
  color: #f5ead0;
  border: 1px solid rgba(245, 234, 208, 0.15);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.footer-social a:hover {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  border-color: var(--color-brand-primary);
  transform: translateY(-2px);
}
.footer-social svg {
  width: 18px;
  height: 18px;
  display: block;
}

.footer-columns {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) {
  .footer-columns { grid-template-columns: repeat(4, 1fr); }
}
.footer-column strong {
  color: #fff;
  font-family: var(--font-display);
  display: block;
  margin-block-end: var(--space-3);
  font-size: var(--text-base);
  font-weight: 600;
}
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column li a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: var(--text-sm);
  display: block;
  padding-block: var(--space-1);
  transition: color var(--duration-fast) var(--ease-out);
}
.footer-column li a:hover { color: #fff; }

.floating-wa {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 90;
}
.floating-wa a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 1.4rem;
  background: var(--color-brand-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.floating-wa a:hover {
  background: var(--color-brand-dark);
  color: #fff;
  transform: translateY(-2px);
}

/* =====================================================================
 * Image / teacher cards
 * ===================================================================== */
.image-card {
  display: block;
  margin: 0;
}
.image-card figure { margin: 0; }
.image-card img {
  border-radius: var(--radius-lg);
  width: 100%;
  height: auto;
}
.image-card figcaption {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  margin-block-start: var(--space-3);
}

.teacher-card { margin: 0; }
.teacher-card img {
  border-radius: var(--radius-lg);
  width: 100%;
  height: auto;
}

.teacher-overview {
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 800px) {
  .teacher-overview { grid-template-columns: 2fr 1fr; }
}

.teacher-card-compact figure { margin: 0; }
.teacher-card-compact img {
  max-width: 280px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
}

.teacher-copy { max-width: 62rem; }
.teacher-copy .section-title { max-width: 22ch; }

.teacher-stats {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, 1fr);
  margin-block-start: var(--space-6);
}
@media (min-width: 800px) {
  .teacher-stats { grid-template-columns: repeat(4, 1fr); }
}

.teacher-actions {
  margin-block-start: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* =====================================================================
 * Misc
 * ===================================================================== */
.route-mini {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
}
.route-mini a {
  padding: 0.5rem 1rem;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.route-mini a:hover {
  background: var(--color-brand-primary);
  color: #fff;
  border-color: transparent;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 180ms; }
.reveal-delay-3 { transition-delay: 260ms; }

.panel-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  color: #fff;
}
.panel-dark p { color: rgba(255, 255, 255, 0.85); }

/* Form niceties (carry-over from legacy markup) */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: #fff;
  color: var(--color-ink);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(217, 160, 62, 0.18);
  outline: none;
}
textarea { min-height: 150px; resize: vertical; }
label { font-weight: 600; color: var(--color-ink); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* =====================================================================
 * === Direction A: Evolve (LIVE) ===
 * Promoted to live homepage in Task 21. Selectors unscoped from .dir-a so
 * they apply globally. Placed at the bottom of the file so they win the
 * cascade against earlier component rules.
 * ===================================================================== */

/* Hero — navy gradient ground with cream type and amber eyebrow */
 .home-hero {
  background:
    radial-gradient(circle, rgba(245, 234, 208, 0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand-accent) 100%);
  color: #f5ead0;
  padding-block: clamp(3rem, 6vw, 5rem);
}
 .home-hero .eyebrow {
  color: var(--color-brand-primary);
  letter-spacing: 0.14em;
}
 .home-hero .headline {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #f5ead0;
  max-width: 18ch;
  line-height: 1.05;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 96;
}
 .home-hero .subheadline {
  color: rgba(245, 234, 208, 0.85);
  max-width: 56ch;
}
 .home-hero .hero-note {
  color: rgba(245, 234, 208, 0.65);
}
/* Hero stat strip — pulls factual claims out of subhead */
 .home-hero .stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  align-items: center;
  margin: var(--space-5) 0 var(--space-6);
  padding: 0;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 234, 208, 0.78);
  font-weight: 500;
}
 .home-hero .stat-strip span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
}
 .home-hero .stat-strip span + span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-brand-primary);
  margin-right: var(--space-5);
}
 .home-hero .hero-visual {
  transform: rotate(2deg);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
 .home-hero .hero-visual img {
  border-radius: var(--radius-lg);
}
 .home-hero .hero-visual figcaption {
  color: rgba(245, 234, 208, 0.75);
}
/* Secondary button on dark hero */
 .home-hero .button-secondary {
  border-color: rgba(245, 234, 208, 0.5);
  color: #f5ead0;
  background: transparent;
}
 .home-hero .button-secondary:hover {
  background: #f5ead0;
  color: var(--color-brand-dark);
  border-color: #f5ead0;
}

/* Jump strip — tighter padding rhythm */
 .jump-strip {
  padding-block: var(--space-2);
}

/* Section headings — display serif, tight tracking */
 .section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 48;
}
 h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
  letter-spacing: -0.01em;
}
 p,
 .subheadline,
 .card p {
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 14;
}

/* Eyebrow — finer tracking + small amber bar */
 .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  font-weight: 700;
}
 .eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--color-brand-primary);
  flex-shrink: 0;
}

/* Section transitions — hairline amber rule between adjacent sections */
 .section + .section {
  border-top: 1px solid rgba(217, 160, 62, 0.15);
}
 .section-dark + .section {
  border-top: 4px solid var(--color-brand-primary);
}

/* Cards — barely-there border, amber dot on hover */
 .card {
  position: relative;
  padding: var(--space-6);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  box-shadow: none;
  background: #fff;
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
 .card::before {
  content: "";
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-brand-primary);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
 .card:hover {
  transform: translateY(-2px);
  border: 1px solid var(--color-brand-primary);
  box-shadow: var(--shadow-sm);
}
 .card:hover::before {
  opacity: 1;
  transform: scale(1);
}

/* Amber callout — pulled from teacher paragraph */
 .callout-amber {
  display: block;
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--color-brand-primary);
  background: rgba(217, 160, 62, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-ink);
  font-size: var(--text-base);
  line-height: 1.5;
}
 .callout-amber strong {
  color: var(--color-brand-dark);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Diagnostic route-mini — amber hover */
 #diagnostic .route-mini a {
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}
 #diagnostic .route-mini a:hover {
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}

/* Editorial proof layout — 1 big + 2 stacked */
@media (min-width: 768px) {
   #proof .testimonial-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-6);
  }
   #proof .testimonial-grid > .proof-card:first-child {
    grid-row: 1 / span 2;
  }
}

/* Dark sections — amber accent strip on top */
 .section-dark {
  background: var(--color-brand-dark);
  border-top: 3px solid var(--color-brand-primary);
  position: relative;
}
 .section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(36, 93, 112, 0.35), transparent 70%),
    radial-gradient(800px 320px at 100% 100%, rgba(217, 160, 62, 0.08), transparent 70%);
  pointer-events: none;
}
 .section-dark > * { position: relative; }

/* Stats cards — amber display numerals */
 .stats-card strong {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-brand-primary);
  letter-spacing: -0.01em;
}
 .stats-card p {
  color: var(--color-ink-muted);
}

/* Proof / testimonials — white cards with quiet border */
 #proof .proof-card {
  background: #fff;
  border: 1px solid var(--color-border);
}

/* Footer — amber accent strip at the very top + tightened columns */
 .footer {
  border-top: 3px solid var(--color-brand-primary);
}
 .footer .footer-columns {
  gap: var(--space-6);
}
 .footer .footer-column ul {
  gap: var(--space-2);
}

/* Reveal motion — subtle fade + small lift, no scroll-driven animation */
 .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
 .reveal.is-visible,
 .reveal[data-revealed="true"] {
  opacity: 1;
  transform: none;
}
/* Fallback: if no JS reveal observer is wired, content still shows after first paint */
@media (prefers-reduced-motion: no-preference) {
   .reveal {
    animation: dir-a-reveal var(--duration-slow) var(--ease-out) forwards;
    animation-delay: 80ms;
  }
   .reveal-delay-1 { animation-delay: 220ms; }
}
@keyframes dir-a-reveal {
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
   .reveal { opacity: 1; transform: none; animation: none; }
}

/* =====================================================================
 * === Inner-page components ===
 * Class names referenced by ~50 non-homepage templates that previously
 * rendered unstyled. Styling intent lifted from site.legacy.css and
 * re-expressed in Direction A tokens (Fraunces display, amber accent,
 * navy ground, cream surfaces).
 * ===================================================================== */

/* Page hero — every non-homepage uses this as the navy banner */
.page-hero {
  background:
    radial-gradient(circle, rgba(245, 234, 208, 0.05) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand-accent) 100%);
  color: #f5ead0;
  padding-block: clamp(3rem, 6vw, 5rem);
  border-top: 3px solid var(--color-brand-primary);
  position: relative;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(36, 93, 112, 0.35), transparent 70%),
    radial-gradient(800px 320px at 100% 100%, rgba(217, 160, 62, 0.08), transparent 70%);
  pointer-events: none;
}
.page-hero > * { position: relative; }
.page-hero .hero-inner { max-width: 920px; }
.page-hero .headline,
.page-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #f5ead0;
  max-width: 22ch;
  line-height: 1.1;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 96;
  margin-block: var(--space-3) var(--space-4);
}
.page-hero .eyebrow {
  color: var(--color-brand-primary);
  letter-spacing: 0.14em;
}
.page-hero .subheadline,
.page-hero p {
  color: rgba(245, 234, 208, 0.85);
  max-width: 56ch;
}
.page-hero .hero-note { color: rgba(245, 234, 208, 0.65); }
.page-hero .text-link { color: var(--color-brand-primary); }
.page-hero .button-secondary {
  color: #f5ead0;
  border-color: rgba(245, 234, 208, 0.25);
  background: rgba(255, 255, 255, 0.06);
}
.page-hero .button-secondary:hover {
  border-color: var(--color-brand-primary);
  background: rgba(217, 160, 62, 0.14);
}

/* Breadcrumbs — small caps amber trail at top of page hero */
.breadcrumbs {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brand-primary);
  margin-block-end: var(--space-3);
}
.breadcrumbs a { color: var(--color-brand-primary); border-bottom: 1px solid transparent; }
.breadcrumbs a:hover { border-bottom-color: var(--color-brand-primary); }
.breadcrumbs span { color: rgba(245, 234, 208, 0.55); }

/* Answer box — amber left-border callout used on FAQ/answer pages */
.answer-box {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand-primary);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  margin-block: var(--space-4);
}
.answer-box p { color: var(--color-ink); }
.answer-box p:last-child { margin-block-end: 0; }

/* Light panel — muted-surface counterpart to .panel-dark */
.panel-light {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}
.panel-light p { color: var(--color-ink-muted); }

/* Philosophy band — emphasised navy section */
.philosophy-band {
  background: var(--color-brand-dark);
  border-top: 4px solid var(--color-brand-primary);
  color: #f5ead0;
  padding-block: clamp(4rem, 8vw, 7rem);
  position: relative;
}
.philosophy-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 360px at 80% 10%, rgba(217, 160, 62, 0.12), transparent 70%);
  pointer-events: none;
}
.philosophy-band > * { position: relative; }
.philosophy-band .section-title,
.philosophy-band h2 { color: #f5ead0; }
.philosophy-band p,
.philosophy-band .subheadline { color: rgba(245, 234, 208, 0.85); }

/* Philosophy points — bullet stack used inside philosophy band */
.philosophy-points {
  display: grid;
  gap: var(--space-4);
  margin-block-start: var(--space-5);
}
.philosophy-points article,
.philosophy-points li {
  position: relative;
  padding-left: var(--space-5);
}
.philosophy-points article::before,
.philosophy-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-brand-primary);
}
.philosophy-points strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  color: inherit;
  margin-block-end: var(--space-2);
}

/* Process grid — numbered 3-up grid for "how it works" sections */
.process-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  counter-reset: process;
  margin-block-start: var(--space-5);
}
.process-grid > * {
  counter-increment: process;
  position: relative;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.process-grid > *::before {
  content: counter(process, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-brand-primary);
  margin-block-end: var(--space-2);
  line-height: 1;
}

/* Route grid — alias of card-grid with slightly different shape (5-up on legacy) */
.route-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-block-start: var(--space-5);
}

/* Contact grid / contact card */
.contact-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-block-start: var(--space-5);
}
.contact-card {
  padding: var(--space-7);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}
.contact-card h3 { font-family: var(--font-display); font-weight: 500; }

/* Weekly plan + diagnosis grid — card-grid variants with larger cards */
.weekly-plan,
.diagnosis-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-block-start: var(--space-5);
}
.weekly-plan > *,
.diagnosis-grid > * {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.weekly-plan strong,
.diagnosis-grid strong {
  display: block;
  color: var(--color-ink);
  margin-block-end: var(--space-2);
  font-family: var(--font-display);
  font-weight: 500;
}

/* Topic map / topic row — definition-list-style rows */
.topic-map {
  display: grid;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.topic-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr);
  gap: var(--space-4);
  align-items: baseline;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.topic-row:last-child { border-bottom: 0; }
.topic-row > :first-child,
.topic-row dt {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--text-xs);
  color: var(--color-brand-primary);
  font-weight: 600;
}
.topic-row > :last-child,
.topic-row dd { color: var(--color-ink); margin: 0; }

/* Status chip — small pill */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(217, 160, 62, 0.14);
  color: var(--color-ink);
  border: 1px solid rgba(217, 160, 62, 0.32);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.section-dark .status-chip,
.page-hero .status-chip,
.philosophy-band .status-chip {
  background: rgba(255, 255, 255, 0.08);
  color: #f5ead0;
  border-color: rgba(245, 234, 208, 0.2);
}

/* Priority list — clean ol/ul with no bullets, amber numerals via counter */
.priority-list {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 0;
  display: grid;
  gap: var(--space-3);
  counter-reset: priority;
}
.priority-list li {
  counter-increment: priority;
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-10);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  line-height: 1.6;
}
.priority-list li::before {
  content: counter(priority);
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--color-brand-primary);
  color: #14130e;
  font-weight: 700;
  font-size: var(--text-sm);
  font-family: var(--font-display);
}

/* Check table — schedule-style table for checklists */
.check-table {
  width: 100%;
  border-collapse: collapse;
  margin-block-start: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.check-table th,
.check-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
.check-table th {
  background: var(--color-surface-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  color: var(--color-ink);
}
.check-table tr:last-child td { border-bottom: 0; }
.check-table th:not(:first-child),
.check-table td:not(:first-child) { text-align: center; }
.check-box {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
  vertical-align: middle;
}

/* Paper check grid */
.paper-check-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-block-start: var(--space-5);
}
.paper-check-grid > * {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* Testimonial shot — framed screenshot container */
.testimonial-shot {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.testimonial-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* Proof card variants */
.proof-card--image {
  padding: var(--space-5);
}
.proof-card--image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.proof-card--gallery {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.proof-card--gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* Testimonial gallery — compact responsive grid with capped thumbnails */
.testimonial-gallery {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: start;
}
.testimonial-gallery .proof-card--gallery {
  gap: var(--space-3);
  height: 100%;
}
.testimonial-gallery .testimonial-shot {
  padding: var(--space-3);
  overflow: hidden;
}
.testimonial-gallery .testimonial-shot img {
  height: 280px;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}
.testimonial-gallery .testimonial-shot:hover img {
  transform: scale(1.03);
}

/* Bullet list — amber bullet ::marker */
.bullet-list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  display: grid;
  gap: var(--space-2);
}
.bullet-list li {
  position: relative;
  padding-left: 1.35rem;
  line-height: 1.65;
  color: var(--color-ink);
}
.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-brand-primary);
}
.section-dark .bullet-list li,
.page-hero .bullet-list li,
.philosophy-band .bullet-list li { color: rgba(245, 234, 208, 0.88); }

/* Map principle — labeled callout card */
.map-principle {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand-primary);
  border-radius: var(--radius-md);
}
.map-principle strong {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-ink);
}

/* Contrast card — before/after side-by-side */
.contrast-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.contrast-card strong {
  display: block;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-weight: 500;
  margin-block-end: var(--space-2);
}

/* Definition grid — term/def 2-column grid */
.definition-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-block-start: var(--space-5);
}
.definition-grid > * {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* Worksheet callout — amber-tinted block */
.worksheet-callout {
  padding: var(--space-7);
  background: linear-gradient(135deg, rgba(217, 160, 62, 0.14), rgba(217, 160, 62, 0.04));
  border: 1px solid rgba(217, 160, 62, 0.32);
  border-radius: var(--radius-lg);
  margin-block: var(--space-6);
}

/* Revision lead — 2-col split */
.revision-lead {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: start;
  margin-block-start: var(--space-5);
}

/* Diagnosis card */
.diagnosis-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.diagnosis-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin-block: 0 var(--space-2);
}

/* Form bits — consent, rows, fields, status, honeypot */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.field {
  display: grid;
  gap: var(--space-2);
}
.consent-line {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-ink-muted);
}
.consent-line input { width: auto; margin-top: 0.25rem; }
.consent-line a {
  color: var(--color-brand-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}
.status-message {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-ink);
}
.status-message[data-status="success"] {
  background: rgba(42, 123, 84, 0.1);
  border-color: rgba(42, 123, 84, 0.3);
  color: var(--color-success);
}
.status-message[data-status="error"] {
  background: rgba(160, 48, 48, 0.1);
  border-color: rgba(160, 48, 48, 0.3);
  color: #8a2626;
}
.status-message[data-status="pending"] {
  background: rgba(217, 160, 62, 0.12);
  border-color: rgba(217, 160, 62, 0.3);
  color: var(--color-warn);
}

/* Responsive collapses for inner-page grids */
@media (max-width: 900px) {
  .process-grid,
  .revision-lead { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: 1fr; gap: var(--space-2); }
}

/* =====================================================================
 * === The Marking (LIVE 2026-06-13) ===
 * Final cascade layer. Design language from the founder-approved
 * landing-marking.html: night cinema heroes, marked-exam-paper world,
 * red pen accents, amber CTAs, sticky-note cards, Caveat margin notes.
 * Placed last so it wins against both earlier layers. Previous CSS is
 * preserved at backup-2026-06-13/.
 * ===================================================================== */

/* --- Topbar: paper + blur ------------------------------------------- */
.topbar {
  background: rgba(250, 243, 230, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(28, 39, 66, 0.12);
}
.nav-links a { color: var(--color-ink); }
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-amber-deep);
  background: rgba(245, 166, 35, 0.12);
}
.nav-toggle { background: rgba(255, 255, 255, 0.55); }
@media (max-width: 799px) {
  .nav-menu {
    background: var(--color-surface);
    border-bottom: 1px solid rgba(28, 39, 66, 0.12);
  }
}

/* --- Buttons: amber pill with hard pen-pressure shadow --------------- */
.button,
.button-light,
.nav-cta {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  font-weight: 800;
  border: none;
  box-shadow: var(--shadow-cta);
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.button:hover,
.button-light:hover,
.nav-cta:hover,
a.button:hover,
a.button-light:hover,
a.nav-cta:hover {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-hover);
}
.button:active,
.button-light:active,
.nav-cta:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--color-amber-deep);
}
.nav-cta { box-shadow: 0 2px 0 var(--color-amber-deep), 0 10px 22px -8px rgba(245, 166, 35, 0.55); }

.button-secondary {
  background: transparent;
  color: var(--color-ink);
  border: 2px solid rgba(28, 39, 66, 0.18);
  font-weight: 700;
}
.button-secondary:hover {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-ink-muted);
  transform: translateY(-2px);
}
.section-dark .button-secondary,
.page-hero .button-secondary,
.philosophy-band .button-secondary {
  background: transparent;
  color: var(--color-bone);
  border-color: rgba(242, 237, 227, 0.3);
}
.section-dark .button-secondary:hover,
.page-hero .button-secondary:hover,
.philosophy-band .button-secondary:hover {
  background: rgba(242, 237, 227, 0.08);
  color: var(--color-bone);
  border-color: rgba(242, 237, 227, 0.55);
}

/* --- Section rhythm: the ruled paper does the work, no hairlines ----- */
.section + .section { border-top: none; }
.section-dark + .section { border-top: none; }

/* --- Night sections: cinematic glow + film grain --------------------- */
.section-dark {
  background: var(--color-surface-dark);
  border-top: none;
}
.section-dark::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(62, 84, 140, 0.3) 0%, transparent 65%);
}

/* --- Page hero (51 pages): the film opening -------------------------- */
.page-hero {
  background: var(--color-surface-dark);
  border-top: none;
  color: var(--color-bone);
  position: relative;
  z-index: 2;
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 44% at 50% 16%, rgba(62, 84, 140, 0.32) 0%, transparent 65%);
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.page-hero > * { position: relative; z-index: 3; }
.page-hero .headline,
.page-hero h1 {
  color: var(--color-bone);
  font-weight: 420;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.page-hero .subheadline,
.page-hero p { color: var(--color-bone-dim); }
.page-hero .subheadline strong,
.page-hero p strong { color: var(--color-bone); }
.page-hero .stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  align-items: center;
  margin: var(--space-5) 0 0;
  padding: 0;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-bone-dim);
  font-weight: 700;
}
.page-hero .stat-strip span { display: inline-flex; align-items: center; gap: var(--space-5); }
.page-hero .stat-strip span + span::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--color-brand-primary);
  margin-right: var(--space-5);
}
.breadcrumbs { color: var(--color-bone-dim); }
.breadcrumbs a { color: var(--color-brand-primary); }
.breadcrumbs span { color: rgba(154, 163, 184, 0.7); }

/* --- Eyebrows: red pen on paper, amber in the dark -------------------- */
.eyebrow {
  color: var(--color-pen);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.eyebrow::before {
  width: 28px;
  height: 2px;
  background: var(--color-pen);
}
.section-dark .eyebrow,
.page-hero .eyebrow,
.philosophy-band .eyebrow,
.footer .eyebrow { color: var(--color-brand-primary); }
.section-dark .eyebrow::before,
.page-hero .eyebrow::before,
.philosophy-band .eyebrow::before,
.footer .eyebrow::before { background: rgba(245, 166, 35, 0.6); }

.section-title { font-weight: 500; letter-spacing: -0.02em; }

/* --- Text links: legible amber-deep, ink on hover --------------------- */
.text-link { color: var(--color-amber-deep); }
.text-link:hover { color: var(--color-ink); }
.section-dark .text-link,
.page-hero .text-link { color: var(--color-brand-primary); }

/* --- Cards: sticky notes pinned slightly off-straight ----------------- */
.card {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card::before { display: none; }
.card-grid .card:nth-child(odd) { transform: rotate(-0.8deg); }
.card-grid .card:nth-child(even) { transform: rotate(0.7deg); }
.card:hover {
  transform: rotate(0) translateY(-6px);
  border: none;
  box-shadow: var(--shadow-md);
}
.card h3 {
  font-style: italic;
  font-weight: 500;
  color: var(--color-ink);
}

/* --- Tags: handwritten red-pen margin notes ---------------------------- */
.tag {
  background: transparent;
  color: var(--color-pen);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
  border-radius: 0;
}

/* --- Stats: Fraunces italic pen-red numerals --------------------------- */
.stats-card {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.stats-card strong {
  font-style: italic;
  color: var(--color-pen);
}

/* --- Proof / testimonials: pinned with amber tape ----------------------- */
.proof-card {
  position: relative;
  background: #fff;
  border: none;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}
.proof-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 96px;
  height: 24px;
  background: rgba(245, 166, 35, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 3;
}
.testimonial-grid .proof-card:nth-child(odd) { transform: rotate(-1deg); }
.testimonial-grid .proof-card:nth-child(even) { transform: rotate(0.8deg); }
.testimonial-grid .proof-card:hover { transform: rotate(0) translateY(-7px); }
.proof-card blockquote {
  border-left: none;
  padding-left: 0;
  font-style: italic;
  font-weight: 480;
  line-height: 1.55;
}
#proof .proof-card { border: none; }

.testimonial-shot,
.image-card {
  background: #fff;
  border: none;
  border-radius: 5px;
  padding: 13px 13px 16px;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.2deg);
  transition: transform 0.3s ease;
}
.testimonial-shot:hover,
.image-card:hover { transform: rotate(0); }
.image-card img,
.testimonial-shot img { border-radius: 3px; }
.image-card figcaption {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--color-pen);
  margin-block-start: var(--space-2);
}
.testimonial-gallery .testimonial-shot { padding: 10px 10px 12px; }

/* --- Tables / schedule -------------------------------------------------- */
.schedule-card {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}
.schedule-card th { border-bottom: 2px solid var(--color-pen); }
.table-wrap {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.table-wrap th { background: rgba(245, 166, 35, 0.14); }

/* --- FAQ: white accordion cards ------------------------------------------ */
.faq-list { gap: 0.85rem; }
.faq-item {
  background: #fff;
  border: 1.5px solid rgba(28, 39, 66, 0.1);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item:has(.faq-question[aria-expanded="true"]) {
  border-color: var(--color-brand-primary);
  box-shadow: 0 14px 28px -16px rgba(28, 39, 66, 0.25);
}
.faq-question {
  padding: 1.15rem 1.4rem;
  font-weight: 700;
}
.faq-question:hover { color: var(--color-amber-deep); }
.faq-icon {
  font-family: var(--font-display);
  color: var(--color-brand-primary);
  font-weight: 400;
}
.faq-answer { padding: 0 1.4rem var(--space-5); }

/* --- Callouts: highlighter sticky notes ----------------------------------- */
.answer-box {
  position: relative;
  background: #fff;
  border: none;
  border-left: none;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  transform: rotate(0.4deg);
  padding: var(--space-6);
}
.answer-box::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 88px;
  height: 24px;
  background: rgba(245, 166, 35, 0.45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.callout-amber {
  background: #FFF6DF;
  border-left: 3px solid var(--color-brand-primary);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.callout-amber strong { color: var(--color-ink); }
.worksheet-callout {
  background: #FFF6DF;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  transform: rotate(-0.4deg);
}
.map-principle {
  background: #fff;
  border: none;
  border-left: 4px solid var(--color-pen);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.panel-light {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.panel-dark {
  background: rgba(250, 243, 230, 0.045);
  border: 1px solid rgba(242, 237, 227, 0.14);
  border-radius: 18px;
  color: var(--color-bone);
}
.panel-dark p { color: var(--color-bone-dim); }
.panel-dark h3 { color: var(--color-bone); }

/* --- Philosophy band: night ----------------------------------------------- */
.philosophy-band {
  background: var(--color-surface-dark);
  border-top: none;
  color: var(--color-bone);
}
.philosophy-band::before {
  background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(62, 84, 140, 0.3) 0%, transparent 65%);
}
.philosophy-band .section-title,
.philosophy-band h2 { color: var(--color-bone); }
.philosophy-band p,
.philosophy-band .subheadline { color: var(--color-bone-dim); }
.philosophy-points strong { color: var(--color-bone); }
.philosophy-points article::before,
.philosophy-points li::before { background: var(--color-brand-primary); }

/* --- Numbered structures: pen-red Fraunces italic numerals ------------------ */
.process-grid > * {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}
.process-grid > *:nth-child(odd) { transform: rotate(-0.5deg); }
.process-grid > *:nth-child(even) { transform: rotate(0.5deg); }
.process-grid > *::before {
  font-style: italic;
  color: var(--color-pen);
}
.priority-list li {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.priority-list li::before {
  background: transparent;
  color: var(--color-pen);
  font-style: italic;
  font-size: var(--text-lg);
  font-weight: 600;
  width: auto;
  height: auto;
}

/* --- Topic map / rows -------------------------------------------------------- */
.topic-map {
  background: #fff;
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: 4px;
}
.topic-row { border-bottom: 1px dashed rgba(28, 39, 66, 0.18); }
.topic-row > :first-child,
.topic-row dt { color: var(--color-pen); }

/* --- Chips / checks ------------------------------------------------------------ */
.status-chip {
  background: rgba(245, 166, 35, 0.14);
  border: 1px solid rgba(245, 166, 35, 0.4);
  color: var(--color-ink);
}
.section-dark .status-chip,
.page-hero .status-chip,
.philosophy-band .status-chip {
  background: rgba(242, 237, 227, 0.08);
  color: var(--color-bone);
  border-color: rgba(242, 237, 227, 0.2);
}
.check-table {
  background: #fff;
  border: none;
  box-shadow: var(--shadow-sm);
}
.check-table th { background: var(--color-surface-muted); }
.check-box { border-color: rgba(28, 39, 66, 0.3); }

/* --- Generic white-paper cards --------------------------------------------------- */
.contact-card,
.weekly-plan > *,
.diagnosis-grid > *,
.paper-check-grid > *,
.definition-grid > *,
.contrast-card,
.diagnosis-card {
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* --- Chips strips ------------------------------------------------------------------ */
.jump-strip {
  background: var(--color-surface-muted);
  border-block: 1px solid rgba(28, 39, 66, 0.1);
}
.jump-strip a {
  background: #fff;
  border: 1px solid rgba(28, 39, 66, 0.12);
  color: var(--color-ink-muted);
}
.jump-strip a:hover {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  border-color: transparent;
}
.route-mini a {
  background: #fff;
  border: 1px solid rgba(28, 39, 66, 0.12);
}
.route-mini a:hover {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  border-color: transparent;
}

/* --- Bullets: red pen ticks ----------------------------------------------------------- */
.bullet-list li::before { background: var(--color-pen); }
.section-dark .bullet-list li,
.page-hero .bullet-list li,
.philosophy-band .bullet-list li { color: var(--color-bone-dim); }

/* --- Floating WhatsApp ------------------------------------------------------------------ */
.floating-wa a {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  font-weight: 800;
  box-shadow: var(--shadow-cta);
}
.floating-wa a:hover {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-hover);
}

/* --- Footer: end credits ------------------------------------------------------------------- */
.footer {
  background: #060A16;
  border-top: none;
  color: rgba(242, 237, 227, 0.75);
}
.footer p { color: rgba(242, 237, 227, 0.65); }
.footer-column strong { color: var(--color-bone); font-weight: 500; }
.footer-column li a { color: rgba(242, 237, 227, 0.78); }
.footer-column li a:hover { color: var(--color-brand-primary); }
.footer-social a {
  background: rgba(242, 237, 227, 0.14);
  color: var(--color-bone);
  border: 1px solid rgba(242, 237, 227, 0.35);
}
.footer-social a:hover {
  background: var(--color-brand-primary);
  color: var(--color-brand-dark);
  border-color: var(--color-brand-primary);
}

/* --- Forms ------------------------------------------------------------------------------------ */
input, select, textarea {
  border: 2px solid rgba(28, 39, 66, 0.14);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18);
}
.consent-line a { color: var(--color-amber-deep); }
.status-message[data-status="pending"] {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.3);
  color: var(--color-warn);
}

/* --- Old homepage hero (replaced by the Marking homepage; kept coherent) --- */
.home-hero {
  background: var(--color-surface-dark);
  color: var(--color-bone);
}
.home-hero .headline { color: var(--color-bone); }
.home-hero .subheadline,
.home-hero .hero-note { color: var(--color-bone-dim); }
.home-hero .stat-strip { color: var(--color-bone-dim); }

/* =====================================================================
 * === Marked mistakes (added 2026-11-06) ===
 * The marked mistake card from the UI/UX audit, section D1. Class names
 * are fixed by that spec: .mark-card and its parts, .script, .working,
 * .mark, .pen-ring, .pen-note, .mark-stamp, .frac, .sqrt; plus the compact
 * .mark-card--mini (one panel, for heroes and in place of pictures).
 * site.js adds .is-marked at about 45% visibility. Without JS the final
 * marked state shows, because the hidden state is scoped to .js.
 * Ruled rhythm: one working line = one ruled line = --mk-band, which is
 * 2.4 x the working size (the same as --line-gap at that size).
 * ===================================================================== */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.mark-card,
.script {
  --mk-fs: clamp(1.05rem, 0.95rem + 0.6vw, 1.4rem);   /* working size   */
  --mk-band: calc(var(--mk-fs) * 2.4);                /* one ruled line */
}
.mark-card {
  max-width: 1040px;
  margin: 0 auto 3.5rem;
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  position: relative;
  color: var(--color-ink);
  text-align: left;
}
/* night bands colour every p and h3 light: put the paper colours back */
.mark-card p { color: var(--color-ink); max-width: none; }
.mark-card p strong { color: inherit; }

.mark-card .mark-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}
.mark-q {
  font: italic 500 1.4rem/1 var(--font-display);
  color: var(--color-pen);
  letter-spacing: 0;
  text-transform: none;
}
@media (min-width: 1180px) {
  /* the question number sits in the left margin, like an exam script */
  .mark-card:not(.mark-card--mini) .mark-q {
    position: absolute;
    left: -2.6rem;
    top: 1.75rem;
    font-size: 1.8rem;
  }
}
.mark-card .mark-card__title {
  font: italic 480 clamp(1.3rem, 1.1rem + 1vw, 1.75rem)/1.25 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin: 0.5rem 0 1.25rem;
  text-wrap: balance;
}
.mark-card__title sup { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; }

.mark-card__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

/* --- one exam-script panel: cream sheet, ruled lines, red margin line --- */
.script {
  --mk-pad-top: 1rem;
  position: relative;
  min-width: 0;
  font-size: var(--mk-fs);
  padding: var(--mk-pad-top) 1.25rem 1.25rem 2.75rem;
  background-color: var(--color-surface);
  background-image: linear-gradient(rgba(28, 39, 66, 0.085) 1px, transparent 1px);
  background-size: 100% var(--mk-band);
  /* the rule sits just under the written baseline of every line */
  background-position: 0 calc(var(--mk-pad-top) + var(--mk-band) * 0.74);
}
.script::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 1.75rem;
  width: 1.5px;
  background: rgba(201, 59, 34, 0.45);
}
.script--right { border-left: 1.5px dashed rgba(28, 39, 66, 0.2); }
.mark-card .script__label {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: var(--mk-band);           /* exactly one ruled line */
  text-transform: uppercase;
  color: var(--color-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- the working: one line per li, equals signs in one column --- */
.working {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24;
  font-size: 1em;                        /* = --mk-fs, set on .script */
  line-height: var(--line-gap);          /* 2.4em here = --mk-band     */
  font-variant-numeric: lining-nums;
  color: var(--color-ink);
}
.working li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr) 2em;
  column-gap: 0.45em;
  align-items: baseline;
  min-height: var(--line-gap);
  color: var(--color-ink);
}
@supports (grid-template-columns: subgrid) {
  /* one shared grid for the whole working, so every "=" lines up */
  .working {
    display: grid;
    grid-template-columns: max-content auto minmax(0, 1fr) 2em;
    column-gap: 0.45em;
  }
  .working li { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
.working .lhs { text-align: right; white-space: nowrap; }
.working .eq { color: var(--color-ink-muted); }
.working .rhs { white-space: nowrap; min-width: 0; }
.working sup { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; }   /* keeps the ruled rhythm */
.working sub { font-size: 0.62em; line-height: 0; vertical-align: -0.2em; }

.mark {
  font-family: var(--font-body);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.08em;
}
.mark--cross { color: var(--color-pen); }
.mark--tick { color: var(--color-teal); }   /* large glyph: 3:1 is enough */

/* --- the red-pen ring around the step that broke --- */
.pen-ring {
  position: relative;
  display: inline-block;
  margin-left: 0.2em;                    /* keeps the ring clear of the "=" */
  padding: 0 0.3em;
  line-height: 1.3;                      /* ring hugs the writing, not the ruled line */
}
.pen-ring svg {
  position: absolute;
  left: -7%; top: -30%;
  width: 114%; height: 160%;
  max-width: none;
  overflow: visible;
  pointer-events: none;
  transform: rotate(-3deg);
}
.pen-ring ellipse {
  fill: none;
  stroke: var(--color-pen);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 0;
}
.js .mark-card .pen-ring ellipse { stroke-dashoffset: 360; }
.js .mark-card.is-marked .pen-ring ellipse { animation: draw 1s var(--ease-out) 0.15s forwards; }

/* --- the teacher's handwritten note, with a pen arrow back to the ring --- */
.mark-card .pen-note {
  position: relative;
  width: fit-content;
  max-width: 15rem;
  margin: 0.35rem 0 0 auto;
  font: 700 1.3rem/1.15 var(--font-hand);
  color: var(--color-pen);
  text-align: right;
  transform: rotate(-3deg);
}
.mark-card .pen-note::before {
  content: "";
  display: inline-block;
  width: 1.45em; height: 1em;
  margin-right: 0.25em;
  vertical-align: 0.15em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M46 29C30 29 14 23 6 6M5.5 15.5L6 6l7.8 5.2'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M46 29C30 29 14 23 6 6M5.5 15.5L6 6l7.8 5.2'/%3E%3C/svg%3E") no-repeat center / contain;
}

.mark-card .mark-stamp {
  display: inline-block;
  margin: 0.9rem 0 0;
  padding: 2px 12px;
  font: 700 1.2rem/1.25 var(--font-hand);
  color: var(--color-teal-text);
  border: 2.5px solid currentColor;
  border-radius: 10px;
  transform: rotate(-6deg);
}

/* --- plain-HTML maths --- */
.frac {
  display: inline-grid;
  vertical-align: middle;
  text-align: center;
  font-size: 0.8em;
  line-height: 1.15;
  margin: 0 0.12em;
}
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 0.2em; }
.sqrt { white-space: nowrap; }
.sqrt > span { border-top: 1.5px solid currentColor; padding-left: 0.12em; }

/* --- why / fix / cost --- */
.mark-card__explain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 0;
}
.mark-card__explain dt {
  font: italic 500 1.05rem/1.3 var(--font-display);
  color: var(--color-ink);
  margin-bottom: 0.35rem;
}
.mark-card__explain dd {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: 0.97rem;
  line-height: 1.6;
}

.mark-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(28, 39, 66, 0.18);
}
.mark-card .mark-card__source {
  margin: 0 auto 0 0;
  font-size: 0.85rem;
  color: var(--color-ink-muted);
}
.mark-card .text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--color-amber-deep);
}
.mark-card .text-link:hover { color: var(--color-ink); }

@media (max-width: 760px) {
  .mark-card { padding: 1.1rem 1rem 1.25rem; }
  .mark-q { display: inline-block; margin-right: 0.5rem; font-size: 1.4rem; }
  .mark-card__body,
  .mark-card__explain { grid-template-columns: minmax(0, 1fr); }
  .script { --mk-pad-top: 0.75rem; padding: var(--mk-pad-top) 0.9rem 1rem 2.25rem; }
  .script::before { left: 1.4rem; }
  .script--right { border-left: 0; border-top: 1.5px dashed rgba(28, 39, 66, 0.2); }
  /* continuation lines start with "=": first lines put the left side on its own line */
  .working li { grid-template-columns: auto minmax(0, 1fr) 1.8em; }
  @supports (grid-template-columns: subgrid) {
    .working { grid-template-columns: auto minmax(0, 1fr) 1.8em; }
  }
  .working .lhs:empty { display: none; }
  .working .lhs:not(:empty) { grid-column: 1 / -1; text-align: left; }
  .working .rhs { white-space: normal; }
  .mark-card .pen-note { text-align: left; margin-left: 0.25rem; }
  .mark-card .pen-note::before { transform: scaleX(-1); }   /* arrow points up-right, at the ring */
}

/* --- compact variant: one panel, for heroes and in place of pictures --- */
.mark-card--mini {
  --mk-fs: clamp(1.05rem, 0.98rem + 0.35vw, 1.3rem);
  max-width: 27rem;
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg);
}
.mark-card--mini .mark-q { position: static; font-size: 1.25rem; }
.mark-card--mini .mark-card__title {
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  margin: 0.3rem 0 0.6rem;
}
.mark-card--mini .mark-card__body { grid-template-columns: minmax(0, 1fr); }
.mark-card--mini .script {
  background-color: transparent;       /* the card is the sheet */
  padding-right: 0.4rem;
  padding-bottom: 0.6rem;
}
.mark-card--mini .script--right { border-left: 0; }
.mark-card--mini .script + .script { border-top: 1.5px dashed rgba(28, 39, 66, 0.2); }
.mark-card--mini .mark-card__explain,
.mark-card--mini .mark-card__foot { display: none; }
/* a sheet of paper under a lamp when it sits in a night band */
:is(.page-hero, .section-dark, .philosophy-band) .mark-card {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 36px 70px -28px rgba(0, 0, 0, 0.9),
              0 0 90px -30px rgba(242, 237, 227, 0.35);
}
:is(.page-hero, .section-dark, .philosophy-band) .mark-card .mark-card__title,
:is(.page-hero, .section-dark, .philosophy-band) .mark-card h3 { color: var(--color-ink); }

@media (prefers-reduced-motion: reduce) {
  .pen-ring ellipse { stroke-dashoffset: 0 !important; animation: none !important; }
}
/* === end Marked mistakes === */
/* =====================================================================
 * === Inner template and fixes (added 2026-11-06) ===
 * Audit fixes U-05, U-11, U-13, U-14, U-20 and the one inner-page
 * template: header and menu (U-08, U-21), hero with the CTA pair (M4),
 * phone action bar (U-08), footer (M7), exam-script sections (M5).
 * Appended last so it wins the cascade. The three older layers above are
 * left as they were (architecture debt, U-30). Homepage-safe: header rules
 * are scoped to the inner markup (.nav-wrap / .nav-menu), and no rule here
 * targets the homepage's private classes.
 * ===================================================================== */

/* --- U-05: tables never widen the page ----------------------------------- */
/* a 3-column schedule fits its box at any width (cells wrap instead of the
 * last column scrolling out of sight); only wide tables, 5+ columns, keep a
 * minimum width and scroll inside their own box */
.table-wrap table { min-width: min(520px, 100%); }
.table-wrap:has(tr > :nth-child(5)) table { min-width: 560px; }
/* tables outside a .table-wrap scroll inside themselves on small screens */
@media (max-width: 760px) {
  .comparison-table,
  .compare-table { display: block; max-width: 100%; overflow-x: auto; }
}
/* safety net: one very long unbreakable string (a formula joined with
 * non-breaking spaces, a long URL) wraps instead of widening the page */
main p,
main li,
main dd,
main td { overflow-wrap: break-word; }
.bullet-list > *,
.priority-list > *,
.faq-list > * { min-width: 0; }   /* grid items: let the string wrap inside the track */
@media (max-width: 560px) {
  .table-wrap th,
  .table-wrap td { padding: 10px 12px; }
}

/* --- U-11: classes the pages use that had no CSS -------------------------- */
.content-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
}
.content-grid > *,
.card-grid > *,
.route-grid > *,
.testimonial-grid > *,
.contact-grid > * { min-width: 0; }
.content-wide { max-width: 980px; }
.contact-single { max-width: 860px; }

/* body copy measure: about 68 characters a line */
.section .container > p,
.section .container > .subheadline,
.content-grid > article > p,
.content-grid > article > .subheadline,
.bullet-list,
.numbered-list,
.lead { max-width: 68ch; }

.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(28, 39, 66, 0.18);
  background: transparent;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.button-outline:hover {
  color: var(--color-ink);
  border-color: var(--color-ink-muted);
  transform: translateY(-2px);
}
.section-dark .button-outline,
.page-hero .button-outline { color: var(--color-bone); border-color: rgba(242, 237, 227, 0.3); }

.route-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.route-card h3 { font-size: var(--text-lg); font-style: italic; line-height: 1.25; }
.route-card p { font-size: var(--text-sm); color: var(--color-ink-muted); }
.route-card .text-link { margin-top: auto; }
.section-dark .route-card {
  background: rgba(250, 243, 230, 0.045);
  border: 1px solid rgba(242, 237, 227, 0.14);
  box-shadow: none;
}
.section-dark .route-card h3 { color: var(--color-bone); }
.section-dark .route-card p { color: var(--color-bone-dim); }

.table-note,
.footnote {
  margin-block-start: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-ink-muted);
}
.compare-table { width: 100%; border-collapse: collapse; background: #fff; }
.compare-table th,
.compare-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(28, 39, 66, 0.1);
  text-align: left;
  vertical-align: top;
}
.compare-table thead th {
  background: rgba(245, 166, 35, 0.14);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compare-table tbody th { font-weight: 700; color: var(--color-ink); }
.compare-table td { color: var(--color-ink-muted); }

.numbered-list { list-style: decimal; padding-left: 1.5em; }
.numbered-list li { margin-block-end: var(--space-3); padding-left: 0.3em; }
.numbered-list li::marker {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--color-pen-text);
}
.lead { font-size: var(--text-lg); line-height: 1.6; color: var(--color-ink-muted); }
.contact-form { display: grid; gap: var(--space-4); margin-block-start: var(--space-5); }
.proof-card__head { display: flex; flex-direction: column; gap: var(--space-2); }
.author-proof {
  margin: var(--space-6) 0 0;
  padding: var(--space-5) var(--space-6);
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.author-proof blockquote {
  font: italic 480 var(--text-lg)/1.45 var(--font-display);
  color: var(--color-ink);
  margin: 0 0 var(--space-3);
}
.author-proof figcaption { font-size: var(--text-sm); color: var(--color-ink-muted); }

/* revision map page */
.topic-group {
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6);
}
.topic-group + .topic-group { margin-block-start: var(--space-5); }
.topic-group__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-block-end: var(--space-3);
}
.topic-group__header span { font-size: var(--text-sm); color: var(--color-ink-muted); }
.topic-name { font-weight: 700; color: var(--color-ink); }
.status-options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.notes-line {
  min-width: 6rem;
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  border-bottom: 1px dashed rgba(28, 39, 66, 0.3);
}
.priority-list { display: grid; gap: var(--space-4); }
.priority-item {
  background: #fff;
  border-left: 4px solid var(--color-pen);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.status-card { border-top: 3px solid var(--color-ink-muted); }
.status-card[data-status="secure"] { border-top-color: var(--color-teal); }
.status-card[data-status="shaky"] { border-top-color: var(--color-brand-primary); }
.status-card[data-status="repeated"] { border-top-color: var(--color-pen); }
.weak-label {
  margin-block: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}
.better-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
  border-left: 3px solid var(--color-teal);
  padding-left: var(--space-3);
}
.paper-check > span {
  display: block;
  font: italic 600 1.6rem/1 var(--font-display);
  color: var(--color-brand-primary);
  margin-block-end: var(--space-2);
}
.map-contrast {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin-block-start: var(--space-6);
}

/* --- U-13: a focus ring that shows on paper and on night ------------------ */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.section-dark :focus-visible,
.page-hero :focus-visible,
.philosophy-band :focus-visible,
.footer :focus-visible,
.film :focus-visible,
.final :focus-visible,
footer :focus-visible { outline-color: var(--color-focus-dark); }
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-color: var(--color-ink);
}

/* --- U-14: small text that passes AA ------------------------------------- */
.eyebrow { color: var(--color-pen-text); }
.eyebrow::before { background: var(--color-pen-text); }
.section-muted .tag { color: var(--color-pen-text); }
.section-dark .tag,
.philosophy-band .tag,
.page-hero .tag { color: var(--color-pen-bright); }
:is(.section-dark, .philosophy-band, .page-hero) :is(.card, .answer-box, .proof-card, .contact-card) .tag { color: var(--color-pen); }
.page-hero .breadcrumbs span { color: var(--color-crumb-current); }
.section-footnote p { opacity: 0.8; }
.status-message[data-status="success"] { color: var(--color-teal-text); }

/* --- U-20: tap targets, the contact card, the consent box ------------------ */
.card .text-link,
.answer-box .text-link,
.route-card .text-link,
.cta-row .text-link,
.contact-card .text-link,
.proof-card .text-link,
.panel-light .text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.button,
.button-secondary,
.button-light,
.button-outline { min-height: 44px; }
/* breadcrumb links: a 44 px tap area without making the trail taller */
.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -8px;
}
.contact-card { text-align: left; }
.consent-line input {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  accent-color: var(--color-ink);
}

/* --- shared bits ------------------------------------------------------------ */
.icon-wa { width: 1.15em; height: 1.15em; flex: none; display: inline-block; }

/* --- Header and menu (U-08, U-21) ------------------------------------------- */
.nav-wrap { min-height: 68px; gap: var(--space-4); }
.nav-wrap .brand { min-width: 0; max-width: none; flex: none; min-height: 44px; }
.nav-wrap .brand img {
  width: 174px;
  height: 32px;
  max-height: none;
  object-fit: contain;
}
.nav-menu .nav-cta { gap: 0.5rem; white-space: nowrap; }
.nav-menu .nav-links a { white-space: nowrap; }

@media (min-width: 1080px) {
  .nav-wrap .nav-toggle { display: none; }
  .nav-wrap .nav-menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(0.75rem, 1.2vw, 1.25rem);
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav-menu .nav-links { flex-direction: row; gap: 0.1rem; }
  .nav-menu .nav-links a { font-size: 0.92rem; padding: 0.5rem clamp(0.45rem, 0.6vw, 0.7rem); }
  .nav-actions { display: flex; align-items: center; }
  .nav-actions .nav-check,
  .nav-actions .nav-micro { display: none; }
  .nav-menu .nav-cta { min-height: 44px; padding: 0.55rem 1.15rem; }
}
@media (min-width: 1080px) and (max-width: 1279px) {
  .nav-menu .nav-cta .lbl-long,
  .nav-menu .nav-link-home { display: none; }
}
@media (max-width: 1079px) {
  .nav-wrap .nav-toggle { display: inline-flex; }
  .nav-wrap .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    bottom: auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-2) clamp(1rem, 4vw, 2.5rem) calc(var(--space-6) + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-top: 1px solid rgba(28, 39, 66, 0.08);
    border-bottom: 1px solid rgba(28, 39, 66, 0.12);
    box-shadow: 0 24px 40px -20px rgba(28, 39, 66, 0.35);
  }
  .nav-wrap .nav-menu.is-open { display: flex; }
  .nav-menu .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu .nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--space-2);
    border-radius: 0;
    border-bottom: 1px solid rgba(28, 39, 66, 0.08);
    font-size: 1.05rem;
    font-weight: 600;
  }
  .nav-menu .nav-links a:hover,
  .nav-menu .nav-links a[aria-current="page"] { background: rgba(245, 166, 35, 0.1); }
  .nav-menu .nav-links a.nav-link-check { display: none; }   /* the button below takes its place */
  .nav-actions { display: grid; gap: var(--space-3); margin-block-start: var(--space-5); }
  .nav-actions .button,
  .nav-actions .button-secondary {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    font-size: 1rem;
  }
  .nav-micro {
    margin: 0;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-ink-muted);
  }
}
body.nav-open .topbar { background: var(--color-surface); }
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(8, 13, 27, 0.5);
}
html.nav-lock,
html.nav-lock body { overflow: hidden; }

/* --- Hero (M4): CTA pair, chips, room for a paper object ---------------------- */
.page-hero { padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(2.75rem, 6vw, 5.75rem); }
.page-hero .hero-inner { max-width: 54rem; }
.hero-main { min-width: 0; }
.page-hero .breadcrumbs { margin-block-end: var(--space-4); }
.page-hero .headline,
.page-hero h1 {
  font-size: clamp(2.05rem, 1.35rem + 2.6vw, 3.4rem);
  max-width: 24ch;
  text-wrap: balance;
  margin-block: var(--space-3) var(--space-5);
}
.page-hero--short-title .headline,
.page-hero--short-title h1 { font-size: clamp(2.4rem, 1.4rem + 3.8vw, 4.4rem); max-width: 16ch; }
.page-hero--long-title .headline,
.page-hero--long-title h1 { font-size: clamp(1.85rem, 1.3rem + 1.9vw, 2.85rem); max-width: 30ch; }
.page-hero .subheadline {
  max-width: 64ch;
  font-size: var(--text-lg);
  line-height: 1.6;
  text-wrap: pretty;
  margin-block-end: 0;
}
.hero-ctas { margin-block-start: var(--space-7); }
.hero-ctas__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.hero-ctas .button,
.hero-ctas .button-secondary {
  min-height: 52px;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  gap: 0.55rem;
}
.page-hero .hero-ctas p { max-width: none; }
.page-hero .hero-micro {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-bone-dim);
}
.hero-ctas__label {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.page-hero .hero-ctas__label { color: var(--color-bone); }
.hero-levels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}
.hero-levels a { min-height: 52px; padding-inline: 1.25rem; }
.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-5);
  margin-block-start: var(--space-5);
  font-size: var(--text-sm);
}
.hero-links strong { color: var(--color-bone); font-weight: 600; }
.hero-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-brand-primary);
  font-weight: 600;
}
/* stat strip as chips: no leading dots when it wraps */
.page-hero .stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: none;
  margin: var(--space-6) 0 0;
  letter-spacing: 0.12em;
}
.page-hero .stat-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(242, 237, 227, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(242, 237, 227, 0.04);
  line-height: 1.3;
}
.page-hero .stat-strip span + span::before { content: none; display: none; }
.page-hero .byline,
.page-hero .hero-note {
  margin-block-start: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-bone-dim);
}
.page-hero .byline + .hero-note { margin-block-start: var(--space-2); }
.page-hero .byline a { color: var(--color-brand-primary); }
.hero-aside:empty { display: none; }
@media (max-width: 559px) {
  .hero-ctas__row > .button,
  .hero-ctas__row > .button-secondary { flex: 1 1 100%; }
  .page-hero .subheadline { font-size: 1.06rem; line-height: 1.6; }
}
@media (min-width: 960px) {
  /* nothing beside the text yet: a centred title card, so the band never
   * shows an empty right half (U-10). */
  .page-hero .hero-main { text-align: center; }
  .page-hero .hero-main > * { margin-inline: auto; }
  .page-hero .breadcrumbs,
  .hero-ctas__row,
  .hero-levels,
  .hero-links,
  .page-hero .stat-strip { justify-content: center; }
  .page-hero .eyebrow::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 2px;
    flex-shrink: 0;
    background: rgba(245, 166, 35, 0.6);
  }
  /* a paper object beside the text (filled in later on key pages): two columns */
  .page-hero .hero-inner:has(> .hero-aside:not(:empty)) {
    max-width: 1200px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: clamp(2rem, 4vw, 4.5rem);
    align-items: center;
  }
  .page-hero .hero-inner:has(> .hero-aside:not(:empty)) > .hero-main { text-align: left; }
  .page-hero .hero-inner:has(> .hero-aside:not(:empty)) > .hero-main > * { margin-inline: 0; }
  .page-hero .hero-inner:has(> .hero-aside:not(:empty)) :is(.breadcrumbs, .hero-ctas__row, .hero-levels, .hero-links, .stat-strip) { justify-content: flex-start; }
  .page-hero .hero-inner:has(> .hero-aside:not(:empty)) .eyebrow::after { content: none; }
}
@media (max-width: 959px) {
  .hero-aside:not(:empty) { margin-block-start: var(--space-8); }
}

/* --- Phone and tablet action bar (U-08): replaces the floating pill ------------- */
.sticky-actions { display: none; }
@media (max-width: 1079px) {
  .sticky-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.6rem max(0.75rem, calc((100% - 560px) / 2)) calc(0.6rem + env(safe-area-inset-bottom));
    background: rgba(250, 243, 230, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1.5px solid rgba(28, 39, 66, 0.14);
    box-shadow: 0 -14px 30px -18px rgba(8, 13, 27, 0.5);
    transition: transform 0.3s var(--ease-out), visibility 0s linear 0s;
  }
  .sticky-actions .button,
  .sticky-actions .button-secondary {
    min-width: 0;
    min-height: 48px;
    padding: 0 0.75rem;
    font-size: 0.95rem;
    gap: 0.45rem;
    white-space: nowrap;
  }
  .sticky-actions .button { box-shadow: 0 2px 0 var(--color-amber-deep); }
  .js .sticky-actions:not(.is-shown),
  body.nav-open .sticky-actions {
    transform: translateY(calc(100% + 16px));
    visibility: hidden;
    transition: transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
  }
  /* the last lines of the page are never trapped under the bar */
  body:has(.sticky-actions) .footer { padding-block-end: calc(var(--space-8) + 72px + env(safe-area-inset-bottom)); }
}
@media (max-width: 430px) {
  .sticky-actions { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0.5rem; }
  .sticky-actions .button,
  .sticky-actions .button-secondary { font-size: 0.88rem; padding-inline: 0.5rem; gap: 0.4rem; }
}
@media (max-width: 380px) {
  .sticky-actions .lbl-long { display: none; }
}

/* --- the red margin line sits in the gutter, never through the text --------------- */
/* inner pages only (.nav-wrap is the inner header): below 1280 px the content
 * starts within a few pixels of the old line position, so the line moved
 * through the first letter of every line on phones and tablets */
@media (max-width: 1279px) {
  body:has(.nav-wrap)::before { left: clamp(6px, 3vw - 8px, 70px); }
}

/* --- Footer (M7): one footer, four columns, two on phones ------------------------ */
.footer { position: relative; z-index: 2; padding-block: clamp(3rem, 6vw, 4.5rem) var(--space-6); }
.footer-grid { gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 960px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
.footer-logo { display: inline-flex; align-items: center; min-height: 44px; margin-block-end: var(--space-3); }
.footer .footer-social a { width: 44px; height: 44px; }
.footer-brand .footer-logo img {
  width: 174px;
  height: 32px;
  max-width: none;
  margin: 0;
}
.footer .footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-bone);
  margin-block-end: var(--space-3);
}
.footer .footer-entity,
.footer .footer-contact {
  max-width: 44ch;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: rgba(242, 237, 227, 0.74);
}
.footer .footer-contact {
  display: grid;
  justify-items: start;
  margin-block-start: var(--space-3);
}
.footer-contact > [aria-hidden="true"] { display: none; }   /* stacked: no separators needed */
.footer-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--color-bone);
  text-decoration-color: rgba(245, 166, 35, 0.6);
}
.footer-contact a:hover { color: var(--color-brand-primary); }
.footer .footer-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8) var(--space-5);
}
@media (min-width: 640px) {
  .footer .footer-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.footer-column li a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-block: 5px;
  font-size: 0.92rem;
  line-height: 1.35;
}
.footer-column li a[aria-current="page"] { color: var(--color-brand-primary); }
.footer-related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-5);
  margin-block-start: var(--space-8);
  padding-block-start: var(--space-5);
  border-top: 1px solid rgba(242, 237, 227, 0.1);
  font-size: 0.88rem;
}
.footer-related strong {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-bone);
}
.footer-related a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: rgba(242, 237, 227, 0.78);
  text-decoration: none;
}
.footer-related a:hover,
.footer-related a[aria-current="page"] { color: var(--color-brand-primary); }
.footer-bottom {
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-5);
  border-top: 1px solid rgba(242, 237, 227, 0.1);
}
.footer .footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(242, 237, 227, 0.72);
}
@media (max-width: 760px), (pointer: coarse) {
  .footer-column li a,
  .footer-related a,
  .footer-contact a { min-height: 44px; }
}

/* --- M5: an exam script: question numbers in the margin, a bigger title scale ------ */
main { counter-reset: q; }
main > .section:not(.section-dark):not(.section-footnote):not(:has(.faq-list)) {
  counter-increment: q;
  position: relative;
}
/* only where the margin is wide enough to hold the number clear of the content */
@media (min-width: 1280px) {
  main > .section:not(.section-dark):not(.section-footnote):not(:has(.faq-list))::before {
    content: counter(q);
    position: absolute;
    top: clamp(3rem, 6vw, 6rem);
    left: 0;
    width: calc(clamp(14px, 5vw, 70px) - 12px);
    text-align: right;
    font: italic 500 1.6rem/1 var(--font-display);
    color: var(--color-ink-mid);
    pointer-events: none;
  }
}
.section-title { text-wrap: balance; }
main > .section > .container > .section-title {
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem);
  line-height: 1.08;
  max-width: 26ch;
}
/* === end Inner template and fixes === */
/* =====================================================================
 * === Page pieces (added 2026-11-06, pages pass) ===
 * Additions only; no rule above this block is edited.
 * 1. Hero marked card: the compact .mark-card--mini in the hero slot
 *    (.hero-aside), with its caption and the "See it marked in full" link.
 * 2. About: the teacher polaroid (the homepage .t-photo look), the teacher
 *    chips and quote, and the sample Learning Graph card.
 * 3. Resources: topic chips, calm grids (tilt on the first row only), the
 *    feature card and the Add Maths mistakes block.
 * ===================================================================== */

/* --- 1. hero marked card ---------------------------------------------------- */
/* the hub's own hero card (.hub-hero-aside) is styled by hub.css and left alone */
.hero-aside:not(.hub-hero-aside) > .mark-card--mini { width: 100%; margin-inline: auto; }
.hero-aside:not(.hub-hero-aside) .mark-card--mini .mark-card__meta { color: var(--color-pen-text); }
.mark-card__mini-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 1rem;
  margin-top: 0.4rem;
  padding-top: 0.2rem;
  border-top: 1px dashed rgba(28, 39, 66, 0.16);
}
.mark-card .mark-card__caption {
  margin: 0.55rem 0 0.2rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-ink-muted);
}
.mark-card .mark-card__more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: auto;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-amber-deep);
}
.mark-card .mark-card__more:hover { color: var(--color-ink); }
@media (max-width: 759px) {
  .hero-aside:not(.hub-hero-aside) > .mark-card--mini { transform: none; }   /* phones: full width, no tilt (M2) */
}
@media (min-width: 960px) {
  .hero-aside:not(.hub-hero-aside) > .mark-card--mini { margin-inline: auto 0; }
}
/* below 1200 px the shared 1.15fr / 0.85fr split leaves the card narrower than
 * its working lines: give the card its full width and let the text column flex */
@media (min-width: 960px) and (max-width: 1199px) {
  .page-hero .hero-inner:has(> .hero-aside:not(.hub-hero-aside) > .mark-card--mini) {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 27rem);
  }
}

/* --- 2. About: teacher polaroid, chips, quote, Learning Graph card ------------ */
.polaroid {
  position: relative;
  width: min(100%, 340px);
  margin: 0 auto;
  padding: 13px 13px 54px;
  background: #fff;
  border-radius: 5px;
  transform: rotate(1.8deg);
  box-shadow: 0 3px 8px rgba(28, 39, 66, 0.15), 0 40px 70px -28px rgba(28, 39, 66, 0.4);
  transition: transform 0.3s ease;
}
.polaroid:hover { transform: rotate(0); }
.polaroid img { width: 100%; height: auto; border-radius: 3px; }
.polaroid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font: 700 1.6rem/1 var(--font-hand);
  color: var(--color-ink-mid);
}
/* under the lamp when it sits in the night hero */
.page-hero .polaroid {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 36px 70px -28px rgba(0, 0, 0, 0.9),
              0 0 90px -30px rgba(242, 237, 227, 0.35);
}

.about-teacher { align-items: start; }
.about-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: var(--space-5) 0 var(--space-6);
}
.about-chips li {
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-ink);
  background: #fff;
  border: 1px solid rgba(28, 39, 66, 0.2);
  border-radius: var(--radius-pill);
}
.about-quote {
  display: block;
  max-width: 60ch;
  margin: var(--space-6) 0 var(--space-4);
  padding-left: 20px;
  border-left: 3px solid var(--color-brand-primary);
  font: italic 480 1.25rem/1.5 var(--font-display);
  color: var(--color-ink);
  quotes: "\201C" "\201D";
}

.lg-card {
  max-width: 980px;
  margin: var(--space-8) 0 0;
  overflow: hidden;
  color: var(--color-ink);
  background: var(--color-surface);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 36px 70px -28px rgba(0, 0, 0, 0.9),
              0 0 90px -30px rgba(242, 237, 227, 0.35);
}
.lg-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-5) var(--space-6);
  background: var(--color-ink);
  border-bottom: 4px solid var(--color-brand-primary);
}
.philosophy-band .lg-card .lg-card__title {
  margin: 0;
  font: italic 480 clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem)/1.25 var(--font-display);
  color: var(--color-bone);
}
.philosophy-band .lg-card .lg-card__note {
  margin: 0;
  font: 700 1.35rem/1.1 var(--font-hand);
  color: var(--color-brand-primary);
}
.lg-card__list { display: grid; grid-template-columns: minmax(0, 1fr); }
.lg-card__item {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid rgba(28, 39, 66, 0.12);
}
.lg-card__item:first-child { border-top: 0; }
@media (min-width: 760px) {
  .lg-card__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-card__item:nth-child(2) { border-top: 0; }
  .lg-card__item:nth-child(even) { border-left: 1px solid rgba(28, 39, 66, 0.12); }
}
.lg-card .lg-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}
.lg-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.lg-tag--open { color: var(--color-brand-dark); background: var(--color-brand-primary); }
.lg-tag--improving { color: var(--color-teal-text); background: #fff; border: 1.5px solid var(--color-teal-text); }
.lg-tag--resolved { color: #fff; background: var(--color-teal-text); }
.lg-tag--new {
  min-height: 24px;
  padding: 1px 10px;
  font-size: 0.74rem;
  color: var(--color-bone);
  background: var(--color-ink);
}
.philosophy-band .lg-card .lg-card__text {
  margin: 0;
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
}

/* --- 3. Resources: topic chips, calm grids, feature card, mistakes block ------- */
.res-jump { position: relative; z-index: 2; padding-block: var(--space-8) 0; }
.res-jump__label {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-ink-muted);
}
.res-chips { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.res-chips a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.35rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-ink);
  text-decoration: none;
  background: #fff;
  border: 1.5px solid rgba(28, 39, 66, 0.14);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.res-chips a:hover { color: var(--color-ink); border-color: var(--color-brand-primary); }
.res-chips .res-count {
  font: italic 600 1.05rem/1 var(--font-display);
  color: var(--color-pen-text);
}
@media (max-width: 620px) {   /* phones: a tidy two-column index instead of seven stacked pills */
  .res-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .res-chips a {
    width: 100%;
    justify-content: space-between;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 14px;
  }
}
.res-section,
.res-mistakes { scroll-margin-top: 92px; }

/* the sticky notes keep their tilt on the first row only, then lie straight */
.card-grid--calm > .card:nth-child(n+4) { transform: none; }
@media (max-width: 944px) {
  .card-grid--calm > .card:nth-child(n+3) { transform: none; }
}
@media (max-width: 621px) {
  .card-grid--calm > .card:nth-child(n+2) { transform: none; }
}
.card-grid .card--feature { border-top: 3px solid var(--color-pen); }

.res-mistakes {
  margin-block-start: var(--space-10);
  padding: var(--space-6);
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}
.res-mistakes__title {
  margin: 0 0 var(--space-4);
  font-size: var(--text-xl);
  font-style: italic;
  font-weight: 500;
  color: var(--color-ink);
}
.res-mistakes__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 0 var(--space-6);
}
.res-mistakes__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--color-amber-deep);
}
.res-mistakes__list a:hover { color: var(--color-ink); }
/* === end Page pieces === */

/* === 2026-11-06 final check: the About page's dark panels sit inside .container and had
   no side padding, so their text touched the panel edge. === */
.container > .philosophy-band {
  padding-inline: clamp(1.25rem, 4vw, 3.5rem);
  border-radius: 8px;
}
