/* Maths With Mr B — styles. Rules and tokens are documented in DESIGN.md. */

/* ---------- Tokens ---------- */
:root {
  --navy: #14213D;
  --navy-rgb: 20, 33, 61;
  --orange: #F26B1D;
  --orange-rgb: 242, 107, 29;
  --orange-hover: #D95A10;
  --grid: #DCE4F2;
  --grid-on-white: #E6ECF6;
  --grid-rgb: 220, 228, 242;
  --paper: #FFFFFF;
  --paper-rgb: 255, 255, 255;
  --slate: #4A5568;

  --bg: var(--paper);
  --surface: var(--paper);
  --surface-alt: #F4F7FC;
  --surface-hover: #EEF2F9;
  --border: var(--navy);
  --border-soft: var(--grid);
  --text: var(--navy);
  --text-secondary: var(--slate);
  --text-on-dark: var(--paper);
  --text-on-dark-muted: #C9D3E6;
  --accent: var(--orange);
  --accent-hover: var(--orange-hover);

  --success: #1F7A4D;
  --error: #B42318;
  --warning: #B54708;

  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 128px);
  --nav-h: 76px;
  --grid-size: 32px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
sup { font-size: 0.62em; line-height: 0; position: relative; top: -0.15em; vertical-align: super; }

::selection { background: rgba(var(--orange-rgb), 0.25); color: var(--navy); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 300;
  background: var(--navy); color: var(--text-on-dark); padding: 12px 18px;
  text-decoration: none; font-weight: 600;
  transition: top .2s var(--ease-std);
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* Graph paper */
.grid-paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid-on-white) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-on-white) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}
.section-alt.grid-paper { background-color: var(--surface-alt); }
.grid-paper-dark {
  background-image:
    linear-gradient(to right, rgba(var(--grid-rgb), .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--grid-rgb), .07) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

/* ---------- Type ---------- */
.h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--text);
  text-wrap: balance;
}
.h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  line-height: 1.1;
  color: var(--text);
}
.h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--text);
}
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.6; color: var(--text-secondary); max-width: 34em; }
.m { font-family: var(--font-display); font-size: 1.08em; letter-spacing: .01em; white-space: nowrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text);
}
.eyebrow-dark { color: var(--text-on-dark); }
.tick-mark {
  width: 18px; height: 14px; flex: none;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg) translate(2px, -3px) scaleY(.55);
  transform-origin: center;
}

.tag {
  display: inline-block;
  margin: 0;
  padding: 4px 8px 3px;
  background: var(--accent);
  color: var(--navy);
  font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.4;
}
.tag-outline { background: transparent; border: 1px solid var(--navy); padding: 3px 7px 2px; }

/* Links */
.text-link, .footer-nav a, .menu ul a {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text); font-weight: 600; text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size .3s var(--ease-out);
}
.text-link { background-size: 100% 2px; padding-bottom: 2px; }
.text-link:hover, .text-link:focus-visible { background-size: 100% 4px; }
.menu ul a:hover, .menu ul a:focus-visible,
.footer-nav a:hover, .footer-nav a:focus-visible { background-size: 100% 2px; }
.faq-a a, .where a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border: 1.5px solid var(--navy); border-radius: 0;
  font-weight: 600; font-size: 1rem; letter-spacing: .01em; line-height: 1.2;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), background-color .16s, color .16s;
}
.btn-primary { background: var(--navy); color: var(--text-on-dark); }
.btn-primary:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--accent); }
.btn-secondary { background: var(--paper); color: var(--navy); }
.btn-secondary:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--navy); }
.btn:active { transform: scale(.98); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .9375rem; }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  color: var(--navy); text-decoration: none;
  font-size: 30px; /* sets the "Mr B" size; everything else scales from it */
}
.logo-kicker {
  font-family: var(--font-body); font-weight: 600;
  font-size: .34em; letter-spacing: .32em; text-transform: uppercase; line-height: 1;
  margin: 0 0 .32em .08em;
}
.logo-mark { display: inline-flex; align-items: flex-start; line-height: 1; }
.logo-tick { width: .5833em; height: 1.1563em; flex: none; overflow: visible; }
.logo-tick path { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linejoin: miter; stroke-miterlimit: 10; stroke-dasharray: 1; stroke-dashoffset: 0; }
.logo-name {
  font-family: var(--font-display); font-size: 1em; line-height: 1;
  border-top: .0729em solid currentColor; padding: .0833em .06em 0 .04em;
  white-space: nowrap;
}
.logo-light { color: var(--text-on-dark); }

/* ---------- Progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 210; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(var(--paper-rgb), 0);
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease-std), border-color .3s var(--ease-std);
}
.nav.scrolled {
  background: rgba(var(--paper-rgb), .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--navy);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.menu { display: flex; align-items: center; gap: 28px; }
.menu ul { display: flex; gap: 24px; }
.menu ul a { font-size: .9375rem; font-weight: 500; padding: 6px 0; }
.menu-btn {
  display: none;
  width: 44px; height: 44px; border: 1.5px solid var(--navy); background: var(--paper);
  cursor: pointer; position: relative;
}
.menu-btn-lines, .menu-btn-lines::before, .menu-btn-lines::after {
  position: absolute; left: 11px; width: 19px; height: 2px; background: var(--navy);
  transition: transform .25s var(--ease-out), opacity .2s;
}
.menu-btn-lines { top: 20px; }
.menu-btn-lines::before, .menu-btn-lines::after { content: ""; left: 0; }
.menu-btn-lines::before { top: -6px; }
.menu-btn-lines::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-btn-lines { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-btn-lines::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn-lines::after { transform: translateY(-6px) rotate(-45deg); }
.menu-btn:hover { background: var(--surface-hover); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  margin-top: calc(var(--nav-h) * -1);
  padding: calc(var(--nav-h) + clamp(40px, 7vw, 96px)) 0 clamp(64px, 8vw, 112px);
  background: var(--paper);
  border-bottom: 1px solid var(--navy);
}
.hero.grid-paper { background-image: none; }
.hero-grid-bg {
  position: absolute; inset: -120px 0 -120px 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-on-white) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-on-white) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  will-change: transform;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.7vw, 4.25rem);
  line-height: 1.02; letter-spacing: -0.012em;
  margin: 0 0 24px;
}
.hero-line { display: block; }
.scribble { position: relative; display: inline-block; white-space: nowrap; }
.scribble svg {
  position: absolute; left: -2%; bottom: -.12em; width: 104%; height: .2em; overflow: visible;
}
.scribble path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: square; stroke-dasharray: 1; stroke-dashoffset: 0; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-facts { display: flex; flex-wrap: wrap; border-top: 1px solid var(--navy); }
.hero-facts li { flex: 1 1 0; min-width: 120px; padding: 16px 16px 0 0; display: flex; flex-direction: column; gap: 2px; }
.hero-facts li + li { padding-left: 16px; border-left: 1px solid var(--border-soft); }
.hero-facts strong { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; }
.hero-facts span { font-size: .875rem; color: var(--text-secondary); }

/* Worked example card */
.worked {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--navy);
  box-shadow: 8px 8px 0 var(--navy);
  padding: clamp(18px, 2.4vw, 28px);
  position: relative;
}
.worked-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.worked-course { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); }
.worked-q { font-size: 1rem; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--navy); }
.worked-body { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 20px; align-items: center; }
.graph { width: 100%; height: auto; }
.graph-grid path { stroke: var(--grid-on-white); stroke-width: 1; fill: none; }
.graph-axis { stroke: var(--navy); stroke-width: 1.5; fill: none; }
.graph-axis-head { stroke: var(--navy); stroke-width: 1.5; fill: none; }
.graph-region { fill: rgba(var(--orange-rgb), .18); }
.graph-curve, .graph-line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: square; stroke-dasharray: 1; stroke-dashoffset: 0; }
.graph-line { stroke-width: 2; }
.graph-pt { fill: var(--navy); }
.graph-label { font-family: var(--font-display); font-size: 13px; fill: var(--navy); }

.working { display: flex; flex-direction: column; }
.working li {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 58px; padding: 8px 44px 8px 0;
  border-bottom: 1px solid var(--grid-on-white);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
}
.working li:last-child { border-bottom: 0; }
.working li::after { /* the margin rule */
  content: ""; position: absolute; right: 36px; top: 0; bottom: 0; width: 1px; background: rgba(var(--orange-rgb), .45);
}
.working .sub { font-size: .82em; color: var(--text-secondary); margin-top: 2px; }
.working .tick { position: absolute; right: 2px; top: 50%; width: 26px; height: 26px; margin-top: -13px; }
.tick path { fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: square; stroke-linejoin: miter; stroke-dasharray: 1; stroke-dashoffset: 0; }
.ans { border: 1.5px solid var(--navy); padding: 0 6px 1px; display: inline-flex; align-items: center; gap: 4px; }
.worked figcaption { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--navy); font-size: .875rem; color: var(--text-secondary); }

/* inline maths helpers */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .78em; line-height: 1.05; margin: 0 .12em; }
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .15em .05em; }
.frac > span:last-child { padding-top: .05em; }
.int { display: inline-flex; align-items: center; font-size: 1.35em; line-height: 1; margin-right: .08em; }
.lims { display: inline-flex; flex-direction: column; justify-content: space-between; font-size: .5em; line-height: 1.1; height: 2.1em; margin-left: .05em; }
.lims-br { font-size: .6em; height: 2.4em; vertical-align: middle; }
.br { font-size: 1.4em; line-height: 1; vertical-align: -.08em; }
.working .m { display: inline-block; white-space: nowrap; }
.graph-guide { stroke: var(--navy); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }

/* ---------- Statement band ---------- */
.band { background: var(--navy); color: var(--text-on-dark); overflow: hidden; }
.band-inner { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(40px, 5vw, 64px); }
.band-statement {
  font-family: var(--font-display); font-size: clamp(1.75rem, 3.8vw, 3rem); line-height: 1.15;
  max-width: 22em; margin: 0; text-wrap: balance;
}
.band-statement em { font-style: italic; color: var(--accent); }
.marquee { border-top: 1px solid rgba(var(--grid-rgb), .25); overflow: hidden; padding: 20px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: .8125rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-on-dark-muted);
  padding: 0 28px;
}
.marquee-track span::after {
  content: ""; width: 12px; height: 7px; margin-left: 56px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) translateY(-3px);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; position: relative; }
.section-alt { background: var(--surface-alt); }
.section + .section { border-top: 1px solid var(--navy); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .h2 { position: relative; padding-top: 22px; margin-bottom: 16px; }
.section-head .h2::before { /* the rule that draws in */
  content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 3px; background: var(--navy);
  transform-origin: 0 50%; transition: transform .9s var(--ease-out) .15s;
}
.section-navy .h2::before { background: var(--accent); }
.section-lead { font-size: 1.125rem; color: var(--text-secondary); margin: 0; max-width: 40em; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--navy);
  padding: clamp(22px, 2.6vw, 34px);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.card p { color: var(--text-secondary); }
.course:hover, .format:hover, .course:focus-within, .format:focus-within {
  transform: translate(-4px, -4px); box-shadow: 4px 4px 0 var(--navy);
}

/* Courses bento */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.course { display: flex; flex-direction: column; grid-column: span 2; }
.course-adv { grid-column: span 4; }
.course-ext1 { grid-column: span 2; }
.course-top { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.course .h3 { margin-bottom: 12px; }
.course-adv .h3 { font-size: clamp(2rem, 3.4vw, 2.75rem); }
.course > p:not(.course-price) { margin-bottom: 20px; }
.course-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.course-topics li { font-size: .8125rem; font-weight: 500; padding: 5px 10px; border: 1px solid var(--border-soft); background: var(--surface-alt); }
.course-price {
  margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--border-soft);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  color: var(--text-secondary); font-size: .875rem;
}
.course-price strong { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1; color: var(--text); }
.course-adv { background-image: linear-gradient(to right, var(--grid-on-white) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-on-white) 1px, transparent 1px); background-size: var(--grid-size) var(--grid-size); }

/* Formats */
.formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.format { display: flex; flex-direction: column; position: relative; }
.format .tag { position: absolute; top: -1px; right: -1px; }
.format-feature { border-width: 2px; }
.icon { width: 44px; height: 44px; margin-bottom: 20px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: square; }
.format .h3 { font-size: 1.5rem; margin-bottom: 10px; }
.format-meta { margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: .875rem; font-weight: 600; color: var(--text) !important; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--navy); counter-reset: none; }
.step { padding: 28px 24px 8px 0; position: relative; }
.step + .step { padding-left: 24px; border-left: 1px solid var(--border-soft); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 20px;
  border: 1.5px solid var(--navy);
  font-family: var(--font-display); font-size: 1.5rem; line-height: 1;
  transition: background-color .3s, color .3s;
}
.step:hover .step-num { background: var(--navy); color: var(--text-on-dark); }
.step .h3 { font-size: 1.375rem; margin-bottom: 10px; }
.step p { color: var(--text-secondary); margin: 0; }

/* Pricing */
.pricing { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.price-table-wrap { border: 1px solid var(--navy); background: var(--paper); }
.price-table { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.price-table th, .price-table td { padding: 18px 20px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.price-table thead th {
  background: var(--navy); color: var(--text-on-dark); border-bottom: 0;
  font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; vertical-align: bottom;
}
.price-table thead th span { display: block; margin-top: 4px; font-size: .75rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-on-dark-muted); }
.price-table tbody th { font-weight: 600; font-size: 1rem; }
.price-table td { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; }
.price-table tbody tr:last-child > * { border-bottom: 0; }
.price-table tbody tr { transition: background-color .2s; }
.price-table tbody tr:hover { background: var(--surface-hover); }
.price-table td:nth-child(2) { background: rgba(var(--orange-rgb), .07); }

.price-extras { display: flex; flex-direction: column; gap: 20px; }
.extras { border: 1px solid var(--navy); background: var(--paper); }
.extras li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.extras li:last-child { border-bottom: 0; }
.x-label { font-size: .9375rem; color: var(--text-secondary); }
.x-value { font-weight: 600; text-align: right; }
.founding { background: var(--navy); color: var(--text-on-dark); padding: 24px; position: relative; }
.founding .tag { margin-bottom: 14px; }
.founding-text { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; margin-bottom: 16px; }
.founding-text strong { font-weight: 400; color: var(--accent); }
.founding .text-link { color: var(--text-on-dark); }

/* Hub */
.hub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.pack { border: 1px solid var(--navy); padding: clamp(22px, 3vw, 36px); background: var(--paper); }
.pack .h3 { margin-bottom: 20px; }
.pack-list { counter-reset: pack; }
.pack-list li {
  counter-increment: pack;
  display: grid; grid-template-columns: 44px 1fr; column-gap: 12px;
  padding: 16px 0; border-top: 1px solid var(--border-soft);
}
.pack-list li::before {
  content: counter(pack, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--accent);
}
.pack-list strong { font-weight: 600; }
.pack-list span { color: var(--text-secondary); font-size: .9375rem; }
.hub-areas { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--navy); }
.area { padding: 20px 0; border-bottom: 1px solid var(--border-soft); }
.area .h4 { margin-bottom: 6px; }
.area p { margin: 0; color: var(--text-secondary); }
.potw { margin-top: 24px; padding: 24px; border: 1px dashed var(--navy); background: var(--surface-alt); }
.potw .tag { margin-bottom: 14px; }
.potw-q { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; margin-bottom: 16px; }
.potw-q .m { font-size: 1em; }
.potw-answer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.potw-answer p { margin: 0; color: var(--text-secondary); }
.potw-ans { font-size: 1.6em; color: var(--text); margin-right: 6px; font-weight: 400; }
.potw-answer:not([hidden]) { animation: fadeInUp .5s var(--ease-out); }

/* About */
.section-navy { background-color: var(--navy); color: var(--text-on-dark); }
.section-navy .h2 { color: var(--text-on-dark); }
.section-navy p { color: var(--text-on-dark-muted); }
.section-navy strong { color: var(--text-on-dark); }
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.monogram {
  aspect-ratio: 1 / 1; border: 1px solid rgba(var(--grid-rgb), .35);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-on-dark);
}
.logo-mark-xl { font-size: clamp(120px, 18vw, 220px); }
.about-copy .h2 { margin-bottom: 24px; }
.about-copy > p:not(.eyebrow) { font-size: 1.0625rem; max-width: 36em; }
.section-navy .eyebrow { color: var(--text-on-dark); }
.book-copy .h2 { margin-bottom: 16px; }
.creds { margin: 28px 0; border-top: 1px solid rgba(var(--grid-rgb), .25); }
.creds li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(var(--grid-rgb), .25); font-weight: 500; }
.tick-static { width: 22px; height: 22px; flex: none; }
.where .h4 { color: var(--text-on-dark); margin-bottom: 8px; }
.where p { margin: 0; }

/* Dates */
.dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.session { border-width: 2px; box-shadow: 6px 6px 0 var(--accent); }
.session .tag { margin-bottom: 18px; }
.session .h3 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-bottom: 8px; }
.session-date { font-size: 1.125rem; color: var(--text) !important; }
.session .btn { margin-top: 8px; }
.timeline { border-left: 1px solid var(--navy); }
.timeline li { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0 14px 28px; border-bottom: 1px solid var(--border-soft); }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 21px; width: 11px; height: 11px;
  background: var(--paper); border: 1.5px solid var(--navy);
}
.timeline li.t-hl::before { background: var(--accent); border-color: var(--accent); }
.t-when { font-weight: 600; font-variant-numeric: tabular-nums; }
.t-what { color: var(--text-secondary); }

/* FAQ */
.faq-wrap { max-width: 920px; }
.faq { border-top: 1px solid var(--navy); }
.faq details { border-bottom: 1px solid var(--navy); background: transparent; }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 0; min-height: 44px;
  font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.25;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background:
    linear-gradient(var(--navy), var(--navy)) center / 14px 2px no-repeat,
    linear-gradient(var(--navy), var(--navy)) center / 2px 14px no-repeat;
  transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(135deg); }
.faq summary:hover { color: var(--slate); }
.faq summary:focus-visible { outline-offset: 4px; }
.faq-a { padding: 0 48px 24px 0; }
.faq-a p { margin: 0; color: var(--text-secondary); }
.faq details[open] .faq-a { animation: fadeInUp .45s var(--ease-out); }

/* Book */
.section-book { background: var(--surface-alt); }
.book { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.book-copy { position: sticky; top: calc(var(--nav-h) + 32px); }
.contact-list { margin-top: 32px; border-top: 1px solid var(--navy); }
.contact-list li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.c-label { width: 72px; flex: none; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); padding-top: 3px; }
.contact-list a { font-weight: 600; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.form-card { background: var(--paper); border: 1px solid var(--navy); box-shadow: 8px 8px 0 var(--navy); padding: clamp(20px, 3vw, 40px); }
.enquiry { display: flex; flex-direction: column; gap: 22px; }
.enquiry fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.enquiry legend, .enquiry label:not(.chip) { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 8px; padding: 0; }
.req { color: var(--error); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; }
.enquiry input[type="text"], .enquiry input[type="email"], .enquiry input[type="tel"], .enquiry select, .enquiry textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1px solid var(--navy); border-radius: 0; background: var(--paper);
  font-size: 1rem; line-height: 1.4;
  transition: background-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.enquiry select {
  padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.enquiry textarea { resize: vertical; min-height: 120px; }
.enquiry input:hover, .enquiry select:hover, .enquiry textarea:hover { background-color: var(--surface-alt); }
.enquiry input:focus, .enquiry select:focus, .enquiry textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--navy); background-color: var(--paper); }
.enquiry .is-invalid { border-color: var(--error) !important; box-shadow: inset 0 0 0 1px var(--error); }
.err { margin: 6px 0 0; font-size: .8125rem; color: var(--error); min-height: 0; }
.err:empty { display: none; }
::placeholder { color: var(--slate); opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--navy); background: var(--paper);
  font-size: .9375rem; font-weight: 500;
  transition: background-color .15s, color .15s, transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.chip:hover span { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--navy); }
.chip input:checked + span { background: var(--navy); color: var(--text-on-dark); }
.chip input:checked + span::before {
  content: ""; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) translate(1px, -1px);
}
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.chips-sm .chip span { font-size: .875rem; padding: 0 12px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding-top: 6px; }
.privacy { margin: 0; font-size: .8125rem; color: var(--text-secondary); max-width: 26em; }
.form-status { margin: 0; font-size: .9375rem; }
.form-status:empty { display: none; }
.form-status.is-error { color: var(--error); font-weight: 500; }

.form-success { text-align: left; padding: clamp(8px, 2vw, 24px) 0; }
.form-success:focus { outline: none; }
.big-tick { width: 88px; height: 88px; margin-bottom: 20px; }
.big-tick path { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: square; stroke-dasharray: 1; stroke-dashoffset: 1; }
.form-success:not([hidden]) .big-tick path { animation: draw .8s var(--ease-out) .15s forwards; }
.form-success .h3 { margin-bottom: 10px; }
.form-success p { color: var(--text-secondary); }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: var(--text-on-dark); padding: 64px 0 28px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(var(--grid-rgb), .25); }
.footer .logo { font-size: 34px; }
.footer-tag { margin: 18px 0 0; color: var(--text-on-dark-muted); font-size: .9375rem; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-nav a { color: var(--text-on-dark); font-weight: 500; padding: 4px 0; }
.footer-contact p { margin: 0 0 8px; color: var(--text-on-dark-muted); }
.footer-contact a { color: var(--text-on-dark); text-decoration: none; font-weight: 600; }
.footer-contact a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.footer-legal { padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.footer-legal p { margin: 0; font-size: .8125rem; color: var(--text-on-dark-muted); max-width: 52em; }

/* ---------- Motion ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Only animate when JS is running and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .hero-step { opacity: 0; animation: fadeInUp .8s var(--ease-out) forwards; animation-delay: calc(var(--d) * 90ms + 100ms); }
  .nav .logo-tick path { stroke-dashoffset: 1; animation: draw .9s var(--ease-out) .2s forwards; }
  .scribble path { stroke-dashoffset: 1; animation: draw .9s var(--ease-out) 1s forwards; }

  .worked { opacity: 0; animation: fadeInUp .9s var(--ease-out) .35s forwards; }
  .graph-curve { stroke-dashoffset: 1; animation: draw 1.1s var(--ease-out) .8s forwards; }
  .graph-line { stroke-dashoffset: 1; animation: draw 1s var(--ease-out) 1.1s forwards; }
  .graph-region { opacity: 0; animation: fadeIn .8s var(--ease-std) 1.8s forwards; }
  .working li { opacity: 0; animation: fadeInUp .6s var(--ease-out) forwards; animation-delay: calc(var(--i) * 450ms + 1.2s); }
  .working .tick path { stroke-dashoffset: 1; animation: draw .45s var(--ease-out) forwards; animation-delay: calc(var(--i) * 450ms + 1.6s); }

  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
  .js [data-reveal].in-view { opacity: 1; transform: none; }
  .js [data-stagger] > * { opacity: 0; transform: translateY(24px); transition: opacity .65s var(--ease-out), transform .65s var(--ease-out), box-shadow .25s var(--ease-out); }
  .js [data-stagger].in-view > * { opacity: 1; transform: none; }
  .js [data-stagger].in-view > .course:hover, .js [data-stagger].in-view > .format:hover,
  .js [data-stagger].in-view > .course:focus-within, .js [data-stagger].in-view > .format:focus-within { transform: translate(-4px, -4px); }
  .js .section-head .h2::before { transform: scaleX(0); }
  .js .section-head.in-view .h2::before { transform: scaleX(1); }
  .js .monogram .logo-tick path { stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease-out) .3s; }
  .js .monogram.in-view .logo-tick path { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; row-gap: 12px; padding: 0 var(--gutter); }
  .marquee-track span:nth-child(n + 13) { display: none; }
  .marquee-track span::after { margin-left: 28px; }
  .hero-grid-bg { transform: none !important; }
  .big-tick path { stroke-dashoffset: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .menu ul { gap: 18px; }
  .menu { gap: 20px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course, .course-ext1 { grid-column: span 1; }
  .course-adv { grid-column: span 2; }
  .formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--border-soft); }
  .pricing { grid-template-columns: 1fr; }
  .price-extras { display: grid; grid-template-columns: 1fr 1fr; }
  .worked-body { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; }
}

@media (max-width: 899px) {
  :root { --nav-h: 68px; }
  .logo { font-size: 26px; }
  .menu-btn { display: block; }
  .menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--navy); border-top: 1px solid var(--navy);
    padding: 8px var(--gutter) 24px;
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s var(--ease-std), transform .25s var(--ease-out), visibility 0s linear .25s;
  }
  .menu.open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s var(--ease-std), transform .25s var(--ease-out), visibility 0s; }
  .menu ul { flex-direction: column; gap: 0; margin-bottom: 16px; }
  .menu ul li { border-bottom: 1px solid var(--border-soft); }
  .menu ul a { display: flex; align-items: center; min-height: 56px; font-size: 1.0625rem; background-image: none; }
  .menu ul a:hover { color: var(--slate); }
  .menu .btn { width: 100%; }
  .nav.menu-open { background: var(--paper); border-bottom-color: var(--navy); }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-title { font-size: min(3.6rem, calc((100vw - 2 * var(--gutter)) / 9.3)); }
  .worked { max-width: 560px; }
  .about { grid-template-columns: 1fr; }
  .monogram { max-width: 260px; width: 100%; }
  .dates { grid-template-columns: 1fr; }
  .hub { grid-template-columns: 1fr; }
  .book { grid-template-columns: 1fr; }
  .book-copy { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 599px) {
  body { font-size: 1rem; }
  .hero { padding-top: calc(var(--nav-h) + 32px); }
  .hero-actions .btn { width: 100%; }
  .hero-facts li { min-width: 0; padding-right: 8px; }
  .hero-facts li + li { padding-left: 10px; }
  .hero-facts strong { font-size: 1.3rem; }
  .hero-facts span { font-size: .78rem; }
  .worked { box-shadow: 5px 5px 0 var(--navy); }
  .worked-body { grid-template-columns: 1fr; }
  .graph { width: 112px; margin: 0 auto 4px; }
  .working li { font-size: 1.05rem; }

  .bento, .formats, .steps { grid-template-columns: 1fr; }
  .course-adv, .course, .course-ext1 { grid-column: auto; }
  .step, .step + .step { padding: 22px 0 18px; border-left: 0; }
  .step + .step { border-top: 1px solid var(--border-soft); }

  .price-table th, .price-table td { padding: 14px 8px; }
  .price-table th:first-child, .price-table td:first-child { padding-left: 12px; }
  .price-table thead th { font-size: .6875rem; letter-spacing: .04em; }
  .price-table thead th span { font-size: .6875rem; }
  .price-table tbody th { font-size: .875rem; }
  .price-table td { font-size: 1.3rem; }
  .price-extras { grid-template-columns: 1fr; }
  .extras li { flex-direction: column; gap: 2px; }
  .x-value { text-align: left; }

  .timeline li { grid-template-columns: 1fr; gap: 2px; padding-left: 22px; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .form-foot .btn { width: 100%; }
  .form-card { box-shadow: 5px 5px 0 var(--navy); }
  .faq-a { padding-right: 0; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* Long contact details (email) wrap rather than overflow on narrow phones */
.contact-list li > :last-child, .footer-contact a { min-width: 0; overflow-wrap: anywhere; }
