/* ============================================================
   Tannen Centre for Future Systems (TCFS) — v2 "Safe Harbour"
   Goethe-complement inversion of the Mayor Wilson palette.
   Light-first: a luminous violet-white field, aubergine ink,
   quiet violet structure, harbour-azure signal.
   Mobile-first: base styles target small screens;
   min-width media queries scale up at 640px and 980px.
   ============================================================ */

:root {
  /* --- Goethe-complement tokens (mapping documented in README) --- */
  --tcfs-field: #f5f4f8;        /* luminous violet-white page field   ← Paper Cream  */
  --tcfs-ink: #241f2e;          /* deep aubergine-ink: text + dark surfaces ← Ink/Pine */
  --tcfs-ink-2: #221c2b;        /* deeper aubergine (band depth)              */
  --tcfs-violet: #7a6fa8;       /* quiet violet: dividers, subdued highlights ← Parchment Gold */
  --tcfs-violet-deep: #635a92;  /* violet for small text labels (AA on field) */
  --tcfs-azure: #2e7fa6;        /* signal azure: graphics, large elements   ← Signal Oxide */
  --tcfs-azure-deep: #246b8f;   /* azure for text links / CTA fills on light (AA) */
  --tcfs-azure-ink: #1d5a7a;    /* azure hover depth                          */
  --tcfs-azure-mist: #9cc8dc;   /* azure text on dark aubergine surfaces      */
  --tcfs-body: #443e50;         /* body text on light                         */
  --tcfs-muted: #6e6a7a;        /* secondary text on light                    */
  --tcfs-border: #e3e1ea;       /* hairline borders on light                  */
  --tcfs-white: #ffffff;
  --tcfs-ember: #df9268;        /* logo artwork only — never used in the page */

  --tcfs-serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --tcfs-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tcfs-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --page-x: clamp(20px, 5vw, 72px);
  --radius-card: 14px;
  --radius-panel: 12px;
  --shadow-soft: 0 24px 48px -16px rgba(36, 31, 46, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--tcfs-field);
  color: var(--tcfs-body);
  font-family: var(--tcfs-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--tcfs-azure-deep);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  color: var(--tcfs-ink);
  font-family: var(--tcfs-mono);
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  overflow: visible;
  clip: auto;
  background: var(--tcfs-white);
}

/* ---------- Header (light, calm) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 var(--page-x);
  background: rgba(245, 244, 248, 0.92);
  border-bottom: 1px solid rgba(122, 111, 168, 0.22);
  color: var(--tcfs-ink);
  backdrop-filter: blur(10px);
}

.site-header.is-scrolled {
  box-shadow: 0 12px 32px rgba(36, 31, 46, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-logo-img {
  display: block;
  width: auto;
  height: 36px;
}

.brand-logo-stacked {
  display: block;
  width: auto;
  max-width: 100%;
  height: 72px;
}

/* Mobile-first: the toggle is always available below the desktop
   breakpoint, at every width including <= 640px. */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(36, 31, 46, 0.28);
  border-radius: 8px;
  background: transparent;
  color: var(--tcfs-ink);
  font-family: var(--tcfs-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-toggle:hover {
  border-color: var(--tcfs-azure-deep);
  color: var(--tcfs-azure-deep);
}

.site-nav {
  position: absolute;
  top: 74px;
  right: 0;
  left: 0;
  display: grid;
  gap: 0;
  padding: 14px var(--page-x) 20px;
  transform: translateY(-8px);
  background: rgba(245, 244, 248, 0.98);
  border-bottom: 1px solid rgba(122, 111, 168, 0.22);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  color: var(--tcfs-ink);
  font-family: var(--tcfs-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.site-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.site-nav a {
  padding: 13px 0;
  border-bottom: 1px solid var(--tcfs-border);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--tcfs-azure-deep);
}

.site-nav .nav-parent {
  color: var(--tcfs-violet-deep);
  border-bottom: 0;
}

.site-nav .nav-parent::after {
  content: "↗";
  margin-left: 8px;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--tcfs-ink);
  font-family: var(--tcfs-serif);
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.06;
}

h2 {
  font-size: 28px;
  line-height: 1.14;
}

h3 {
  font-size: 22px;
  line-height: 1.2;
}

p {
  margin: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--tcfs-violet-deep);
  font-family: var(--tcfs-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.55;
  text-transform: uppercase;
}

.large-copy {
  max-width: 680px;
  margin-top: 20px;
  color: var(--tcfs-ink);
  font-size: 19px;
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-family: var(--tcfs-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.button-primary {
  background: var(--tcfs-azure-deep);
  color: var(--tcfs-white);
  border-color: var(--tcfs-azure-deep);
}

.button-primary:hover {
  background: var(--tcfs-azure-ink);
  border-color: var(--tcfs-azure-ink);
}

.button-ghost {
  color: var(--tcfs-ink);
  border-color: rgba(36, 31, 46, 0.35);
}

.button-ghost:hover {
  border-color: var(--tcfs-azure-deep);
  color: var(--tcfs-azure-deep);
}

/* Luminous azure CTA for the evening-beacon band. */
.button-azure {
  background: #2a7195; /* 5.4:1 with white label on aubergine */
  color: var(--tcfs-white);
  border-color: #2a7195;
}

.button-azure:hover {
  background: var(--tcfs-field);
  color: var(--tcfs-ink);
  border-color: var(--tcfs-field);
}

/* ---------- The path motif (beacon dots at section boundaries) ---------- */

.path-node {
  position: relative;
  z-index: 6;
  height: 0;
}

.path-node::before,
.path-node::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 34px;
  transform: translateX(-50%);
  background: rgba(122, 111, 168, 0.38);
}

.path-node::before {
  bottom: 6px;
}

.path-node::after {
  top: 6px;
}

.path-node span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--tcfs-violet);
  border-radius: 50%;
  background: var(--tcfs-field);
}

.path-node span::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--tcfs-azure);
}

/* ---------- Hero: the horizon ---------- */

.hero-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 88px var(--page-x) 0;
  text-align: center;
}

/* faint dawn contour lines, pushed into the violet-azure spectrum */
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/terrain/topography-white-plateau.jpg") center / cover no-repeat;
  filter: sepia(0.5) hue-rotate(195deg) saturate(1.1);
  opacity: 0.16;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
}

.hero-inner h1 {
  max-width: 24ch;
  text-wrap: balance;
  margin: 0 auto;
}

.hero-statement {
  max-width: 620px;
  margin: 26px auto 0;
  color: var(--tcfs-body);
  font-size: 17px;
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
  margin: 36px auto 0;
}

.hero-horizon {
  width: 100%;
  height: 150px;
  margin-top: 48px;
}

/* ---------- Definition strip (replaces the MW side panel) ---------- */

.definition-strip {
  max-width: 920px;
  margin: 0 auto;
  padding: 72px var(--page-x) 8px;
  text-align: center;
}

.definition-label {
  color: var(--tcfs-violet-deep);
  font-family: var(--tcfs-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.definition-strip h2 {
  margin-top: 14px;
  font-size: 30px;
}

.definition-lede {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--tcfs-muted);
  font-family: var(--tcfs-serif);
  font-size: 20px;
  line-height: 1.3;
}

.definition-list {
  display: grid;
  gap: 18px;
  margin: 34px 0 0;
  padding: 26px 0 0;
  list-style: none;
  border-top: 1px solid var(--tcfs-border);
}

.definition-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  text-align: left;
}

.definition-list span {
  color: var(--tcfs-azure-deep);
  font-family: var(--tcfs-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.definition-list p {
  color: var(--tcfs-body);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Sections (light default) ---------- */

.mission-section,
.functions-section,
.convening-section {
  padding: 84px var(--page-x);
}

.mission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.mission-body {
  max-width: 640px;
  margin-top: 22px;
  color: var(--tcfs-body);
  font-size: 15px;
  line-height: 1.65;
}

/* sanctuary card instead of MW's hard left-border note */
.field-note {
  max-width: 680px;
  padding: 30px;
  border: 1px solid var(--tcfs-border);
  border-radius: var(--radius-card);
  background: var(--tcfs-white);
  box-shadow: var(--shadow-soft);
}

.field-note p {
  color: var(--tcfs-body);
  font-size: 15px;
  line-height: 1.65;
}

.field-note p + p {
  margin-top: 18px;
}

.field-note .field-note-label {
  margin: 0 0 14px;
  color: var(--tcfs-violet-deep);
  font-family: var(--tcfs-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.55;
  text-transform: uppercase;
}

.field-note .field-note-accent {
  margin-top: 22px;
  color: var(--tcfs-ink);
  font-family: var(--tcfs-serif);
  font-size: 24px;
  line-height: 1.22;
}

/* ---------- Three functions: a centered timeline ---------- */

.functions-kicker {
  text-align: center;
}

.procession {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}

/* central rail — sits on the same 50% axis as the .path-node waypoints */
.procession::before {
  content: "";
  position: absolute;
  top: 52px;
  bottom: 52px;
  left: 50%;
  width: 1px;
  background: rgba(122, 111, 168, 0.35);
}

.procession article {
  position: relative;
  padding: 30px 0;
  text-align: center;
}

.proc-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 1px solid var(--tcfs-violet);
  border-radius: 50%;
  background: var(--tcfs-field);
  color: var(--tcfs-azure-deep);
  font-family: var(--tcfs-mono);
  font-size: 11px;
  font-weight: 700;
}

.procession h3 {
  margin-top: 16px;
}

.procession article p {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--tcfs-body);
  font-size: 15px;
  line-height: 1.62;
}

/* ---------- Bellewether: the evening beacon ---------- */

.project-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px var(--page-x);
  background: var(--tcfs-ink);
  color: rgba(245, 244, 248, 0.78);
  text-align: center;
}

.project-inner {
  max-width: 680px;
  margin: 0 auto;
}

.project-beacon {
  width: 72px;
  height: 72px;
  margin: 0 auto 30px;
}

.project-tag {
  margin: 0 0 16px;
  color: var(--tcfs-azure-mist);
  font-family: var(--tcfs-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-band h2 {
  color: var(--tcfs-field);
  font-size: 34px;
}

.project-copy {
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.62;
}

.project-note {
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid rgba(122, 111, 168, 0.4);
  border-radius: var(--radius-panel);
  color: rgba(245, 244, 248, 0.72);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.project-band .button {
  margin-top: 32px;
}

/* ---------- Convening ---------- */

.convening-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.convening-copy p {
  max-width: 680px;
  color: var(--tcfs-body);
  font-size: 15px;
  line-height: 1.65;
}

.convening-copy p + p {
  margin-top: 18px;
}

.convening-note {
  padding: 18px 22px;
  border: 1px solid var(--tcfs-border);
  border-radius: var(--radius-panel);
  background: var(--tcfs-white);
  color: var(--tcfs-muted) !important;
  font-size: 14px !important;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.convening-cta {
  margin-top: 22px;
  text-align: center;
}

/* ---------- Final CTA: quiet and open ---------- */

.final-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px var(--page-x) 110px;
  text-align: center;
}

/* dark terrain lifted into a pale dawn register */
.final-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/terrain/terrain-mountain-dark.jpg") center / cover no-repeat;
  filter: grayscale(0.5) sepia(0.55) hue-rotate(190deg) brightness(2.1) contrast(0.72) saturate(0.85);
  opacity: 0.14;
}

.final-cta-copy {
  max-width: 680px;
  margin: 0 auto;
}

.final-cta-copy p:not(.section-kicker) {
  max-width: 610px;
  margin: 22px auto 0;
  color: var(--tcfs-body);
}

.final-cta .button {
  margin-top: 36px;
}

/* ---------- Footer (aubergine, light logo) ---------- */

.site-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: center;
  justify-items: start;
  padding: 48px var(--page-x);
  background: var(--tcfs-ink);
  color: rgba(245, 244, 248, 0.72);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.footer-initiative a {
  color: var(--tcfs-azure-mist);
  text-decoration: none;
  border-bottom: 1px solid rgba(156, 200, 220, 0.4);
}

.footer-initiative a:hover {
  color: var(--tcfs-field);
  border-bottom-color: var(--tcfs-field);
}

.footer-copy {
  font-family: var(--tcfs-mono);
  font-size: 11px;
  text-transform: uppercase;
}

/* ---------- Reveal (JS-gated, no-JS safe) ---------- */

html.js-enabled .section-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 420ms ease;
}

html.js-enabled .section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 640px and up ---------- */

@media (min-width: 640px) {
  .brand-logo-img {
    height: 40px;
  }

  .hero-section {
    padding-top: 104px;
  }

  /* wide columns carry the formal justified block; mobile stays centered */
  .hero-statement {
    text-align: justify;
    text-align-last: center;
    text-justify: inter-word;
    hyphens: none;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }

  .hero-horizon {
    height: 190px;
  }

  .definition-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }

  .definition-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mission-section,
  .functions-section,
  .convening-section {
    padding-top: 100px;
    padding-bottom: 100px;
  }
}

/* ---------- 980px and up ---------- */

@media (min-width: 980px) {
  body {
    font-size: 17px;
  }

  h1 {
    font-size: 56px;
    line-height: 1.04;
  }

  h2 {
    font-size: 34px;
    line-height: 1.1;
  }

  h3 {
    font-size: 24px;
  }

  .brand-logo-img {
    height: 44px;
  }

  .menu-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0;
    transform: none;
    background: transparent;
    border-bottom: 0;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    font-size: 11px;
  }

  .site-nav a {
    padding: 0;
    border-bottom: 0;
  }

  .site-nav .nav-parent {
    padding-left: 28px;
    border-left: 1px solid rgba(122, 111, 168, 0.3);
  }

  .hero-section {
    padding-top: 108px;
  }

  .definition-strip h2 {
    font-size: 34px;
  }

  .mission-grid {
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1fr);
    gap: clamp(42px, 7vw, 104px);
  }

  .field-note {
    padding: 36px;
  }

  .field-note .field-note-accent {
    font-size: 27px;
  }

  /* desktop: cards alternate around the central rail — 01/03 left, 02 right */
  .procession article {
    text-align: left;
  }

  .procession .proc-num {
    position: absolute;
    top: 30px;
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
  }

  .proc-left .proc-card {
    margin-right: calc(50% + 46px);
    text-align: right;
  }

  .proc-right .proc-card {
    margin-left: calc(50% + 46px);
  }

  .project-band {
    padding-top: 110px;
    padding-bottom: 110px;
  }

  .project-band h2 {
    font-size: 44px;
  }

  .convening-grid {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
    gap: clamp(38px, 6vw, 86px);
  }

  .final-cta {
    padding-top: 120px;
    padding-bottom: 132px;
  }

  .site-footer {
    grid-template-columns: 1fr auto 1fr;
    gap: 28px;
    justify-items: center;
  }

  .site-footer .brand {
    justify-self: start;
  }

  .footer-copy {
    justify-self: end;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  html.js-enabled .section-reveal {
    opacity: 1;
    transform: none;
  }
}
