/* =========================================================
   INFINITE NL — site styles (shared by every page)
   Change a colour or font here and it updates all pages.
   ========================================================= */

:root {
  /* Brand palette, sampled from the launch and STEM posts */
  --espresso: #251C17;      /* dark panels, logo, headlines */
  --cream:    #F1ECE6;      /* page background */
  --ink:      #221A15;      /* headline text on cream */
  --taupe:    #5A4A3F;      /* italic second lines */
  --body:     #5C5247;      /* running text on cream */
  --label:    #7A7166;      /* small caps labels */
  --hairline: #DDD6C8;      /* rules and frames on cream */
  --sand:     #D8CCBE;      /* italic accent on dark */
  --dim:      #A99D91;      /* labels on dark */
  --night-line: #3E332C;    /* rules on dark */

  /* Roles (switch in dark mode) */
  --paper: var(--cream);
  --on-paper: var(--ink);
  --on-paper-soft: var(--body);
  --on-paper-accent: var(--taupe);
  --on-paper-label: var(--label);
  --rule: var(--hairline);
  --night: var(--espresso);
  --on-night: var(--cream);

  --serif-display: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  --serif-text: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);

  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1410;
    --on-paper: #F1ECE6;
    --on-paper-soft: #CFC5BA;
    --on-paper-accent: #D8CCBE;
    --on-paper-label: #A99D91;
    --rule: #3A2F28;
    --night: #2A201A;
    --on-night: #F1ECE6;
  }
}
:root[data-theme="dark"] {
  --paper: #1B1410; --on-paper: #F1ECE6; --on-paper-soft: #CFC5BA;
  --on-paper-accent: #D8CCBE; --on-paper-label: #A99D91; --rule: #3A2F28;
  --night: #2A201A; --on-night: #F1ECE6;
}

*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--on-paper-soft);
  font-family: var(--serif-text);
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga", "kern";
}
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Small caps labels (brand device from the posts) ---------- */
.label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--on-paper-label);
  margin: 0;
}
.night .label { color: var(--dim); }

/* ---------- Header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--paper);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 4.5rem; gap: 1.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.75rem;
  text-decoration: none; color: var(--on-paper);
}
.brand svg { width: 44px; height: auto; fill: currentColor; }
.brand span {
  font-family: var(--sans); font-weight: 500; font-size: 0.875rem;
  letter-spacing: 0.3em; text-transform: uppercase;
}
.nav ul { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); list-style: none; margin: 0; padding: 0; }
.nav a {
  font-family: var(--sans); font-size: 0.8125rem; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none; color: var(--on-paper-soft);
  padding: 0.4rem 0; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--on-paper); border-bottom-color: currentColor; }
.nav a[aria-current="page"] { color: var(--on-paper); border-bottom-color: currentColor; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); color: var(--on-paper);
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.55rem 0.9rem; border-radius: 999px; cursor: pointer;
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav { position: absolute; inset: 100% 0 auto 0; background: var(--paper);
         border-bottom: 1px solid var(--rule); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1.25rem; }
  .nav a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
}

/* ---------- Buttons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 999px;
  padding: 0.95rem 1.7rem; text-decoration: none; color: var(--on-paper);
  background: transparent; transition: background-color .2s, color .2s;
}
a.pill:hover { background: var(--on-paper); color: var(--paper); }
.pill.static { cursor: default; }
.text-link {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.26em; text-transform: uppercase;
  text-decoration: none; color: var(--on-paper); border-bottom: 1px solid var(--rule); padding-bottom: 0.3rem;
}
.text-link:hover { border-bottom-color: currentColor; }

/* ---------- Headlines ---------- */
.display, .h2, .h3 {
  font-family: var(--serif-display); font-weight: 500; color: var(--on-paper);
  margin: 0; letter-spacing: -0.01em; line-height: 1.02;
}
.display em, .h2 em, .h3 em { font-style: italic; color: var(--on-paper-accent); }
.night .h2, .night .h3, .night .display { color: var(--on-night); }
.night .h2 em, .night .h3 em { color: var(--sand); }
.display { font-size: clamp(3.4rem, 10vw, 8rem); font-weight: 400; }
.h2 { font-size: clamp(2.6rem, 6vw, 4.75rem); font-weight: 400; }
.h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-style: italic; }
.lede {
  font-family: var(--serif-display); font-weight: 500;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.35;
  color: var(--on-paper-soft); max-width: 34ch; margin: 0;
}
.night .lede { color: #E7DED4; }
p { max-width: 62ch; }

/* ---------- Section rhythm ---------- */
.section { padding: clamp(5rem, 11vw, 9rem) 0; }
.night { background: var(--night); color: #D9CFC4; }
.section-head { display: grid; gap: 1.5rem; margin-bottom: clamp(3rem, 6vw, 4.5rem); }

/* ---------- Hero: framed panel like the posts ---------- */
.hero { padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter) 0; }
.hero-frame {
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto;
  border: 1px solid var(--rule);
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
  display: grid; gap: clamp(2rem, 4vw, 3rem);
}
.hero-mark { width: clamp(84px, 9vw, 120px); height: auto; fill: var(--on-paper); }
.hero .display { max-width: 14ch; }
.hero .display .line2 { display: block; font-style: italic; color: var(--on-paper-accent); }
.hero-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem 2rem; margin-top: clamp(1.5rem, 5vw, 4rem);
  padding-top: 1.75rem; border-top: 1px solid var(--rule);
}
.hero-foot .label { line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; }

/* ---------- STEM rows ---------- */
.stem { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--night-line); }
.stem li {
  display: grid; grid-template-columns: clamp(4rem, 10vw, 8rem) 1fr; align-items: center;
  gap: 1rem; padding: clamp(1.25rem, 2.5vw, 1.9rem) 0; border-bottom: 1px solid var(--night-line);
}
.stem .letter {
  font-family: var(--serif-display); font-style: italic; font-weight: 400;
  font-size: clamp(3rem, 7vw, 5rem); line-height: 1; color: var(--sand);
}
.stem h3 {
  font-family: var(--sans); font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--on-night); margin: 0 0 0.35rem;
}
.stem p { margin: 0; font-style: italic; font-size: 1.2rem; color: #E7DED4; }
.stem-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 1rem; margin-top: 2.5rem;
}
.stem-foot p:not(.label) { font-family: var(--serif-display); font-size: 1.5rem; color: var(--on-night); margin: 0; }
.stem-foot em { color: var(--sand); }

/* ---------- Sector tracks ---------- */
.tracks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--on-paper); }
.track { padding: 1.75rem 1.5rem 2rem 0; border-right: 1px solid var(--rule); }
.track + .track { padding-left: 1.5rem; }
.track:last-child { border-right: 0; }
.track .label { margin-bottom: 1.5rem; }
.track h3 {
  margin-top: 0;
  font-family: var(--serif-display); font-weight: 500; font-size: 1.75rem; line-height: 1.1;
  color: var(--on-paper); margin: 0 0 1rem;
}
.track p { margin: 0; font-size: 1.0625rem; }
@media (max-width: 960px) {
  .tracks { grid-template-columns: 1fr 1fr; }
  .track:nth-child(2) { border-right: 0; }
  .track:nth-child(3) { padding-left: 0; }
  .track:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .tracks { grid-template-columns: 1fr; }
  .track, .track + .track { padding: 1.75rem 0; border-right: 0; }
  .track + .track { border-top: 1px solid var(--rule); }
}

/* ---------- Objectives: split panels (signature element) ---------- */
.objectives { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.objective { display: grid; grid-template-rows: auto 1fr; background: var(--paper); }
.objective .top {
  background: var(--night); color: var(--on-night);
  padding: clamp(2rem, 4vw, 3rem) 1.75rem 1.75rem; min-height: 15rem;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.75rem;
}
.objective .top .label { color: var(--dim); }
.objective .word {
  font-family: var(--serif-display); font-weight: 400; font-size: clamp(2.75rem, 4.2vw, 4.25rem);
  line-height: 0.9; margin: 0; color: var(--on-night);
}
.objective .bottom { padding: 1.75rem; display: grid; gap: 1rem; align-content: start; }
.objective .tag {
  font-family: var(--serif-display); font-style: italic; font-size: 1.5rem; line-height: 1.2;
  color: var(--on-paper); margin: 0;
}
.objective .bottom p:last-child { margin: 0; font-size: 1.0625rem; }
@media (max-width: 960px) { .objectives { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .objectives { grid-template-columns: 1fr; }
  .objective .top { min-height: 11rem; }
}

/* ---------- Why STEM ---------- */
.why { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.why-list { margin: 0; padding: 0; list-style: none; }
.why-list li { padding: 2rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.6rem; }
.why-list li:first-child { padding-top: 0.25rem; }
.why-list li:last-child { border-bottom: 0; }
.why-list p { margin: 0; }
@media (max-width: 860px) { .why { grid-template-columns: 1fr; } }

/* ---------- Ecosystem ring ---------- */
.eco { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.eco-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2rem 4rem; align-items: end; }
.eco-head p { margin: 0; }
.ring { width: 100%; height: auto; display: block; }
.ring ellipse { fill: none; stroke: var(--on-paper-label); stroke-opacity: .45; stroke-width: 1; }
.ring text { font-family: var(--serif-display); font-style: italic; font-size: 27px; fill: var(--on-paper);
             stroke: var(--paper); stroke-width: 14px; paint-order: stroke; stroke-linejoin: round; }
.ring .core { font-family: var(--sans); font-style: normal; font-size: 13px; letter-spacing: 0.3em; fill: var(--on-paper-label); stroke: none; }
.ring .core-mark { fill: var(--on-paper-soft); }
.roles { display: none; }
@media (max-width: 640px) {
  .eco-head { grid-template-columns: 1fr; }
  .ring { display: none; }
  .roles { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0; margin: 0; }
  .roles li { font-family: var(--serif-display); font-style: italic; font-size: 1.3rem; color: var(--on-paper);
              border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem 1rem; }
}

/* ---------- Membership tiers ---------- */
.tiers { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--night-line); }
.tier { padding: 2.25rem 2rem 0.5rem 0; display: grid; gap: 1rem; align-content: start; }
.tier + .tier { padding-left: 2rem; border-left: 1px solid var(--night-line); }
.tier p { margin: 0; color: #D9CFC4; }
.tier .meta { font-family: var(--sans); font-size: 0.8125rem; letter-spacing: 0.08em; color: var(--dim); }
@media (max-width: 700px) {
  .tiers { grid-template-columns: 1fr; }
  .tier + .tier { padding-left: 0; border-left: 0; border-top: 1px solid var(--night-line); margin-top: 2rem; }
}

/* ---------- Closing ---------- */
.closing .hero-frame { text-align: left; }
.closing .display { font-size: clamp(3rem, 8vw, 6.5rem); max-width: 12ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--dim); padding: 4rem 0 3rem; margin-top: clamp(4rem, 9vw, 7rem); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; border-bottom: 1px solid var(--night-line); }
.footer-brand { display: grid; gap: 1.25rem; align-content: start; }
.footer-brand svg { width: 70px; fill: var(--on-night); }
.footer-brand .name { font-family: var(--serif-display); font-size: 1.6rem; letter-spacing: 0.35em; color: var(--on-night); margin: 0; }
.footer-brand p { margin: 0; max-width: 36ch; }
.site-footer h2 { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--on-night); margin: 0 0 1.1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.site-footer a { color: #D9CFC4; text-decoration: none; }
.site-footer a:hover { color: var(--on-night); text-decoration: underline; text-underline-offset: 4px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.75rem;
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Stub pages ---------- */
.stub .hero-frame { min-height: 55vh; align-content: center; }

/* ---------- Load moment: one orchestrated reveal on the hero ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .reveal { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero .reveal:nth-child(2) { animation-delay: .12s; }
  .hero .reveal:nth-child(3) { animation-delay: .28s; }
  .hero .reveal:nth-child(4) { animation-delay: .44s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
