/*
 * Common Wealth Trustees — landing page
 * Sections: TOKENS · THEME · RESET · BASE · HERO-BG · NAV · HERO · WORDMARK
 *           · TAGLINE · MISSION · CTA · FOOTER · TOGGLE · MOTION · RESPONSIVE
 *
 * Design register: 2026 contemporary. Warm radial-gradient ground (CSE family).
 * Generative SVG curves drift behind the composition. Subtle paper grain
 * overlay. Big serif display (Cormorant Garamond) paired with sans body
 * (Inter). Real CTA surface, not an underlined inline link. Composed
 * vertical rhythm using a modular spacing scale.
 */

/* === TOKENS === */
:root {
  /* Type families */
  --font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Modular spacing */
  --sp-2:   0.125rem;
  --sp-4:   0.25rem;
  --sp-8:   0.5rem;
  --sp-12:  0.75rem;
  --sp-16:  1rem;
  --sp-24:  1.5rem;
  --sp-32:  2rem;
  --sp-40:  2.5rem;
  --sp-48:  3rem;
  --sp-64:  4rem;
  --sp-80:  5rem;
  --sp-96:  6rem;
  --sp-128: 8rem;

  /* Type scale */
  --type-display: clamp(3.25rem, 11vw, 7.25rem);
  --type-tagline: clamp(1.5rem, 3.2vw, 2.25rem);
  --type-mission: clamp(1.05rem, 1.6vw, 1.2rem);
  --type-email:   clamp(1.2rem, 2.2vw, 1.55rem);

  /* Light palette — CSE family + much stronger radial depth so the gradients are visible */
  --c-bg:        #F4EEE4;     /* CSE cream — base */
  --c-bg-2:      #E5D0AC;     /* deep warm sand */
  --c-bg-3:      #D4B98A;     /* deepest warm — gradient corner */
  --c-text:      #2A1F18;
  --c-text-soft: #6A5A48;
  --c-rule:      #C9B496;
  --c-accent:    #6B2424;
  --c-accent-2:  #8A2E2E;
  --c-curve:     #6B2424;
  --c-cta-bg:    rgba(107, 36, 36, 0.05);
}

/* === THEME ===
 * data-theme="light" → cream warmth (default)
 * data-theme="dark"  → deep burgundy ground, cream ink, warm gold accent
 */
:root[data-theme="dark"] {
  --c-bg:        #1A0F0F;
  --c-bg-2:      #220F0F;
  --c-bg-3:      #2C1414;
  --c-text:      #F4EEE4;
  --c-text-soft: #C9B496;
  --c-rule:      #5C3535;
  --c-accent:    #E8C9A0;     /* warm gold on dark */
  --c-accent-2:  #F4DDB8;
  --c-curve:     #E8C9A0;
  --c-cta-bg:    rgba(232, 201, 160, 0.06);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* === BASE === */
html, body { min-height: 100%; }

body {
  background-color: var(--c-bg);
  /* Layered radial gradients — visible warm depth, not subtle whisper */
  background-image:
    radial-gradient(ellipse 1100px 800px at 12% 0%,   var(--c-bg-3) 0%, transparent 55%),
    radial-gradient(ellipse 900px 700px  at 95% 100%, var(--c-bg-2) 0%, transparent 60%);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "kern" 1, "liga" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}

h1, h2, h3 { text-wrap: balance; }
p          { text-wrap: pretty; }

/* === HERO-BG — gradient blobs + generative curves + paper grain === */
.hero-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Big soft blobs — Anthropic-style generative gradient depth */
.hero-bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: blob-drift 30s ease-in-out infinite alternate;
}
.hero-bg__blob--warm {
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  top: -15vw;
  left: -10vw;
  background: radial-gradient(circle, var(--c-bg-3) 0%, transparent 65%);
}
.hero-bg__blob--accent {
  width: 50vw;
  height: 50vw;
  max-width: 700px;
  max-height: 700px;
  bottom: -10vw;
  right: -10vw;
  background: radial-gradient(circle, var(--c-accent) 0%, transparent 65%);
  opacity: 0.18;
  animation-delay: -8s;
}
@keyframes blob-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, -2vh, 0) scale(1.05); }
}

/* Generative SVG curves — CSS-styled (NOT SVG attributes; vars don't resolve there) */
.hero-bg__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: drift 60s ease-in-out infinite alternate;
}
.hero-bg__curve {
  fill: none;
  stroke: var(--c-curve);
  stroke-linecap: round;
}
.hero-bg__curve--1 { stroke-width: 1.5; opacity: 0.32; }
.hero-bg__curve--2 { stroke-width: 1;   opacity: 0.22; }
.hero-bg__curve--3 { stroke-width: 0.9; opacity: 0.18; }
.hero-bg__curve--4 { stroke-width: 1.2; opacity: 0.20; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-2%, 1.5%, 0); }
}

/* Paper grain — fractal noise data URL, subtle but visible */
.hero-bg__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0 0.09  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .hero-bg__grain {
  opacity: 0.22;
  mix-blend-mode: screen;
}
:root[data-theme="dark"] .hero-bg__blob--accent {
  opacity: 0.28;
}

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-24) var(--sp-32);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav__brand {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-text-soft);
}

/* === HERO === */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-96) var(--sp-32) var(--sp-128);
}
.hero__inner {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-48);
  text-align: center;
}

/* === WORDMARK === */
.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--type-display);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.wordmark__line {
  display: block;
}
.wordmark__line + .wordmark__line {
  margin-top: var(--sp-4);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--c-accent);
}

/* === TAGLINE === */
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--type-tagline);
  line-height: 1.45;
  color: var(--c-text);
  max-width: 28ch;
}
.tagline em {
  font-style: italic;
  font-family: var(--font-display);
}

/* === MISSION === */
.mission {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--type-mission);
  line-height: 1.65;
  color: var(--c-text-soft);
  max-width: 36ch;
  letter-spacing: 0.005em;
}

/* === CTA — envelope above, email below, framed surface === */
.cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-12);
  margin-top: var(--sp-24);
  padding: var(--sp-24) var(--sp-32);
  border: 1px solid var(--c-rule);
  border-radius: 4px;
  background: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.cta:hover,
.cta:focus-within {
  background: var(--c-cta-bg);
  border-color: var(--c-accent);
  transform: translateY(-1px);
}
.cta__envelope {
  width: 28px;
  height: 28px;
  color: var(--c-accent);
  opacity: 0.85;
}
.cta__email {
  font-family: var(--font-body);
  font-size: var(--type-email);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--c-accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.cta__email:hover,
.cta__email:focus-visible {
  border-bottom-color: var(--c-accent);
  outline: none;
}

/* === FOOTER === */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  padding: var(--sp-32);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-soft);
  opacity: 0.7;
}
.foot__sep { opacity: 0.5; }

/* === TOGGLE === */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  color: var(--c-text-soft);
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  opacity: 1;
  color: var(--c-accent);
  border-color: var(--c-accent);
  outline: none;
}

/* === MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
  .nav { padding: var(--sp-16); }
  .hero { padding: var(--sp-80) var(--sp-16) var(--sp-96); }
  .hero__inner { gap: var(--sp-32); }
  .cta { padding: var(--sp-16) var(--sp-24); }
}
@media (max-width: 480px) {
  .hero { padding: var(--sp-64) var(--sp-16) var(--sp-80); }
  .tagline { max-width: 22ch; }
  .mission { max-width: 30ch; }
}
