/* Shared styles for every page. Colours come only from tokens.css. */
:root { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .24 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 50% at 0% 30%, var(--wash-sage), transparent 70%),
    radial-gradient(ellipse 60% 45% at 100% 75%, var(--wash-sage), transparent 70%),
    var(--bg);
  background-attachment: scroll, fixed, fixed, scroll;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  overflow-x: clip;
  overflow-wrap: break-word; /* long titles never force horizontal scroll */
}

/* Faint starfield (sparse dots in two tile sizes so the repeat never shows)
   and a whisper of grain. Both sit behind everything and never take clicks. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  opacity: var(--star-opacity);
  background-image:
    radial-gradient(1px 1px at 12% 18%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 67% 9%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 41% 63%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 88% 44%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 23% 86%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 79% 77%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 5% 52%, var(--plum-bright), transparent 100%),
    radial-gradient(1px 1px at 55% 33%, var(--plum-bright), transparent 100%),
    radial-gradient(1px 1px at 33% 4%, var(--sage), transparent 100%),
    radial-gradient(1px 1px at 94% 92%, var(--sage), transparent 100%);
  background-size: 520px 520px, 520px 520px, 520px 520px, 520px 520px, 520px 520px,
                   520px 520px, 830px 830px, 830px 830px, 830px 830px, 830px 830px;
}
body::after {
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
  text-wrap: balance;
}
/* Cinzel Decorative: H1s, hero headline and logo only. The odd TH / OO joins
   are the font's kerning pairs (tested in Chrome: "oo" kerns from 1.70em to
   1.38em, so the O's interlock), not ligatures, so kerning is switched off as
   well as ligatures. */
h1, .display {
  font-family: var(--font-display);
  font-kerning: none;
  font-variant-ligatures: no-common-ligatures no-discretionary-ligatures;
  font-feature-settings: "kern" 0, "liga" 0, "dlig" 0;
  letter-spacing: 0.02em;
}
h1 { font-size: var(--step-3); line-height: 1.1; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0 0 1.1em; }
strong { font-weight: 600; }

img, video { max-width: 100%; height: auto; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--hairline-strong);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--text); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.kicker {
  margin: 0 0 var(--space-1);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--space-1); }

/* ---------- Ornament: three moon phases on a fading hairline ---------- */
.ornament {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(100%, 30rem);
  margin: var(--space-3) auto;
  color: var(--sage);
}
.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--hairline-strong));
}
.ornament::after { background: linear-gradient(to left, transparent, var(--hairline-strong)); }
.ornament svg { flex: none; width: 7.5rem; height: auto; fill: currentColor; }
.ornament svg path:first-child,
.ornament svg path:last-child { fill: var(--plum-bright); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.btn-primary {
  background: var(--sage-light);
  border-color: var(--sage-light);
  color: var(--on-accent);
  box-shadow: 0 0 28px -6px var(--glow-sage);
}
.btn-primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-ghost {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--text);
  box-shadow: 0 0 24px -8px var(--glow-plum);
}
.btn-ghost:hover { border-color: var(--sage); color: var(--text); box-shadow: 0 0 26px -4px var(--glow-plum); }
.btn-small { min-height: 2.6rem; padding: 0.55rem 1.2rem; font-size: 0.7rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}
/* The translucent, blurred bar lives on a pseudo-element: backdrop-filter on
   the header itself would trap the fixed-position menu panel inside it. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--veil);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--hairline);
  transition: opacity 0.35s ease, background-color 0.35s ease;
}
.site-header.is-scrolled::before { background: var(--veil-strong); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
}

/* Logo: Guy's master lockup (logo/mystic_roots_logo.svg), inlined verbatim
   by build.py so its live text uses the self-hosted Cinzel Decorative. The
   whole SVG scales as one unit from its height (viewBox 2565.59 x 616.35);
   nothing inside it is moved, cropped or recoloured. */
.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: none;
}
.logo-lockup { display: block; width: auto; aspect-ratio: 2645.59 / 616.35;   /* viewBox incl. the Guy-approved 80-unit text gap */ overflow: hidden; }
.site-logo-lockup { height: 3.5rem; }                                   /* 56px: 240px wide */
/* Where the full nav first arrives (70-80rem) the logo is a little smaller, so
   logo, eight links, Notify me and the theme toggle fit without overflow. */
@media (min-width: 70rem) and (max-width: 79.99rem) { .site-logo-lockup { height: 3rem; } }   /* 206px */
@media (max-width: 47.99rem) { .site-logo-lockup { height: clamp(2.4rem, calc((100vw - 12.5rem) / 4.29), 2.9rem); } }

/* Theme toggle (light / dark): a round icon button in the header and a
   labelled one in the mobile menu. Hidden until site.js runs. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;    /* 44px hit area */
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--link); color: var(--link); }
.theme-toggle .icon-sun,
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
.theme-toggle--menu {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: auto;
  height: auto;
  min-height: 2.75rem;
  margin: var(--space-3) 0 0;
  padding: 0.5rem 1.1rem;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
/* Narrow phones: the header toggle gives way (the menu has its own). */
@media (max-width: 22.5rem) { .header-inner > .theme-toggle { display: none; } }

/* Desktop nav: spaced small capitals, a drawn-in sage underline on hover and a
   small crescent above the current page (or the article's hub). */
.nav-desktop { display: none; }
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 1.3vw, 1.7rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0 0.4rem;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-soft);
  text-decoration: none;
  background: linear-gradient(var(--sage), var(--sage)) no-repeat 50% 100% / 0 1px;
  transition: color 0.2s ease, background-size 0.35s var(--ease);
}
.nav-list a:hover,
.nav-list a:focus-visible { color: var(--text); background-size: 100% 1px; }
.nav-list a[aria-current="page"],
.nav-list a.is-section { color: var(--text); }
/* CSS crescent: a ring with an offset inner shadow. */
.nav-list a[aria-current="page"]::before,
.nav-list a.is-section::before,
.menu-list a[aria-current="page"]::before,
.menu-list a.is-section::before {
  content: "";
  position: absolute;
  top: -0.32rem;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: -0.25rem;
  border-radius: 50%;
  box-shadow: inset 0.14rem -0.06rem 0 0 var(--sage);
  transform: rotate(-20deg);
}
.nav-list a.is-section::before,
.menu-list a.is-section::before { opacity: 0.6; }
.nav-list .nav-notify,
.menu-list .nav-notify {
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  box-shadow: 0 0 18px -4px var(--glow-plum), inset 0 0 12px -6px var(--glow-sage);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.nav-list .nav-notify:hover,
.nav-list .nav-notify:focus-visible {
  border-color: var(--sage);
  background-size: 0 1px;
  box-shadow: 0 0 22px -2px var(--glow-plum), inset 0 0 14px -6px var(--glow-sage);
}
.nav-list .nav-notify-item { margin-left: 0.4rem; }

/* ---------- Mobile menu: <details> slide-out panel ----------
   Without JS the summary opens and closes it (its label becomes "Close").
   site.js adds the close button, focus trap, Esc and scrim click. */
.menu { display: block; }
.menu-button {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.45rem 1rem 0.45rem 0.85rem;
  border: 1px solid var(--hairline-sage);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.menu-button::-webkit-details-marker { display: none; }
.menu-button:hover { border-color: var(--sage); }
.menu-icon { position: relative; display: block; width: 1.1rem; height: 0.7rem; }
.menu-icon::before,
.menu-icon::after,
.menu-icon span {
  content: "";
  position: absolute;
  right: 0;
  height: 1px;
  background: currentColor;
}
.menu-icon::before { top: 0; width: 100%; }
.menu-icon span { top: 50%; width: 65%; }
.menu-icon::after { bottom: 0; width: 100%; }
.menu-label-close,
.menu[open] .menu-label-open { display: none; }
.menu[open] .menu-label-close { display: inline; }

.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--bg-deep) 70%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(24rem, 88vw);
  padding: 5.5rem 2rem 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--hairline);
  background: var(--panel);
  box-shadow: -20px 0 60px -30px color-mix(in srgb, var(--text) 35%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .menu[open] .menu-panel { animation: menu-in 0.4s var(--ease); }
  .menu[open] .menu-scrim { animation: fade-in 0.3s ease; }
}
@keyframes menu-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.menu-close { display: none; }
.js .menu-button { z-index: 0; }
.js .menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--hairline-sage);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.js .menu-close:hover { border-color: var(--sage); }
/* Guy's wreath at the top of the panel (decorative: the panel is the menu). */
.menu-brand {
  position: absolute;
  top: 1rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}
/* Without JS the "Close" summary button sits over the panel's top right, so
   the lockup stays narrow enough to clear it. */
.menu-logo-lockup { height: 2.9rem; max-width: calc(100vw - 8.5rem); }
.menu-list { margin: 0; padding: 0; list-style: none; }
.menu-list li + li { border-top: 1px solid var(--hairline); }
.menu-list a {
  position: relative;
  display: block;
  padding: 0.8rem 0 0.8rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
}
.menu-list a:hover { color: var(--sage); }
.menu-list a:focus-visible { outline-offset: -1px; border-radius: var(--r-sm); }
.menu-list a[aria-current="page"]::before,
.menu-list a.is-section::before { top: 50%; left: 0; margin: -0.3rem 0 0; width: 0.65rem; height: 0.65rem; }
.menu-list .nav-notify-item { border-top: 0; padding-top: var(--space-3); }
.menu-list .nav-notify {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.menu .ornament { margin: var(--space-4) 0 var(--space-2); }
.menu-note { margin: 0; font-style: italic; font-size: 1rem; color: var(--text-soft); }

/* The brief asked for the menu below 900px, but seven links in spaced capitals
   need about 1,040px beside the logo, so the full nav starts at 70rem (1120px). */
@media (max-width: 69.99rem) {
  html:has(.menu[open]),
  html.menu-open { overflow: hidden; }
}
@media (min-width: 70rem) and (max-width: 80rem) {
  .nav-list { gap: 1.05vw; }
  .nav-list .nav-notify-item { margin-left: 0; }
}
/* The first 3rem of the desktop nav: slightly tighter caps, so at least 32px
   stays clear between the logo and the first link. */
@media (min-width: 70rem) and (max-width: 73rem) {
  .nav-list a { letter-spacing: 0.1em; }
  .nav-list .nav-notify { padding-left: 0.95rem; padding-right: 0.95rem; }
}
@media (min-width: 70rem) {
  .header-inner { gap: 2rem; }   /* at least 32px between the logo and the nav */
  .nav-desktop { display: block; }
  .menu { display: none; }
}

/* ---------- Page frame ---------- */
main { display: block; padding: var(--space-4) var(--gutter) 0; }
main:focus { outline: none; }
/* Text keeps a comfortable measure; wide components opt out below. */
main > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
main > h1 { max-width: var(--wrap-narrow); margin-top: var(--space-3); text-align: center; }
main > h1 + .ornament { margin-top: 0; margin-bottom: var(--space-4); }
main > .guides,
main > .related,
main > .article,
main > .breadcrumb { max-width: var(--wrap); }

/* ---------- Shared content helpers (hub pages and home) ---------- */
.hub-art {
  display: block;
  width: 100%;
  border-radius: var(--arch-16x9);
  margin-bottom: var(--space-4);
  box-shadow: 0 30px 80px -40px var(--glow-plum);
}
main > .hub-art { max-width: 62rem; }
main > p { color: var(--text-soft); }
.note { font-size: 1rem; font-style: italic; color: var(--text-soft); }
.arriving {
  margin-top: var(--space-4);
  text-align: center;
  color: var(--sage);
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

/* ---------- Guide cards (hub listings, related guides) ---------- */
.guides, .related { margin-top: var(--space-5); }
.guides > h2, .related > h2 { text-align: center; }
.guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: var(--space-4) var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
/* Guides fill the width: two or three share the row. */
.guide-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
/* A single guide becomes a wide feature: picture beside its words. */
.guide-list:has(> li:only-child) { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) {
  .guide-list > .guide-card:only-child {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
  }
  .guide-list > .guide-card:only-child .guide-card-img { aspect-ratio: 16 / 10; }
  .guide-list > .guide-card:only-child .guide-card-body { padding: 0; text-align: left; }
  .guide-list > .guide-card:only-child h2,
  .guide-list > .guide-card:only-child h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); margin-bottom: var(--space-2); }
  .guide-list > .guide-card:only-child p { font-size: var(--step-1); line-height: 1.6; }
  .guide-list > .guide-card:only-child .guide-card-body::after {
    content: "Read the guide \2726";
    display: block;
    margin-top: var(--space-3);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sage);
  }
}
.guide-card,
.card {
  position: relative;
  display: flex;
  flex-direction: column;
}
.guide-card-img,
.card-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--arch-4x5);
  transition: transform 0.9s var(--ease), filter 0.6s ease;
}
.card-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--arch-4x5);
  border: 1px solid var(--hairline);
  isolation: isolate;
}
.card-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--hairline);
  pointer-events: none;
}
.guide-card-body,
.card-body { padding: var(--space-3) var(--space-1) 0; text-align: center; }
.guide-card h3,
.card h3 { margin: 0 0 var(--space-1); font-size: 1.2rem; line-height: 1.3; }
.guide-card h3 a,
.card h3 a { color: var(--text); text-decoration: none; }
.guide-card h3 a::after,
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is the link */
.guide-card p,
.card p { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--text-soft); }
.guide-card:hover h3 a,
.card:hover h3 a { color: var(--sage); }
.guide-card h3 a:focus-visible,
.card h3 a:focus-visible { outline: none; }
.guide-card:focus-within,
.card:focus-within { outline: 2px solid var(--sage); outline-offset: 8px; border-radius: var(--r-img); }
@media (prefers-reduced-motion: no-preference) {
  .guide-card:hover .guide-card-img,
  .guide-card:focus-within .guide-card-img,
  .card:hover .card-img,
  .card:focus-within .card-img { transform: scale(1.06); }
}


/* ---------- Smoke overlay (scroll heroes and the sign-up band) ---------- */
/* Three soft smoke textures (pale lilac on transparent), oversized so their
   edges never show, drifting at different rates as you scroll. scrollscrub.js
   sets --s (0 to 1) on the hero or band; transform and opacity only. The head
   script adds .motion (motion allowed) or .lowdata (save-data / 2G): with
   .lowdata the textures are never requested, and without .motion (reduced
   motion, or no JS) they sit still and faint. */
.smoke {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 55%, black 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 75% at 50% 55%, black 40%, transparent 100%);
  /* On light sections the lilac smoke is screened into soft lavender mist. */
  mix-blend-mode: var(--smoke-blend);
  filter: var(--smoke-filter);
}
.smoke-l {
  position: absolute;
  inset: -20% -30%;
  background: 50% 50% / cover no-repeat;
  opacity: calc(var(--o) * (0.55 + var(--s, 0) * 0.9));
  transform: translate3d(calc(var(--s, 0) * var(--dx)), calc(var(--s, 0) * var(--dy)), 0)
             scale(calc(1 + var(--s, 0) * var(--ds)));
}
.smoke-bank   { --o: 0.38; --dx: -9%;  --dy: -6%;  --ds: 0.12; top: 15%; }
.smoke-wisps  { --o: 0.31; --dx: 14%;  --dy: -14%; --ds: 0.2; bottom: 25%; }
.smoke-plumes { --o: 0.2;  --dx: -18%; --dy: -22%; --ds: 0.3; }
.js:not(.lowdata) .smoke-bank   { background-image: url("/assets/smoke/smoke-bank.webp"); }
.js:not(.lowdata) .smoke-wisps  { background-image: url("/assets/smoke/smoke-wisps.webp"); }
.js:not(.lowdata) .smoke-plumes { background-image: url("/assets/smoke/smoke-plumes.webp"); }
html:not(.motion) .smoke-l { transform: none; opacity: calc(var(--o) * 0.45); }
@media (prefers-reduced-motion: reduce) {
  .smoke-l { transform: none !important; opacity: calc(var(--o) * 0.45) !important; }
}
/* The band: quieter, so the form stays the focus. */
.smoke--band { opacity: 0.7; }

/* ---------- Sign-up: a full-bleed smoky band; the arch is on the form card ---------- */
/* The band runs edge to edge. It is always a direct child of <main>, which has
   side padding of one gutter on most pages (none on the home page), so it pulls
   out by that much. No 100vw, so no horizontal scroll from scrollbars. */
.notify {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: var(--space-5) calc(-1 * var(--gutter)) 0;
  padding: var(--space-5) var(--gutter);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .24 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 50% 70% at 15% 30%, var(--wash-sage), transparent 70%),
    radial-gradient(ellipse 45% 60% at 90% 85%, var(--wash-sage), transparent 70%),
    var(--bg);
  color: var(--text);
}
main > .notify { max-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
.notify-inner { position: relative; z-index: 1; }   /* above the smoke layer */
.notify-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
}
.notify-copy { max-width: var(--measure); margin: 0 auto; text-align: center; }
/* Never split a word mid-way: the copy column is always wide enough for whole words. */
.notify h2 { margin: 0; font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.8rem); overflow-wrap: normal; word-break: normal; }
.notify .ornament { margin: var(--space-2) auto var(--space-3); }
.notify p { margin: 0 0 var(--space-2); color: var(--text-soft); }
.notify .notify-lede { color: var(--text); font-size: var(--step-1); line-height: 1.55; }
.notify .kicker { color: var(--sage); }
.notify strong { color: var(--text); }

/* The form card: a tall gothic-window arch, with the free printable (the
   reward) peeking out of its crown. */
.notify-card {
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin: 7rem auto 0;            /* room for the printable peeking above */
  padding: 8rem clamp(1.25rem, 4vw, 2.5rem) clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid var(--hairline-sage);
  border-radius: var(--r);
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--panel) 92%, transparent),
    color-mix(in srgb, var(--panel-soft) 96%, transparent));
  box-shadow: inset 0 1px 0 var(--hairline);
}
.notify-card::before {
  /* inner moulding, like the second line of a window frame */
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid var(--hairline);
  border-radius: inherit;
  pointer-events: none;
}
.notify-reward {
  position: absolute;
  top: -6.5rem;
  left: 50%;
  width: 9rem;                   /* about 12.7rem tall: it rises 6.5rem above the card */
  margin-left: -4.5rem;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--arch-4x5);
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--shade) 70%, transparent), 0 0 30px -6px var(--glow-plum);
  transform: rotate(-4deg);
}
.notify-reward img { display: block; width: 100%; height: auto; }

@media (min-width: 64rem) {
  .notify-inner {
    /* The copy column never drops below 18rem, whatever caps the band. */
    grid-template-columns: minmax(18rem, 1fr) minmax(0, 34rem);
    gap: clamp(3rem, 6vw, 7rem);
    align-items: center;
  }
  .notify-copy { margin: 0; text-align: left; }
  .notify .ornament { margin-left: 0; }
  .notify-card { margin: 7rem 0 0; }
}
.notify-form { text-align: left; }
.notify-form label { display: block; margin-bottom: var(--space-1); }
.notify-form input[type="email"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: var(--space-2);
  font: inherit;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
}
.notify-form button {
  min-height: 2.9rem;
  padding: 0.7rem 1.6rem;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--sage-light);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.notify-form button:hover { background: var(--text); }
/* Preview only, without JavaScript: the button is disabled until site.js runs. */
.notify-form button:disabled { opacity: 0.55; cursor: not-allowed; }
.notify-form button:disabled:hover { background: var(--sage-light); }
.notify .notify-preview-note { margin: var(--space-2) 0 0; font-style: italic; color: var(--text-soft); }
.notify-status:empty { display: none; }
.notify-status p { margin: 0; font-size: var(--step-1); font-style: italic; color: var(--text); }
.notify-status:focus { outline: none; }
.notify-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 1rem; }
.notify-consent label { display: inline; margin: 0; }
.notify-consent input { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--sage); }
.notify-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 0;
  padding: var(--space-4) var(--gutter) var(--space-3);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .24 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 60% 90% at 50% 0%, var(--wash-sage), transparent 70%),
    var(--bg);
  border-top: 1px solid var(--hairline);
  font-size: 1rem;
  color: var(--text-soft);
}
.footer-inner { max-width: var(--wrap); margin: 0 auto; }
.site-footer .ornament { width: min(100%, 40rem); margin: 0 auto var(--space-4); }
.footer-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1.1fr; gap: var(--space-4) clamp(2rem, 5vw, 5rem); }
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}
.footer-logo-lockup { height: 4rem; max-width: 100%; }   /* 64px: 266px wide */
.footer-line { margin: var(--space-2) 0 0; max-width: 24rem; font-style: italic; }
.footer-heading {
  margin: 0 0 var(--space-2);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sage);
}
.footer-nav ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: var(--space-3); }
.footer-nav li { break-inside: avoid; }
.footer-nav a { display: inline-block; padding: 0.3rem 0; color: var(--text-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }
.footer-notify p { margin: 0 0 var(--space-2); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
  color: var(--sage-dim);
}
.footer-base p { margin: 0; }
.footer-base a { color: var(--link); }

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

/* Hidden visually, kept for screen readers (e.g. a section heading the
   design shows through imagery instead). */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* (Placed last so it wins over the header and menu rules above.) */
/* 320px phones: tighten the lockup and the Menu button so both fit with the
   48px mark (no horizontal scroll). */
@media (max-width: 340px) {
  .header-inner { gap: 0.5rem; }
  /* The words "Menu"/"Close" stay for screen readers; the icon shows. */
  .menu-button { gap: 0; padding-left: 0.85rem; padding-right: 0.85rem; }
  .menu-button .menu-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
}

/* No starfield or white grain: the texture is the soft sage wash and paper
   grain on body and the bands instead. */
body::before, body::after { display: none; }
/* Smoke: the lilac textures turned into a soft grey-sage mist (dark theme only;
   the light "cover" look has none). */
.smoke-l { filter: grayscale(1) sepia(0.22) hue-rotate(45deg) brightness(1.05); }
:root:not([data-theme="dark"]) .smoke { display: none; }


/* ---------- Cover look: fine sage lines, airy capitals, pale sage bands ---------- */
h2 { letter-spacing: 0.1em; }
h1 { letter-spacing: 0.06em; }
.kicker { letter-spacing: 0.32em; }
.notify, .site-footer { background: var(--bg-alt); }
.notify { border-color: var(--line); }
.site-footer { border-top-color: var(--line); }
.notify-card { background: var(--panel); border-color: var(--line); box-shadow: none; }
.notify-card::before { border-color: var(--hairline); }
.notify-reward { box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--text) 35%, transparent); }
.card-frame { border-color: var(--line); }
.card-frame::after { box-shadow: none; }
/* The ornament: a fine crescent moon and star (after the logo) between two hairlines. */
.ornament::before, .ornament::after { background: var(--line); opacity: 0.8; }
.ornament svg { width: 3rem; fill: none; stroke: var(--sage); stroke-width: 1; }
.ornament svg .orn-moon { fill: color-mix(in srgb, var(--sage) 12%, transparent); stroke: var(--sage); stroke-width: 1.2; }
:root:not([data-theme="dark"]) .ornament svg .orn-star { fill: var(--logo-purple); stroke: none; }
:root[data-theme="dark"] .ornament svg .orn-star { fill: var(--logo-lavender); stroke: none; }

/* Sage and lavender, like the cover's foil: the ornament's middle ring and
   right-hand hairline are lavender, the rest sage. */
.ornament::after { background: var(--line-lavender); }


/* Light-theme twins (tools/build.py add_light_twins): one copy shows per theme.
   A hidden lazy image is never fetched. */
:root:not([data-theme="dark"]) .img-night,
:root[data-theme="dark"] .img-dawn { display: none !important; }

/* ---------- Smoke behind page panels (.has-smoke + .smoke--panel) ----------
   The same three textures as the heroes, drifting with the scroll (--s from
   scrollscrub.js) and, where motion is welcome, wandering slowly on their own.
   Light theme: tinted grey-lavender and multiplied so it shows as a faint mist
   on white. Dark theme: pale smoke over the sage-charcoal. */
.has-smoke { position: relative; isolation: isolate; }
.has-smoke > :not(.smoke) { position: relative; z-index: 1; }
.smoke--panel {
  inset: 0 calc(-1 * var(--gutter));
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, black 15%, transparent 92%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, black 15%, transparent 92%);
}
:root:not([data-theme="dark"]) .smoke.smoke--panel { display: block; mix-blend-mode: multiply; opacity: 0.58; }
:root:not([data-theme="dark"]) .smoke--panel .smoke-l {
  filter: grayscale(1) brightness(0.72) sepia(0.5) hue-rotate(225deg) saturate(1.3);
}
:root[data-theme="dark"] .smoke--panel { opacity: 0.6; }
@keyframes smoke-wander {
  0%   { translate: 0 0; }
  50%  { translate: 3% -2%; }
  100% { translate: -3% 1.5%; }
}
.motion .smoke--panel .smoke-l { animation: smoke-wander 46s ease-in-out infinite alternate; }
.motion .smoke--panel .smoke-wisps { animation-duration: 34s; animation-direction: alternate-reverse; }
.motion .smoke--panel .smoke-plumes { animation-duration: 58s; }
@media (prefers-reduced-motion: reduce) {
  .smoke--panel .smoke-l { animation: none !important; }
}
