/* =========================================================================
   jpatty.com — signature design system
   Two worlds, one mechanic:
     · PUBLIC world  — cinematic aurora canvas (violet/cyan/pink)
     · FAMILY world  — the airlock flips the palette (emerald/amber), adds a
       grid texture, a dock, and a denser app feel
   Pane pages slide over the canvas via cross-document View Transitions.
   ========================================================================= */

/* ---- Cross-document view transitions (progressive enhancement) ------- */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: .35s; }

.pane-sheet { view-transition-name: pane; }

::view-transition-new(pane):only-child { animation: sheetIn .5s cubic-bezier(.22,1,.36,1); }
::view-transition-old(pane):only-child { animation: sheetOut .3s ease-in; }

@keyframes sheetIn  { from { transform: translateX(60px); opacity: 0; } }
@keyframes sheetOut { to   { transform: translateX(60px); opacity: 0; } }

/* ---- Tokens ----------------------------------------------------------- */
:root {
  /* PUBLIC world: blacks & whites, medium-to-deep blues carrying the
     accents; gold appears ONLY in the wordmark + a couple of tiny glints. */
  --bg:        #050608;
  --bg-2:      #0b0d12;
  --surface:   rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --border:    rgba(255,255,255,0.10);
  --border-2:  rgba(255,255,255,0.18);
  --ink:       #f4f5f7;
  --ink-soft:  #b3b8c2;
  --ink-mute:  #71767f;
  --accent:    #3564c9;   /* medium blue   */
  --accent-2:  #7ea2e6;   /* steel blue    */
  --accent-3:  #1b3a80;   /* deep blue     */
  --gold:      #d4af37;   /* the counter to darkness — use sparingly */
  --gold-2:    #f2e9d8;   /* champagne */
  --gold-3:    #9a7b24;   /* deep gold */
  --glow:      0 0 60px rgba(53,100,201,0.35);
  --radius:    20px;
  --rail-h:    56px;
  --ease:      cubic-bezier(.22,1,.36,1);
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Light theme: blue spread across the page — blue-tinted paper, surfaces,
     and borders, not just blue accents. */
  --bg:        #edf2fa;
  --bg-2:      #dfe8f5;
  --surface:   rgba(28,58,128,0.04);
  --surface-2: rgba(28,58,128,0.08);
  --border:    rgba(28,58,128,0.13);
  --border-2:  rgba(28,58,128,0.24);
  --ink:       #0f1420;
  --ink-soft:  #3e4a63;
  --ink-mute:  #66718c;
  --accent-2:  #2b55b0;   /* steel blue too pale on white — deepen */
  --gold-2:    #8a6d1f;   /* champagne invisible on white — darken */
  --glow:      0 0 60px rgba(53,100,201,0.28);
  color-scheme: light;
}

/* The FAMILY world — crossing the airlock floods the monochrome with color. */
body.world-family {
  --accent:    #34d399;   /* emerald */
  --accent-2:  #38bdf8;   /* sky     */
  --accent-3:  #a78bfa;   /* violet  */
  --glow:      0 0 60px rgba(52,211,153,0.30);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  padding-top: var(--rail-h);
  transition: background .6s var(--ease), color .4s var(--ease);
}

/* Techie grid texture, family world only. */
body.world-family::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
  pointer-events: none;
}

/* ---- Animated aurora background --------------------------------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  filter: blur(70px) saturate(140%);
  opacity: .9;
}
.aurora span {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 45% 55% 60% 40%;
  mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
  will-change: transform;
}
:root[data-theme="light"] .aurora span { mix-blend-mode: multiply; opacity: .45; }
.aurora span:nth-child(1) { background: var(--accent);   top: -18vmax; left: -12vmax; animation-duration: 30s; }
.aurora span:nth-child(2) { background: var(--accent-2); bottom: -22vmax; right: -14vmax; animation-duration: 24s; animation-delay: -6s; }
.aurora span:nth-child(3) { background: var(--accent-3); top: 30%; left: 40%; animation-duration: 34s; animation-delay: -12s; }
/* Public world: a deep-blue night sky — medium & deep blue blobs over black,
   one soft white breath so it never goes flat. Restrained, not neon. */
body.world-public .aurora { opacity: .6; }
body.world-public .aurora span:nth-child(2) { opacity: .7; }
body.world-public .aurora span:nth-child(3) { background: #e8eaef; opacity: .35; }
:root[data-theme="light"] body.world-public .aurora { opacity: .55; }
/* Family world: aurora recedes — calmer, further away. */
body.world-family .aurora { opacity: .5; filter: blur(90px) saturate(120%); }

@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(6vmax,-4vmax,0) scale(1.15) rotate(20deg); }
  100% { transform: translate3d(-5vmax,5vmax,0) scale(.95) rotate(-15deg); }
}

/* ---- The rail (persistent top bar, both worlds) ------------------------ */
.rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--rail-h);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0 clamp(.9rem, 3vw, 1.8rem);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.rail-brand {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  display: flex; align-items: baseline; gap: .45em;
}
.rail-brand span { color: var(--gold); } /* a tiny gold glint */
.rail-brand em {
  font-style: normal;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.rail-links { display: flex; gap: .3rem; }
.rail-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .88rem;
  padding: .45em .85em;
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.rail-link:hover { color: var(--ink); background: var(--surface-2); }
.rail-end { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.rail-form { margin: 0; display: flex; }
.rail-lock {
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: .5em 1em;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease);
}
.rail-lock:hover { border-color: var(--accent); box-shadow: var(--glow); transform: translateY(-1px); }
.rail-lock.is-open { border-color: var(--accent); }

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition: transform .4s var(--ease), border-color .3s;
}
.theme-toggle:hover { transform: rotate(180deg) scale(1.08); border-color: var(--accent); }

/* ---- The dock (family world) ------------------------------------------ */
.dock {
  position: fixed;
  z-index: 40;
  display: flex;
  gap: .35rem;
  padding: .45rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  /* Desktop: floating left edge, vertical. */
  left: 14px; top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
}
.dock-item {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.25rem;
  transition: transform .3s var(--ease), background .25s;
}
.dock-item:hover { transform: scale(1.22); background: var(--surface-2); }
.dock-home { border-bottom: 1px solid var(--border); border-radius: 50% 50% 0 0; padding-bottom: 2px; margin-bottom: 2px; }
/* Mobile: dock becomes a bottom bar. */
@media (max-width: 720px) {
  .dock {
    left: 50%; top: auto; bottom: 12px;
    transform: translateX(-50%);
    flex-direction: row;
  }
  .dock-home { border-bottom: none; border-right: 1px solid var(--border); border-radius: 50% 0 0 50%; padding-bottom: 0; margin-bottom: 0; padding-right: 2px; margin-right: 2px; }
  body.world-family { padding-bottom: 84px; }
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: .85em 1.5em;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { box-shadow: 0 10px 40px color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---- Hero (public canvas) ---------------------------------------------- */
.hero {
  min-height: calc(92vh - var(--rail-h));
  display: grid;
  place-items: center;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}
.hero-inner { max-width: 780px; animation: rise 1s var(--ease) both; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .5em;
  font-size: .72rem;
  color: var(--ink-mute);
  margin: 0 0 1.2rem;
  padding-left: .5em;
}
.wordmark {
  font-family: var(--font);
  font-weight: 700;
  line-height: .92;
  margin: 0 0 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .04em;
}
.wordmark span { display: block; }
.wordmark .w1 { font-size: clamp(1.1rem, 4vw, 2rem); color: var(--ink-soft); letter-spacing: .3em; text-transform: uppercase; }
.wordmark .w2 {
  font-size: clamp(3.4rem, 16vw, 9rem);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  background-size: 220% 100%;
  animation: sheen 8s linear infinite;
  /* DARK theme (the primary look): true-black letters with a bright gold
     band washing through the name — plus the blade spin + sound on hover.
     The letters read against the lifted blue pool behind the hero (below). */
  background-image: linear-gradient(100deg,
    #060606 0%, #060606 36%,
    var(--gold-3) 44%, var(--gold) 49%, #f2e9d8 51%, var(--gold) 53%, var(--gold-3) 60%,
    #060606 68%, #060606 100%);
  background-size: 280% 100%;
  animation: sheen 7s linear infinite;
  filter: drop-shadow(0 0 22px rgba(212,175,55,.25));
}
/* The middle title section lifts to a not-as-dark blue so black letters pop. */
:root[data-theme="dark"] body.world-public .hero-inner {
  background: radial-gradient(ellipse 78% 62% at 50% 42%,
    rgba(74,116,204,.34), rgba(53,100,201,.16) 55%, transparent 75%);
  border-radius: 40px;
}
/* LIGHT theme: polished steel-blue chrome (the shimmer that lived on dark,
   re-cut for a light ground). Arrives via the roadrunner race-in (app.js). */
:root[data-theme="light"] .wordmark .w2 {
  background-image: linear-gradient(115deg,
    #16305e 0%, #2b55b0 30%, #6f9be0 48%, #1b3a80 56%, #3564c9 70%, #16305e 100%);
  filter: drop-shadow(0 6px 18px rgba(53,100,201,.3));
}
/* 3D stage for the hover spin (driven by app.js). */
.wordmark { perspective: 900px; }
.wordmark .w2 { transform-style: preserve-3d; will-change: transform; cursor: default; }
.wordmark .w3 { font-size: clamp(1.4rem, 6vw, 3rem); color: var(--ink); letter-spacing: .18em; text-transform: lowercase; }

@keyframes sheen { to { background-position: 200% 0; } }

.lede {
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 0 auto 2.4rem;
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---- Word of the Day (landing: below the titling, above the tiles) ------ */
.wod {
  /* spans the middle of the screen — roughly 2/3 of the page on desktop */
  width: clamp(320px, 66vw, 1060px);
  max-width: 92vw;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  text-align: center;
  /* the whole block writes in blue, not normal ink */
  color: #5b82d8;
  display: grid;
  gap: .6rem;
}
:root[data-theme="light"] .wod { color: #2b55b0; }
@media (min-width: 760px) {
  .wod {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 2.6rem;
    text-align: left;
  }
  .wod-eyebrow { grid-column: 1 / -1; }
  .wod-line, .wod-sub { justify-content: flex-start; }
  .wod-right {
    padding-left: 2.6rem;
    border-left: 1px solid rgba(91,130,216,.35);
  }
}
.wod-pos {
  font-size: .64rem;
  font-family: ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5b82d8;
  border: 1px solid rgba(91,130,216,.4);
  background: rgba(53,100,201,.10);
  border-radius: 999px;
  padding: .2em .9em;
  align-self: center;
}
.wod-sub {
  display: flex; align-items: center; justify-content: center;
  gap: .9rem; flex-wrap: wrap;
  margin-top: .5rem;
}
.wod-ipa { font-family: ui-monospace, monospace; font-size: .82rem; color: #46639f; }
:root[data-theme="light"] .wod-ipa { color: #5b82d8; }
.wod-speak {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  color: #5b82d8;
  border: 1px solid rgba(91,130,216,.45);
  background: rgba(53,100,201,.10);
  border-radius: 999px;
  padding: .5em 1.1em;
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.wod-speak:hover { transform: scale(1.06); border-color: #5b82d8; box-shadow: 0 0 24px rgba(53,100,201,.35); }
.wod-speak .wod-speak-live { display: none; align-items: center; gap: .45em; }
.wod-speak.speaking .wod-speak-idle { display: none; }
.wod-speak.speaking .wod-speak-live { display: inline-flex; }
.wod-speak.speaking {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  color: #fff; border-color: transparent;
}
.wod-speak-live i {
  width: 3px; height: 12px;
  background: currentColor;
  border-radius: 2px;
  animation: wodBars .6s ease-in-out infinite;
}
.wod-speak-live i:nth-child(2) { animation-delay: .1s; }
.wod-speak-live i:nth-child(3) { animation-delay: .2s; }
.wod-speak-live i:nth-child(4) { animation-delay: .15s; }
@keyframes wodBars { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
/* WOD as its own pane page (/word) — stacked card inside the sheet. */
.wod-pane { color: #5b82d8; display: flex; flex-direction: column; gap: .6rem; }
:root[data-theme="light"] .wod-pane { color: #2b55b0; }
.wod-pane .wod-line, .wod-pane .wod-sub { justify-content: flex-start; }
.wod-pane .wod-word { font-size: clamp(2.1rem, 6vw, 3.2rem); }
.wod-rule {
  width: 44px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  margin: .4rem 0;
}
.wod-pane .wod-def { font-size: 1.08rem; max-width: 52ch; }

.wod-ex {
  margin: .8rem 0 0;
  padding: .55rem 1rem;
  font-style: italic;
  font-size: .92rem;
  color: #6d8fd8;
  border-left: 3px solid rgba(91,130,216,.55);
  border-radius: 0 10px 10px 0;
  background: rgba(53,100,201,.07);
}
:root[data-theme="light"] .wod-ex { color: #33549c; }
.wod-eyebrow {
  font-size: .68rem;
  letter-spacing: .45em;
  text-transform: uppercase;
  color: #46639f;
  margin: 0 0 .8rem;
}
:root[data-theme="light"] .wod-eyebrow { color: #5b82d8; }
.wod-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .7rem;
  flex-wrap: wrap;
}
.wod-word {
  font-family: var(--font);
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 700;
  margin: 0;
  background: linear-gradient(120deg, #7ea2e6, #3564c9 60%, #24499e);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
:root[data-theme="light"] .wod-word {
  background: linear-gradient(120deg, #2b55b0, #1b3a80);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.wod-pron { font-size: 1rem; color: #4f74bd; font-style: italic; }
.wod-def {
  font-size: 1.02rem;
  line-height: 1.6;
  margin: .9rem 0 0;
  color: #6d8fd8;
}
:root[data-theme="light"] .wod-def { color: #33549c; }
.wod-def em { color: #4f74bd; }

/* ---- WOD subscriptions (the /word pane) ---------------------------------- */
.wod-block-head {
  font-family: var(--font);
  font-size: 1.05rem;
  margin: .4rem 0 .8rem;
  color: #7ea2e6;
  display: flex; align-items: baseline; gap: .8rem;
}
:root[data-theme="light"] .wod-block-head { color: #2b55b0; }
.sub-count { font-size: .72rem; font-family: ui-monospace, monospace; color: #46639f; }
.sub-form { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.sub-form input, .sub-form select {
  padding: .7em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(91,130,216,.4);
  background: var(--surface);
  color: var(--ink);
  font-size: .92rem;
  outline: none;
}
.sub-form input:focus, .sub-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.sub-form input[name="name"] { width: 9.5rem; }
.sub-form input[name="email"] { flex: 1; min-width: 13rem; }
.sub-form .btn { padding: .7em 1.3em; font-size: .92rem; }
.sub-fine { font-size: .78rem; color: var(--ink-mute); margin: .6rem 0 0; }
.sub-note { font-size: .9rem; margin: 0 0 .8rem; padding: .5em 1em; border-radius: 12px; }
.sub-note.ok { color: #34d399; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); }
.sub-note.dup { color: #f87171; background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.35); }
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.sub-row {
  display: grid;
  grid-template-columns: minmax(6rem, auto) 1fr auto auto;
  gap: .9rem; align-items: center;
  padding: .55rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sub-name { font-weight: 600; font-size: .92rem; }
.sub-email { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; }
.sub-time { font-size: .76rem; color: #7ea2e6; white-space: nowrap; }
.sub-remove {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--ink-mute);
  font-size: .75rem;
  cursor: pointer;
  transition: border-color .3s, color .3s;
}
.sub-remove:hover { border-color: #f87171; color: #f87171; }
@media (max-width: 560px) {
  .sub-row { grid-template-columns: 1fr auto; }
  .sub-email { grid-column: 1 / -1; }
}

/* ---- Contact pane -------------------------------------------------------- */
.contact-card { text-align: center; padding: 1.5rem 0; }
.contact-email {
  display: inline-block;
  font-family: var(--font);
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  padding: .5em 1.2em;
  border-radius: 16px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.contact-email:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow); }
.contact-note { color: var(--ink-mute); margin: 1rem 0 0; }

/* ---- Scribe gate (WOD subscriber list) ----------------------------------- */
.scribe-gate { margin-top: .4rem; }
.scribe-gate summary {
  cursor: pointer;
  color: var(--ink-mute);
  font-size: .85rem;
  list-style: none;
  display: inline-flex; align-items: center; gap: .4em;
  padding: .3em 0;
}
.scribe-gate summary::before { content: "🔒"; font-size: .8em; }
.scribe-gate summary:hover { color: var(--ink); }
.scribe-form { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; }
.scribe-form input {
  padding: .6em 1em; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface);
  color: var(--ink); font-size: .9rem; outline: none;
}
.scribe-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.scribe-form .btn { padding: .6em 1.2em; font-size: .9rem; }
.scribe-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.scribe-lock {
  font-size: .74rem; color: var(--ink-mute);
  background: transparent; border: 1px solid var(--border-2);
  border-radius: 999px; padding: .35em .9em; cursor: pointer;
  transition: border-color .3s, color .3s;
}
.scribe-lock:hover { border-color: var(--accent-3); color: var(--ink); }

/* ---- Deck of section tiles (public canvas) ------------------------------ */
.deck { max-width: 1120px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.deck-head { text-align: center; margin-bottom: 2.5rem; }
.deck-head h2 { font-family: var(--font); font-size: clamp(1.6rem,5vw,2.4rem); margin: 0 0 .3rem; }
.deck-head p { color: var(--ink-mute); margin: 0; }

.panes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}
.pane {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  backdrop-filter: blur(14px);
  transform: translateY(20px);
  opacity: 0;
  animation: paneIn .7s var(--ease) forwards;
  animation-delay: calc(var(--i) * 70ms + .2s);
  transition: transform .45s var(--ease), border-color .35s, box-shadow .45s;
}
.pane::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent, var(--surface-2));
  opacity: 0;
  transition: opacity .4s;
}
.pane:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: var(--border-2);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.pane:hover::before { opacity: 1; }
.pane-glyph { font-size: 1.9rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.pane-body { position: relative; z-index: 1; }
.pane-body h3 { margin: 0 0 .2rem; font-family: var(--font); font-size: 1.15rem; }
.pane-body p { margin: 0; color: var(--ink-mute); font-size: .88rem; }
.pane-lock { position: absolute; top: 12px; right: 14px; font-size: .8rem; opacity: .7; }
.pane-arrow {
  position: absolute; right: 16px; bottom: 14px;
  color: var(--accent-2);
  transform: translateX(-6px);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .4s;
}
.pane:hover .pane-arrow,
.app-card:hover .pane-arrow { transform: translateX(0); opacity: 1; }

@keyframes paneIn { to { transform: none; opacity: 1; } }

/* ---- Footer -------------------------------------------------------------- */
.foot {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--ink-mute);
  font-size: .85rem;
  display: flex; gap: .6rem; justify-content: center; align-items: center; flex-wrap: wrap;
}
.foot .dot { color: var(--gold); opacity: .7; } /* a tiny gold glint */

/* ---- Pane pages: sheet sliding over the canvas --------------------------- */
.pane-stage {
  position: fixed;
  inset: var(--rail-h) 0 0 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
}
.pane-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  backdrop-filter: blur(3px) saturate(80%);
  cursor: pointer;
}
.pane-sheet {
  position: relative;
  width: min(680px, 94vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(26px);
  border-left: 1px solid var(--border-2);
  box-shadow: -40px 0 90px rgba(0,0,0,.45);
  animation: sheetSlide .55s var(--ease) both;
  overflow-y: auto;
}
@keyframes sheetSlide { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: clamp(1.4rem, 4vw, 2.2rem) clamp(1.4rem, 5vw, 2.6rem) 1.2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: inherit;
  backdrop-filter: blur(26px);
}
.sheet-glyph { font-size: 2.4rem; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.sheet-titles h1 { font-family: var(--font); font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: 0 0 .15rem; }
.sheet-titles p { margin: 0; color: var(--ink-mute); font-size: .9rem; }
.sheet-close {
  margin-left: auto;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .95rem;
  transition: transform .3s var(--ease), border-color .3s, color .3s;
}
.sheet-close:hover { transform: rotate(90deg); border-color: var(--accent-3); color: var(--ink); }

.sheet-body { padding: clamp(1.4rem, 5vw, 2.6rem); }

/* ---- Calendar (very colorful) ---------------------------------------------- */
/* The calendar wants room to breathe — nearly the whole viewport. */
.pane-sheet.wide { width: min(1400px, 98vw); }

.cal-head {
  display: flex; align-items: center; justify-content: center; gap: 1.4rem;
  margin-bottom: 1.2rem;
}
.cal-month-name { font-family: var(--font); font-size: clamp(1.3rem, 3vw, 1.8rem); margin: 0; }
.cal-month-name span { color: var(--ink-mute); font-weight: 500; }
.cal-nav {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.2rem;
  transition: transform .3s var(--ease), border-color .3s;
}
.cal-nav:hover { transform: scale(1.12); border-color: var(--accent); }

.cal-dows {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 4px;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute); text-align: center;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 4px 5px;
  overflow: hidden;
}
.cal-cell.blank { border: none; background: transparent; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.cal-daynum { font-size: .72rem; color: var(--ink-mute); display: block; margin-bottom: 2px; }
.cal-cell.today .cal-daynum { color: var(--accent); font-weight: 700; }
.cal-pill {
  display: block;
  font-size: .64rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
  padding: .2em .55em;
  border-radius: 6px;
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-more { font-size: .62rem; color: var(--ink-mute); }

.cal-up-head { font-family: var(--font); margin: 2.2rem 0 .9rem; font-size: 1.15rem; }
.cal-up { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.cal-up-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: .9rem;
  align-items: baseline;
  padding: .65rem .9rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--c);
}
.cal-up-date { font-size: .78rem; font-weight: 700; color: var(--c); }
.cal-up-title { font-weight: 600; }
.cal-up-meta { font-size: .78rem; color: var(--ink-mute); }
.cal-up-empty { color: var(--ink-mute); font-style: italic; }
.cal-setup ol { line-height: 2; color: var(--ink-soft); }
.cal-setup code { background: var(--surface-2); padding: .15em .45em; border-radius: 6px; }

@media (max-width: 640px) {
  .cal-cell { min-height: 44px; padding: 3px; }
  .cal-pill { font-size: 0; height: 7px; width: 70%; border-radius: 4px; padding: 0; }
  .cal-up-row { grid-template-columns: 1fr; gap: .1rem; }
}

/* Light theme: give the calendar sheet a deep-blue surround so the white
   tiles pop against it, instead of white-on-pale-blue washing out. */
:root[data-theme="light"] .pane-sheet.wide {
  background: color-mix(in srgb, #1b3a80 92%, transparent);
  border-left-color: rgba(11,26,60,0.6);
}
:root[data-theme="light"] .pane-sheet.wide .sheet-head { border-bottom-color: rgba(255,255,255,0.14); }
:root[data-theme="light"] .pane-sheet.wide .sheet-titles h1,
:root[data-theme="light"] .pane-sheet.wide .cal-month-name { color: #f4f7ff; }
:root[data-theme="light"] .pane-sheet.wide .sheet-titles p,
:root[data-theme="light"] .pane-sheet.wide .cal-month-name span,
:root[data-theme="light"] .pane-sheet.wide .cal-dows { color: #b8c6e6; }
:root[data-theme="light"] .pane-sheet.wide .cal-nav,
:root[data-theme="light"] .pane-sheet.wide .sheet-close { color: #dbe4fb; border-color: rgba(255,255,255,0.28); }
:root[data-theme="light"] .pane-sheet.wide .cal-up-head { color: #f4f7ff; }

/* White tiles pop against the deep-blue surround. */
:root[data-theme="light"] .cal-cell {
  background: #ffffff;
  border-color: rgba(255,255,255,0.5);
}
:root[data-theme="light"] .cal-daynum { color: #4a5670; }
:root[data-theme="light"] .cal-up-row { background: #ffffff; border-color: rgba(255,255,255,0.4); }
:root[data-theme="light"] .cal-up-title { color: #0f1420; }

/* ---- Calendar topic filter ------------------------------------------------- */
.cal-filter {
  display: flex; align-items: center; gap: .7rem;
  margin: 0 0 1.1rem;
}
.cal-filter-label {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute);
}
.cal-select-wrap {
  --swatch: transparent;
  position: relative; display: inline-flex; align-items: center;
}
/* Color swatch of the chosen event, left of the text. */
.cal-select-wrap::before {
  content: ""; position: absolute; left: .7rem;
  width: 11px; height: 11px; border-radius: 3px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  pointer-events: none;
  transition: background .25s var(--ease);
}
.cal-select-wrap[style*="transparent"]::before { box-shadow: none; }
/* Chevron. */
.cal-select-wrap::after {
  content: "▾"; position: absolute; right: .8rem;
  color: var(--ink-mute); pointer-events: none; font-size: .8rem;
}
.cal-select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: .5rem 2.1rem .5rem 1.7rem;
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s;
}
.cal-select:hover { border-color: var(--accent); }
.cal-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.cal-select option { color: #0f1420; background: #fff; }

/* Deep-blue surround (light theme): make the control read on blue. */
:root[data-theme="light"] .pane-sheet.wide .cal-filter-label { color: #b8c6e6; }
:root[data-theme="light"] .pane-sheet.wide .cal-select {
  color: #f4f7ff; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.28);
}
:root[data-theme="light"] .pane-sheet.wide .cal-select-wrap::after { color: #b8c6e6; }

/* Dimming: when a topic is active, non-matches fade way back. */
.cal-scope.is-filtered .cal-pill.cal-dim {
  opacity: .16; filter: saturate(.4);
}
.cal-scope.is-filtered .cal-cell:has(.cal-pill:not(.cal-dim)) {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.cal-pill { transition: opacity .3s var(--ease), filter .3s var(--ease); }

/* ---- Ghost placeholders --------------------------------------------------- */
.ghost-block { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.ghost-row {
  display: flex; align-items: center; gap: 1rem;
  opacity: 0;
  animation: paneIn .6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 90ms + .25s);
}
.ghost-dot {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ghost-bar {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.soon-tag {
  display: inline-block;
  padding: .5em 1.1em;
  border-radius: 999px;
  border: 1px dashed var(--border-2);
  color: var(--ink-mute);
  font-size: .85rem;
}

/* ---- Auth form (inside the login pane) ------------------------------------ */
.auth-form { display: flex; flex-direction: column; gap: .9rem; max-width: 380px; }
.auth-form input {
  padding: .9em 1.1em;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.auth-error { color: var(--accent-3); margin: 1.1rem 0 0; font-size: .9rem; }

/* ---- Family canvas (dashboard) --------------------------------------------- */
.dash-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 4.5rem) 1.5rem 5rem;
}
/* Dock floats over the left margin — no extra padding needed; content centers evenly. */
/* The airlock entrance — the family world materializes. */
.airlock { animation: airlock .8s var(--ease) both; }
@keyframes airlock {
  from { opacity: 0; transform: scale(.965); filter: saturate(.4) brightness(1.3); }
  to   { opacity: 1; transform: none;        filter: none; }
}
.dash-title { font-family: var(--font); font-size: clamp(2rem,7vw,3.4rem); margin: 0 0 .3rem; }
.dash-lede { color: var(--ink-soft); margin: 0 0 3rem; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
}
.app-card {
  position: relative;
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.6rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  backdrop-filter: blur(14px);
  transform: translateY(20px); opacity: 0;
  animation: paneIn .6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 60ms + .15s);
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
}
.app-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 18px 44px rgba(0,0,0,.35); }
.app-glyph { font-size: 2rem; }
.app-ext { font-size: .7rem; color: var(--accent-2); vertical-align: super; }
.app-name { font-family: var(--font); font-weight: 600; font-size: 1.15rem; }
.app-blurb { color: var(--ink-mute); font-size: .86rem; }

/* ---- The intro screen (the front door at "/") -------------------------------
   A deliberately dark, single-theme scene: two askew B&W photos behind tinted
   glass, a front glass layer of white/blue writing, and a light so faint it's
   almost missable drifting across the field of view as you scroll.          */

.intro-page {
  padding-top: 0;
  background: #000;
  color: #f2f4f9;
}

/* Layer 1 — the photographs: oversized, borderless, sunk into the black.
   They bleed off the edges and their own darkness does the tinting work
   (the Kingsmen treatment: tonal depth, not heavy blur). */
.intro-photos { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.intro-ph {
  position: absolute;
  /* darker still, but crisp — sharpness from contrast, not light */
  filter: grayscale(1) contrast(1.22) brightness(.32);
  /* feathered edges — the image dissolves into the dark, no frame */
  -webkit-mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, black 56%, transparent 80%);
  mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, black 56%, transparent 80%);
  will-change: transform;
}
.intro-ph1 {
  width: min(74vw, 940px);
  top: -8%; left: -14%;
  transform: rotate(-7deg);
}
.intro-ph2 {
  width: min(64vw, 820px);
  top: 32%; right: -4%;
  transform: rotate(5deg);
}
@media (max-width: 640px) {
  .intro-ph1 { width: 120vw; top: -4%; left: -30%; }
  .intro-ph2 { width: 105vw; top: 34%; right: -16%; }
}

/* Layer 2 — clear tinted glass: no blur at all, the photos stay sharp;
   only a thin dark tint so type sits comfortably on top. */
.intro-tint {
  position: fixed; inset: 0; z-index: 1;
  background: linear-gradient(160deg, rgba(0,0,0,.38), rgba(4,8,18,.26) 55%, rgba(0,0,0,.44));
}

/* Layer 3 — the barely-there light drifting across the field of view. */
.intro-sheen {
  position: fixed; inset: -40%; z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(226,234,250,.035), transparent 70%);
  will-change: transform;
}

/* Layer 4 — the front glass carrying the writing. */
.intro-glass {
  position: relative; z-index: 3;
  /* faint diagonal reflection streaks — the surface of the front pane */
  background:
    linear-gradient(115deg, transparent 42%, rgba(240,244,252,.012) 46%, transparent 50%),
    linear-gradient(115deg, transparent 68%, rgba(240,244,252,.008) 73%, transparent 78%);
}

.intro-hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 3rem 1.5rem 5rem;
  position: relative;
}
.intro-mark {
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .45em;
  text-transform: uppercase;
  color: rgba(242,244,249,.55);
  margin: 0 0 3.2rem;
}
.intro-mark span { color: #7ea2e6; }
.intro-quote { max-width: 720px; margin: 0; animation: rise 1.4s var(--ease) both; }
.intro-quote p {
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(1.4rem, 3.6vw, 2.3rem);
  line-height: 1.45;
  color: #f2f4f9;
  margin: 0 0 1.6rem;
  text-wrap: balance;
}
.intro-quote cite {
  font-style: normal;
  font-size: .9rem;
  letter-spacing: .12em;
  color: #7ea2e6;
}
.intro-quote cite em { font-style: italic; color: rgba(126,162,230,.75); }

.intro-cue {
  position: absolute;
  bottom: 2.2rem; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  font-size: .72rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(242,244,249,.45);
}
.intro-chevron {
  font-size: 1.6rem;
  animation: cueBob 2.2s var(--ease) infinite;
  color: rgba(126,162,230,.8);
}
@keyframes cueBob { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(8px); opacity: 1; } }

.intro-mid {
  min-height: 70vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}
.intro-line {
  font-family: var(--font);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: rgba(242,244,249,.9);
  margin: 0 0 .6rem;
}
.intro-line-cite { font-size: .82rem; letter-spacing: .14em; color: #7ea2e6; margin: 0; }

.intro-enter {
  min-height: 80vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 3rem;
  text-align: center;
  padding: 2rem 1.5rem 6rem;
}
.intro-enter-quote .intro-line { font-size: clamp(1.05rem, 2.4vw, 1.5rem); }
.intro-btn {
  font-family: var(--font);
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  font-weight: 500;
  color: #eef2fb;
  text-decoration: none;
  padding: 1.1em 2.2em;
  border-radius: 18px;
  background: linear-gradient(140deg, #16264d, #0d1730 55%, #1b3a80);
  border: 1px solid rgba(212,175,55,.55);           /* the tiny bit of gold */
  box-shadow: 0 0 0 1px rgba(4,6,12,.8), 0 24px 70px rgba(27,58,128,.45);
  transition: transform .4s var(--ease), box-shadow .4s, border-color .4s;
}
.intro-btn strong { font-weight: 700; }
.intro-btn strong span { color: var(--gold); }
.intro-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(212,175,55,.9);
  box-shadow: 0 0 0 1px rgba(4,6,12,.8), 0 30px 90px rgba(53,100,201,.6);
}

/* ---- Motion & responsive safety --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aurora span { animation: none; }
  @view-transition { navigation: none; }
}
@media (max-width: 560px) {
  .rail-links { display: none; }
  .rail-brand em { display: none; }
}
