/* Melbourne Maths Tutor — site styles
   Palette taken from a maths exercise book: grid-paper blue, navy ink, margin red. */

:root {
  --paper: #f6f8fc;
  --paper-2: #eaf0f9;
  --grid: #d5e0f1;
  --ink: #152238;
  --ink-soft: #46556e;
  --margin: #cf3a36;
  --margin-dark: #a82b28;
  --pencil: #f3c948;
  --white: #ffffff;
  --radius-sm: 4px;
  --radius-lg: 14px;
  --max: 1120px;
  --read: 68ch;
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

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

a { color: var(--ink); text-decoration-color: var(--margin); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--margin-dark); }

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

h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: var(--read); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grid);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { white-space: nowrap; text-decoration: none; padding: 8px 9px; border-radius: var(--radius-sm); font-size: 0.97rem; font-weight: 500; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--margin); border-radius: 0; }
.nav .btn { margin-left: 8px; }

.menu-toggle { display: none; background: none; border: 1px solid var(--grid); border-radius: var(--radius-sm); padding: 8px 12px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }

@media (max-width: 1320px) {
  .menu-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--grid); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 6px; border-bottom: 1px solid var(--paper-2); }
  .nav a[aria-current="page"] { box-shadow: none; background: var(--paper-2); font-weight: 700; padding-left: 10px; }
  .nav .btn { margin: 12px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-family: var(--font-body);
  padding: 13px 22px; border-radius: var(--radius-sm); border: 2px solid var(--ink);
  background: var(--ink); color: var(--white); line-height: 1.2; cursor: pointer; font-size: 1rem;
}
.btn:hover { background: var(--margin); border-color: var(--margin); color: var(--white); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.nav .btn { padding: 9px 16px; color: var(--white); }
.nav .btn:hover { background: var(--margin); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Graph-paper hero ---------- */
.grid-paper {
  background-color: var(--white);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--grid); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero::before { content: ""; position: absolute; top: 0; bottom: 0; left: max(20px, calc((100vw - var(--max)) / 2 - 18px)); width: 2px; background: var(--margin); opacity: 0.75; }
.hero-copy { position: relative; }
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.hero-plot { width: 100%; max-width: 420px; justify-self: end; }
.hero-plot .curve { stroke: var(--margin); stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.2s 0.3s ease-out forwards; }
.hero-plot .axis { stroke: var(--ink); stroke-width: 2; }
.hero-plot .dot { fill: var(--ink); opacity: 0; animation: pop 0.4s 2.3s forwards; }
.hero-plot text { font-family: var(--font-head); font-size: 17px; fill: var(--ink); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero-plot .curve { animation: none; stroke-dashoffset: 0; }
  .hero-plot .dot { animation: none; opacity: 1; }
}
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; }
  .hero-plot { justify-self: start; max-width: 300px; }
  .hero::before { left: 10px; }
}

.page-head { border-bottom: 1px solid var(--grid); position: relative; }
.page-head .wrap { padding-top: 56px; padding-bottom: 48px; }
.page-head::before { content: ""; position: absolute; top: 0; bottom: 0; left: max(20px, calc((100vw - var(--max)) / 2 - 18px)); width: 2px; background: var(--margin); opacity: 0.75; }
.page-head .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 56ch; }
.crumbs { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 14px; }
.crumbs a { color: var(--ink-soft); }
@media (max-width: 820px) { .page-head::before { left: 10px; } }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; }
section.block.alt { background: var(--white); border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.section-intro { max-width: 60ch; margin-bottom: 36px; }
.section-intro p { color: var(--ink-soft); }

.trust { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 18px 0; margin: 0; list-style: none; font-weight: 600; font-size: 0.98rem; }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust li::before { content: ""; width: 10px; height: 10px; background: var(--margin); border-radius: 50%; flex: none; }
.trust-bar { background: var(--ink); color: var(--white); }

/* Level list: rows, not cards */
.levels { border-top: 2px solid var(--ink); }
.level { display: grid; grid-template-columns: 220px 1fr auto; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--grid); align-items: start; }
.level h3 { margin: 0; }
.level .years { color: var(--margin-dark); font-weight: 700; font-size: 0.95rem; margin-top: 4px; }
.level p { margin: 0; color: var(--ink-soft); }
.level a.more { white-space: nowrap; font-weight: 700; }
@media (max-width: 760px) { .level { grid-template-columns: 1fr; gap: 8px; } }

/* Steps: a real sequence, so numbered */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 58px; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 42px; height: 42px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; background: var(--pencil); }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--ink-soft); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 28px; } }

.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 30px; margin-bottom: 12px; max-width: var(--read); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 8px; border-left: 3px solid var(--margin); border-bottom: 3px solid var(--margin); transform: rotate(-45deg); }

.note { background: #fdf6dc; border: 1px solid #ecd98f; padding: 20px 22px; border-radius: var(--radius-lg); max-width: var(--read); }
.note p:last-child { margin: 0; }

/* Subject panels (VCE page etc.) */
.subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.subject { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--grid); }
.subject:nth-child(even) { padding: 28px 0 28px 28px; border-left: 1px solid var(--grid); }
.subject .tag { display: inline-block; font-size: 0.85rem; font-weight: 700; color: var(--margin-dark); margin-bottom: 6px; }
.subject p { color: var(--ink-soft); }
.subject ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
@media (max-width: 760px) { .subjects { grid-template-columns: 1fr; } .subject, .subject:nth-child(even) { padding: 24px 0; border-left: 0; } }

/* ---------- Pricing ---------- */
.price-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius-lg); overflow: hidden; }
.price-table th, .price-table td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.price-table thead th { background: var(--ink); color: var(--white); font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.price-table tbody th { font-weight: 700; }
.price-table tbody th span { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.93rem; }
.price-table td.amt { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; white-space: nowrap; }
.price-table td.amt small { font-family: var(--font-body); font-weight: 500; font-size: 0.85rem; color: var(--ink-soft); }
.price-table tr:last-child th, .price-table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .price-table thead { display: none; }
  .price-table, .price-table tbody, .price-table tr, .price-table th, .price-table td { display: block; width: 100%; }
  .price-table tr { border-bottom: 1px solid var(--grid); padding: 8px 0; }
  .price-table th, .price-table td { border: 0; padding: 6px 18px; }
  .price-table td.amt::before { content: attr(data-label) " "; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
}

.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pack { background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius-lg); padding: 26px; }
.pack.feature { border: 2px solid var(--ink); }
.pack .amt { font-family: var(--font-head); font-weight: 800; font-size: 2rem; margin: 4px 0 2px; }
.pack .per { color: var(--ink-soft); font-size: 0.93rem; margin-bottom: 14px; }
@media (max-width: 820px) { .packs { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { border-top: 2px solid var(--ink); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--grid); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 44px 20px 0; font-weight: 700; font-size: 1.08rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font-family: var(--font-head); font-size: 1.7rem; color: var(--margin); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 20px; color: var(--ink-soft); }
.faq-group { margin-bottom: 48px; }
.faq-group h2 { font-size: 1.5rem; }

/* ---------- Suburbs ---------- */
.suburbs { columns: 4 180px; column-gap: 28px; list-style: none; padding: 0; margin: 0; }
.suburbs li { break-inside: avoid; padding: 6px 0; border-bottom: 1px dashed var(--grid); }
.region h3 { margin-top: 28px; color: var(--margin-dark); font-size: 1.05rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: var(--white); padding: 64px 0; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: #c9d3e4; }
.cta-band .btn { background: var(--margin); border-color: var(--margin); }
.cta-band .btn:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.cta-band .btn.ghost { background: transparent; border-color: var(--white); color: var(--white); }
.cta-band .btn.ghost:hover { background: var(--white); color: var(--ink); }
.cta-band a:not(.btn) { color: var(--white); }

/* ---------- Forms ---------- */
.form { background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius-lg); padding: 28px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } .form { padding: 20px; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.97rem; }
.field .hint { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid #b8c6dd; border-radius: var(--radius-sm); padding: 11px 12px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--margin); outline-offset: 1px; border-color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 0; padding: 0; margin: 0 0 16px; }
.checks legend { font-weight: 600; margin-bottom: 6px; font-size: 0.97rem; }
.checks label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hp { position: absolute; left: -9999px; }
.form-status { margin-top: 14px; font-weight: 600; }
.form-status.ok { color: #1c7a3c; }
.form-status.err { color: var(--margin-dark); }

.contact-list { list-style: none; padding: 0; margin: 0 0 28px; }
.contact-list li { padding: 14px 0; border-bottom: 1px solid var(--grid); }
.contact-list strong { display: block; font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; }
.contact-list a, .contact-list span { font-size: 1.15rem; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--grid); padding: 56px 0 28px; font-size: 0.97rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h2 { font-size: 1rem; margin-bottom: 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 8px; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { text-decoration: underline; }
.foot-grid p { color: var(--ink-soft); }
.foot-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--grid); color: var(--ink-soft); font-size: 0.9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* Mobile sticky call bar */
.callbar { display: none; }
@media (max-width: 640px) {
  .callbar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--white); border-top: 1px solid var(--grid); }
  .callbar a { text-align: center; padding: 14px 8px; font-weight: 700; text-decoration: none; }
  .callbar a + a { background: var(--margin); color: var(--white); }
  body { padding-bottom: 52px; }
}

/* Let grid children shrink below long unbroken strings (emails) */
.split > *, .hero .wrap > * { min-width: 0; }
.contact-list a, .foot-grid a { overflow-wrap: anywhere; }

/* ---------- Friendly extras ---------- */
.hero h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
.head-phone { margin-left: auto; margin-right: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: var(--radius-sm); }
.head-phone:hover { background: var(--paper-2); color: var(--ink); }
@media (min-width: 1321px) { .head-phone { display: none; } }
@media (max-width: 520px) { .head-phone { display: none; } }

/* Warm-up quiz */
.quiz { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius-lg); overflow: hidden; max-width: 860px; box-shadow: 0 14px 34px -18px rgba(21,34,56,0.45); }
.quiz-tabs { display: flex; border-bottom: 2px solid var(--ink); background: var(--paper-2); }
.quiz-tabs button { flex: 1; font: inherit; font-weight: 700; padding: 14px 10px; background: none; border: 0; border-right: 1px solid var(--grid); cursor: pointer; color: var(--ink); }
.quiz-tabs button:last-child { border-right: 0; }
.quiz-tabs button[aria-selected="true"] { background: var(--ink); color: var(--white); }
.quiz-panel { padding: 8px 26px 22px; }
.q { padding: 18px 0; border-bottom: 1px dashed var(--grid); }
.q-text { font-weight: 700; font-size: 1.08rem; display: flex; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.q-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pencil); display: inline-grid; place-items: center; font-family: var(--font-head); font-size: 0.95rem; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-left: 40px; }
.opt { font: inherit; font-weight: 600; padding: 11px 8px; border: 2px solid var(--grid); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt:disabled { cursor: default; }
.opt.is-right { background: #e3f4e8; border-color: #1c7a3c; color: #14552a; }
.opt.is-wrong { background: #fbe6e5; border-color: var(--margin); color: var(--margin-dark); }
.why { margin: 12px 0 0 40px; color: var(--ink-soft); }
.quiz-score { margin: 18px 0 0; font-weight: 700; font-size: 1.05rem; }
.quiz-score:empty { display: none; }
@media (max-width: 640px) {
  .opts { grid-template-columns: 1fr 1fr; padding-left: 0; }
  .why { margin-left: 0; }
  .quiz-panel { padding: 4px 16px 18px; }
  .quiz-tabs button { font-size: 0.92rem; padding: 12px 4px; }
}

/* Browser surfaces */
::selection { background: var(--pencil); color: var(--ink); }
html { accent-color: var(--margin); caret-color: var(--margin); scrollbar-color: #9fb1cf var(--paper); }
.price-table td.amt, .pack .amt { font-variant-numeric: tabular-nums lining-nums; }

/* Nav contact link: show in desktop nav only as a text link */
@media (min-width: 1321px) { .nav .nav-contact { display: none; } }

/* Inline form errors */
.field-error { display: block; color: var(--margin-dark); font-size: 0.9rem; font-weight: 600; margin-top: 6px; }
.field [aria-invalid="true"] { border-color: var(--margin); background: #fdf1f0; }
.form-status:focus { outline: none; }
.form-status.ok { background: #e3f4e8; border: 1px solid #b7dfc3; padding: 14px 16px; border-radius: var(--radius-sm); }
.form-status.err { background: #fdf1f0; border: 1px solid #f0c4c1; padding: 14px 16px; border-radius: var(--radius-sm); }
.form-status:empty { display: none; }

@media (prefers-reduced-motion: reduce) { .opt { transition: none; } }
.site-header .wrap { max-width: 1400px; }
