/* Simple Tutor base stylesheet. Tokens, reset, typography, layout, and every shared component.
   Budget: 25 KB. Module styles live in modules/<name>/assets and are scoped under .m-<name>. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next.woff2") format("woff2");
}

:root {
  --navy: #0B2545;
  --navy-700: #13315C;
  --navy-100: #E8EEF7;
  --ink: #14213D;
  --muted: #4A5568;
  --white: #FFFFFF;
  --paper: #F6F8FB;
  --line: #D5DDE8;
  --orange: #F97316;
  --orange-400: #FB923C;
  --orange-600: #EA580C;
  --orange-700: #C2410C;
  --orange-100: #FFEDD5;
  --green: #1B7F3B;
  --red: #B42318;
  /* Fixed pairs for blocks that stay navy or orange in both modes: hero, footer, toasts, primary buttons. */
  --brand: #0B2545;
  --brand-hover: #13315C;
  --on-brand: #FFFFFF;
  --on-orange: #0B2545;
  /* Tinted states: success and danger surfaces, a stronger border on hover, and a translucent tint on any surface. */
  --green-bg: #E8F5EC;
  --green-bg-hover: #D6EEDD;
  --green-line: #2F855A;
  --green-ink: #1E4D34;
  --red-bg: #FDECEA;
  --red-bg-hover: #FBDDD9;
  --red-line: #F1B4AD;
  --line-strong: #B9C4D6;
  --tint: rgba(11, 37, 69, 0.08);
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 37, 69, 0.08);
  --container: 1120px;
  --gutter: 16px;
  color-scheme: light;
}

/* Dark mode: the same tokens, swapped. Surfaces go dark, text and navy go light, the brand pairs keep their contrast.
   The choice lives on <html data-theme>, set before paint by the head script from localStorage or the system setting. */
[data-theme="dark"] {
  --navy: #C7D5EE;
  --navy-700: #E3EBF7;
  --navy-100: #1C2A44;
  --ink: #E6ECF5;
  --muted: #A5B2C8;
  --white: #0F1A2B;
  --paper: #172439;
  --line: #2C3D5A;
  --orange-700: #FDBA74;
  --orange-100: #4A2A12;
  --green: #4ADE80;
  --red: #F87171;
  --brand: #13315C;
  --brand-hover: #1B4179;
  --green-bg: #14301F;
  --green-bg-hover: #1B3D28;
  --green-line: #3FA56A;
  --green-ink: #BBF7D0;
  --red-bg: #3B1D1D;
  --red-bg-hover: #4A2323;
  --red-line: #7F1D1D;
  --line-strong: #3D5075;
  --tint: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
@media (max-width: 399px) { html { font-size: 17px; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--navy-700); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

/* Typography */
h1, h2, h3, h4 { color: var(--navy); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
@media (max-width: 599px) {
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }
}
.lead { font-size: 1.15rem; }
.small { font-size: 0.9rem; }
.muted { color: var(--muted); }
strong { font-weight: 700; }
code, pre { font-family: var(--mono); font-size: 0.95em; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 900px) { :root { --gutter: 32px; } }
.site-main { flex: 1 0 auto; }
.section { padding: var(--s4) 0; }
@media (min-width: 600px) { .section { padding: var(--s5) 0; } }
.section--paper { background: var(--paper); }
.section__title { margin-bottom: var(--s3); }
.stack > * + * { margin-top: var(--s2); }
.stack--tight > * + * { margin-top: var(--s1); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; }
.grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(var(--min, 240px), 1fr)); }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--s2); }
.prose h2 { margin-top: var(--s4); }
.prose h3 { margin-top: var(--s3); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--s1); }
.text-center { text-align: center; }

/* Skip link */
.skip-link {
  position: absolute; left: var(--s2); top: -100px;
  background: var(--brand); color: var(--on-brand); padding: 12px 20px; border-radius: var(--radius);
  z-index: 100; font-weight: 700;
}
.skip-link:focus { top: var(--s2); }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 64px; gap: var(--s2); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 1.25rem; min-height: 44px; }
.brand__logo { height: 36px; width: auto; }
.brand__logo--dark { display: none; }
[data-theme="dark"] .brand__logo--light { display: none; }
[data-theme="dark"] .brand__logo--dark { display: block; }
.brand__mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: var(--on-brand); font-size: 1.2rem;
}
.site-header__tools { display: flex; align-items: center; gap: var(--s1); }
.menu-toggle {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2);
  background: var(--white); color: var(--navy); border: 2px solid var(--navy); border-radius: var(--radius); font-weight: 700;
}
/* The appearance menu: light or dark, and a look (kids = colorful, simple, professional). site.js stores both on <html> and in localStorage. */
.appearance { position: relative; flex: none; }
.appearance summary {
  list-style: none; display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer;
  background: var(--white); color: var(--navy); border: 2px solid var(--navy); border-radius: var(--radius);
}
.appearance summary::-webkit-details-marker { display: none; }
.appearance summary:hover, .appearance[open] summary { background: var(--navy-100); }
.appearance summary svg { width: 22px; height: 22px; }
.appearance__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 280px; max-width: calc(100vw - 32px); padding: var(--s2);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(11, 37, 69, 0.18);
}
.appearance__label { margin: 0 0 6px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.appearance__row { display: flex; flex-wrap: wrap; gap: 6px; }
.appearance__row + .appearance__label { margin-top: var(--s2); }
.appearance__option {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 700; font-size: 0.95rem;
}
.appearance__option:hover { border-color: var(--navy); }
.appearance__option[aria-pressed="true"] { border-color: var(--navy); background: var(--navy-100); color: var(--navy); }
/* Each look's own colours, so a swatch shows what you would get rather than the current look. */
.appearance__swatch { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.appearance__swatch--kids { background: conic-gradient(#2563EB 0 25%, #7C3AED 0 50%, #DB2777 0 75%, #FFB703 0); }
.appearance__swatch--simple { background: linear-gradient(135deg, #0B2545 50%, #F97316 50%); }
.appearance__swatch--professional { background: linear-gradient(135deg, #111827 50%, #1E3A5F 50%); }
.site-nav { display: none; width: 100%; }
.site-nav[data-open] { display: block; }
.site-nav__list { list-style: none; display: flex; flex-direction: column; gap: 4px; padding-bottom: var(--s2); }
.site-nav__list a { display: flex; align-items: center; min-height: 48px; padding: 0 var(--s2); border-radius: var(--radius); text-decoration: none; font-weight: 700; }
.site-nav__list a:hover { background: var(--navy-100); }
.site-nav__list a[aria-current="page"] { background: var(--navy-100); }
.site-nav__account { margin-top: var(--s1); border-top: 1px solid var(--line); padding-top: var(--s1); }
.site-nav__list a.site-nav__admin { min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 0.9rem; align-self: center; }
.site-nav__list a.site-nav__admin:hover { background: var(--brand-hover); }
@media (min-width: 600px) {
  .menu-toggle { display: none; }
  .site-nav { display: block; width: auto; order: 2; margin-left: auto; }
  .site-header__tools { order: 3; }
  .site-nav__list { flex-direction: row; align-items: center; gap: var(--s1); padding: 0; }
  .site-nav__account { display: flex; align-items: center; gap: var(--s1); margin: 0 0 0 var(--s1); border: 0; padding: 0 0 0 var(--s2); border-left: 1px solid var(--line); }
}

/* Breadcrumbs */
.breadcrumbs { padding-top: var(--s2); font-size: 0.95rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1); color: var(--muted); }
.breadcrumbs li + li::before { content: "\203A"; margin-right: var(--s1); }
.breadcrumbs span[aria-current] { color: var(--ink); }

/* Hero */
.hero { background: var(--brand); color: var(--on-brand); padding: var(--s5) 0; }
@media (min-width: 900px) { .hero { padding: var(--s6) 0; } }
.hero h1 { color: var(--on-brand); font-size: 2.4rem; max-width: 20ch; }
@media (min-width: 600px) { .hero h1 { font-size: 3rem; } }
.hero p { font-size: 1.2rem; max-width: 48ch; margin-top: var(--s2); }
.hero .btn { margin-top: var(--s3); }
.hero a:not(.btn) { color: var(--on-brand); }
.hero__note { font-size: 1rem; margin-top: var(--s2); opacity: 0.9; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 24px; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
  border: 2px solid transparent; transition: background-color 150ms, color 150ms, border-color 150ms;
}
.btn--primary { background: var(--orange); color: var(--on-orange); border-color: var(--orange); }
.btn--primary:hover { background: var(--orange-400); border-color: var(--orange-400); color: var(--on-orange); }
.btn--primary:active { background: var(--orange-600); border-color: var(--orange-600); }
.btn--secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--navy-100); color: var(--navy); }
.btn--navy { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--navy:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn--large { min-height: 56px; padding: 12px 32px; font-size: 1.1rem; }
.btn[aria-disabled="true"], .btn:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
[data-theme="dark"] .btn[aria-disabled="true"], [data-theme="dark"] .btn:disabled { opacity: 0.6; }
.btn--block { width: 100%; }
@media (max-width: 599px) { .btn--block-mobile { width: 100%; } }
.btn__icon { width: 22px; height: 22px; flex: none; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); box-shadow: var(--shadow); }
.card--paper { background: var(--paper); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px;
  background: var(--navy-100); color: var(--ink); border-radius: 999px; font-size: 0.95rem;
}
.chip--orange { background: var(--orange-100); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; }
.input, .select, textarea.input {
  min-height: 48px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--white); font-size: 1rem; width: 100%;
}
.select { padding-right: 40px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B2545' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
[data-theme="dark"] .select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23C7D5EE' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); }
.input:focus, .select:focus { border-color: var(--navy); outline: 3px solid var(--orange); outline-offset: 2px; }
.help { font-size: 0.9rem; color: var(--muted); }
.error-text { color: var(--red); font-weight: 700; }

/* Filter bar */
.filters { display: grid; gap: var(--s2); grid-template-columns: 1fr; align-items: end; }
@media (min-width: 600px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(4, 1fr) auto; } }
.filters .btn { min-height: 48px; }

/* Tutor cards */
.tutor-grid { --min: 240px; }
.tutor-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2);
  box-shadow: var(--shadow); transition: border-color 150ms;
}
.tutor-card:hover { border-color: var(--navy); }
.tutor-card__photo { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: 10px; background: var(--navy-100); }
.tutor-card__name { font-size: 1.25rem; }
.tutor-card__name a { text-decoration: none; }
.tutor-card__name a::after { content: ""; position: absolute; inset: 0; }
.tutor-card__subject { font-weight: 700; color: var(--orange-700); }
.tutor-card__meta { color: var(--muted); font-size: 0.95rem; }
.tutor-card__tagline { flex: 1 0 auto; }
.tutor-card .btn { position: relative; z-index: 1; }
.face-grid { --min: 150px; gap: var(--s2); }
@media (min-width: 900px) { .face-grid { grid-template-columns: repeat(5, 1fr); } }
.face { text-align: center; text-decoration: none; display: block; padding: 6px; border-radius: var(--radius); }
.face:hover { background: var(--navy-100); }
.face img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; width: 100%; background: var(--navy-100); }
.face__name { display: block; margin-top: var(--s1); font-weight: 700; color: var(--navy); }
.face__subject { display: block; color: var(--muted); font-size: 0.95rem; }

/* Steps */
.steps { list-style: none; display: grid; gap: var(--s3); counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { display: flex; gap: var(--s2); align-items: flex-start; counter-increment: step; }
.steps li::before {
  content: counter(step); flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--orange); color: var(--on-orange); font-weight: 700; font-size: 1.2rem;
}
.steps h3 { margin-bottom: 4px; }

/* Plans */
.plan-grid { grid-template-columns: 1fr; }   /* four plans: one column, then two by two, then one row */
@media (min-width: 600px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .plan-grid { grid-template-columns: repeat(4, 1fr); } }
.plan { display: flex; flex-direction: column; gap: var(--s2); }
.plan--featured { border-color: var(--navy); border-width: 2px; }
.plan__name { font-size: 1.35rem; }
.plan__price { font-size: 2.4rem; font-weight: 700; color: var(--navy); line-height: 1; }
.plan__price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan__lines { list-style: none; display: grid; align-content: start; gap: var(--s1); flex: 1 0 auto; font-size: 0.9rem; line-height: 1.45; }
.plan__lines li { padding-left: 22px; position: relative; }
.plan__lines li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* Notice */
.notice { background: var(--paper); border-left: 4px solid var(--orange); border-radius: 0 var(--radius) var(--radius) 0; padding: var(--s2) var(--s3); }
.notice--info { border-left-color: var(--navy); }

/* Profile */
.profile { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .profile { grid-template-columns: minmax(280px, 400px) 1fr; align-items: start; } }
.profile__photo { width: 100%; max-width: 260px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--navy-100); }
@media (min-width: 900px) { .profile__photo { max-width: none; } }
.profile__title { color: var(--orange-700); font-weight: 700; font-size: 1.15rem; }
.profile__facts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); color: var(--muted); }
.profile__cta { margin-top: var(--s3); display: grid; gap: var(--s1); justify-items: start; }
.profile__bio { margin-top: var(--s3); max-width: 60ch; }
.profile__section { margin-top: var(--s4); }
.profile__section h2 { font-size: 1.35rem; margin-bottom: var(--s2); }
.profile__disclosure { margin-top: var(--s4); color: var(--muted); }

/* Audio button */
.audio-btn { gap: 12px; }
.audio-btn__time { color: var(--muted); font-weight: 400; min-width: 4ch; }

/* Footer */
.site-footer { background: var(--brand); color: var(--on-brand); padding: var(--s4) 0; margin-top: var(--s4); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; align-items: flex-start; }
.site-footer__name { font-weight: 700; font-size: 1.25rem; }
.site-footer__note { margin-top: var(--s1); opacity: 0.9; }
.site-footer__links ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.site-footer a { color: var(--on-brand); display: inline-flex; align-items: center; min-height: 44px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: var(--s3); transform: translateX(-50%);
  background: var(--brand); color: var(--on-brand); padding: 12px 20px; border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(11, 37, 69, 0.25); max-width: calc(100% - 32px); z-index: 90;
}

/* Dialog */
dialog.dialog { border: 0; border-radius: var(--radius); padding: var(--s3); max-width: 480px; width: calc(100% - 32px); color: var(--ink); background: var(--white); }
dialog.dialog::backdrop { background: rgba(11, 37, 69, 0.5); }
.dialog__actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s3); flex-wrap: wrap; }

/* Tables (rare) */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--navy); }

/* Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
