/* Archway Tutoring — single stylesheet, mobile-first. No frameworks.
   Brand colours match the social posts (tutoring_plan/social_posts/post*.png). */

/* One self-hosted font (DM Serif Display, SIL OFL) for headings; body text uses the system sans-serif stack. */
@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/dm-serif-display-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215;
}

/* Metric-adjusted fallback limits layout shift while the heading font loads. */
@font-face {
  font-family: "DM Serif Fallback";
  src: local("Georgia"), local("Times New Roman"), local("Liberation Serif");
  size-adjust: 98%;
  ascent-override: 98%;
  descent-override: 32%;
  line-gap-override: 0%;
}

:root {
  --navy: #14233f;
  --navy-2: #1f3358;
  --navy-3: #2a4170;
  --gold: #c9a24a;
  --gold-light: #e2c480;
  --gold-text: #7a5b14;   /* gold for text on cream (5.7:1) */
  --cream: #f8f3e8;
  --paper: #fffdf8;
  --ink: #14233f;
  --muted: #4f5a70;        /* 6.3:1 on cream */
  --on-navy: #ffffff;
  --on-navy-muted: #bec8dc;
  --line: rgba(20, 35, 63, .14);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 63, .06), 0 8px 24px rgba(20, 35, 63, .07);
  --serif: "DM Serif Display", "DM Serif Fallback", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
/* One-page anchors: stop the sticky header covering section headings */
[id] { scroll-margin-top: 4.5rem; }
.anchor-alias { display: block; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 .6em;
  letter-spacing: -.005em;
}
h1 { font-size: clamp(2.2rem, 6vw + .5rem, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3vw + .75rem, 2.5rem); }
h3 { font-size: 1.4rem; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: .35em; }

a { color: var(--navy); text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--navy-3); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.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;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--gold); color: var(--navy); padding: .6rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 46rem; }

/* Placeholder marker: visible so nothing unconfirmed slips through unnoticed. */
.ph {
  background: #fff1c7;
  color: #5c4200;
  border: 1px dashed #b38a1e;
  border-radius: 4px;
  padding: 0 .3em;
  font-size: .92em;
  font-style: normal;
  white-space: normal;
}
.on-navy .ph, .site-footer .ph { background: #3b3214; color: #ffe8a8; border-color: #e2c480; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: var(--on-navy);
  border-bottom: 1px solid rgba(201, 162, 74, .35);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--on-navy); text-decoration: none; }
.brand svg { width: 1.6rem; height: auto; flex: none; }
.brand-name { font-weight: 800; letter-spacing: .16em; font-size: .9rem; text-transform: uppercase; white-space: nowrap; }
.brand:hover { color: var(--gold-light); }

.menu-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: var(--on-navy);
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px;
  padding: .5rem .75rem; font: inherit; font-size: .95rem; cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: "";
}
.menu-toggle-bars::before { position: absolute; top: -6px; }
.menu-toggle-bars::after { position: absolute; top: 6px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: block; color: var(--on-navy); text-decoration: none; padding: .75rem 0; font-weight: 600;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold-light); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); }
.site-nav .nav-cta a {
  display: inline-block; margin-top: .5rem; background: var(--gold); color: var(--navy);
  padding: .6rem 1rem; border-radius: 999px; text-decoration: none;
}
.site-nav .nav-cta a:hover { background: var(--gold-light); color: var(--navy); }

/* Mobile menu: hidden only when JS is available (no-JS visitors see the links). */
.js .site-nav { display: none; }
.js .site-header.menu-open .site-nav {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--navy); padding: .5rem 1.25rem 1.25rem; border-bottom: 1px solid rgba(201, 162, 74, .35);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
}
.no-js .menu-toggle { display: none; }
.no-js .header-inner { flex-wrap: wrap; padding-block: .5rem; }
.no-js .site-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }

@media (min-width: 60rem) {
  .menu-toggle { display: none; }
  .js .site-nav, .site-nav { display: block; position: static; padding: 0; box-shadow: none; border: 0; }
  .site-nav ul { display: flex; align-items: center; gap: 1.4rem; }
  .site-nav a { padding: .5rem 0; font-size: .97rem; }
  .site-nav .nav-cta a { margin-top: 0; padding: .55rem 1.05rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  padding: .85rem 1.35rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-outline-light { border-color: rgba(255, 255, 255, .6); color: var(--on-navy); }
.btn-outline-light:hover { border-color: var(--gold-light); color: var(--gold-light); }
.btn-navy { background: var(--navy); color: var(--on-navy); }
.btn-navy:hover { background: var(--navy-3); color: var(--on-navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--navy); color: var(--on-navy);
  padding: 3.5rem 0 4rem;
}
.hero::before { /* faint arch, echoing the social posts */
  content: ""; position: absolute; left: 50%; top: 2.5rem; transform: translateX(-50%);
  width: min(80vw, 34rem); height: 140%;
  border: clamp(14px, 3vw, 28px) solid var(--navy-2); border-bottom: 0;
  border-radius: 999px 999px 0 0; pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero .eyebrow { color: var(--gold-light); }
.hero h1 { color: #fff; }
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero .lead { color: var(--on-navy); font-size: 1.15rem; max-width: 41rem; }
.hero-home { text-align: center; padding: 4rem 0 4.5rem; }
.hero-home .lead { margin-inline: auto; }
.hero-home .btn-row { justify-content: center; }
.page-hero { padding: 3rem 0 3.25rem; }
.page-hero::before { left: auto; right: -6rem; transform: none; width: 22rem; top: 1.5rem; }

.eyebrow {
  display: block; font-family: var(--sans); font-size: .82rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-text); margin-bottom: .75rem;
}

.level-cards { display: grid; gap: .9rem; grid-template-columns: repeat(3, 1fr); margin: 2.25rem auto 0; max-width: 40rem; }
.level-card {
  border: 2px solid var(--gold); border-radius: 12px; padding: .9rem .5rem; text-decoration: none; color: var(--on-navy);
  display: block; background: rgba(20, 35, 63, .6);
}
.level-card strong { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(1.4rem, 4vw, 2rem); color: var(--gold-light); line-height: 1.1; }
.level-card span { font-size: .9rem; }
.level-card:hover { background: var(--navy-2); color: #fff; }
.hero-note { margin-top: 1.5rem; font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-navy { background: var(--navy); color: var(--on-navy); }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy .eyebrow { color: var(--gold-light); }
.section-navy a:not(.btn) { color: var(--gold-light); }
.section-head { max-width: 44rem; margin-bottom: 2rem; }
.section-head p { color: var(--muted); }
.section-navy .section-head p { color: var(--on-navy-muted); }

.grid { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 52rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 40rem) and (max-width: 51.99rem) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .meta { color: var(--muted); font-size: .95rem; }
.card-cream { background: var(--cream); color: var(--ink); box-shadow: none; border: 0; }
.card-cream h3 { color: var(--navy) !important; }
.card-top { border-top: 4px solid var(--gold); }
.tag {
  display: inline-block; font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy); background: var(--gold-light); border-radius: 999px; padding: .2rem .65rem; margin-bottom: .75rem;
}

.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 1.75rem; }
.check-list li::before {
  content: ""; position: absolute; left: .1rem; top: .45em; width: .85rem; height: .5rem;
  border-left: 3px solid var(--gold); border-bottom: 3px solid var(--gold); transform: rotate(-45deg);
}

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.25rem 1.25rem 4rem; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 1.1rem; top: 1.1rem; width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: var(--gold-light);
  font-family: var(--serif); font-size: 1.15rem;
}
.steps strong { display: block; }

.split { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1.4fr; gap: 3rem; } }

.callout {
  background: var(--paper); border-left: 5px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.25rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout-navy { background: var(--navy); color: var(--on-navy); }

.notice {
  background: var(--navy); color: var(--on-navy); border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.notice p { margin: 0; }
.notice strong { color: var(--gold-light); }

/* FAQ */
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0 1.1rem; }
.faq details + details { margin-top: .6rem; }
.faq summary { cursor: pointer; padding: 1rem 0; font-weight: 700; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: .75rem; }



/* ---------- Form ---------- */
.form-section { background: var(--navy); color: var(--on-navy); }
.form-section h2 { color: #fff; }
.form-section .eyebrow { color: var(--gold-light); }
.form-section .section-head p { color: var(--on-navy-muted); }
.form-section a:not(.btn) { color: var(--gold-light); }
.form-layout { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .form-layout { grid-template-columns: 1fr 1.6fr; gap: 3rem; align-items: start; } }

.form-card { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.form-card a { color: var(--navy); }
@media (min-width: 40rem) { .form-card { padding: 2rem; } }

.field { margin-bottom: 1.15rem; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }
label, legend { display: block; font-weight: 700; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; }
.req { color: #8a1c1c; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid #8b93a5; border-radius: 8px; padding: .7rem .8rem; min-height: 2.9rem;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid var(--gold-light); outline-offset: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.15rem; min-width: 0; }
.choices { display: grid; gap: .4rem; }
@media (min-width: 40rem) { .choices-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 40rem) { .choices-3 { grid-template-columns: repeat(3, 1fr); } }
fieldset .form-error { margin: .5rem 0 0; }
.choice { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 0; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.choice input { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; flex: none; accent-color: var(--navy); }
.consent { background: var(--cream); border-color: var(--gold); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #a32020; font-weight: 700; }
.form-error[hidden] { display: none; }
.form-card .btn { width: 100%; }
@media (min-width: 40rem) { .form-card .btn { width: auto; } }

/* ---------- Footer ---------- */
.site-footer { background: #0e1a31; color: var(--on-navy-muted); padding: 3rem 0 2rem; font-size: 1rem; }
.site-footer a:not(.btn) { color: #fff; }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-family: var(--sans); font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-light); margin-bottom: .9rem; font-weight: 800; }
.site-footer ul { list-style: none; padding: 0; }
.footer-brand .brand { margin-bottom: 1rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1.25rem; font-size: .88rem; }
.footer-bottom p { margin: 0 0 .4rem; }

/* ---------- Simple pages (thanks / 404) ---------- */
.simple { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }
.simple .arch-mark { width: 4.5rem; margin: 0 auto 1.5rem; }
.simple .btn-row { justify-content: center; }

/* Long-form text (privacy) */
.prose h2 { font-size: 1.6rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5rem; }
.prose { max-width: 46rem; }

@media print {
  .site-header, .site-footer, .form-section { display: none; }
  body { background: #fff; }
}

/* Small utilities (used instead of inline styles, which the Content-Security-Policy blocks) */
.mt { margin-top: 1.25rem; }
.mt-lg { margin-top: 2.5rem; }
.h-small { font-size: 1.5rem; }

/* Linked cards on the home page */
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card-link:hover, .card-link:focus-visible { transform: translateY(-2px); border-color: var(--gold); }
.card-link h3 { color: var(--navy); }
.card-link p { margin-bottom: 0; }
/* Short stacked lines */
.plain-lines { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain-lines li { margin: 0 0 .35rem; }
.card-link h3 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.card-link-plain h3 { font-size: 1.4rem; }
.form-section .form-card a:not(.btn) { color: var(--navy); text-decoration-color: var(--gold); }

/* Bigger tap targets for footer links */
.site-footer li a { display: inline-block; padding: .4rem 0; }
.site-footer li { margin: 0; }

.choice { min-height: 2.75rem; align-items: center; }
.choice input { margin: 0; }
.consent { align-items: flex-start; }
.consent input { margin-top: .2rem; }
/* Show errors only after the parent has interacted with a field */
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: #a32020; border-width: 2px; }

/* Mobile: one always-visible "Book a free assessment" bar (the header button shows on desktop) */
.mobile-cta { display: none; }
@media (max-width: 59.99rem) {
  .has-mobile-cta { padding-bottom: 5rem; }
  .has-mobile-cta .site-nav .nav-cta { display: none; }
  .mobile-cta {
    display: flex; position: fixed; z-index: 40; left: 1rem; right: 1rem;
    bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
    justify-content: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    transition: opacity .2s, transform .2s;
  }
  .mobile-cta.is-hidden { opacity: 0; transform: translateY(150%); pointer-events: none; }
}

/* ---------- Pop-up cards: Safeguarding and Privacy notice (<dialog>) ---------- */
.text-link { font-weight: 700; }
.policy-dialog {
  width: min(46rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.policy-dialog[open] { display: flex; flex-direction: column; }
.policy-dialog:focus, .policy-dialog:focus-visible { outline: none; }
.policy-dialog::backdrop { background: rgba(20, 35, 63, .65); }
.policy-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}
.policy-head h2 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.1rem); }
.policy-close {
  flex: none; width: 2.5rem; height: 2.5rem; font-size: 1.6rem; line-height: 1;
  color: var(--navy); background: var(--cream); border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
}
.policy-close:hover { background: var(--gold-light); }
.policy-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.policy-body { overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem clamp(1.25rem, 4vw, 2.25rem) 1.75rem; line-height: 1.6; overflow-wrap: anywhere; }
.policy-note { margin: 0 0 1.25rem; font-style: italic; color: var(--muted); }
.policy-body h3 { margin: 1.5rem 0 .4rem; font-size: 1.3rem; color: var(--gold-text); }
.policy-body ul:not(.check-list) { padding-left: 1.25rem; }
.policy-body li { margin: .3rem 0; }
html:has(.policy-dialog[open]) { overflow: hidden; }
/* Without JavaScript the cards show as normal sections at the end of the page, so the content stays reachable. */
.no-js .policy-dialog { display: block; position: static; max-height: none; margin: 2rem auto; box-shadow: none; }
.no-js .policy-close { display: none; }

.optional { font-weight: 400; color: #5a6475; }
.faq { max-width: 46rem; }

/* Cookie consent banner (shown only when a Google Analytics ID is set in analytics.js) */
.cookie-banner { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 100; display: flex; align-items: center; gap: 1rem 1.75rem; max-width: 44rem; margin: 0 auto; padding: 1rem 1.25rem; background: var(--navy); color: #fff; border: 1px solid var(--gold); border-radius: 12px; box-shadow: 0 18px 45px rgba(20, 35, 63, .3); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: .92rem; line-height: 1.5; }
.cookie-banner a { color: var(--gold-light); }
.cookie-actions { display: flex; flex: 0 0 auto; gap: .6rem; }
/* Accept and Decline deliberately look the same. */
.cookie-button { min-width: 6.5rem; background: transparent; color: #fff; border: 1px solid var(--gold); }
.cookie-button:hover { background: var(--gold); color: var(--navy); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }
.link-button[hidden] { display: none; }
@media (max-width: 40rem) {
  .cookie-banner { flex-direction: column; align-items: stretch; left: .75rem; right: .75rem; bottom: .75rem; }
  .cookie-actions > .cookie-button { flex: 1 1 0; }
}
