/* ============================================================
   The Learning Engine – shared design system
   Version 3 build, September 2026
   Specification: Website – The Learning Engine, Version 3, section 1
   ============================================================ */

/* ---------- 1.2 Color, light mode ---------- */
:root {
  --ground:       #f8f5f0;   /* page background, off-white */
  --surface:      #ede9e2;   /* cream: alternating grounds and tiles */
  --deep:         #115740;   /* hunter green: headings, reversed grounds */
  --deep-dark:    #0a3d28;   /* footer ground */
  --ink:          #1a1814;   /* body text */
  --link:         #1a6b4a;   /* inline links */
  --accent:       #c8a96e;   /* gold: rules, borders, numerals, button edges */
  --accent-light: #e8d5b0;   /* gold-light: headings on green grounds */

  --text:         var(--ink);
  --heading:      var(--deep);
  --reversed:     var(--deep);           /* reversed section ground */
  --reversed-border: transparent;        /* hairline only needed in dark mode */
  --tile:         var(--surface);
  --rule:         rgba(200,169,110,0.35);
  --hairline:     rgba(200,169,110,0.2);
  --soft-link:    rgba(26,107,74,0.9);   /* softened link, Guide section; 0.8 falls under AA, 0.9 clears */

  --btn-text:     var(--ground);

  --container:    min(1120px, 92vw);
  --measure:      65ch;
  --section:      clamp(4rem, 8vw, 6.5rem);
}

/* ---------- 1.3 Color, dark mode ---------- */
html.dark {
  --ground:       #0c1a14;
  --surface:      #12291f;
  --raised:       #0a3d28;
  --ink:          #ede9e2;
  --link:         #c8a96e;
  --accent:       #c8a96e;
  --accent-light: #e8d5b0;

  --text:         var(--ink);
  --heading:      #ede9e2;               /* cream, never gold */
  --reversed:     var(--raised);
  --reversed-border: rgba(200,169,110,0.3);
  --tile:         var(--surface);
  --rule:         rgba(200,169,110,0.35);
  --hairline:     rgba(200,169,110,0.2);
  --soft-link:    rgba(200,169,110,0.8);

  --btn-text:     #ede9e2;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;              /* 17px */
  line-height: 1.6;                  /* 1.1 body */
  color: var(--text);
  background: var(--ground);
  transition: background 0.3s, color 0.3s;
  min-height: 100vh; display: flex; flex-direction: column;   /* short pages: footer stays at the bottom of the window */
}
.site-footer { margin-top: auto; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
em { font-style: italic; }
strong { font-weight: 500; }
p { max-width: var(--measure); }
p + p, ul + p, ol + p, .table-wrap + p, blockquote + p { margin-top: 1.1em; }
p + ul, p + ol { margin-top: 0.6em; }
ul, ol { max-width: var(--measure); padding-left: 1.3em; }
li + li { margin-top: 0.35em; }

h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  line-height: 1.05;                 /* 1.1: at 1.0 the descenders on G and J clip */
  color: var(--heading);
  transition: color 0.3s;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.01em; margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 1.4rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.8rem; }
h1 em, h2 em, h3 em { font-style: italic; color: inherit; }   /* H1 rule: one color across the line */

.container { width: var(--container); margin-inline: auto; }
.prose { max-width: var(--measure); }
.container.prose { max-width: none; }           /* keep the container's left edge; limit the children instead */
.container.prose > *, .container.prose .vignette > * { max-width: var(--measure); }
.lead { font-size: 1.25rem; line-height: 1.55; }               /* one step larger than body */

/* Reading column: long-prose pages (Students, essays). 80 characters at 19px, centered. */
.container.reading { max-width: 80ch; font-size: 1.1875rem; line-height: 1.6; margin-inline: auto; }
.container.reading > *, .container.reading .vignette > *, .container.reading .essay-content > * { max-width: none; }
.container.reading p, .container.reading ul, .container.reading ol { max-width: none; }

section { padding-block: var(--section); transition: background 0.3s; }
.ground   { background: var(--ground); }
.surface  { background: var(--surface); }
.reversed {
  background: var(--reversed);
  color: #ede9e2;
  border-top: 1px solid var(--reversed-border);
  border-bottom: 1px solid var(--reversed-border);
}
.reversed h1, .reversed h2, .reversed h3 { color: var(--accent-light); }
.reversed a { color: var(--accent-light); }   /* gold on #115740 falls under AA; gold-light clears */
.reversed a:hover { color: var(--accent); }

hr.rule { border: none; border-top: 1px solid var(--rule); margin-block: 2.5rem; }

/* ---------- 1.6 Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  border: 1.5px solid var(--accent);
  background: var(--deep);
  color: var(--btn-text);
  cursor: pointer;
  transition: background 0.22s, color 0.22s, border-color 0.22s;
}
.btn:hover, .btn:focus-visible { background: var(--accent); color: var(--deep-dark); border-color: var(--accent); }
.btn-small { padding: 0.55rem 1.15rem; font-size: 0.85rem; }

/* ---------- 2.1 Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--ground);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.3s, border-color 0.3s;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand, .nav-links a, .nav-sep {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand { color: var(--deep); opacity: 0.8; flex-shrink: 0; transition: opacity 0.2s, color 0.3s; }
.brand:hover { opacity: 1; color: var(--deep); }
html.dark .brand { color: #ede9e2; }
html.dark .brand:hover { color: #ede9e2; }
.header-right { display: flex; align-items: center; gap: 0.25rem; }
.nav-links { display: flex; align-items: center; list-style: none; padding: 0; margin: 0; max-width: none; }
.nav-links li { display: flex; align-items: center; margin: 0; }
.nav-links a { color: var(--deep); padding: 0.3rem 0.7rem; transition: color 0.2s; }
html.dark .nav-links a { color: #ede9e2; }
.nav-links a:hover, .nav-links a.active,
html.dark .nav-links a:hover, html.dark .nav-links a.active { color: var(--accent); }
.nav-sep { color: var(--accent); opacity: 0.8; pointer-events: none; }
.header-cta { margin-left: 0.9rem; }
.theme-toggle {
  background: none; border: none; cursor: pointer;
  padding: 0.4rem 0.5rem; margin-left: 0.4rem;
  color: var(--deep); opacity: 0.55;
  display: flex; align-items: center;
  transition: opacity 0.2s, color 0.3s;
}
html.dark .theme-toggle { color: #ede9e2; opacity: 0.7; }
.theme-toggle:hover { opacity: 1; }
.theme-toggle svg { width: 17px; height: 17px; }
#icon-sun { display: none; }
html.dark #icon-sun { display: block; }
html.dark #icon-moon { display: none; }

/* Mobile menu */
.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; margin-left: 0.4rem; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--deep); transition: background 0.2s; }
html.dark .menu-toggle span { background: #ede9e2; }
.menu-toggle:hover span { background: var(--accent); }
.mobile-backdrop { display: none; position: fixed; inset: 0; z-index: 150; }
.mobile-backdrop.open { display: block; }
.mobile-menu {
  display: none; position: fixed; top: 64px; right: 0; z-index: 160; width: 240px;
  background: var(--ground);
  border-left: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  padding: 0.75rem 0;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 0.65rem 1.4rem;
  font-family: Georgia, 'Times New Roman', serif; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--deep); text-decoration: none;
}
html.dark .mobile-menu a { color: #ede9e2; }
.mobile-menu a:hover, .mobile-menu a.active { color: var(--accent); }
.mobile-menu .btn { margin: 0.75rem 1.4rem 0.4rem; display: block; text-align: center; color: var(--btn-text); }
.mobile-menu .btn:hover { color: var(--deep-dark); }
@media (max-width: 760px) {
  .nav-links, .header-cta { display: none; }
  .menu-toggle { display: flex; }
}

/* ---------- 2.2 Footer ---------- */
.site-footer {
  background: #0a3d28;               /* same ground in both modes */
  color: #ede9e2;
  padding-block: 2.25rem 1.5rem;
  border-top: 1px solid rgba(200,169,110,0.3);
}
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: var(--accent-light); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem 3rem; align-items: center; }
.footer-subscribe p { color: #ede9e2; font-size: 0.95rem; max-width: 42ch; }
.footer-links { justify-self: end; line-height: 1; }   /* one row: links level with the form */
.footer-links ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0; max-width: none; line-height: 1; }
.footer-links li { margin: 0; }
.footer-links li + li::before { content: '·'; color: var(--accent); padding-inline: 0.8rem; }
.footer-links a { font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; letter-spacing: 0.06em; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-copy { max-width: none; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid rgba(200,169,110,0.2); font-size: 0.85rem; color: rgba(237,233,226,0.7); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } .footer-links { justify-self: start; } }

/* ---------- Kit subscribe form – placeholder container (2.2) ---------- */
.kit-form {
  display: flex; gap: 0.5rem; flex-wrap: wrap; max-width: 520px;
}
.footer-subscribe .kit-form + p { margin-top: 0.9rem; }
.kit-form input[type="email"] {
  flex: 1 1 200px; min-width: 0;
  padding: 0.7rem 0.9rem;
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.95rem;
  color: var(--ink); background: var(--ground);
  border: 1px solid var(--accent);
}
html.dark .kit-form input[type="email"] { color: #ede9e2; background: #0c1a14; }
.kit-form .btn { flex: 0 0 auto; }

/* ---------- Page close: both calls to action (4.8, 8, 9) ---------- */
.close-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 3rem 4rem; align-items: start; }
.close-grid p { color: inherit; }
@media (max-width: 760px) { .close-grid { grid-template-columns: 1fr; } }

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

/* ---------- Inner pages: Students, Educators, Writing, About (sections 6 to 9) ---------- */
.page-top { padding-block: clamp(3rem, 7vw, 5.5rem) 2.25rem; }
.page-top h1 { margin-bottom: 0.9rem; }
.page-top .subhead { font-size: 1.1875rem; color: var(--text); }
.page-top .subhead-title { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.15; color: var(--heading); margin-top: -0.2rem; }   /* About: the founder line as a second title line */
.page-body { padding-block: 0.5rem var(--section); }
.page-body h2 { margin-top: 2.6rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.8rem; }
.actions-bottom { margin-top: 2.8rem; }
.pdf-link { font-size: 0.95rem; }
.vignette p { font-size: 1.3125rem; line-height: 1.55; }
.vignette p + p { margin-top: 1em; }

.table-wrap { overflow-x: auto; margin-block: 1.8rem; -webkit-overflow-scrolling: touch; }
table.lessons { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 1rem; }
table.lessons th, table.lessons td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--hairline); }
table.lessons thead th { background: var(--surface); font-family: Georgia, 'Times New Roman', serif; font-weight: normal; color: var(--heading); border-bottom: 1px solid var(--accent); }
html.dark table.lessons thead th { background: var(--surface); }

.proof { padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.proof-rating { font-size: 1.25rem; margin-bottom: 1.4rem; color: var(--heading); font-family: Georgia, 'Times New Roman', serif; }
.reviews blockquote + blockquote { margin-top: 1.4rem; }
.reviews blockquote p { font-size: 1rem; }
.reviews blockquote footer { margin-top: 0.4rem; font-size: 0.9rem; color: var(--text); opacity: 0.8; }
.practical { margin-top: 2rem; padding: 1.3rem 1.5rem; background: var(--surface); border-left: 3px solid var(--accent); }
.practical-line { font-family: Georgia, 'Times New Roman', serif; color: var(--heading); margin-bottom: 0.6rem; }

.essay-list { list-style: none; padding: 0; }
.essay-entry + .essay-entry { margin-top: 2.4rem; padding-top: 2.4rem; border-top: 1px solid var(--hairline); }
.essay-entry a { text-decoration: none; }
.essay-entry .essay-title { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-bottom: 0.7rem; }
.essay-entry a:hover .essay-title { color: var(--accent); }
.essay-date { margin-top: 0.5rem; font-size: 0.9rem; opacity: 0.8; }
.archive-link { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--accent); }

.about-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-photo { width: 100%; height: auto; margin-top: 0.3rem; }   /* aligns the photo's top with the cap height of the first text line */
.credentials { margin-top: 1.4rem; }
.credential { display: flex; flex-direction: column; font-size: 0.9rem; }
.credential + .credential { margin-top: 0.8rem; }
.credential-degree { font-family: Georgia, 'Times New Roman', serif; color: var(--heading); }
.credential-inst { opacity: 0.85; }
.about-text ul { margin-block: 0.6em; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-photo { max-width: 320px; } }

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(4rem, 10vw, 8rem); min-height: 50vh; }
.notfound-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
