/* RUMA v3 · shell area. Owned by the shell agent; reads tokens.css vars only.
   The quiet site-wide pieces: the RUMA veil (first visit), Turbo page fades, the mobile Book dock,
   the late-night "Goodnight from RUMA", the shared "A moment for you" / phrase partials, the 404. */

/* ---------- the RUMA veil: first visit per session, 600ms, never blocks a click ----------
   Kept short (was 860ms with a long opaque hold) so the page under it shows at once. */
.theme-v3 .veil { display: none; }
html.v3-veil .theme-v3 .veil {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: var(--z-veil); pointer-events: none;
  background: radial-gradient(40% 40% at 50% 50%, rgb(var(--candle-glow) / .1), transparent 70%), var(--night);
  animation: v3-veil-out 600ms cubic-bezier(.22, .61, .36, 1) both;
}
html.v3-veil .theme-v3 .veil__mark { animation: v3-veil-mark 600ms cubic-bezier(.23, 1, .32, 1) both; }
.theme-v3 .veil__mark { width: 46px; height: auto; color: var(--candle); filter: drop-shadow(0 0 22px rgb(var(--candle-glow) / .45)); }
@keyframes v3-veil-out { 0%, 25% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes v3-veil-mark { 0% { opacity: 0; transform: scale(.9); } 38% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { html.v3-veil .theme-v3 .veil { display: none; } }

/* ---------- subtle page transitions: Turbo 8 view transitions, a short cross-fade ---------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 340ms; animation-timing-function: cubic-bezier(.22, .61, .36, 1); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- mobile Book dock (brief 2265): thumb-reach, replaces the header button on phones ---------- */
.theme-v3 .book-dock { display: none; }
@media (max-width: 700px) {
  .theme-v3.has-dock { --dock-h: 76px; padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
  .theme-v3.has-dock .nav__cta { display: none; }
  .theme-v3 .book-dock {
    display: flex; justify-content: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-dock);
    padding: 14px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgb(var(--deep-rgb) / 0), rgb(var(--deep-rgb) / .9) 45%);
    transition: transform .5s var(--ease-out), opacity .4s var(--ease-warm);
  }
  .theme-v3 .book-dock__btn { width: 100%; max-width: 420px; box-shadow: 0 12px 36px -12px rgb(var(--candle-glow) / .55); }
  .theme-v3.menu-open .book-dock { opacity: 0; transform: translateY(100%); pointer-events: none; }
}

/* ---------- "Goodnight from RUMA" (brief 297–307): late night only, revealed by shell.js ---------- */
.theme-v3 .goodnight {
  position: relative; text-align: center; padding-block: clamp(80px, 10vw, 140px);
  background:
    radial-gradient(50% 70% at 50% 0%, rgb(var(--forest-rgb) / .22), transparent 70%),
    radial-gradient(60% 80% at 50% 100%, rgb(var(--dusk-rgb) / .4), transparent 72%), var(--night);
}
.theme-v3 .goodnight__inner { display: grid; justify-items: center; gap: 16px; max-width: 620px; margin-inline: auto; }
.theme-v3 .goodnight__moon { width: 34px; height: 34px; color: var(--candle-soft); margin-bottom: 6px; }
.theme-v3 .goodnight h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-style: italic; }
.theme-v3 .goodnight p { color: var(--text); font-size: clamp(1.1rem, 1.4vw, 1.25rem); line-height: 1.6; }
.theme-v3 .goodnight .goodnight__sign { font-family: var(--font-display); font-style: italic; color: var(--candle-soft); font-size: clamp(1.3rem, 2vw, 1.6rem); }
.theme-v3 .goodnight__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 32px; margin-top: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .theme-v3 .goodnight.is-shown .goodnight__inner { animation: v3-rise 1.6s var(--ease-warm) both; }
  .theme-v3 .goodnight__moon { animation: v3-halo 10s infinite; }
}

/* ---------- "A moment for you." (brief 168–178): a discovered pause, not a banner ---------- */
.theme-v3 .v3-moment { position: relative; display: grid; place-items: center; text-align: center; padding: clamp(72px, 10vw, 144px) var(--gut); }
.theme-v3 .v3-moment__inner { display: grid; justify-items: center; gap: 10px; max-width: 34ch; }
.theme-v3 .v3-moment__breath { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--candle); margin-bottom: 18px; box-shadow: 0 0 14px rgb(var(--candle-glow) / .7); }
.theme-v3 .v3-moment__breath::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(var(--candle-glow) / .45); transform: scale(.4); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .theme-v3 .v3-moment__breath::after { animation: v3-moment-breath calc(var(--breath-in) + var(--breath-out)) infinite; }
}
@keyframes v3-moment-breath {
  0% { transform: scale(.4); opacity: 0; animation-timing-function: cubic-bezier(.45, 0, .4, 1); }
  40% { transform: scale(1.5); opacity: .9; animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  100% { transform: scale(.4); opacity: 0; }
}
.theme-v3 .v3-moment__label { font-size: var(--fs-micro); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--sage); }
.theme-v3 .v3-moment__line { font-family: var(--font-display); font-style: italic; font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.35; color: var(--text-strong); }

/* ---------- one quiet RUMA line beside imagery (brief 117–133) ---------- */
.theme-v3 .v3-phrase { display: flex; align-items: center; gap: 14px; font-family: var(--font-display); font-style: italic; font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.3; color: var(--candle-soft); }
.theme-v3 .v3-phrase__rule { width: 28px; height: 1px; flex: none; background: var(--line-strong); }
.theme-v3 .v3-phrase--center { justify-content: center; }
.theme-v3 .v3-phrase--end { justify-content: flex-end; flex-direction: row-reverse; }

/* ---------- 404: "Looks like you've wandered off the mat." ---------- */
.theme-v3 .lost { position: relative; overflow: hidden; isolation: isolate; display: grid; place-items: center; min-height: 78vh; text-align: center; padding-block: clamp(96px, 12vw, 160px); }
.theme-v3 .lost .glow { z-index: -1; }
.theme-v3 .lost__inner { display: grid; justify-items: center; gap: 24px; }
.theme-v3 .lost__mark { width: 48px; height: auto; color: var(--candle); }
.theme-v3 .lost h1 { font-size: var(--fs-h1-page); max-width: 15ch; }
.theme-v3 .lost .lede { margin-inline: auto; }
.theme-v3 .lost .cta-row { justify-content: center; }

/* ---------- EN · ES: a quiet text selector (header + mobile menu) ---------- */
.theme-v3 .lang { display: inline-flex; align-items: center; flex: none; font-size: var(--fs-micro); letter-spacing: var(--track-label); font-weight: 600; }
.theme-v3 .lang__a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 44px; padding: 0 4px;
  color: var(--muted); text-decoration: none; border-radius: 8px; transition: color .3s var(--ease-warm);
}
.theme-v3 .lang__a[aria-current="true"] { color: var(--candle-soft); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .45em; }
.theme-v3 .lang__dot { color: var(--line-strong); padding: 0 1px; }
@media (hover: hover) { .theme-v3 .lang__a:hover { color: var(--text-strong); } }
.theme-v3 .lang--head { margin-right: 2px; }
/* phones: the header is full (logo, account, Book, menu); the selector lives in the menu there (pages/nav.css) */
.theme-v3 .lang--menu { font-size: var(--fs-small); }
.theme-v3 .foot__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.theme-v3 .lang--foot { margin-left: -6px; }
.theme-v3 .lang--foot .lang__a { min-width: 40px; }
.theme-v3 .lang--menu .lang__a { min-width: 44px; }

/* ---------- "Stay close." the real list: email + button in one candlelit pill ---------- */
.theme-v3 .stay { scroll-margin-top: calc(var(--head-h) + 24px); }
.theme-v3 .stay:focus { outline: none; }
.theme-v3 .stay__act { justify-items: stretch; width: 100%; max-width: 540px; }
.theme-v3 .stay__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; position: relative; }
.theme-v3 .stay__label { font-size: var(--fs-micro); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); font-weight: 600; }
.theme-v3 .stay__row {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--r-pill);
  background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-line);
  transition: box-shadow .35s var(--ease-warm), background-color .35s var(--ease-warm);
}
.theme-v3 .stay__row:focus-within { background: rgb(var(--text-rgb) / .08); box-shadow: inset 0 0 0 1.5px var(--candle), 0 0 40px -14px rgb(var(--candle-glow) / .6); }
.theme-v3 .stay__input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 8px 0 18px; border: 0; background: transparent; border-radius: var(--r-pill);
  color: var(--text-strong); font: inherit; font-size: 1.0625rem;
}
.theme-v3 .stay__input::placeholder { color: var(--muted); opacity: .75; }
.theme-v3 .stay__input:focus-visible { outline: none; } /* the whole pill shows focus (:focus-within) */
.theme-v3 .stay__input[aria-invalid="true"] { color: var(--text-strong); }
.theme-v3 .stay__row:has(.stay__input[aria-invalid="true"]) { box-shadow: inset 0 0 0 1.5px var(--danger); }
.theme-v3 .stay__input:-webkit-autofill { -webkit-text-fill-color: var(--text-strong); -webkit-box-shadow: 0 0 0 40px var(--ember-2) inset; caret-color: var(--text-strong); }
.theme-v3 .stay__row .stay__btn { flex: none; }
.theme-v3 .foot .stay__small { margin-top: 4px; }
.theme-v3 .foot a.stay__privacy { display: flex; width: max-content; min-height: 44px; font-family: var(--font-body); font-style: normal; font-size: var(--fs-micro); color: var(--muted); text-decoration: underline; text-underline-offset: .25em; }
/* honeypot: off-screen for people, still in the form for bots */
.theme-v3 .stay__hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.theme-v3 .stay__status {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r-core);
  background: rgb(var(--candle-glow) / .1); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-strong); font-size: var(--fs-small); line-height: 1.5;
}
.theme-v3 .stay__status::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .5em; border-radius: 50%; background: var(--candle); box-shadow: 0 0 10px rgb(var(--candle-glow) / .7); }
.theme-v3 .stay__status--error { background: var(--danger-wash); box-shadow: inset 0 0 0 1px var(--danger-line); }
.theme-v3 .stay__status--error::before { background: var(--danger); box-shadow: none; }
@media (prefers-reduced-motion: no-preference) { .theme-v3 .stay__status { animation: v3-rise .9s var(--ease-warm) both; } }
@media (max-width: 479px) {
  .theme-v3 .stay__row { flex-direction: column; align-items: stretch; border-radius: var(--r-core); padding: 6px; }
  .theme-v3 .stay__row .stay__btn { width: 100%; justify-content: center; }
  .theme-v3 .stay__input { padding: 0 14px; }
}

/* ---------- the studio credit: "Designed by" + Catalyx Studio, as quiet as a colophon ---------- */
/* The credit is the page's last line: the footer ends just under it (overrides site.css's 88px bottom padding).
   On phones with the Book dock, body.has-dock already reserves --dock-h below this, so the dock never covers it. */
.theme-v3 .foot { padding-bottom: clamp(20px, 2.5vw, 36px); }
.theme-v3 .foot__credit {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; margin-top: 28px; padding-top: 18px;
  border-top: 1px solid rgb(var(--text-rgb) / .06); color: var(--text); font-size: 1rem; letter-spacing: .03em;
}
.theme-v3 .foot .foot__credit a { min-height: 44px; display: inline-flex; align-items: center; opacity: .95; transition: opacity .35s var(--ease-warm); border-radius: 6px; }
.theme-v3 .foot__credit img { display: block; height: clamp(28px, 2.4vw, 34px); width: auto; }
@media (max-width: 480px) { .theme-v3 .foot__credit { gap: 4px 12px; margin-top: 22px; padding-top: 12px; font-size: .9375rem; } }
@media (hover: hover) { .theme-v3 .foot .foot__credit a:hover { opacity: 1; filter: none; text-decoration: none; } }
.theme-v3 .foot .foot__credit a:focus-visible { opacity: 1; filter: none; }
