/* ==========================================================================
   Easy STEM School — design system
   Restrained and editorial: warm paper, one blue accent, one brass second.
   ========================================================================== */

:root {
  /* Ink & paper */
  --ink:        #16191f;
  --ink-soft:   #3b424b;
  --muted:      #6b727c;
  --faint:      #9aa1aa;
  --paper:      #fcfbf8;
  --paper-alt:  #f2efe8;
  --rule:       #e2ded5;
  --rule-soft:  #ece9e1;

  /* Primary accent: deep petrol blue */
  --accent:     #1d4a68;
  --accent-dim: #2f6f96;
  --accent-wash: #eaf0f3;

  /* Secondary accent: muted brass, for numerals and small marks only */
  --brass:      #9a7439;

  /* Dark band — navy rather than black */
  --band-bg:    #142430;

  /* Type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Rhythm */
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --section: clamp(4.5rem, 9vw, 8.5rem);
  --measure: 62ch;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent); text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.011em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--ink); color: var(--paper); }

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

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

.wrap--narrow { max-width: 820px; }

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section--alt { background: var(--paper-alt); }
.section--ruled { border-top: 1px solid var(--rule); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Type scale
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
/* A short accent dash carries the colour consistently across every label. */
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  flex: none;
  background: var(--accent);
}

.display {
  font-size: clamp(2.5rem, 6vw, 4.125rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.h2 {
  font-size: clamp(1.875rem, 3.4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
}

.h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  line-height: 1.25;
}

.h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.body-muted { color: var(--muted); }

.small {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--ghost:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--light {
  background: transparent;
  color: var(--paper);
  border-color: rgba(252, 251, 249, 0.35);
}
.btn--light:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}
.link-arrow svg { width: 14px; height: 14px; flex: none; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); gap: 0.7rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.5rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--ink);
}
.brand__mark {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
/* Greek sigma standing in for the E of Easy. */
.brand__sigma {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 1.7em;      /* the display mark — tune this one number */
  line-height: 0;         /* keeps the tall glyph from growing the header */
  vertical-align: -0.09em;
  margin-right: 0.06em;
}
.brand__sub {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav { display: flex; align-items: center; gap: 2.25rem; }

.nav__list {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] {
  color: var(--ink);
  border-color: var(--ink);
}

.nav__cta { font-size: 0.8125rem; padding: 0.65rem 1.25rem; }

/* Duplicate of the header CTA, revealed only inside the mobile menu. */
.nav__item-cta { display: none; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1px;
  background: var(--ink);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

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

.hero { padding-block: clamp(3.5rem, 8vw, 7rem) clamp(3.5rem, 7vw, 6rem); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero__title { margin-bottom: 1.75rem; }
.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__figure {
  position: relative;
  border: 1px solid var(--rule);
  padding: 10px;
  background: var(--paper);
}
.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  /* Muted rather than stripped — colour stays present but subdued. */
  filter: saturate(0.55) contrast(1.02);
}

.hero__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(20, 23, 28, 0.86);
  color: var(--paper);
  padding: 0.9rem 1.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}
.stats__item {
  padding: 1.75rem 1.75rem 0 0;
  border-right: 1px solid var(--rule);
}
.stats__item:last-child { border-right: 0; }
.stats__item:not(:first-child) { padding-left: 1.75rem; }
.stats__value {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  display: block;
  margin-bottom: 0.4rem;
}
.stats__label {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
  padding-bottom: 2.5rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--rule);
}
.section-head__aside {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 46ch;
  padding-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   Subject columns
   -------------------------------------------------------------------------- */

.subjects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.subject {
  padding: 0 clamp(1.25rem, 2.5vw, 2.25rem);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}
.subject:first-child { padding-left: 0; border-left: 0; }
.subject:last-child { padding-right: 0; }

.subject__num {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--brass);
  margin-bottom: 1.25rem;
}
.subject__title { margin-bottom: 0.9rem; }
.subject__text {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.75rem;
}
.subject__list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-top: 1px solid var(--rule-soft);
}
.subject__list li {
  font-size: 0.875rem;
  color: var(--ink-soft);
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.subject__foot { margin-top: auto; }

/* --------------------------------------------------------------------------
   Principles / approach
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.principles {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.principle {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}
.principle__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--brass);
  padding-top: 0.15rem;
}
.principle__title { margin-bottom: 0.5rem; }
.principle__text { color: var(--muted); font-size: 0.9375rem; }

/* --------------------------------------------------------------------------
   Coverage table (levels)
   -------------------------------------------------------------------------- */

.spec {
  border-top: 1px solid var(--rule);
}
/* The section header already supplies a rule — avoid a doubled line. */
.section-head + .spec { border-top: 0; }
.spec__row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 2.4fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.spec__key {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec__val {
  font-size: 1rem;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   People
   -------------------------------------------------------------------------- */

.people {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
}

.person {
  border-top: 1px solid var(--ink);
  padding-top: 1.75rem;
}
.person__portrait {
  margin: 0 0 1.75rem;
  border: 1px solid var(--rule);
  padding: 8px;
  background: var(--paper);
  max-width: 260px;
}
.person__portrait img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.55) contrast(1.02);
}
.person__role {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.person__name { margin-bottom: 0.35rem; }
.person__cred {
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.person__bio { color: var(--ink-soft); font-size: 0.9375rem; }
.person__bio p { margin-bottom: 1em; }

/* --------------------------------------------------------------------------
   Quote / pull
   -------------------------------------------------------------------------- */

.pull {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 30ch;
  margin: 0;
}
.pull__cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Dark call-to-action band
   -------------------------------------------------------------------------- */

.band {
  background: var(--band-bg);
  color: var(--paper);
}
.band h2, .band h3 { color: var(--paper); }
.band .eyebrow { color: rgba(252, 251, 249, 0.6); }
.band .eyebrow::before { background: var(--brass); }
.band p { color: rgba(252, 251, 249, 0.72); }

.band__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
}

/* --------------------------------------------------------------------------
   Page header (interior pages)
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.page-head__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
}

/* --------------------------------------------------------------------------
   Subject detail blocks (tutoring page)
   -------------------------------------------------------------------------- */

.detail {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.detail:last-of-type { border-bottom: 0; }

.detail__aside { position: sticky; top: 108px; }
.detail__figure {
  margin: 0 0 1.75rem;
  border: 1px solid var(--rule);
  padding: 8px;
}
.detail__figure img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
  filter: saturate(0.55) contrast(1.02);
}

.curriculum {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.curriculum li {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(0, 1.6fr);
  gap: clamp(0.75rem, 3vw, 2.5rem);
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.curriculum strong {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--ink);
}
.curriculum span {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.field { margin-bottom: 1.5rem; }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0.65rem 0;
  transition: border-color 0.2s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 120px; }
.field--invalid input,
.field--invalid textarea { border-bottom-color: #a13b3b; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 1.25rem;
}

.form-status {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  font-size: 0.9375rem;
  border-left: 2px solid var(--accent);
  background: var(--paper-alt);
}
.form-status[hidden] { display: none; }
.form-status--error { border-left-color: #a13b3b; }

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.detail-list > div {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.detail-list dt {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.detail-list dd {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--ink);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 5vw, 4.5rem) 2rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 3rem;
}
.site-footer h4 {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.7rem; }
.site-footer a { color: var(--ink-soft); font-size: 0.9375rem; }
.site-footer a:hover { color: var(--accent); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--faint);
}
.site-footer__bottom a { color: var(--faint); font-size: 0.8125rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero__grid,
  .split,
  .band__grid,
  .page-head__grid,
  .detail,
  .contact-grid,
  .people,
  .section-head { grid-template-columns: 1fr; }

  .section-head { align-items: start; }
  .detail__aside { position: static; }
  .hero__figure img { aspect-ratio: 16 / 10; }

  .subjects { grid-template-columns: 1fr; }
  .subject {
    padding: 2.25rem 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .subject:first-child { border-top: 0; padding-top: 0; }
  .subject:last-child { padding-bottom: 0; }

  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
  }
  .nav__list.is-open { display: flex; }
  .nav__link {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .nav__link[aria-current="page"] { border-color: var(--rule-soft); }
  .nav-toggle { display: flex; }
  .nav__cta { display: none; }
  .nav__item-cta { display: block; }
  .nav__item-cta .nav__link { color: var(--accent); font-weight: 500; border-bottom: 0; }
  .brand__sub { display: none; }
  .brand__mark { font-size: 1.125rem; }

  /* The scrim caption eats too much of a short image — set it below instead. */
  .hero__caption {
    position: static;
    background: transparent;
    color: var(--muted);
    padding: 0.9rem 0 0.1rem;
  }

  .stats { grid-template-columns: 1fr; }
  .stats__item {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 1.35rem 0;
  }
  .stats__item:not(:first-child) { padding-left: 0; }
  .stats__item:last-child { border-bottom: 0; }

  .spec__row,
  .curriculum li { grid-template-columns: 1fr; gap: 0.4rem; }
  .field-row { grid-template-columns: 1fr; }
  .principle { grid-template-columns: 1fr; gap: 0.5rem; }
  .principle__num { padding-top: 0; }
  .site-footer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
