/* Fonts: Outfit + Work Sans (SIL Open Font License), hosted on this site */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/outfit-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/work-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/work-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/work-sans-latin-600-normal.woff2') format('woff2'); }

/* Ace Brainery — site styles
   Brand: green #28B34B + charcoal #383839 (from the Ace Brainery logo) */
:root {
  --bg: #F5FAF6;
  --surface: #FFFFFF;
  --fg: #1F2723;
  --muted: #4B5563;
  --brand: #28B34B;
  --brand-strong: #1C7A34;
  --brand-soft: #E0F3E5;
  --brand-on-dark: #7ED68B;
  --ink: #2F3031;
  --ink-2: #383839;
  --on-ink-muted: #C9CDCB;
  --border: #D3E7D8;
  --cta: #28B34B;
  --on-cta: #0F1A12;
  --radius: 16px;
  --max: 1200px;
  --head: 'Outfit', system-ui, sans-serif;
  --body: 'Work Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand-strong); }
a:hover { color: var(--fg); }
a, button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
p { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 104px 0; scroll-margin-top: 80px; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-strong); margin-bottom: 12px; }
.h2 { font-size: clamp(32px, 4vw, 46px); }
.lead { font-size: 19px; color: var(--muted); }
.muted { color: var(--muted); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; margin-bottom: 48px; }
.section-head .lead, .section-head p { max-width: 460px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.btn-cta { background: var(--cta); color: var(--on-cta); }
.btn-cta:hover { background: var(--brand-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--fg); }
.btn-sm { min-height: 44px; padding: 0 20px; border-radius: 10px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(245, 250, 246, 0.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); min-height: 44px; }
.brand img { height: 48px; width: auto; }
.brand span { font-family: var(--head); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; font-weight: 500; }
.nav a:not(.btn) { color: var(--fg); text-decoration: none; padding: 12px 0; transition: color .2s ease; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--brand-strong); }
.nav a[aria-current="page"] { font-weight: 600; }
@media (max-width: 860px) { .nav a:not(.btn) { display: none; } }

/* Hero */
.hero { padding: 80px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 56px; align-items: center; }
.pill { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); padding: 6px 14px; border-radius: 999px; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-weight: 700; font-size: clamp(42px, 6vw, 68px); line-height: 1.04; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--brand-strong); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero-media { position: relative; }
.hero-media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; }
.float-card { position: absolute; left: -16px; bottom: -22px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(31, 39, 35, 0.12); }
.float-card strong { font-family: var(--head); font-size: 30px; line-height: 1; }
.float-card span { font-size: 14px; color: var(--muted); max-width: 150px; line-height: 1.35; }
@media (max-width: 560px) { .float-card { left: 12px; } }

/* Stats */
.stats { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 24px; padding-top: 30px; padding-bottom: 30px; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat svg { flex: none; color: var(--brand-strong); }
.stat b { display: block; font-family: var(--head); font-size: 26px; line-height: 1.1; }
.stat span { font-size: 14px; color: var(--muted); }

/* Cards */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; transition: border-color .2s ease, box-shadow .2s ease; }
.card:hover { border-color: var(--brand); box-shadow: 0 2px 0 var(--brand); }
.card .tag { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--brand-strong); text-transform: uppercase; }
.card h3 { font-size: 24px; line-height: 1.2; }
.card p { font-size: 16px; color: var(--muted); }
.card .foot { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--border); font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card .foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
.card.dark .foot a { color: var(--brand-on-dark); }
.card.dark .foot a:hover { color: #fff; }
.card.dark { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.card.dark .tag { color: var(--brand-on-dark); }
.card.dark p { color: var(--on-ink-muted); }
.card.dark .foot { border-color: #57585a; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 40px; }
.step { display: flex; flex-direction: column; gap: 12px; }
.icon-box { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong); display: flex; align-items: center; justify-content: center; }
.step .num { font-size: 14px; font-weight: 600; color: var(--brand-strong); }
.step h3 { font-size: 23px; }
.step p { color: var(--muted); }
.quote-band { margin-top: 56px; padding: 32px; border-radius: var(--radius); background: var(--brand-soft); font-family: var(--head); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.4; font-weight: 500; }

/* Tutors */
.tutors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.tutor { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.tutor-top { display: flex; align-items: center; gap: 18px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--ink-2); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 26px; font-weight: 700; flex: none; }
.tutor h3 { font-size: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--brand-soft); color: var(--brand-strong); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; }
.tutor blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--brand); color: var(--muted); font-size: 16px; }
.tutor cite { display: block; margin-top: 6px; font-style: normal; font-size: 14px; color: var(--fg); font-weight: 600; }

/* Centre */
.centre { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px; align-items: center; }
.centre-photos { display: grid; gap: 14px; }
.centre-photos img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; }
.info-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 14px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; }
.info-list svg { flex: none; margin-top: 3px; color: var(--brand-strong); }

/* Table */
.table-box { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 16px; }
th { text-align: left; background: var(--brand-soft); padding: 16px 20px; font-family: var(--head); font-weight: 600; }
td { padding: 16px 20px; border-top: 1px solid var(--border); vertical-align: top; }
td:first-child { font-weight: 600; }
.note { margin-top: 16px; font-size: 15px; color: var(--muted); }

/* Testimonials */
.t-grid { columns: 3 320px; column-gap: 20px; }
.t-card { break-inside: avoid; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 16px; transition: border-color .2s ease; }
.t-card:hover { border-color: var(--brand); }
.t-card .result { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; }
.t-card blockquote { margin: 0; font-size: 16px; line-height: 1.65; }
.t-card blockquote p + p { margin-top: 10px; }
.t-card figcaption { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.t-card figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.t-card figcaption strong { display: block; color: var(--fg); font-size: 15px; }
.t-card details summary { color: var(--brand-strong); font-weight: 600; font-size: 15px; list-style: none; padding: 6px 0; }
.t-card details summary::-webkit-details-marker { display: none; }
.t-card details[open] summary { display: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 20px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.tab { min-height: 46px; padding: 10px 22px; border-radius: 999px; font: inherit; font-size: 16px; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface); color: var(--fg); transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.tab:hover { border-color: var(--brand); }
.tab[aria-selected="true"] { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.tab .count { font-weight: 500; opacity: .75; margin-left: 4px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 24px; }
.panel-head h2 { font-size: clamp(28px, 3.5vw, 38px); }

/* FAQ */
.faq { max-width: 860px; margin: 0 auto; }
.faq-list { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: var(--head); font-size: 20px; font-weight: 600; min-height: 52px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { font-size: 28px; font-weight: 400; color: var(--brand-strong); transition: transform .2s ease; }
.faq details[open] .plus { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 12px; }

/* Contact */
.contact { background: var(--ink-2); color: #fff; }
.contact .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 56px; align-items: start; }
.contact .eyebrow { color: var(--brand-on-dark); }
.contact h2 { font-size: clamp(34px, 4.5vw, 50px); }
.contact .lead { color: var(--on-ink-muted); }
.contact .info-list svg { color: var(--brand-on-dark); }
.contact .info-list a { color: #fff; }
.form { background: var(--surface); color: var(--fg); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; color: var(--fg); border: 1.5px solid #94A3A0; border-radius: 10px; padding: 0 14px; height: 50px; background: #fff; transition: border-color .2s ease; }
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-strong); outline: 3px solid var(--brand-soft); outline-offset: 0; }
.field .hint { font-size: 13px; color: var(--muted); }
.form .btn { height: 54px; margin-top: 4px; border: 0; }

/* CTA band + footer */
.cta-band { background: var(--ink-2); color: #fff; }
.cta-band .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; padding-top: 80px; padding-bottom: 80px; }
.cta-band p { color: var(--on-ink-muted); font-size: 18px; margin-top: 10px; }
.site-footer { background: var(--ink); color: var(--on-ink-muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 26px; padding-bottom: 26px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.site-footer a { color: var(--on-ink-muted); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: #fff; }

.page-head { padding: 72px 0 40px; }
.page-head .wrap { display: flex; flex-direction: column; gap: 18px; }
.page-head h1 { font-size: clamp(40px, 5.5vw, 62px); line-height: 1.05; letter-spacing: -0.03em; max-width: 820px; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: none; min-height: 44px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ===== Motion (patterns adapted from 21st.dev: testimonial marquee, count-up, staggered reveal) ===== */
/* Testimonial marquee: two rows scrolling in opposite directions with faded edges */
.marquees { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }
.marquee .track { display: flex; width: max-content; animation: marquee var(--dur, 60s) linear infinite; }
.marquee.reverse .track { animation-direction: reverse; }
.marquee .group { display: flex; }
.marquee:hover .track, .marquee:focus-within .track, .marquees.paused .track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.m-card { width: 340px; flex: none; margin: 0 20px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: border-color .2s ease, transform .25s ease; }
.m-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.m-card figcaption { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.m-card figcaption img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.m-card figcaption strong { display: block; color: var(--fg); font-size: 15px; }
.m-card blockquote { margin: 0; font-size: 16px; line-height: 1.55; }
.m-card .result { margin-top: auto; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; }
.marquee-ctrl { display: flex; justify-content: flex-end; margin-top: 18px; }
.pause-btn { font: inherit; font-size: 14px; font-weight: 600; color: var(--fg); background: transparent; border: 1.5px solid var(--border); border-radius: 999px; min-height: 44px; padding: 0 18px; transition: border-color .2s ease; }
.pause-btn:hover { border-color: var(--brand); }

/* Hero: staggered entrance */
.hero-copy > *, .hero-media { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero-media { animation-delay: .2s; }
.float-card { animation: rise .7s .55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Scroll reveal (only applied by site.js to content that starts off-screen) */
.reveal.pre, .reveal-stagger.pre > * { opacity: 0; transform: translateY(24px); }
.reveal.in, .reveal-stagger.in > * { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.reveal-stagger.in > :nth-child(2) { transition-delay: .08s; }
.reveal-stagger.in > :nth-child(3) { transition-delay: .16s; }
.reveal-stagger.in > :nth-child(4) { transition-delay: .24s; }

/* Reduced motion: no animation, marquee becomes a swipeable row */
@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-media, .float-card { animation: none; }
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .marquee .track { animation: none; }
  .marquee .group[aria-hidden="true"], .marquee-ctrl { display: none; }
  .reveal.pre, .reveal-stagger.pre > * { opacity: 1; transform: none; }
}
@media (max-width: 560px) { .m-card { width: 280px; } }
/* Count-up numbers inherit the big number styling */
.stat b [data-count], .float-card strong [data-count] { font: inherit; color: inherit; max-width: none; display: inline; line-height: inherit; }
.stat b, .float-card strong { font-variant-numeric: tabular-nums; }

/* Utilities and small components */
.mt-6 { margin-top: 6px; } .mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; } .mb-32 { margin-bottom: 32px; } .m-0 { margin: 0; }
.mw-640 { max-width: 640px; } .pb-104 { padding-bottom: 104px; }
.chips { margin-top: 8px; }
.quote-by { display: block; font-family: var(--body); font-size: 15px; font-weight: 500; color: var(--muted); margin-top: 10px; }
.cta-title { font-size: clamp(30px, 4vw, 44px); }
.nf { text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.nf h1 { font-size: clamp(36px, 5vw, 56px); }
.actions.center { justify-content: center; }
.marquee.dur-70 { --dur: 70s; } .marquee.dur-75 { --dur: 75s; }
.form-error { margin: 0; padding: 10px 14px; border-radius: 10px; background: #FDECEC; color: #9B1C1C; font-size: 15px; font-weight: 500; }
.field [aria-invalid="true"] { border-color: #B42318; }
.table-box:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 3px; }
/* keep card hover effects working after the reveal animation */
.reveal-stagger.in > .card, .reveal-stagger.in > .tutor { transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1), border-color .2s ease, box-shadow .2s ease; }
.centre-photos img.top { object-position: center top; }
/* Keep the header on one row on phones, and stop the sticky header covering anchors/focused fields */
html { scroll-padding-top: 88px; }
.float-card span { max-width: 170px; }
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: nowrap; }
  .nav { gap: 12px; }
}
@media (max-width: 480px) {
  .brand { gap: 8px; }
  .brand img { height: 40px; }
  .brand span { font-size: 18px; }
  .nav .btn-sm { padding: 0 14px; font-size: 14px; }
}
.brand span, .nav .btn-sm { white-space: nowrap; }
@media (max-width: 360px) {
  .brand span { font-size: 16px; }
  .brand img { height: 36px; }
  .nav .btn-sm { padding: 0 12px; }
}

/* Tutor portraits */
img.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--brand), 0 8px 20px rgba(31, 39, 35, 0.12); background: var(--brand-soft); }
@media (max-width: 480px) { img.avatar { width: 80px; height: 80px; } }
