/* Ella Feltus Maths Tutoring */

@font-face {
  font-family: "Newsreader";
  src: local("Newsreader");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: local("Newsreader Medium");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #F7F4EE;
  --paper-alt: #EFEADF;
  --paper-deep: #E5DAC4;
  --ink: #1E1C17;
  --ink-soft: #5C5648;
  --ink-faint: #7A7264;
  --accent: #2F5D4E;
  --accent-hover: #24483C;
  --sand: #C4B69B;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 88px;

  --header-h: 104px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
}

a {
  color: var(--accent);
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

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

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: var(--space-2) 0 var(--space-1);
  background: rgba(247, 244, 238, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(196, 182, 155, 0.5);
}
.header-inner {
  max-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px var(--space-4);
}
.brand {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Burger — revealed by JS only, so the no-JS fallback stays a visible nav row */
.nav-burger {
  display: none;
  background: none;
  border: none;
  padding: 6px 0 6px 12px;
  cursor: pointer;
  color: var(--ink);
}
.burger-box {
  display: block;
  position: relative;
  width: 24px;
  height: 14px;
}
.burger-line,
.burger-line::before,
.burger-line::after {
  position: absolute;
  left: 0;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, background-color 0.2s ease;
}
.burger-line { top: 6px; }
.burger-line::before { content: ""; top: -6px; }
.burger-line::after { content: ""; top: 6px; }
[aria-expanded="true"] .burger-line { background: transparent; }
[aria-expanded="true"] .burger-line::before { transform: translateY(6px) rotate(45deg); }
[aria-expanded="true"] .burger-line::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: none;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 4px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* JS-enhanced mobile menu */
@media (max-width: 859px) {
  body.js-nav .nav-burger { display: block; }
  body.js-nav .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    width: auto;
    overflow: visible;
    padding: var(--space-2) 20px var(--space-4);
    background: rgba(247, 244, 238, 0.97);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--sand);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  body.js-nav .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  body.js-nav .site-nav a {
    font-family: "Newsreader", Georgia, serif;
    font-size: 24px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    padding: 14px 0;
    border-bottom: 1px solid rgba(196, 182, 155, 0.5);
  }
  body.js-nav .site-nav a:last-child { border-bottom: none; }
  body.js-nav .site-nav a.is-current { color: var(--accent); }
}

@media (min-width: 860px) {
  .site-nav { width: auto; overflow: visible; }
}

/* ---------- Hero ---------- */

.hero-section {
  position: relative;
  overflow: hidden;
  padding: var(--space-6) 0 var(--space-7);
}
/* soft, on-brand depth behind the portrait — no hard edges, no overlay text */
.hero-section::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -35%;
  width: 110%;
  height: 150%;
  background: radial-gradient(closest-side circle at 50% 50%, rgba(47, 93, 78, 0.14), rgba(47, 93, 78, 0.05) 45%, rgba(47, 93, 78, 0) 75%);
  pointer-events: none;
}
.hero {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-5);
  max-width: 1080px;
}
.hero-text { flex: 1.1; }
.hero-photo { flex: 1; }

h1 {
  font-size: clamp(38px, 11vw, 76px);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.lede {
  font-size: clamp(19px, 4.6vw, 23px);
  line-height: 1.45;
  margin: 0 0 var(--space-3);
  max-width: 22ch;
}
.credentials {
  color: var(--ink-soft);
  margin: 0 0 var(--space-4);
}

.hero-photo img {
  width: 100%;
  display: block;
  border-radius: 18px;
  /* on small screens the portrait is letterboxed so the headline and CTA
     still land in the first viewport */
  height: 42vh;
  object-fit: cover;
  object-position: center 22%;
}

@media (min-width: 860px) {
  .hero {
    flex-direction: row;
    align-items: center;
    gap: var(--space-7);
  }
  .hero-text { flex: 1.15; }
  .hero-photo {
    flex: 0 0 42%;
    /* deliberate asymmetry: the portrait sits lower than the headline baseline */
    margin-top: var(--space-6);
  }
  .hero-photo img {
    height: auto;
    aspect-ratio: 4 / 5;
    object-position: center center;
  }
  .hero-section { padding: var(--space-7) 0 calc(var(--space-7) + var(--space-4)); }
}

/* ---------- Sections ---------- */

.section {
  padding: var(--space-6) 0;
  background: var(--paper);
  scroll-margin-top: var(--header-h);
}
.section--alt { background: var(--paper-alt); }
/* Deepest tone on the page, so the enquiry form reads as the destination. */
.section--contact { background: var(--paper-deep); }
.section--contact .field input,
.section--contact .field select,
.section--contact .field textarea {
  background: #FFFDF9;
  border-color: rgba(122, 114, 100, 0.35);
}

.section-grid { max-width: 1080px; }

h2 {
  font-size: clamp(26px, 6vw, 34px);
  letter-spacing: -0.01em;
}
h3 {
  font-size: 15px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: var(--space-5) 0 var(--space-2);
}
.section-body > h3:first-child { margin-top: 0; }

.section-body > p { margin: 0 0 var(--space-2); }
.lead-para {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
}

@media (min-width: 860px) {
  .section { padding: var(--space-7) 0; }
  .section-grid {
    display: grid;
    grid-template-columns: 200px minmax(0, 600px);
    gap: var(--space-7);
    align-items: start;
  }
  /* headings sit in their own column, right-aligned against the gutter —
     asymmetric, while body copy stays left-aligned per brand rules */
  .section-grid > h2 {
    text-align: right;
    position: sticky;
    top: calc(var(--header-h) + var(--space-3));
    margin: 0;
  }
}

/* ---------- Lists ---------- */

.plain-list {
  list-style: none;
  padding-left: var(--space-3);
  margin: 0 0 var(--space-3);
}
.plain-list li {
  position: relative;
  margin-bottom: var(--space-1);
}
.plain-list li::before {
  content: "\2013";
  position: absolute;
  left: calc(var(--space-3) * -1);
  color: var(--accent);
}

.note {
  color: var(--ink-faint);
  font-size: 15px;
}

/* ---------- Pricing ---------- */

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-3);
}
.pricing-table th,
.pricing-table td {
  text-align: left;
  padding: var(--space-2) 12px var(--space-2) 0;
  border-bottom: 1px solid var(--sand);
}
.pricing-table th {
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0;
}
.pricing-table th:last-child,
.pricing-table td:last-child {
  text-align: right;
  padding-right: 0;
}
.pricing-table td:last-child {
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Rows open one after another as the table comes into view.
   Applied by JS only, so rows are plainly visible without it. */
.pricing-table tbody tr {
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.pricing-table.is-staggered tbody tr {
  opacity: 0;
  transform: translateY(26px);
}
.pricing-table.is-staggered.is-revealed tbody tr {
  opacity: 1;
  transform: none;
}
.pricing-table.is-staggered.is-revealed tbody tr:nth-child(1) { transition-delay: 0.2s; }
.pricing-table.is-staggered.is-revealed tbody tr:nth-child(2) { transition-delay: 0.38s; }
.pricing-table.is-staggered.is-revealed tbody tr:nth-child(3) { transition-delay: 0.56s; }

/* ---------- Testimonials ---------- */

.testimonials {
  list-style: none;
  margin: 0;
  padding: 0;
}
.testimonials li {
  margin-bottom: var(--space-5);
}
.testimonials li:last-child { margin-bottom: 0; }

.testimonials blockquote {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(20px, 4.4vw, 24px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
}
/* quote mark sits in normal flow above the text — no absolute positioning,
   so nothing needs masking behind it whatever the section background is */
.testimonials blockquote::before {
  content: "\201C";
  display: block;
  font-size: 52px;
  line-height: 0.7;
  height: 34px;
  color: var(--accent);
  opacity: 0.55;
}
.testimonials .attrib {
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: var(--space-2) 0 0;
}

/* ---------- Form ---------- */

.enquiry-form { margin-top: var(--space-3); }
.field {
  margin-bottom: var(--space-3);
  border: none;
  padding: 0;
  min-width: 0;
}
.field-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.field-row .field { flex: 1 1 180px; }

.field label,
.field legend {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
  padding: 0;
}
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  border: 1px solid var(--sand);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: #fff;
}
.field-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  min-height: 1.4em;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 4px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 13px 25px;
}
.btn--ghost:hover {
  background: rgba(47, 93, 78, 0.08);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero-note {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-2);
  border-left: 2px solid var(--accent);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34ch;
}

/* ---------- Placeholders (draft flags, removed at launch) ---------- */

.placeholder {
  background: rgba(196, 182, 155, 0.28);
  outline: 1px dashed var(--sand);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--sand);
  padding: var(--space-5) 0 var(--space-6);
  color: var(--ink-faint);
  font-size: 15px;
  background: var(--paper);
}
.site-footer .wrap { max-width: 1080px; }
.site-footer p { margin: 4px 0; }

/* ---------- Scroll reveal (progressive enhancement) ---------- */

/* The section fades as a whole; the heading and body then rise in sequence,
   which reads more deliberately than moving the whole block at once. */
.reveal { transition: opacity 0.5s ease; }
.reveal.is-hidden { opacity: 0; }

.reveal .section-grid > h2,
.reveal .section-body {
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-hidden .section-grid > h2,
.reveal.is-hidden .section-body {
  opacity: 0;
  transform: translateY(40px);
}
.reveal .section-body { transition-delay: 0.14s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
  .reveal.is-hidden,
  .reveal.is-hidden .section-grid > h2,
  .reveal.is-hidden .section-body { opacity: 1; transform: none; }
  .pricing-table.is-staggered tbody tr { opacity: 1; transform: none; }
}
