/*
 * Senpai design system. Shared by every page; page-specific CSS lives in each page's own sheet.
 *
 * z-index scale (use these, never ad-hoc numbers):
 *   nav 20 · panels 30 · dialogs 50 · toasts 60 · share indicator 70
 *   Native <dialog> opened with showModal() sits in the top layer, above all of these.
 *
 * Motion: everything animated here is switched off under prefers-reduced-motion (bottom of file).
 */

:root {
  /* colour */
  --bg: #FBF6EE;
  --bg-2: #F4ECDF;
  --surface: #FFFFFF;
  --ink: #24152B;
  --ink-2: #5E5165;
  --muted: #8C8291;
  --line: rgba(36, 21, 43, 0.10);
  --lav: #E9E2F5;
  --lav-2: #D6C9EC;
  --coral: #F26B4E;
  --coral-ink: #B8412A;
  --coral-soft: #FDE3DA;
  --ok: #2E9E6B; --warn: #C98A1E; --err: #CF3F3F; --share: #E5484D;
  --focus: #24152B;
  /* type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* shape */
  --r-s: 10px; --r-m: 18px; --r-l: 28px; --r-xl: 40px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(36,21,43,.06), 0 4px 14px rgba(36,21,43,.06);
  --shadow-2: 0 10px 40px rgba(36,21,43,.12);
  /* space */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;
  /* motion */
  --ease: cubic-bezier(.2,.8,.2,1);
  --dur-1: 150ms; --dur-2: 280ms; --dur-3: 520ms;
  /* layout */
  --rail-w: 84px;
  --bar-h: 64px;
  /* z-index scale (see header) */
  --z-nav: 20; --z-panel: 30; --z-dialog: 50; --z-toast: 60; --z-share: 70;
  color-scheme: light;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--coral); }
::selection { background: var(--coral-soft); color: var(--ink); }

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

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 80;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-pill);
  text-decoration: none; transition: top var(--dur-2) var(--ease);
}
.skip-link:focus { top: var(--s-4); }

/* ---------- typography ---------- */
.display, .h1, .h2, .h3, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}
.display {
  font-size: clamp(44px, 7.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.display em, .h1 em, .h2 em { font-style: italic; color: var(--coral-ink); }
h1, .h1 { font-size: clamp(36px, 5vw, 60px); }
h2, .h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; }
h3, .h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.2; letter-spacing: -0.01em; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); line-height: 1.55; max-width: 58ch; text-wrap: pretty; }
.muted { color: var(--muted); }
p { text-wrap: pretty; }
small, .small { font-size: 14px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral);
}
.eyebrow--plain::before { display: none; }

/* ---------- layout ---------- */
.page {
  width: min(1120px, 100% - 2 * var(--s-5));
  margin-inline: auto;
  padding-block: clamp(32px, 6vw, 72px) var(--s-8);
}
.page--narrow { width: min(760px, 100% - 2 * var(--s-5)); }
.page__head { display: grid; gap: var(--s-3); margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.page__head .h1, .page__head h1 { margin-top: var(--s-1); }

.stack { display: flex; flex-direction: column; gap: var(--gap, var(--s-4)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--s-3)); }
.divider { border: 0; height: 1px; background: var(--line); margin-block: var(--gap, var(--s-6)); }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--btn-bd); border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.btn:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-pill); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .btn__arrow { transition: transform var(--dur-2) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.btn--primary { --btn-bg: var(--ink); --btn-fg: var(--bg); --btn-bd: var(--ink); }
.btn--primary:hover { --btn-bg: #3A2443; box-shadow: 0 8px 24px rgba(36,21,43,.22); }
.btn--accent { --btn-bg: var(--coral); --btn-fg: #2A0E06; --btn-bd: var(--coral); }
.btn--accent:hover { --btn-bg: #F47E64; box-shadow: 0 8px 24px rgba(242,107,78,.32); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: rgba(36,21,43,.22); }
.btn--ghost:hover { --btn-bg: var(--surface); --btn-bd: var(--ink); box-shadow: none; }
.btn--quiet { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--ink-2); padding: 0 14px; }
.btn--quiet:hover { --btn-bg: var(--lav); --btn-fg: var(--ink); box-shadow: none; transform: none; }
.btn--icon { width: 48px; padding: 0; flex: none; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--sm.btn--icon { width: 36px; padding: 0; }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn[aria-pressed="true"] { --btn-bg: var(--ink); --btn-fg: var(--bg); --btn-bd: var(--ink); }
.btn--accent[aria-pressed="true"] { --btn-bg: var(--coral); --btn-fg: #2A0E06; --btn-bd: var(--coral); }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed; opacity: 0.45; transform: none; box-shadow: none; pointer-events: none;
}
@media (pointer: coarse) { .btn--sm { min-height: 44px; } .btn--sm.btn--icon { width: 44px; } }

/* ---------- form controls ---------- */
.field { display: grid; gap: var(--s-2); }
.field > label, .field__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field__hint { font-size: 14px; color: var(--muted); }
.field__error { font-size: 14px; color: var(--err); font-weight: 500; }
.input, .textarea, select.input {
  width: 100%; min-height: 48px; padding: 12px 18px;
  background: var(--surface); color: var(--ink);
  border: 1px solid rgba(36,21,43,.16); border-radius: var(--r-m);
  font-size: 16px; line-height: 1.4;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.input { border-radius: var(--r-pill); }
.textarea { min-height: 112px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .textarea:hover { border-color: rgba(36,21,43,.32); }
.input:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--lav); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.input[disabled], .textarea[disabled] { background: var(--bg-2); color: var(--muted); cursor: not-allowed; }

/* segmented control: <div class="seg" role="radiogroup"><label><input type="radio" name=x><span>A</span></label>... */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--bg-2); border-radius: var(--r-pill);
}
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px;
  border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg input:disabled + span { opacity: .45; cursor: not-allowed; }
@media (pointer: coarse) { .seg span { min-height: 44px; } }

/* switch: <label class="switch"><input type="checkbox"><span class="switch__track"></span>Label</label> */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; min-height: 44px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; flex: none; width: 48px; height: 28px; border-radius: var(--r-pill);
  background: rgba(36,21,43,.18); transition: background-color var(--dur-2) var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(36,21,43,.25);
  transition: transform var(--dur-2) var(--ease);
}
.switch input:checked + .switch__track { background: var(--ink); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 3px; }
.switch input:disabled + .switch__track { opacity: .45; }

/* ---------- surfaces ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-1);
}
.card--lav { background: var(--lav); border-color: transparent; box-shadow: none; }
.card--ivory { background: var(--bg-2); border-color: transparent; box-shadow: none; }
.card--coral { background: var(--coral-soft); border-color: transparent; box-shadow: none; }
.card--flat { box-shadow: none; }
a.card, .card--interactive { transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); text-decoration: none; }
a.card:hover, .card--interactive:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid rgba(36,21,43,.16); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
button.chip:hover, a.chip:hover { border-color: var(--ink); color: var(--ink); }
button.chip:active { transform: scale(.96); }
.chip--on, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
button.chip--on:hover, .chip[aria-pressed="true"]:hover { color: var(--bg); }
@media (pointer: coarse) { .chip { min-height: 44px; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink-2);
  font-size: 13px; font-weight: 600; line-height: 1.4;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill--plain::before { display: none; }
.pill--ok { background: #DDF3E8; color: #1D6B48; }
.pill--warn { background: #FBEFD6; color: #855A0E; }
.pill--err { background: #FBE1E1; color: #A12C2C; }
.pill--live { background: var(--coral-soft); color: var(--coral-ink); }
.pill--live::before { background: var(--coral); opacity: 1; animation: senpai-pulse 1.6s var(--ease) infinite; }
.pill--lav { background: var(--lav); color: var(--ink); }

.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--r-pill); background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 600; line-height: 1;
}
.badge--coral { background: var(--coral); color: #2A0E06; }
.badge--soft { background: var(--lav); color: var(--ink); }

/* ---------- empty state ---------- */
.empty {
  position: relative; overflow: hidden;
  display: grid; justify-items: start; gap: var(--s-3);
  padding: clamp(28px, 5vw, 56px);
  background: var(--bg-2); border-radius: var(--r-xl);
}
.empty::after { /* a quiet organic shape so empty never feels broken */
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px;
  background: var(--lav); border-radius: 58% 42% 55% 45% / 48% 60% 40% 52%; opacity: .8; z-index: 0;
}
.empty > * { position: relative; z-index: 1; }
.empty__title { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -0.015em; }
.empty__text { color: var(--ink-2); max-width: 46ch; }
.empty .btn { margin-top: var(--s-2); }

/* ---------- skeleton ---------- */
.skeleton {
  display: block; min-height: 1em; border-radius: var(--r-s);
  background: linear-gradient(90deg, var(--bg-2) 0%, #FBF4EA 40%, var(--bg-2) 80%);
  background-size: 300% 100%;
  animation: senpai-shimmer 1.4s linear infinite;
  color: transparent !important;
}

/* ---------- dialog ---------- */
.dialog {
  width: min(560px, 100% - 32px); max-height: min(86vh, 860px);
  padding: clamp(24px, 4vw, 36px);
  border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px rgba(36,21,43,.25);
  z-index: var(--z-dialog);
}
.dialog::backdrop { background: rgba(36,21,43,.38); backdrop-filter: blur(2px); }
.dialog[open] { animation: senpai-pop var(--dur-2) var(--ease); }
.dialog[open]::backdrop { animation: senpai-fade var(--dur-2) var(--ease); }

/* ---------- toast ---------- */
.toast-region {
  position: fixed; z-index: var(--z-toast);
  left: 50%; bottom: calc(var(--s-5) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: var(--s-2);
  width: min(440px, 100% - 32px);
  pointer-events: none;
}
body.has-rail .toast-region { margin-left: calc(var(--rail-w) / 2); }
.toast {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 12px 18px 12px 14px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2);
  font-size: 15px; font-weight: 500; pointer-events: auto;
  animation: senpai-toast-in var(--dur-3) var(--ease) both;
}
.toast::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--lav-2); }
.toast--ok::before { background: #6FD3A2; }
.toast--warn::before { background: #F2C15A; }
.toast--err::before { background: #FF8A7A; }
.toast.is-leaving { animation: senpai-toast-out var(--dur-2) var(--ease) forwards; }

/* ---------- motion utilities ---------- */
.reveal { animation: senpai-rise var(--dur-3) var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 40ms); }
/* scroll-revealed variant: JS adds .in when the element enters the viewport */
.reveal-on-scroll { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal-on-scroll.in { opacity: 1; transform: none; }
.lift { transition: transform var(--dur-2) var(--ease); }
.lift:hover { transform: translateY(-3px); }

/* ---------- organic background shapes (decorative; aria-hidden on use) ---------- */
.blob, .arch {
  position: absolute; pointer-events: none; z-index: 0;
  width: var(--size, 320px); aspect-ratio: 1;
  background: var(--tint, var(--lav));
}
.blob { border-radius: 58% 42% 55% 45% / 48% 60% 40% 52%; }
.blob--2 { border-radius: 40% 60% 38% 62% / 58% 38% 62% 42%; }
.blob--drift { animation: senpai-drift 18s ease-in-out infinite alternate; }
.arch { aspect-ratio: 3 / 4; border-radius: 999px 999px var(--r-l) var(--r-l); }
.tint-lav { --tint: var(--lav); }
.tint-lav-2 { --tint: var(--lav-2); }
.tint-coral { --tint: var(--coral-soft); }
.tint-ivory { --tint: var(--bg-2); }
.shape-host { position: relative; isolation: isolate; overflow: hidden; }
.shape-host > :not(.blob):not(.arch) { position: relative; z-index: 1; }

/* ---------- shared shell: navigation rail (≥900px) / bottom bar (<900px) ---------- */
.senpai-nav {
  position: fixed; z-index: var(--z-nav);
  background: var(--surface);
  font-family: var(--font-ui);
}
.senpai-nav__list { display: flex; margin: 0; padding: 0; list-style: none; }
.senpai-nav__link {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}
.senpai-nav__icon {
  display: grid; place-items: center; width: 48px; height: 36px; border-radius: var(--r-pill);
  transition: background-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.senpai-nav__icon svg { width: 22px; height: 22px; }
.senpai-nav__link:hover { color: var(--ink); }
.senpai-nav__link:hover .senpai-nav__icon { background: var(--bg-2); }
.senpai-nav__link:active .senpai-nav__icon { transform: scale(.92); }
.senpai-nav__link[aria-current="page"] { color: var(--ink); }
.senpai-nav__link[aria-current="page"] .senpai-nav__icon { background: var(--lav); }
.senpai-nav__link[aria-current="page"] .senpai-nav__icon::after {
  content: ""; position: absolute; top: 3px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 2px var(--lav);
}
.senpai-nav__icon { position: relative; }
.senpai-nav__link:focus-visible { outline: none; }
.senpai-nav__link:focus-visible .senpai-nav__icon { outline: 2px solid var(--focus); outline-offset: 2px; }
.senpai-nav__label { font-size: 12px; font-weight: 600; letter-spacing: .01em; }

.senpai-nav__me {
  display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--ink);
}
.senpai-nav__avatar {
  position: relative; display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  background: var(--coral-soft); color: var(--coral-ink);
  font-family: var(--font-display); font-size: 20px; line-height: 1;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}
.senpai-nav__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.senpai-nav__name { font-family: var(--font-display); font-size: 15px; line-height: 1.1; }

/* desktop rail */
@media (min-width: 900px) {
  body.has-rail { padding-left: var(--rail-w); }
  .senpai-nav {
    left: 0; top: 0; bottom: 0; width: var(--rail-w);
    display: flex; flex-direction: column; align-items: center; gap: var(--s-6);
    padding: var(--s-5) 0;
    border-right: 1px solid var(--line);
    border-radius: 0 var(--r-xl) var(--r-xl) 0;
  }
  .senpai-nav__me { flex-direction: column; gap: 6px; max-width: 76px; }
  .senpai-nav__name {
    font-size: 13px; text-align: center; max-width: 72px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .senpai-nav__list { flex-direction: column; gap: var(--s-2); }
  .senpai-nav__link { width: 64px; min-height: 52px; flex-direction: column; gap: 3px; }
  /* labels: visible as a floating tag on hover/focus; always in the accessibility tree */
  .senpai-nav__label {
    position: absolute; left: calc(100% + 10px); top: 50%;
    padding: 6px 12px; border-radius: var(--r-pill);
    background: var(--ink); color: var(--bg); white-space: nowrap;
    opacity: 0; transform: translate(-6px, -50%); pointer-events: none;
    transition: opacity var(--dur-1) var(--ease), transform var(--dur-2) var(--ease);
  }
  .senpai-nav__link:hover .senpai-nav__label,
  .senpai-nav__link:focus-visible .senpai-nav__label { opacity: 1; transform: translate(0, -50%); }
  .senpai-nav__foot { margin-top: auto; }
}

/* mobile bottom bar */
@media (max-width: 899.98px) {
  body.has-rail { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .senpai-nav {
    left: 0; right: 0; bottom: 0;
    height: calc(var(--bar-h) + env(safe-area-inset-bottom));
    padding: 0 var(--s-2) env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    border-radius: var(--r-l) var(--r-l) 0 0;
    box-shadow: 0 -6px 24px rgba(36,21,43,.06);
  }
  .senpai-nav__me, .senpai-nav__foot { display: none; }
  .senpai-nav__list { height: 100%; justify-content: space-around; align-items: center; }
  .senpai-nav__list > li { flex: 1; }
  .senpai-nav__link { flex-direction: column; gap: 2px; min-height: 56px; }
  .senpai-nav__icon { height: 30px; width: 52px; }
  .senpai-nav__label { font-size: 11px; }
  body.has-rail .toast-region { margin-left: 0; bottom: calc(var(--bar-h) + var(--s-4) + env(safe-area-inset-bottom)); }
}

/* page transitions (cross-document View Transitions where supported; shell.js handles the fallback) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: senpai-vt-out 180ms var(--ease) both; }
::view-transition-new(root) { animation: senpai-vt-in 320ms var(--ease) both; }
.senpai-nav { view-transition-name: senpai-nav; }
body.is-leaving main { opacity: 0; transform: translateY(6px); transition: opacity 160ms var(--ease), transform 160ms var(--ease); }

/* ---------- keyframes ---------- */
@keyframes senpai-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes senpai-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes senpai-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes senpai-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes senpai-toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes senpai-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes senpai-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
@keyframes senpai-drift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(14px, -18px) rotate(8deg); } }
@keyframes senpai-vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes senpai-vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important;
  }
  .reveal, .reveal-on-scroll { opacity: 1 !important; transform: none !important; animation: none !important; }
  .blob--drift, .skeleton, .pill--live::before { animation: none !important; }
  .btn:hover, .btn:active, a.card:hover, .lift:hover { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
