:root {
  --clay: #b87758;
  --clay-deep: #8f5a42;
  --purple: #7c5ce8;
  --ink: #1b1613;
  --ink-soft: #3b332f;
  --paper: #eceae5;
  --paper-warm: #f0ede7;
  --hairline: rgba(27, 22, 19, 0.12);
  --nav-h: 72px;
  --ease: cubic-bezier(0.65, 0.05, 0.25, 1);
  /* Pastel hover color — matches center star sphere */
  --pastel-hover: #f0d5bb;
}

* { box-sizing: border-box; }

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fine grain overlay — matches the paper-grain texture in the PDF */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

body.cosmos-only { overflow: hidden; height: 100vh; height: 100svh; overscroll-behavior: none; }
/* iOS ignores overflow:hidden on body alone — lock html too */
html:has(body.cosmos-only) { overflow: hidden; }

a { color: inherit; }

button {
  font-family: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 12px; left: 16px; right: 16px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.09);
  opacity: 0;
  transform: translateY(-8px) translateZ(0);
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}

.navbar.visible {
  opacity: 1;
  transform: translateY(0) translateZ(0);
  pointer-events: auto;
}

.navbar.hidden { display: flex; }

/* Mulvium brand link — hover color signals it returns to landing */
.nav-brand a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.07em;
  font-size: 26px;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}

.nav-brand a:hover { color: var(--pastel-hover); }

/* Collage brand letters — each letter of "Mulvium" in a different editorial font.
   Parent is inline-flex/align-items:baseline so all text baselines align exactly. */
.bl { display: inline-block; }
/* M */ .bl-1 { font-family: "Cinzel", serif; font-weight: 500; }
/* U */ .bl-2 { font-family: "Playfair Display", serif; font-weight: 500; }
/* L */ .bl-3 { font-family: "Cinzel", serif; font-weight: 400; }
/* V */ .bl-4 { font-family: "Italiana", serif; -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px currentColor; }
/* i */ .bl-5 { font-family: "Inter", sans-serif; font-weight: 900; margin-left: 0.03em; }
/* u */ .bl-6 { font-family: "Cormorant SC", serif; font-weight: 500; font-size: 1.22em; margin-left: 0.03em; }
/* M */ .bl-7 { font-family: "Cinzel", serif; font-weight: 500; margin-left: 0.03em; }

/* Hover wiggle — letters wave in sequence */
@keyframes blWiggle {
  0%   { transform: translateY(0)    rotate(0deg);  }
  25%  { transform: translateY(-5px) rotate(-6deg); }
  55%  { transform: translateY(2px)  rotate(4deg);  }
  78%  { transform: translateY(-2px) rotate(-2deg); }
  100% { transform: translateY(0)    rotate(0deg);  }
}

.nav-brand a:hover .bl {
  animation: blWiggle 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
.nav-brand a:hover .bl-1 { animation-delay:   0ms; }
.nav-brand a:hover .bl-2 { animation-delay:  45ms; }
.nav-brand a:hover .bl-3 { animation-delay:  90ms; }
.nav-brand a:hover .bl-4 { animation-delay: 135ms; }
.nav-brand a:hover .bl-5 { animation-delay: 180ms; }
.nav-brand a:hover .bl-6 { animation-delay: 225ms; }
.nav-brand a:hover .bl-7 { animation-delay: 270ms; }

/* Glimmer — every few seconds a warm light runs through the letters
   themselves, left to right: each glyph briefly brightens to gold and
   settles back. A quiet hint that the wordmark is the way home. Hovering
   swaps it for the wiggle above. */
.nav-brand { --glint-base: var(--ink); --glint-hi: #c0965a; }
body.night-mode .nav-brand { --glint-base: rgba(255, 255, 255, 0.92); --glint-hi: #f3d9a8; }

@keyframes blGlint {
  0%, 72%, 100% { color: var(--glint-base); }
  80%           { color: var(--glint-hi); }
}

.nav-brand .bl   { animation: blGlint 3.5s ease-in-out 1.5s infinite; }
.nav-brand .bl-2 { animation-delay: 1.57s; }
.nav-brand .bl-3 { animation-delay: 1.64s; }
.nav-brand .bl-4 { animation-delay: 1.71s; }
.nav-brand .bl-5 { animation-delay: 1.78s; }
.nav-brand .bl-6 { animation-delay: 1.85s; }
.nav-brand .bl-7 { animation-delay: 1.92s; }

@media (prefers-reduced-motion: reduce) {
  .nav-brand .bl { animation: none; }
}

.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-trigger {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: none;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 10px;
  min-height: 44px;
  position: relative;
  transition: color 0.25s var(--ease);
  touch-action: manipulation;
  cursor: pointer;
}
a.nav-trigger:visited { text-decoration: none; color: var(--ink); }

/* ---------- Mobile hamburger button (hidden on desktop) ---------- */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.32s var(--ease), margin 0.32s var(--ease);
}
.nav-burger span:first-child { margin-left:  5px; }
.nav-burger span:last-child  { margin-left: -5px; }

/* Open state — the two bars meet and cross into an X */
.navbar.menu-open .nav-burger span:first-child {
  margin-left: 0;
  transform: translateY(4.25px) rotate(45deg);
}
.navbar.menu-open .nav-burger span:last-child {
  margin-left: 0;
  transform: translateY(-4.25px) rotate(-45deg);
}

body.night-mode .nav-burger { color: rgba(255, 255, 255, 0.92); }

.nav-trigger::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease);
}

.nav-trigger:hover,
.nav-item.open .nav-trigger { color: var(--clay); }

.nav-trigger:hover::after,
.nav-item.open .nav-trigger::after { transform: scaleX(1); }

.nav-item { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  list-style: none;
  padding: 10px 0;
  margin: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 18px 48px rgba(27, 22, 19, 0.08);
}

.nav-item.open .dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown a {
  display: flex;
  align-items: center;
  padding: 0 26px;
  min-height: 48px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.22s var(--ease);
  touch-action: manipulation;
}

.dropdown a:hover { color: var(--clay); }

/* ---------- Stage / canvas ---------- */
main#stage { position: relative; width: 100%; }

#expansion-wrapper { position: relative; }

#canvas-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--paper);
}

/* Fix canvas-wrap in cosmos mode so iOS scroll bleed can't move it.
   Explicit height pins the canvas to a stable unit so the mobile address bar
   appearing/disappearing never triggers a resize or background flash. */
body.cosmos-only #canvas-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  /* Above page content — .rv reveal transforms create stacking contexts on
     letter/footer elements that would otherwise paint over the fixed canvas */
  z-index: 3;
}

/* Once the Three.js 3D→2D transition completes, fix the canvas so it
   stays in place while scroll drives the expansion sequence. Explicit
   stable height prevents address-bar resize events from reflowing the canvas. */
body.expansion-active #canvas-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  z-index: 0;
}

#expansion-space {
  height: 0;
  pointer-events: none;
}

body.expansion-active #expansion-space {
  height: 140vh;
}

/* ---------- Night-mode (phase 2 of expansion) ---------- */
body { transition: background-color 0.6s ease; }

body.night-mode { background: #060412; }

body.night-mode #letter-section {
  background: transparent;
  position: relative;
  z-index: 1;
}

body.night-mode .letter-to,
body.night-mode .letter-sig {
  color: #ffffff;
}

body.night-mode .letter-body p,
body.night-mode .letter-close p {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

body.night-mode .letter-body em {
  color: #ffffff;
}

body.night-mode .letter-quote {
  border-left-color: rgba(255, 255, 255, 0.25);
}

body.night-mode .letter-quote p {
  color: rgba(255, 255, 255, 0.82);
}

body.night-mode .letter-title {
  color: rgba(255, 255, 255, 0.60);
}

body.night-mode .letter-sig-img {
  filter: invert(1);
}

body.night-mode .letter-body p.letter-mission {
  color: #ffffff;
  font-weight: 600;
}

body.night-mode #site-footer {
  background: transparent;
  border-top-color: rgba(195, 175, 255, 0.20);
  position: relative;
  z-index: 1;
}

body.night-mode .footer-copy p {
  color: rgba(205, 190, 255, 0.82);
}

/* Holder for the SVG goo filter that dissolves the hero wordmark */
.goo-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

canvas#cosmos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* In cosmos mode no scrolling is wanted — disable pan so iOS doesn't
   hide the address bar and jump the viewport height */
body.cosmos-only canvas#cosmos { touch-action: none; }

.cosmos-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-soft);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: none;
  line-height: 1.8;
  opacity: 0.65;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}

body.mode-2d .cosmos-hint { opacity: 0; }

/* "Click a sphere | Join the waitlist": the second opens the waitlist */
.cosmos-hint p { margin: 0; }
.hint-sep { margin: 0 0.9em; opacity: 0.7; }
.hint-join {
  pointer-events: auto;
  padding: 8px 2px;
  font: inherit;
  letter-spacing: inherit;
  color: var(--clay-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.hint-join:hover { color: var(--ink); }
body.mode-2d .hint-join,
body.footer-open .hint-join { pointer-events: none; }


/* ---------- Letter Section ---------- */
#letter-section {
  background: var(--paper);
  padding: clamp(110px, 16vh, 190px) clamp(24px, 8vw, 160px) 140px;
}

.letter-article {
  max-width: 680px;
  margin: 0 auto;
}

.letter-to {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}

.letter-body p {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.letter-body p:last-child { margin-bottom: 0; }

.letter-quote {
  margin: 4px 0 28px 0;
  padding: 20px 32px;
  border-left: 2px solid var(--hairline);
}

.letter-quote p {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 17px;
  font-style: italic;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0;
}

.letter-close { margin-top: 56px; }

/* Reply — answers the letter through the contact card: a plain line of
   text, centred well below the signature, underlined as the pointer nears */
.letter-reply {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: clamp(64px, 10vh, 104px) auto 0;
  padding: 6px 2px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left 90% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease), gap 0.35s var(--ease), color 0.3s var(--ease);
}

.letter-reply:hover { gap: 16px; background-size: 100% 1px; }

body.night-mode .letter-reply { color: #ffffff; }

.letter-close p {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.letter-sig-img {
  display: block;
  width: 300px;
  height: auto;
  margin: 12px 0 4px -61px; /* -61px aligns the B stroke with the text left edge */
}

.letter-sig {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin: 4px 0 2px;
}

.letter-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  letter-spacing: 0.02em;
}

/* The mission statement, emphasized within the letter */
.letter-body p.letter-mission {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(21px, 2.3vw, 26px);
  line-height: 1.55;
  color: var(--ink);
}

/* ========== Contact card — an open two-page spread ========== */

#card-section {
  display: flex;
  justify-content: center;
}

.card {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  width: min(880px, 94vw);
  min-height: 396px;
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(27, 22, 19, 0.05),
    0 12px 32px rgba(27, 22, 19, 0.10),
    0 32px 80px rgba(27, 22, 19, 0.10);
  opacity: 0;
}

body.ls-done .card { animation: pageRise 0.9s var(--ease) 0.28s both; }

.card-page {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  padding: clamp(26px, 4vw, 44px) clamp(24px, 3.4vw, 40px);
}

/* Centre fold — hairline spine with soft shading on both pages */
.card-spine {
  background: rgba(27, 22, 19, 0.12);
  position: relative;
}

.card-spine::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 100%;
  width: 22px;
  background: linear-gradient(to left, rgba(27, 22, 19, 0.05), transparent);
}

.card-spine::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 100%;
  width: 22px;
  background: linear-gradient(to right, rgba(27, 22, 19, 0.04), transparent);
}

.ci-salutation {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(18px, 1.8vw, 23px);
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.2;
}

.card-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.ci-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.ci-field--fill {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

.ci-field--fill .ci-textarea {
  flex: 1;
  min-height: 96px;
  resize: none;
  line-height: 1.65;
}

.ci-label {
  font-family: "Cormorant SC", serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.ci-input {
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  padding: 6px 0;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  transition: border-color 0.25s ease;
}

.ci-input:focus { border-bottom-color: var(--ink); }
.ci-input::placeholder { color: rgba(27, 22, 19, 0.30); }
.ci-input--error { border-bottom-color: #b94040; }

.ci-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%233b332f' fill-opacity='.45'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 18px;
}

.ci-actions {
  margin-top: auto;
  padding-top: 18px;
}

.ci-submit {
  font-family: "Cormorant SC", serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(27, 22, 19, 0.30);
  border-radius: 1px;
  padding: 11px 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.ci-submit:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-warm);
}

.ci-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.ci-arrow { transition: transform 0.22s ease; }
.ci-submit:hover:not(:disabled) .ci-arrow { transform: translateX(4px); }

.ci-submit:focus-visible,
.ci-input:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* Success — replaces the right page content */
.ci-success {
  display: none; /* JS sets display:flex */
  position: absolute;
  inset: 0;
  background: var(--paper-warm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 6px;
}

.ci-success-icon {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 8px;
}

.ci-success-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  margin: 0;
}

.ci-success-msg {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Site Footer — navigation to every part of the site ---------- */
#site-footer {
  background: var(--paper-warm);
  border-top: 1px solid var(--hairline);
}

.sf-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr);
  gap: clamp(28px, 5vw, 80px);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 6vh, 64px) clamp(24px, 5vw, 64px) 8px;
}

.sf-wordmark {
  --sf-ink: var(--ink);
  --sf-light: #b8925a;
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  /* The letters are painted half in light, half in ink, with the light
     parked off to the left; pointing at the wordmark (or tapping it) washes
     the light across the letters and they stay lit, glowing softly, to show
     it leads home */
  color: transparent;
  background: linear-gradient(100deg, var(--sf-light) 0 42%, var(--sf-ink) 58% 100%) 100% 0 / 260% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 0 rgba(201, 168, 116, 0));
  transition: background-position 1.1s var(--ease), filter 0.6s var(--ease);
}
.sf-wordmark:hover,
.sf-wordmark:focus-visible,
.sf-wordmark:active {
  background-position: 0 0;
  filter: drop-shadow(0 0 10px rgba(201, 168, 116, 0.6));
}
.sf-wordmark:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { .sf-wordmark { transition: none; } }

.sf-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.sf-head {
  font-family: "Cormorant SC", serif;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--clay-deep);
  margin: 6px 0 12px;
}

.sf-col ul { list-style: none; margin: 0; padding: 0; }

.sf-col a {
  display: inline-block;
  padding: 5px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left 85% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease), color 0.3s var(--ease);
}

.sf-col a:hover { background-size: 100% 1px; color: var(--clay-deep); }

body.night-mode .sf-col a { color: rgba(255, 255, 255, 0.92); }
body.night-mode .sf-wordmark { --sf-ink: rgba(255, 255, 255, 0.92); --sf-light: #f3d9a8; }
body.night-mode .sf-head { color: rgba(205, 190, 255, 0.82); }
body.night-mode .sf-col a:hover { color: #ffffff; }

@media (max-width: 720px) {
  .sf-inner { grid-template-columns: 1fr; gap: 26px; }
  .sf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
  .sf-wordmark { font-size: 24px; }
}

/* On the 3D landing the page doesn't scroll; the waitlist drawer rises from
   below instead (css/waitlist.css: .wl-drawer), the site's footer at its
   end, and the cosmos lifts with it (js/main.js: openFooter) */
body.cosmos-only #site-footer .rv { opacity: 1; transform: none; }

body.cosmos-only #canvas-wrap { transition: transform 0.75s var(--ease); }

body.cosmos-only.footer-open #canvas-wrap {
  transform: translateY(calc(var(--sf-h, 260px) * -0.55));
}

body.cosmos-only.footer-open .cosmos-hint { opacity: 0; }

/* Rewinds the hero without animating, so its entrance can replay */
body.hero-reset .hero-wrap,
body.hero-reset .hero-mission,
body.hero-reset .hero-statement .hw > span { transition: none !important; }

.footer-copy {
  text-align: center;
  padding: 28px clamp(24px, 5vw, 64px) 32px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: none;
  color: var(--ink-soft);
}

.footer-copy p { margin: 0; }

/* ---------- Sub-pages ---------- */
.page-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 80px) clamp(22px, 5vw, 64px) 120px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: none;
  color: var(--clay-deep);
  margin: 0 0 22px;
}

.page-shell .eyebrow { margin-bottom: 18px; }

.page-shell h1 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.06;
  margin: 0 0 32px;
  color: var(--ink);
}

.page-shell p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 640px;
}

.page-shell .back {
  display: inline-block;
  margin-top: 48px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: none;
  color: var(--purple);
  text-decoration: none;
  border-bottom: 1px solid var(--purple);
  padding-bottom: 2px;
}

.static-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
  z-index: 20;
}

.static-nav a {
  font-size: 24px;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--ink);
}

.static-nav .back-home {
  font-family: "Cormorant Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: none;
  color: var(--clay-deep);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

/* Tablet and below (≤ 900px) */
@media (max-width: 900px) {
  .letter-body p { font-size: 16px; }
  .fsos-prose-body p { font-size: 16px; line-height: 1.78; }
}

/* Small tablet and large phone (≤ 720px) */
@media (max-width: 720px) {
  .nav-links { gap: 14px; }
  .nav-trigger { font-size: 11px; letter-spacing: 0.10em; }
  .dropdown { min-width: 220px; }
  #letter-section { padding: 72px clamp(20px, 7vw, 80px); }
  .fsos-prose-body p { font-size: 16px; line-height: 1.75; }
}

/* Card responsive — pages stack on narrow screens */
@media (max-width: 700px) {
  .card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto;
    min-height: 0;
  }
  .card-spine { width: auto; height: 1px; }
  .card-spine::before {
    top: auto; bottom: 100%; left: 0; right: 0;
    width: auto; height: 16px;
    background: linear-gradient(to top, rgba(27, 22, 19, 0.05), transparent);
  }
  .card-spine::after {
    top: 100%; bottom: auto; left: 0; right: 0;
    width: auto; height: 14px;
    background: linear-gradient(to bottom, rgba(27, 22, 19, 0.04), transparent);
  }
  .ci-field--fill .ci-textarea { min-height: 140px; flex: none; }
}

/* Small phone (≤ 480px) */
@media (max-width: 480px) {
  :root { --nav-h: 60px; }
  .nav-brand a { font-size: 21px; }
  .nav-trigger { font-size: 10px; letter-spacing: 0.08em; padding: 10px 8px; }
  .dropdown { min-width: 200px; }

  #letter-section { padding: 56px clamp(18px, 5.5vw, 36px); }
  .letter-to { font-size: clamp(17px, 5.2vw, 22px); }
  .letter-body p { font-size: 15px; line-height: 1.75; margin-bottom: 20px; }
  .letter-close { margin-top: 36px; }
  .letter-sig { font-size: 22px; }

  .cosmos-hint { font-size: 11px; bottom: 22px; letter-spacing: 0.18em; }
  .fsos-prose { padding-bottom: 72px; }
  .fsos-prose-header { margin: 32px 0 28px; }
  .fsos-prose-body p { font-size: 15px; line-height: 1.75; }

  .footer-copy { font-size: 10px; letter-spacing: 0.10em; }
}

/* Landscape mobile — short viewport */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --nav-h: 52px; }
  .cosmos-hint { bottom: 14px; font-size: 10px; letter-spacing: 0.18em; }
  #letter-section { padding-top: 48px; padding-bottom: 48px; }
  .letter-close { margin-top: 32px; }
  .fsos-prose { padding-bottom: 64px; }
  .fsos-prose-header { margin-top: 28px; margin-bottom: 24px; }
  .footer-copy { font-size: 10px; letter-spacing: 0.10em; }
}

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

/* =====================================================================
   MULVIUMSOS PAGE (msos.html; its rules keep the fsos- prefix) — the
   word sphere on a stage, prose below; the stack diagram is in msos.css
   ===================================================================== */
.fsos-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
}

/* The scene stays fixed behind the page, as on the Oak page */
#fsos-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* ---- Prose rises over the scene on a paper wash, as on the Oak page ---- */
.fsos-prose {
  position: relative;
  z-index: 2;
  padding: clamp(120px, 22vh, 220px) clamp(22px, 5vw, 48px) 120px;
  /* Solid paper well before the first section, so the scene behind never
     shows through the text */
  background: linear-gradient(to bottom,
    rgba(236, 234, 229, 0) 0,
    rgba(236, 234, 229, 0.94) clamp(90px, 16vh, 170px),
    var(--paper) clamp(240px, 40vh, 420px));
}
.fsos-prose > * {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.fsos-page #site-footer { position: relative; z-index: 2; }

.fsos-prose-header { text-align: center; margin: 24px 0 40px; }

.fsos-prose-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}

.fsos-prose-body p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 0 24px;
  text-indent: 1.6em;
}

.fsos-prose-body p:first-child,
.fsos-prose-body h2 + p { text-indent: 0; }

/* Section heads within the essay, in the small capitals of the site's eyebrows */
.fsos-prose-body h2 {
  font-family: "Cormorant SC", serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.24em;
  text-align: center;
  color: var(--clay-deep);
  margin: 60px 0 22px;
}

.fsos-prose-body em {
  font-style: italic;
  font-size: 1.0em;
  color: var(--ink);
}

/* ---------- Loading screen ---------- */
/* js/ls.js plays it. While it plays, the paper is drawn by four bands around
   the window onto the page (.ls-band > .ls-bg), and the photographs' pane is
   cut by a clip-path while they surround the window. */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
  opacity: 0;
  display: none;
  will-change: opacity;
}
#loading-screen,
.ls-bg {
  background-color: #eceae5;
  background-image:
    radial-gradient(ellipse 60% 50% at 38% 18%, rgba(240, 213, 187, 0.55) 0%, transparent 68%),
    radial-gradient(ellipse 54% 60% at 18% 65%, rgba(196, 221, 184, 0.48) 0%, transparent 62%),
    radial-gradient(ellipse 60% 54% at 82% 66%, rgba(184, 202, 224, 0.52) 0%, transparent 62%),
    radial-gradient(ellipse 40% 44% at 72% 22%, rgba(224, 184, 200, 0.38) 0%, transparent 60%);
}
#loading-screen.ls-banded { background: none; }
.ls-band {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  visibility: hidden;
  will-change: transform, opacity;
}
.ls-bg {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.ls-pane {
  position: absolute;
  inset: 0;
}
/* Applied by inline <head> script when navigating in from a sub-page;
   ensures the overlay covers the canvas before the first paint. */
html.ls-instant-cover #loading-screen {
  display: block !important;
  opacity: 1 !important;
  pointer-events: all !important;
}

.ls-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  overflow: hidden;
  will-change: transform, opacity;
}

/* Sized once by js/ls.js to the picture at cover size for its frame's largest
   size; the motion only ever changes its transform (which also centres it on
   the frame), so the photograph is never re-rastered. The faint inset shadow
   is never seen, but stops Chrome treating the layer as a lone image, which
   it re-rasters to track the image's scale. */
.ls-img {
  position: absolute;
  left: 0;
  top: 0;
  box-shadow: inset 0 0 0 1px rgba(42, 38, 34, 0.01);
  background-size: cover;
  background-position: center;
  transform-origin: center;
  will-change: transform;
}

/* The window's outline: four 1px squares that js/ls.js scales into edges */
.ls-edge {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 1px;
  height: 1px;
  background: rgba(27, 22, 19, 0.45);
  transform-origin: 0 0;
  visibility: hidden;
  will-change: transform;
}

#ls-f1 { z-index: 1; }
#ls-f2 { z-index: 2; }
#ls-f3 { z-index: 3; }
#ls-f4 { z-index: 4; }
#ls-f1 .ls-img { background-image: url('../Musical.webp');      }
#ls-f2 .ls-img { background-image: url('../Pictorial.webp');    }
#ls-f3 .ls-img { background-image: url('../image-13.webp');     }
#ls-f4 .ls-img { background-image: url('../Horticulture.webp'); }

/* ---------- Nav-cap: hides content in the gap above the floating navbar ---------- */
#nav-cap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: var(--paper);
  z-index: 41;
  pointer-events: none;
}
body.night-mode #nav-cap { background: #060412; }

/* ---------- Night-mode navbar (background driven by JS; text colours via CSS class) ---------- */
body.night-mode .nav-trigger { color: rgba(255, 255, 255, 0.88); }
body.night-mode .nav-trigger:hover,
body.night-mode .nav-item.open .nav-trigger { color: #ffffff; }
body.night-mode .nav-trigger::after { background: rgba(255, 255, 255, 0.55); }
body.night-mode .nav-brand a { color: rgba(255, 255, 255, 0.92); }
body.night-mode .dropdown {
  background: rgba(8, 6, 20, 0.97);
  border-color: rgba(255, 255, 255, 0.10);
}
body.night-mode .dropdown a { color: rgba(255, 255, 255, 0.55); }
body.night-mode .dropdown a:hover { color: rgba(255, 255, 255, 0.92); }

/* ---------- Letter-spacing reductions for formerly-uppercase elements ---------- */
.nav-trigger        { letter-spacing: 0.03em; }
.cosmos-hint        { letter-spacing: 0.04em; }
.footer-copy        { letter-spacing: 0.03em; }
.eyebrow            { letter-spacing: 0.06em; }
.page-shell .back   { letter-spacing: 0.04em; }
.static-nav .back-home { letter-spacing: 0.04em; }
.ci-label           { letter-spacing: 0.04em; }
.ci-submit          { letter-spacing: 0.04em; }

/* ---------- Accessibility font-size bumps ---------- */
.nav-trigger          { font-size: 17px; }
.dropdown a           { font-size: 15px; }
.cosmos-hint          { font-size: 15px; }
.letter-body p        { font-size: 21px; }
.letter-quote p       { font-size: 19px; }
.footer-copy          { font-size: 15px; }
.eyebrow              { font-size: 14px; }
.page-shell .back     { font-size: 14px; }
.static-nav .back-home { font-size: 14px; }
.ci-label             { font-size: 12px; }
.ci-submit            { font-size: 13px; }

/* ---------- Mobile nav: hamburger menu (≤ 720px) ---------- */
@media (max-width: 720px) {
  /* Show burger; pill stays at fixed nav-h — never expands */
  .nav-burger { display: flex; }

  .navbar {
    height: var(--nav-h);
    overflow: visible;
  }
  .nav-brand { flex: 1; }

  /* Menu panel drops below the pill as a separate floating card */
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* override desktop center — rows span full width */
    gap: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 10px;
    padding: 6px 0 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }
  body.night-mode .nav-links {
    background: rgba(8, 6, 20, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.10);
  }

  .navbar.menu-open .nav-links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links { padding: 6px 0 10px; }

  /* Hairline separators between top-level groups */
  .nav-item + .nav-item { border-top: 1px solid rgba(27, 22, 19, 0.07); }
  body.night-mode .nav-item + .nav-item { border-top-color: rgba(255, 255, 255, 0.09); }

  /* Full-width tappable items — label left, group indicator right */
  .nav-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--ink);
    min-height: 50px;
  }
  body.night-mode .nav-trigger { color: rgba(255, 255, 255, 0.88); }
  body.night-mode .nav-trigger:hover,
  body.night-mode .nav-item.open .nav-trigger { color: #ffffff; }

  /* Suppress the desktop underline indicator in the menu panel */
  .nav-trigger::after { display: none; }

  /* Group indicator — a fine "+" that turns into "×" when the group opens */
  .nav-item.has-dropdown > .nav-trigger::after {
    content: '+';
    display: block;
    position: static;
    width: auto;
    height: auto;
    background: none;
    font-family: "Cormorant Garamond", serif;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    opacity: 0.5;
    transform: rotate(0deg);
    transform-origin: center;
    transition: transform 0.3s var(--ease), opacity 0.3s ease;
  }
  .nav-item.open > .nav-trigger::after {
    transform: rotate(45deg);
    opacity: 0.85;
  }

  /* Dropdowns expand inline within the panel — animated via max-height */
  .dropdown {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    background: transparent !important;
    padding: 0 0 8px;
    display: flex !important;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.30s ease, opacity 0.22s ease;
  }
  .nav-item.open .dropdown {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
  }

  /* Nested items — uniform indent with a small dash marker */
  .dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 400;
    color: var(--ink-soft);
    padding: 10px 22px 10px 34px;
    min-height: 44px;
    border: none;
    margin: 0;
  }
  .dropdown a::before {
    content: '';
    width: 14px;
    height: 1px;
    background: currentColor;
    opacity: 0.4;
    flex-shrink: 0;
  }
  body.night-mode .dropdown a { color: rgba(255, 255, 255, 0.6); }
  .dropdown a:hover { color: var(--clay); }
  body.night-mode .dropdown a:hover { color: rgba(255, 255, 255, 0.95); }

  /* Pull back the big desktop bumps to sensible mobile sizes */
  .nav-trigger        { font-size: 15px; }
  .letter-body p      { font-size: 17px; }
  .letter-quote p     { font-size: 15px; }
  .footer-copy        { font-size: 13px; }
  .cosmos-hint        { font-size: 12px; }
}

/* ---------- Offerings and About Us: floating panels of cards ---------- */
/* Each panel hangs from the navbar itself rather than its menu item: a
   separate rounded card a little below the bar's right edge. Offerings
   holds a still of each company's animation; About Us is the same panel
   in type alone. */
.nav-item.has-panel { position: static; }

.dropdown.offer-grid {
  top: calc(100% + 14px);
  right: 0;
  width: min(780px, calc(100vw - 32px));
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(27, 22, 19, 0.06);
  border-radius: 22px;
  background: rgba(250, 249, 246, 0.97);
  box-shadow: 0 28px 70px rgba(27, 22, 19, 0.16), 0 3px 12px rgba(27, 22, 19, 0.06);
  transform: translateY(-10px) scale(0.985);
  transform-origin: top right;
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
}

/* An invisible bridge over the gap, so the pointer can travel from the
   trigger down to the panel without it closing */
.dropdown.offer-grid::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  height: calc(16px + (var(--nav-h) - 44px) / 2);
}

/* Cards rise in one after another as the panel opens */
.offer-grid > li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}
.nav-item.open .offer-grid > li {
  opacity: 1;
  transform: none;
  transition-delay: calc(60ms + var(--i, 0) * 60ms);
}

.offer-grid .offer-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  padding: 8px 8px 16px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.3s var(--ease);
}
.offer-grid .offer-card:hover,
.offer-grid .offer-card:focus-visible {
  background: rgba(27, 22, 19, 0.045);
  color: var(--ink);
}

.offer-art {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(27, 22, 19, 0.06);
}
.offer-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.offer-card:hover .offer-art img { transform: scale(1.045); }

.offer-name {
  display: block;
  margin: 14px 6px 4px;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  transition: color 0.25s var(--ease);
}
.offer-card:hover .offer-name { color: var(--clay); }

.offer-line {
  display: block;
  margin: 0 6px;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: rgba(27, 22, 19, 0.62);
}

/* About Us: the same panel and type, without the stills, four across */
.dropdown.offer-grid--text {
  width: min(780px, calc(100vw - 32px));
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.offer-grid--text .offer-card { padding: 16px 16px 18px; }
.offer-grid--text .offer-name { margin-top: 0; }

body.night-mode .dropdown.offer-grid {
  background: rgba(10, 8, 24, 0.97);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}
body.night-mode .offer-grid .offer-card { color: rgba(255, 255, 255, 0.92); }
body.night-mode .offer-grid .offer-card:hover,
body.night-mode .offer-grid .offer-card:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}
body.night-mode .offer-card:hover .offer-name { color: #f3d9a8; }
body.night-mode .offer-line { color: rgba(255, 255, 255, 0.55); }
body.night-mode .offer-art { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }

/* In the phone menu the panel folds into compact rows, each with a small still */
@media (max-width: 720px) {
  .dropdown.offer-grid {
    width: auto;
    gap: 0;
    padding: 0 12px 10px 16px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: max-height 0.30s ease, opacity 0.22s ease;
  }
  .dropdown.offer-grid::before { display: none; }
  .nav-item.open .dropdown.offer-grid { max-height: 380px; }
  .offer-grid > li { transform: translateY(6px); }

  .offer-grid .offer-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
    gap: 0 14px;
    align-items: center;
    height: auto;
    padding: 8px 10px;
    border-radius: 12px;
  }
  .offer-grid .offer-card::before { display: none; }
  .offer-art { grid-row: 1 / 3; width: 64px; border-radius: 9px; }
  .offer-grid--text .offer-card { grid-template-columns: 1fr; padding: 8px 10px; }
  .offer-name { margin: 0; font-size: 19px; align-self: end; }
  .offer-line { margin: 2px 0 0; font-size: 12.5px; line-height: 1.35; align-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .dropdown.offer-grid { transform: none; }
  .offer-grid > li { transform: none; transition: opacity 0.2s ease; }
  .offer-art img,
  .offer-card:hover .offer-art img { transition: none; transform: none; }
}

@media (max-width: 480px) {
  .nav-trigger      { font-size: 14px; }
  .letter-body p    { font-size: 15px; }
  .letter-quote p   { font-size: 14px; }
}

/* =====================================================================
   ELEVATION PASS — hero identity, scroll storytelling, custom cursor,
   cinematic vignette, and sub-page choreography.
   ===================================================================== */

/* ---------- Hero — brand and tagline stacked over the cosmos ---------- */
.hero-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(52px, 11vh, 130px);
  pointer-events: none;
  z-index: 2;
  opacity: 0; /* revealed once the loading sequence completes */
  transition: opacity 0.8s var(--ease);
}

body.cosmos-intro .hero-wrap { opacity: 1; }

/* Soft paper fog behind the text so orbit lines never fight the words.
   Fades away with the night sky (driven by JS). */
.hero-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(94vw, 1020px);
  height: 340%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
    rgba(236, 234, 229, 0.96) 0%,
    rgba(236, 234, 229, 0.62) 46%,
    rgba(236, 234, 229, 0) 74%);
}

.hero-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 18px);
}

.hero-brand-goo {
  margin: 0;
  filter: url(#threshold);
  text-align: center;
}

.hero-brand {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(38px, 6.5vw, 84px);
  letter-spacing: 0.3em;
  text-indent: 0.3em; /* recentres tracked text */
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  will-change: filter, opacity;
  user-select: none;
}

/* ---------- Hero statements — the statement and the mission ----------
   Positioned by js/main.js (layoutHero) around the cosmos's measured bounds:
   "stack" puts the statement under the wordmark and the mission under the
   cosmos; "side" puts them left and right of it. The wrapper fades out with
   the wordmark on entering the night sky. */
.hero-statements {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* the canvas beneath keeps every hover and click */
  opacity: 0;
}

.hero-statement,
.hero-mission {
  position: absolute;
  left: 50%;
  width: min(90vw, 560px);
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  color: var(--ink);
  /* Paper glow so orbit lines and passing planets never fight the words */
  text-shadow: 0 0 14px var(--paper), 0 0 5px var(--paper), 0 0 2px var(--paper);
}

.hero-statement {
  top: var(--st-top, 24vh);
  font-weight: 700;
  font-size: clamp(20px, 5.4vw, 30px);
  line-height: 1.2;
}

.hero-mission {
  top: var(--mi-top, 72vh);
  font-weight: 500;
  font-size: clamp(13px, 3.5vw, 17px);
  line-height: 1.55;
  color: var(--ink-soft);
}

html[data-hero-layout="side"] .hero-statement,
html[data-hero-layout="side"] .hero-mission {
  top: var(--hero-mid, 50%);
  width: var(--hero-col, 300px);
  transform: translateY(-50%);
  text-align: left;
}

html[data-hero-layout="side"] .hero-statement {
  left: var(--hero-edge, 48px);
  font-size: clamp(17px, min(2.5vw, 4.6vh), 40px);
  line-height: 1.16;
}

html[data-hero-layout="side"] .hero-mission {
  left: auto;
  right: var(--hero-edge, 48px);
  font-size: clamp(12px, min(1.3vw, 2.7vh), 20px);
  line-height: 1.6;
}

/* Mission: fades in the way the wordmark does, a beat after it */
.hero-mission {
  opacity: 0;
  transition: opacity 1s var(--ease) 0.25s;
}

body.cosmos-intro .hero-mission { opacity: 1; }

/* Statement: each word rises out of its own mask at its own pace */
.hero-statement .hw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.12em 0.14em;
  margin: 0 -0.12em -0.14em;
}

.hero-statement .hw > span {
  display: inline-block;
  transform: translateY(115%);
  transition: transform var(--dur, 1.1s) cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s);
}

body.cosmos-intro .hero-statement .hw > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-statement .hw > span { transform: none; transition: none; }
  .hero-mission { transition: none; }
}

/* ---------- Scroll reveal — content rises in as it enters the viewport ---------- */
.rv {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1s var(--ease) var(--rv-delay, 0s),
    transform 1s var(--ease) var(--rv-delay, 0s);
  will-change: opacity, transform;
}

.rv.rv-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Letter storytelling — drop cap, signature wipe ---------- */
.letter-body > p:first-of-type::first-letter {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 3.55em;
  line-height: 0.78;
  float: left;
  padding: 7px 14px 0 0;
  color: var(--ink);
}

body.night-mode .letter-body > p:first-of-type::first-letter { color: #ffffff; }

/* Signature draws in from left, like ink being written */
.letter-sig-img {
  clip-path: inset(-8% 102% -8% -2%);
  transition: clip-path 1.8s cubic-bezier(0.5, 0.05, 0.2, 1) 0.35s;
}

.letter-close.rv-in .letter-sig-img {
  clip-path: inset(-8% -2% -8% -2%);
}

/* ---------- MulviumSOS prose eyebrow ---------- */
.fsos-eyebrow {
  font-family: "Cormorant SC", serif;
  font-size: 14px;
  letter-spacing: 0.26em;
  color: var(--clay-deep);
  margin: 0 0 14px;
}

/* ---------- Cinematic vignette in night mode ---------- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  background: radial-gradient(ellipse 125% 105% at 50% 50%,
    transparent 58%,
    rgba(0, 0, 8, 0.5) 100%);
}

body.night-mode::after { opacity: 1; }

/* ---------- Custom cursor (desktop pointer devices only) ---------- */
@media (hover: hover) and (pointer: fine) {
  html.cursor-on,
  html.cursor-on * { cursor: none !important; }

  .cur-star,
  .cur-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: difference;
    transition: opacity 0.25s ease;
  }

  /* Four-pointed star — same ✦ glyph as the letter ornaments, turning slowly */
  .cur-star {
    width: 14px;
    height: 14px;
  }

  .cur-star::before {
    content: '\2726';
    display: block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 13px;
    text-align: center;
    color: #ffffff;
    animation: curSpin 16s linear infinite;
  }

  .cur-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    transition: opacity 0.25s ease, border-color 0.4s ease;
  }

  html.cur-hover .cur-ring { border-color: rgba(255, 255, 255, 0.95); }

  html.cur-hidden .cur-star,
  html.cur-hidden .cur-ring { opacity: 0; }

  @keyframes curSpin {
    to { transform: rotate(360deg); }
  }
}

/* ---------- Sub-page entrance choreography ---------- */
.page-shell > * { animation: pageRise 0.9s var(--ease) both; }
.page-shell > *:nth-child(1) { animation-delay: 0.05s; }
.page-shell > *:nth-child(2) { animation-delay: 0.16s; }
.page-shell > *:nth-child(3) { animation-delay: 0.27s; }
.page-shell > *:nth-child(4) { animation-delay: 0.38s; }
.page-shell > *:nth-child(5) { animation-delay: 0.49s; }
.page-shell > *:nth-child(n+6) { animation-delay: 0.6s; }

@keyframes pageRise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Text selection ---------- */
::selection { background: rgba(184, 119, 88, 0.28); }
body.night-mode ::selection { background: rgba(124, 92, 232, 0.45); color: #ffffff; }

/* ---------- Reduced motion — settle everything instantly ---------- */
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .ar, body.contact-page .card { opacity: 1; animation: none !important; }
  .letter-sig-img { clip-path: none; transition: none; }
  .page-shell > * { animation: none; }
}

/* ---------- Shared by the pages with a loading screen ---------- */
/* Content holds back until the loading screen finishes (body.ls-done) */
.ar { opacity: 0; }
body.ls-done .ar {
  animation: pageRise 0.9s var(--ease) both;
  animation-delay: var(--ard, 0s);
}
@media (prefers-reduced-motion: reduce) {
  .ar { opacity: 1; }
}

/* The "Scroll" cue on the Oak and MulviumSOS pages: js/scroll-cue.js shows it
   (.is-shown); it leaves quickly and returns slowly */
.oak-cue,
.fsos-cue {
  position: fixed;
  left: 0;
  right: 0;
  bottom: clamp(18px, 4vh, 36px);
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.oak-cue.is-shown,
.fsos-cue.is-shown { opacity: 1; transition-duration: 1.2s; }
