/* TeachingBuddy — coming-soon site
   Plain CSS, mobile first. Design tokens first, then components.
   Colour pairs were checked for WCAG AA in both themes. */

/* === TOKENS === */
:root {
  color-scheme: light dark;

  /* Light theme (default) */
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --surface-2: #F5EFE5;
  --ink: #2B2520;
  --muted: #5E554B;
  --line: #E6DDCF;
  --border-control: #857A6C;
  --accent: #B5440F;
  --on-accent: #FFFFFF;
  --accent-ink: #9C3A0B;
  --accent-soft: #FBE6D8;
  --focus: #1F57B5;
  --success: #1E6B3A;
  --danger: #B3261E;

  /* Whiteboard only */
  --board-paper: #FFFEFA;
  --board-ink: #3A312A;
  --board-teal: #1F7A7A;
  --board-accent: #C2501A;
  --board-edge: #E2D8C8;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Marker Felt", "Comic Neue", "Comic Sans MS", cursive;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .06);
  --shadow-demo: 0 2px 4px rgba(60, 40, 20, .06), 0 18px 48px rgba(60, 40, 20, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1713;
    --surface: #252019;
    --surface-2: #2E2821;
    --ink: #F4EDE3;
    --muted: #C2B7A9;
    --line: #3A332B;
    --border-control: #968B7C;
    --accent: #F08A4B;
    --on-accent: #26140A;
    --accent-ink: #F5A878;
    --accent-soft: #3B2A1E;
    --focus: #9DC3FF;
    --success: #7BD39A;
    --danger: #FF9C94;

    --board-paper: #2B2620;
    --board-ink: #F1E9DC;
    --board-teal: #6CCBC4;
    --board-accent: #F5A070;
    --board-edge: #453D33;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-demo: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .4);
  }
}

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent-ink); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }
section[id], h2[id] { scroll-margin-top: 4.5rem; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
.container--narrow { max-width: 48rem; }
.center { text-align: center; margin-top: 2rem; }

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: .75rem 1rem; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: .75rem; }

/* === COMPONENTS === */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.25rem;
  border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--border-control); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--accent-ink); padding-inline: .75rem; }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--sm { min-height: 44px; padding: .5rem 1.1rem; }
.btn--lg { padding: .85rem 1.6rem; font-size: 1.0625rem; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn--primary:hover { transform: none; } }

.link-btn {
  background: none; border: 0; padding: .5rem .25rem; min-height: 44px;
  color: var(--accent-ink); font: inherit; font-size: .9rem; text-decoration: underline;
  text-underline-offset: .18em; cursor: pointer;
}

.badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: .875rem; font-weight: 650; padding: .3rem .8rem; border-radius: 999px;
}
.badge__dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent-ink); }

.eyebrow {
  color: var(--accent-ink); font-weight: 700; font-size: .8125rem;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: .6rem;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); border-radius: var(--radius-sm); }
.wordmark__text { font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em; }
.wordmark__text span { color: var(--accent-ink); }
.mark-bg { fill: var(--accent); }
.mark-bubble { fill: var(--on-accent); }
.mark-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nav-toggle {
  display: none; align-items: center; gap: .6rem; min-height: 44px; padding: .4rem .9rem;
  background: transparent; color: var(--ink); border: 2px solid var(--border-control); border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.site-nav { display: flex; align-items: center; gap: 1.25rem; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 1rem; }
.site-nav ul { display: flex; flex-direction: column; }
.site-nav li a {
  display: flex; align-items: center; min-height: 44px; padding: .25rem .25rem;
  color: var(--ink); font-weight: 550; text-decoration: none; border-radius: var(--radius-sm);
}
.site-nav li a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .25em; }
.site-nav .btn { align-self: stretch; }

/* On small screens, once JS is available, the menu collapses. Without JS it simply stays open. */
@media (max-width: 859px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: flex; }
}
@media (min-width: 860px) {
  .site-header__inner { flex-wrap: nowrap; }
  .site-nav { width: auto; flex-direction: row; align-items: center; padding-bottom: 0; gap: 1.5rem; }
  .site-nav ul { flex-direction: row; gap: .25rem; }
  .site-nav li a { padding-inline: .6rem; }
  .site-nav .btn { align-self: auto; }
}

/* Hero */
.hero { padding: 2.5rem 0 3.5rem; background:
  radial-gradient(60rem 28rem at 85% -10%, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 70%); }
.hero__inner { display: grid; gap: 2.5rem; align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; }
.hero h1 { font-size: clamp(2.15rem, 7.5vw, 3.6rem); font-weight: 780; letter-spacing: -0.025em; line-height: 1.07; }
.lead { font-size: clamp(1.1rem, 2.6vw, 1.3rem); color: var(--muted); max-width: 34rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__note { font-size: .95rem; color: var(--muted); }
@media (min-width: 1024px) {
  .hero { padding: 4.5rem 0 5.5rem; }
  .hero__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3.5rem; }
}

/* Promo demo */
.demo { margin: 0; container-type: inline-size; container-name: demo; }
.demo__frame {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-demo); overflow: hidden;
}
.demo__bar {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
  font-size: .8125rem; color: var(--muted);
}
.demo__dots { display: inline-flex; gap: .35rem; }
.demo__dots i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--border-control); opacity: .55; }
.demo__title { font-weight: 600; flex: 1; }
.demo__live { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--accent-ink); }
.demo__live i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent-ink); }
.demo__body { display: grid; gap: .9rem; padding: .9rem; }
.demo__video { width: 100%; border-radius: var(--radius-lg); background: #000; box-shadow: var(--shadow-demo); aspect-ratio: 16 / 9; }
.demo__caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding: .35rem .25rem 0; font-size: .875rem; color: var(--muted); }
@container demo (min-width: 520px) {
  .demo__body { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); padding: 1rem; gap: 1rem; }
}

/* Whiteboard (the only hand-drawn place) */
.board { width: 100%; height: auto; border-radius: var(--radius-md); }
.board__paper { fill: var(--board-paper); stroke: var(--board-edge); stroke-width: 2; }
.board .stroke { fill: none; stroke: var(--board-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.board .stroke--accent { stroke: var(--board-accent); }
.board .stroke--arrow { stroke: var(--board-ink); }
.board .step--teal .stroke { stroke: var(--board-teal); }
.board .step--accent .stroke { stroke: var(--board-accent); }
.board .draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.board .fill { fill: var(--board-ink); fill-opacity: .06; }
.board .step--teal .fill { fill: var(--board-teal); fill-opacity: .14; }
.board .step--accent .fill { fill: var(--board-accent); fill-opacity: .16; }
.board .hand { font-family: var(--font-hand); fill: var(--board-ink); font-size: 24px; font-weight: 600; }
.board .hand.label { font-size: 30px; }
.board .hand.small { font-size: 21px; fill: var(--board-accent); }
.board .step--teal .label { fill: var(--board-teal); }
.board .step--accent .label { fill: var(--board-accent); }

.demo__side { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.transcript { display: flex; flex-direction: column; gap: .55rem; font-size: .9rem; line-height: 1.45; flex: 1; }
.transcript__line { background: var(--surface-2); border-radius: var(--radius-sm); padding: .5rem .65rem; color: var(--ink); }
.transcript__line--q { background: var(--accent-soft); }
.transcript .who { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.wave { width: 100%; height: 44px; }
.wave rect { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.wave rect:nth-child(3n) { fill: var(--board-teal); }

/* Sections */
.section { padding: 3.5rem 0; }
.section--alt { background: var(--surface-2); }
@media (min-width: 860px) { .section { padding: 5.5rem 0; } }
.section__head { max-width: 40rem; margin-bottom: 2rem; }
.section__head h2, .pricing h2 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 760; }
.section__lede { margin-top: .9rem; color: var(--muted); font-size: 1.1rem; }

/* Steps */
.steps { display: grid; gap: 1rem; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; }
.step-card__num {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 750;
}
.step-card h3 { font-size: 1.2rem; }
.step-card p { color: var(--muted); }

/* Cards */
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: .65rem; }
.card--plain { box-shadow: none; }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); }
.icon { width: 3rem; height: 3rem; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.icon svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.more { margin-top: 2rem; background: var(--surface); border: 1px dashed var(--border-control); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.more__title { font-size: 1rem; margin-bottom: .6rem; }
.more__list { display: grid; gap: .5rem; color: var(--muted); }
.more__list strong { color: var(--ink); }
@media (min-width: 860px) { .more__list { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }

.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.75rem; }
.chips li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; font-weight: 600; font-size: .95rem; }

/* Pricing */
.pricing { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .pricing { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.pricing__panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; box-shadow: var(--shadow-card); }
.credit { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.credit__num { font-size: 2.75rem; font-weight: 800; color: var(--accent-ink); line-height: 1; }
.credit__eq { font-size: 1.25rem; font-weight: 650; color: var(--muted); }

/* Enquiry form */
.enquiry { max-width: 52rem; }
.callout { margin-top: 1.1rem; background: var(--accent-soft); color: var(--ink); border-radius: var(--radius-md); padding: .8rem 1rem; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-card); }
@media (min-width: 640px) { .form { padding: 2rem; } }
.form__hint, .field__hint { color: var(--muted); font-size: .9rem; }
.form__hint { margin-bottom: 1rem; }
.form__grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .form__grid { grid-template-columns: 1fr 1fr; column-gap: 1.25rem; } .field--wide { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > label, .field > legend { font-weight: 650; padding: 0; }
.req, .hint-inline { color: var(--muted); font-weight: 450; font-size: .875rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 48px; padding: .65rem .85rem;
  background: var(--bg); color: var(--ink);
  border: 2px solid var(--border-control); border-radius: var(--radius-sm);
  font: inherit;
}
textarea { resize: vertical; min-height: 7rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.field[data-invalid] input, .field[data-invalid] select, .field[data-invalid] textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-weight: 600; font-size: .925rem; display: flex; gap: .4rem; }
.field__error::before { content: "!"; flex: none; width: 1.15rem; height: 1.15rem; margin-top: .15rem; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.checks { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .35rem; }
.check { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; font-weight: 500; }
.checks .check { padding: .35rem .9rem .35rem .7rem; border: 2px solid var(--border-control); border-radius: 999px; background: var(--bg); }
.checks .check:has(input:checked) { border-color: var(--accent-ink); background: var(--accent-soft); }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; margin: 0; }
.check--consent { align-items: flex-start; }
.check--consent input { margin-top: .2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.form__fine { color: var(--muted); font-size: .9rem; }
.form__status { border-radius: var(--radius-md); padding: .85rem 1rem; margin-bottom: 1rem; font-weight: 600; border: 2px solid var(--danger); color: var(--ink); background: var(--surface); }
.form__status--error { border-color: var(--danger); }
.form__result { margin-top: 1.25rem; background: var(--surface); border: 2px solid var(--success); border-radius: var(--radius-lg); padding: 1.5rem; }
.form__result h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.form__result p { color: var(--muted); }
.form__result--error { border-color: var(--danger); }

/* FAQ */
.faq { display: grid; gap: .75rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1rem 3rem 1rem 1.25rem; min-height: 44px; font-weight: 650; position: relative; border-radius: var(--radius-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.25rem; top: 50%; width: .6rem; height: .6rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 1.25rem 1.2rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); }
.site-footer__inner { display: flex; flex-direction: column; gap: 1rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
@media (min-width: 640px) { .site-footer__inner { flex-direction: row; justify-content: space-between; align-items: center; } }

/* Legal pages */
.legal { padding: 2.5rem 0 4rem; }
.legal .container { max-width: 46rem; }
.legal h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 780; margin-bottom: .5rem; }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
.legal p, .legal li { color: var(--ink); margin-top: .7rem; }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal .meta { color: var(--muted); }
.draft-banner { background: var(--accent-soft); border: 2px solid var(--accent-ink); border-radius: var(--radius-md); padding: .85rem 1rem; margin: 1rem 0 1.5rem; font-weight: 650; }
.todo { background: var(--accent-soft); border-radius: 4px; padding: 0 .3em; }

/* Forced colours (Windows high contrast) */
@media (forced-colors: active) {
  .btn--primary, .step-card__num { border: 2px solid ButtonText; }
  .board .fill { fill: Canvas; }
  .wave rect { fill: CanvasText; }
}
