/* ==========================================================================
   Education Changes Lives — stylesheet
   A quiet, readable, editorial theme. No external dependencies.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Paper & ink */
  --paper:          #fbfaf6;
  --paper-raised:   #ffffff;
  --paper-sunken:   #f2efe7;
  --ink:            #1b2129;
  --ink-soft:       #4a545f;
  --ink-faint:      #7b8590;
  --rule:           #e2ddd1;
  --rule-strong:    #cdc6b6;

  /* Accents */
  --accent:         #a8451c;
  --accent-deep:    #7d3214;
  --accent-wash:    #f6e9e2;
  --teal:           #2c5d59;
  --teal-wash:      #e4eeec;

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Metrics */
  --measure:   36rem;   /* comfortable reading column */
  --wide:      72rem;   /* page container */
  --radius:    4px;
  --radius-lg: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #14171b;
    --paper-raised: #1c2026;
    --paper-sunken: #101317;
    --ink:          #e8e6e0;
    --ink-soft:     #b0b5bc;
    --ink-faint:    #7f868f;
    --rule:         #2b3138;
    --rule-strong:  #3b434c;

    --accent:       #e08a63;
    --accent-deep:  #f0a684;
    --accent-wash:  #2a1f1a;
    --teal:         #7fb8b1;
    --teal-wash:    #17251f;
  }
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*,
*::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(--serif);
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s var(--ease);
}
a:hover { color: var(--accent-deep); }

h1, h2, h3, h4 {
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.24rem; }
h4 { font-size: 1.06rem; }

p { margin: 0 0 1.15em; }

ul, ol { margin: 0 0 1.3em; padding-left: 1.3em; }
li { margin-bottom: 0.5em; }

blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}
blockquote p:last-child { margin-bottom: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper-sunken);
  padding: 0.12em 0.36em;
  border-radius: 3px;
}

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

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

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.wrap--narrow { max-width: 46rem; }

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

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.section { padding: 4.5rem 0; }
.section--sunken { background: var(--paper-sunken); }
.section-head { margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-soft); max-width: 40rem; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.brand__text {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.brand__text span {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2px;
}

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

.nav a {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--paper-sunken); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.4rem 0.6rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.5rem 1rem;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.7rem 0.25rem; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: 0; }
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--accent-wash), transparent 65%),
    radial-gradient(50rem 26rem at 92% 8%, var(--teal-wash), transparent 60%);
}

.hero h1 { max-width: 20ch; margin-bottom: 1rem; }
.hero .lede { max-width: 46ch; font-size: 1.28rem; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.hero__stats dt {
  font-family: var(--sans);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -0.02em;
}
.hero__stats dd {
  margin: 0.3rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease),
              border-color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-deep); color: #fff; }

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

@media (prefers-color-scheme: dark) {
  .btn--primary { color: #1a1207; }
  .btn--primary:hover { color: #1a1207; }
}

/* --------------------------------------------------------------------------
   7. Article cards
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
              box-shadow 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--rule-strong);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.5);
}

.card__figure {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-sunken);
}
.card__figure svg { width: 100%; height: 100%; }

.card__body { padding: 1.35rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }

.card__meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.7rem;
}
.card__meta .tag { color: var(--teal); font-weight: 700; }
.card__meta .dot { color: var(--rule-strong); }

.card__title { font-size: 1.18rem; margin-bottom: 0.5rem; line-height: 1.3; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent); }

.card__excerpt {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 1.1rem;
}

.card__more {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.card__more::after { content: " \2192"; }

/* Featured card — spans two columns on wide screens */
.card--feature { grid-column: 1 / -1; }
@media (min-width: 62rem) {
  .card--feature { flex-direction: row; }
  .card--feature .card__figure {
    flex: 0 0 44%;
    aspect-ratio: auto;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
  .card--feature .card__body { padding: 2.5rem 2.5rem 2.5rem; justify-content: center; }
  .card--feature .card__title { font-size: 1.75rem; }
  .card--feature .card__excerpt { font-size: 1.02rem; }
}

/* --------------------------------------------------------------------------
   8. Article page
   -------------------------------------------------------------------------- */

.article-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-sunken);
}
.article-header .wrap { max-width: 46rem; }
.article-header h1 { margin-bottom: 1rem; }
.article-header .lede { margin-bottom: 1.5rem; }

.article-meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.article-meta .tag {
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.article-meta .dot { color: var(--rule-strong); }

.breadcrumb {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

.prose {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 3rem 0 2rem;
}
.prose > h2 {
  margin-top: 2.6rem;
  padding-top: 0.2rem;
  font-size: 1.55rem;
}
.prose > h3 { margin-top: 2rem; }
.prose > p:first-of-type::first-letter {
  float: left;
  font-size: 3.4rem;
  line-height: 0.86;
  padding: 0.08em 0.09em 0 0;
  color: var(--accent);
  font-weight: 600;
}
.prose img { border-radius: var(--radius-lg); margin: 2rem 0; }
.prose figure { margin: 2.2rem 0; }
.prose figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 0.6rem;
  text-align: center;
}

/* Pull quote */
.pull {
  margin: 2.6rem 0;
  padding: 1.6rem 0;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  font-size: 1.28rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
}
.pull p:last-child { margin-bottom: 0; }
.pull cite {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-style: normal;
  color: var(--ink-faint);
}

/* Callout box */
.callout {
  margin: 2.4rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--teal-wash);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.98rem;
}
.callout h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.6rem;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

/* Key-points list */
.keypoints {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}
.keypoints li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.85rem;
}
.keypoints li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Data table */
.table-scroll { overflow-x: auto; margin: 2rem 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--sans);
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--rule-strong);
}
tbody tr:hover { background: var(--paper-sunken); }

/* Article footer / next-up */
.article-foot {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--rule);
}
.article-foot h3 { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }

.next-list { list-style: none; padding: 0; margin: 0; }
.next-list li { margin-bottom: 0.6rem; }
.next-list a { font-weight: 600; text-decoration: none; }
.next-list a:hover { text-decoration: underline; }
.next-list span { display: block; font-size: 0.88rem; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   9. Misc components
   -------------------------------------------------------------------------- */

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.chip {
  font-family: var(--sans);
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--paper-raised);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2rem;
}

.form-field { margin-bottom: 1.1rem; }
.form-field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.form-field textarea { min-height: 8rem; resize: vertical; }
.form-note { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-sunken);
  padding: 3.5rem 0 2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(auto-fit, minmax(9rem, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.site-footer h4 {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { color: var(--ink-soft); max-width: 30rem; }

.site-footer__base {
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 0.82rem;
}
.site-footer__base ul { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer__base li { margin: 0; }

/* --------------------------------------------------------------------------
   11. Utilities & reduced motion
   -------------------------------------------------------------------------- */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-soft); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .article-foot, .hero__actions { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .prose { max-width: none; }
}
