/* Home effects (index.html only): archival effects and animation refinements. One sheet for two that always loaded together,
   deferred, in this order (2026-11-10, review/home-consolidate). Each part is unchanged; search for '==== name' to find one. */

/* ==== archival-effects (was _shared/archival-effects.css) ==== */
/* Archival Effects — Component Styling using Museum Design System

   Applies Stitch design elements (spotlighting, matting, grid, vignette)
   to specific components: cards, buttons, focus elements, and interactive states.

   Live: 2026-09-22
*/

/* ========== CARD COMPONENTS ========== */

/* Primary card with full museum treatment */
.card-archival {
  background: var(--color-paper);
  border: 1px solid rgba(197, 160, 89, 0.25);
  padding: 1.5rem;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95),
              0 0 40px rgba(212, 175, 55, 0.08);
  transition: all var(--duration-long) var(--easing-standard);
  position: relative;
}

.card-archival:hover {
  border-color: rgba(197, 160, 89, 0.5);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95),
              0 0 50px rgba(212, 175, 55, 0.12);
}

/* Gridded card variant */
.card-archival.gridded {
  background-image:
    linear-gradient(to right, rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 0 0;
  background-attachment: local;
}

/* ========== BUTTONS ========== */

/* Primary curatorial button */
.btn-primary-curatorial {
  background: var(--color-accent);
  color: var(--color-paper);
  border: none;
  padding: 12px 24px;
  font-family: var(--font-family-primary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.04);
}

.btn-primary-curatorial:hover {
  background: var(--color-accent-highlight);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-primary-curatorial:active {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

/* Secondary outlined button */
.btn-secondary-outline {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid rgba(197, 160, 89, 0.4);
  padding: 12px 24px;
  font-family: var(--font-family-primary);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
}

.btn-secondary-outline:hover {
  background: rgba(197, 160, 89, 0.08);
  border-color: rgba(197, 160, 89, 0.6);
  color: var(--color-accent);
}

/* Tertiary link button */
.btn-tertiary-link {
  background: none;
  border: none;
  color: rgba(197, 160, 89, 0.8);
  text-decoration: none;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.1em;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--duration-short) var(--easing-standard);
}

.btn-tertiary-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: rgba(197, 160, 89, 0.6);
  transition: width var(--duration-medium) var(--easing-standard);
}

.btn-tertiary-link:hover {
  color: var(--color-accent);
}

.btn-tertiary-link:hover::after {
  width: 100%;
}

/* ========== BUTTERFLY MARK CYPHER ========== */

.butterfly-mark {
  filter: drop-shadow(0 0 8px rgba(255, 87, 0, 0.6));
  transition: filter var(--duration-medium) var(--easing-standard),
              transform var(--duration-medium) var(--easing-standard);
  will-change: transform, filter;
}

.butterfly-mark:hover {
  filter: drop-shadow(0 0 16px rgba(255, 87, 0, 0.9));
  transform: scale(1.1) rotate(5deg);
}

/* ========== TOUCH TARGET OPTIMIZATION (44px Minimum) ========== */

/* WCAG AA compliance: all interactive elements minimum 44×44px touch target */
button:not(.btn-icon-small),
a[href]:not(.link-inline),
.waypoint-link,
.nav-drawer-item,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
.icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon buttons in navbar/header */
.app-bar-icon,
.app-bar-menu-btn,
.app-bar-search-btn,
.nav-drawer-close-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Smaller icon buttons (allowed if within grouped targets) */
.btn-icon-small {
  min-width: 36px;
  min-height: 36px;
}

/* Inline links can be smaller if sufficient spacing */
.link-inline {
  min-width: auto;
  min-height: auto;
  padding: 4px 8px;
}

/* Ensure focus states have adequate target area */
*:focus-visible {
  outline-offset: 2px;
}

/* ========== FOCUS STATES ========== */

/* Enhanced focus ring for keyboard navigation */
.focus-ring-archival:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* Focus ring for buttons */
button.focus-ring-archival:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

/* ========== BADGE & METADATA CHIPS ========== */

.badge-archival {
  display: inline-block;
  background: rgba(24, 24, 27, 0.8);
  border: 1px solid rgba(153, 144, 124, 0.3);
  color: rgba(197, 160, 89, 0.9);
  padding: 4px 10px;
  font-family: var(--font-family-primary);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 0;
  transition: all var(--duration-medium) var(--easing-standard);
}

.badge-archival:hover {
  border-color: rgba(197, 160, 89, 0.6);
  background: rgba(24, 24, 27, 1);
  color: var(--color-accent);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

/* ========== FORM INPUTS ========== */

.input-archival {
  background: var(--color-paper);
  border: 1px solid rgba(245, 242, 235, 0.15);
  color: var(--color-ink);
  padding: 12px 14px;
  font-family: "EB Garamond", serif;
  font-size: 14px;
  transition: all var(--duration-medium) var(--easing-standard);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.input-archival::placeholder {
  color: rgba(168, 163, 152, 0.6);
}

.input-archival:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5),
              0 0 0 3px rgba(212, 175, 55, 0.1);
  background: rgba(19, 19, 21, 0.8);
}

/* ========== SECTION HEADERS ========== */

.section-header-archival {
  position: relative;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.section-header-archival::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(197, 160, 89, 0.3) 10%,
    rgba(197, 160, 89, 0.3) 90%,
    transparent 100%);
}

.section-header-archival h2 {
  font-family: var(--font-family-primary);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-accent);
  margin: 0 0 0.5rem 0;
}

/* ========== VITRINE PRESENTATION ========== */

/* Museum vitrine container for art/photos */
.vitrine-frame {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .vitrine-frame {
    grid-template-columns: 1fr;
  }
}

.vitrine-image {
  background: var(--color-paper);
  min-height: 340px;
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 1px solid rgba(197, 160, 89, 0.2);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95),
              0 0 30px rgba(212, 175, 55, 0.06);
}

.vitrine-image img {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.vitrine-metadata {
  padding: 1rem;
  background: rgba(19, 19, 21, 0.5);
  border: 1px solid rgba(197, 160, 89, 0.15);
}

.vitrine-metadata h4 {
  font-size: 2rem;
  font-family: var(--font-family-primary);
  color: var(--color-accent);
  margin: 0.2rem 0 1rem;
}

.vitrine-metadata p {
  font-family: "EB Garamond", serif;
  color: var(--color-ink);
  margin: 0.5rem 0;
  line-height: 1.65;
}

/* ========== ANIMATION SEQUENCES ========== */

/* Staggered reveal for list items */
.reveal-staggered > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-extra-long) var(--easing-elastic),
              transform var(--duration-extra-long) var(--easing-elastic);
}

.reveal-staggered.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-staggered > *:nth-child(1) { transition-delay: var(--delay-0); }
.reveal-staggered > *:nth-child(2) { transition-delay: var(--delay-1); }
.reveal-staggered > *:nth-child(3) { transition-delay: var(--delay-2); }
.reveal-staggered > *:nth-child(4) { transition-delay: var(--delay-3); }
.reveal-staggered > *:nth-child(5) { transition-delay: var(--delay-4); }

/* ========== ACCESSIBILITY ========== */

/* High contrast mode adjustments */
@media (prefers-contrast: more) {
  .card-archival {
    border-color: rgba(212, 175, 55, 0.5);
  }

  .hairline-frame {
    border-color: rgba(197, 160, 89, 0.6);
  }

  .badge-archival {
    border-color: rgba(197, 160, 89, 0.8);
  }
}

/* ========== VITRINE INSPECTION VIEWER ========== */

.vitrine-inspection-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity var(--duration-long) var(--easing-standard);
}

.vitrine-inspection-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.vitrine-inspection-viewer {
  position: relative;
  width: 100%;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--color-paper);
  border: 1px solid rgba(212, 175, 55, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inspection-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: grab;
  transition: transform var(--duration-medium) var(--easing-standard);
}

.inspection-image:active {
  cursor: grabbing;
}

.inspection-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: var(--z-sticky);
}

.inspection-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(19, 19, 21, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 0px;
}

.btn-inspect {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--color-accent);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
  padding: 0;
}

.btn-inspect:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.inspection-zoom-level {
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: var(--color-accent);
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crosshair-reticle {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: var(--color-accent);
  opacity: 0.6;
  transition: opacity var(--duration-medium) var(--easing-standard);
}

.crosshair-icon {
  width: 100%;
  height: 100%;
}

.btn-inspect-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(19, 19, 21, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
  z-index: var(--z-sticky-high);
}

.btn-inspect-close:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .vitrine-inspection-overlay {
    padding: 1rem;
  }

  .inspection-toolbar {
    flex-direction: column;
  }

  .btn-inspect {
    width: 36px;
    height: 36px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card-archival,
  .btn-primary-curatorial,
  .btn-secondary-outline,
  .btn-tertiary-link,
  .input-archival,
  .badge-archival,
  .vitrine-frame {
    transition: none !important;
  }

  .btn-primary-curatorial:hover,
  .btn-primary-curatorial:active {
    transform: none !important;
  }

  .reveal-staggered > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==== animations-refinement (was _shared/animations-refinement.css) ==== */
/* ══════════════════════════════════════════════════════════════════════════
   ANIMATION REFINEMENTS: Premium UX/UI Polish
   Five tiers of interactive refinement for Material Design 3 experience
   ═════════════════════════════════════════════════════════════════════════ */

/* ── 1. PAGE TRANSITION ANIMATIONS ───────────────────────────────────────── */

/* Page-level fade-in on load */
body {
  animation: pageLoadFadeIn 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageLoadFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Main content slide-up entrance */
main {
  animation: contentSlideUp 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms backwards;
}

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

/* ── 2. SCROLL-TRIGGERED CONTENT REVEALS ──────────────────────────────────── */

/* Default reveal state */
.reveal-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Revealed state */
.reveal-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveals for groups */
.reveal-scroll:nth-child(1).in-view { transition-delay: 0ms; }
.reveal-scroll:nth-child(2).in-view { transition-delay: 50ms; }
.reveal-scroll:nth-child(3).in-view { transition-delay: 100ms; }
.reveal-scroll:nth-child(4).in-view { transition-delay: 150ms; }
.reveal-scroll:nth-child(5).in-view { transition-delay: 200ms; }
.reveal-scroll:nth-child(n+6).in-view { transition-delay: 250ms; }

/* Card grid staggered reveals */
.card-interactive {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-interactive.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── CARD HOVER EFFECTS (7-LAYER STAGGERED) ──────────────────────────────── */
.card-interactive {
  position: relative;
  border-color: rgba(212, 175, 55, 0.3);
  transition:
    border-color 120ms ease-out,
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 150ms ease-out,
    transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-interactive:hover {
  /* Layer 1: Border glow (0ms) */
  border-color: var(--color-gold-alt) !important;

  /* Layer 2: Background shift (20ms delay) */
  background-color: rgba(212, 175, 55, 0.03) !important;

  /* Layer 3: Shadow glow (40ms delay) */
  box-shadow:
    0 8px 24px rgba(212, 175, 55, 0.15),
    inset 0 0 16px rgba(212, 175, 55, 0.08) !important;

  /* Layer 4: Scale preview (60ms delay) */
  transform: scale(1.01) translateY(-2px) !important;
}

/* ── 3. COMMAND PALETTE MICRO-INTERACTIONS ────────────────────────────────── */

/* Result items fade in sequentially */
.cmdk-row {
  opacity: 0;
  animation: cmdkRowFadeIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stagger result items */
.cmdk-row:nth-child(1) { animation-delay: 0ms; }
.cmdk-row:nth-child(2) { animation-delay: 30ms; }
.cmdk-row:nth-child(3) { animation-delay: 60ms; }
.cmdk-row:nth-child(4) { animation-delay: 90ms; }
.cmdk-row:nth-child(5) { animation-delay: 120ms; }
.cmdk-row:nth-child(n+6) { animation-delay: 150ms; }

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

/* Hover state on results */
.cmdk-row:hover {
  transition: background-color 150ms ease-out,
              border-color 150ms ease-out;
}

/* Icon animation in results */
.cmdk-row:hover .material-symbols-outlined {
  animation: iconPulseRotate 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconPulseRotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.08); }
  100% { transform: rotate(0deg) scale(1.12); }
}

/* ── 4. BUTTON & CONTROL FEEDBACK STATES (STAGGERED 7-LAYER ANIMATION) ──── */

/* Primary button with staggered hover layers */
button:not(.app-bar-icon):not(.app-bar-search-btn):not(.app-bar-menu-btn) {
  transition:
    background-color 120ms ease-out,
    color 120ms ease-out,
    transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 150ms ease-out;
  position: relative;
  overflow: hidden;
}

/* Staggered hover animation layers */
button:not(.app-bar-icon):not(.app-bar-search-btn):not(.app-bar-menu-btn):hover {
  /* Layer 1: Color shift (0ms) */
  color: var(--color-text-on-dark) !important;
  transition: color 120ms ease-out !important;

  /* Layer 2: Background glow (delay 20ms) */
  background-color: var(--color-paper) !important;
  box-shadow:
    inset 0 0 12px rgba(212, 175, 55, 0.12),
    0 6px 16px rgba(212, 175, 55, 0.2) !important;
  transition:
    color 120ms ease-out,
    background-color 120ms ease-out 20ms,
    box-shadow 150ms ease-out 40ms !important;

  /* Layer 3: Scale preview (delay 60ms) */
  transform: scale(1.02);
  transition:
    color 120ms ease-out,
    background-color 120ms ease-out 20ms,
    box-shadow 150ms ease-out 40ms,
    transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1) 60ms !important;
}

/* Button active/press state */
button:not(.app-bar-icon):not(.app-bar-search-btn):not(.app-bar-menu-btn):active {
  transform: scale(0.98) !important;
  box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.2) !important;
}

/* Enhanced focus ring with glow animation */
button:not(.app-bar-icon):not(.app-bar-search-btn):not(.app-bar-menu-btn):focus-visible {
  outline: none !important;
  box-shadow:
    0 0 0 2px var(--color-paper),
    0 0 0 4px var(--color-accent) !important;
  animation: focusGlowPulse 2s ease-in-out infinite;
}

/* Focus ring animation */
button:not(.app-bar-icon):focus-visible,
a:focus-visible {
  animation: focusGlowPulse 2s ease-in-out infinite;
}

@keyframes focusGlowPulse {
  0%, 100% {
    outline-width: 2px;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3);
  }
  50% {
    outline-width: 2px;
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.15);
  }
}

/* Icon button rotation */
.app-bar-icon {
  transition:
    color 120ms ease-out,
    transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-bar-icon:hover {
  transform: rotate(10deg) scale(1.1);
}

/* ── SMOOTH COLOR TRANSITIONS FOR LINKS & TEXT ──────────────────────────── */
a {
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

a:hover {
  color: var(--color-gold-alt) !important;
}

/* Focus state for links */
a:focus-visible {
  outline: 2px solid var(--color-gold-alt) !important;
  outline-offset: 2px !important;
  border-radius: 2px;
  animation: focusGlowPulse 2s ease-in-out infinite;
}

/* ── RIPPLE EFFECT SYSTEM (MD3) ────────────────────────────────────────── */

/* Ripple effect for all clickable elements */
button:not(.app-bar-icon),
a:not(.app-bar-logo),
.nav-drawer-item,
.card-interactive {
  position: relative;
  overflow: hidden;
}

/* Ripple pseudo-element (triggered on :active) */
button:not(.app-bar-icon)::before,
a:not(.app-bar-logo)::before,
.card-interactive::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: var(--z-content);
}

button:not(.app-bar-icon):active::before,
a:not(.app-bar-logo):active::before,
.card-interactive:active::before {
  transform: scale(1.5);
  opacity: 1;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── ACTIVE/CURRENT PAGE INDICATOR ──────────────────────────────────────── */

/* Breadcrumb active state */
.breadcrumb-nav .breadcrumb-current {
  position: relative;
  color: var(--color-gold-alt);
  font-weight: 500;
}

.breadcrumb-nav .breadcrumb-current::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-gold-alt);
  border-radius: 1px;
}

/* Nav item active indicator (fallback for non-drawer items) */
.nav-item.active {
  color: var(--color-gold-alt);
  position: relative;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-gold-alt);
  border-radius: 1px;
}

/* ── MOMENTUM SCROLLING ENHANCEMENT ─────────────────────────────────────── */

/* All scrollable containers get momentum scrolling */
.reveal-scroll,
.card-grid,
[class*="scroll"],
main,
article {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── KEYBOARD NAVIGATION ENHANCEMENT ────────────────────────────────────── */

/* Enhanced focus rings for keyboard users */
button:not(.app-bar-icon):focus-visible,
a:focus-visible,
.nav-item:focus-visible,
[role="menuitem"]:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 2px var(--color-paper),
    inset 0 0 0 4px var(--color-gold-alt),
    0 0 0 4px rgba(212, 175, 55, 0.3);
  border-radius: 2px;
  animation: focusGlowPulse 2s ease-in-out infinite;
}

/* Skip links for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: var(--z-system, 10000);   /* was --z-navbar: under the app bar, so the focused link was hidden */
  background: var(--color-accent);
  color: var(--color-paper);
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 500;
  border-radius: 0 4px 4px 0;
}

.skip-link:focus {
  top: 0;
  transition: top 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── ANIMATED TOOLTIP HINTS ────────────────────────────────────────────── */
[data-hint] {
  position: relative;
  cursor: help;
}

[data-hint]:hover::before {
  content: attr(data-hint);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-paper);
  color: var(--color-text-on-dark);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  z-index: var(--z-viewer);
  border: 1px solid var(--color-gold-alt);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
  opacity: 0;
  animation: tooltipSlideUp 200ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms forwards;
  pointer-events: none;
}

[data-hint]:hover::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--color-gold-alt);
  z-index: var(--z-command-palette);
  opacity: 0;
  animation: tooltipSlideUp 200ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms forwards;
}

@keyframes tooltipSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Disabled state */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ── 5. HERO IMAGE & BACKGROUND ANIMATIONS ────────────────────────────────── */

/* Hero image fade-in and subtle parallax setup */
.hero-image, .hero-container {
  animation: heroImageFadeIn 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes heroImageFadeIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Thermal image pulse for emotional connection */
.register-of-loss-bg {
  animation: thermalImagePulse 3s ease-in-out 2s infinite;
}

@keyframes thermalImagePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.95;
  }
}

/* Gradient overlay smooth transitions */
.gradient-overlay {
  transition: background-color 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chapter divider animations */
.chapter-divider {
  animation: chapterDividerReveal 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

@keyframes chapterDividerReveal {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* Watermark numeral animation */
.chapter-divider::before {
  animation: watermarkFade 1000ms ease-out 400ms both;
}

@keyframes watermarkFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.08;
  }
}

/* ── ACCESSIBILITY: RESPECT MOTION PREFERENCES ─────────────────────────────── */

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

  /* Keep visual state changes, just remove motion */
  body {
    animation: none;
    opacity: 1;
  }

  main {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal-scroll,
  .card-interactive {
    opacity: 1;
    transform: none;
  }
}

/* ── PERFORMANCE OPTIMIZATION ───────────────────────────────────────────────── */

/* Use GPU acceleration for smooth animations */
.reveal-scroll,
.card-interactive,
.nav-drawer-item,
button:not(.app-bar-icon),
.cmdk-row {
  will-change: transform, opacity;
}

/* Remove will-change after animations complete to save memory */
.reveal-scroll.in-view,
.card-interactive.in-view {
  will-change: auto;
}
