:root {
  --bg: #0b0b0c;
  --fg: #f2f2f2;
  --muted: #b8b8b8;
  --card: #141416;
  --border: rgba(255, 255, 255, 0.12);
  --link: #d7c8ff;
  
  /* Typography tokens */
  --font-brand: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  
  /* Luxury accent tokens */
  --rose-a: #E7B6B0;
  --rose-b: #B07A77;
  --gold-a: #E9E2D3;
  --gold-hot: #FFF6E6;
  
  /* Pill tokens */
  --pill-fill: rgba(255,255,255,0.06);
  --pill-fill-hover: rgba(255,255,255,0.10);
  --pill-text: rgba(242,242,242,0.92);
  --pill-text-strong: rgba(242,242,242,0.98);
  
  /* Near-black pill fill (no warm tint) */
  --pill-black-0: #0B0B0C;
  --pill-black-1: #0E0F12;
  
  /* White-gold border as RGBA helpers */
  --gold-strong: rgba(233,226,211,0.55);
  --gold-mid: rgba(233,226,211,0.32);
  --gold-soft: rgba(255,246,230,0.18);
  
  /* Link hover tokens */
  --link-idle: rgba(255, 255, 255, 0.86);
  --link-hover: rgba(255,246,230,0.94);
  --link-hover-soft: rgba(233,226,211,0.78);
  --link-glow: rgba(255,246,230,0.10);
}

* { box-sizing: border-box; }
html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-kerning: normal;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
}
a { color: var(--link); text-decoration: none; }

/* Shared luxury link system */
.lux-link,
header a,
footer a,
.menu-overlay a {
  color: var(--link-idle);
  text-decoration: none;
  position: relative;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.lux-link:hover,
.lux-link:focus-visible,
header a:hover,
header a:focus-visible,
footer a:hover,
footer a:focus-visible,
.menu-overlay a:hover,
.menu-overlay a:focus-visible {
  color: var(--link-hover);
  text-shadow: 0 0 14px var(--link-glow);
}

/* Typography: Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  margin: 0.5em 0;
}
h1 {
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}
h2, h3 {
  font-weight: 300;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
main { max-width: 1100px; margin: 0 auto; padding: 32px 16px 64px; }
main.wide { max-width: 1400px; }
/* Font loading gating: Hide brand/headings until Poppins is ready */
.header-title,
h1, h2, h3, h4, h5, h6 {
  visibility: hidden;
}
html.fonts-poppins-ready .header-title,
html.fonts-poppins-ready h1,
html.fonts-poppins-ready h2,
html.fonts-poppins-ready h3,
html.fonts-poppins-ready h4,
html.fonts-poppins-ready h5,
html.fonts-poppins-ready h6 {
  visibility: visible;
}

/* UI Typography: Explicitly use Inter for all UI chrome */
.menu-button, .menu-close, .menu-section a, .menu-section .menu-heading, .hero-btn, footer, footer a, .muted {
  font-family: var(--font-body);
}

/* Luxury navigation links */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-radius: 10px;
  font-weight: 500;
  font-family: var(--font-body);
}

.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,246,230,0.14);
}

/* Active/current page state for header nav links */
.nav-link.is-active {
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

.nav-link.is-active::after {
  display: none;
}

header, footer { border-bottom: 1px solid var(--border); }
footer { 
  border-top: 1px solid var(--border); 
  border-bottom: none;
}

/* Unified underline animation for luxury links */
.lux-link::after,
footer a::after,
.menu-overlay a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(233,226,211,0),
    rgba(233,226,211,0.70),
    rgba(255,246,230,0.95),
    rgba(233,226,211,0.70),
    rgba(233,226,211,0)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.lux-link:hover::after,
.lux-link:focus-visible::after,
footer a:hover::after,
footer a:focus-visible::after,
.menu-overlay a:hover::after,
.menu-overlay a:focus-visible::after {
  transform: scaleX(1);
}
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.header-title {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}
.header-title a {
  color: var(--fg);
  text-decoration: none;
}
.header-title a:hover,
.header-title a:focus-visible {
  color: var(--link-hover);
  text-shadow: 0 0 16px rgba(255,246,230,0.12);
}
.header-title a::after {
  display: none;
}
.muted { 
  color: var(--muted);
}
footer .muted {
  color: var(--link-idle);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.gallery-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Gallery grid card glow effect */
.gallery-grid .card {
  position: relative;
  overflow: visible;
  transition: transform 220ms ease;
}

.gallery-grid .card::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  filter: blur(12px);
  background: radial-gradient(
    ellipse 200% 200% at 50% 25%,
    rgba(255,246,230,0.12),
    rgba(233,226,211,0.08) 45%,
    rgba(255,246,230,0.00) 70%
  );
  transition: opacity 220ms ease;
  z-index: -1;
}

.gallery-grid .card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,246,230,0.14),
    0 0 0 1px rgba(233,226,211,0.08);
  transition: opacity 220ms ease;
  z-index: 1;
}

.gallery-grid .card:hover,
.gallery-grid .card:focus-visible {
  transform: translateY(-1px);
}

.gallery-grid .card:hover::before,
.gallery-grid .card:focus-visible::before,
.gallery-grid .card:hover::after,
.gallery-grid .card:focus-visible::after {
  opacity: 1;
}

.gallery-grid .card:hover img,
.gallery-grid .card:focus-visible img {
  filter: brightness(1.03) contrast(1.02);
}

.gallery-grid .card:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-grid .card {
    transition: none;
  }
  .gallery-grid .card::before,
  .gallery-grid .card::after {
    transition: none;
  }
}
@media (min-width: 1600px) {
  .gallery-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

/* Space between consecutive cards (e.g. Links and Attributes on work pages) */
.card + .card {
  margin-top: 1.25rem;
}
/* Grids use gap for spacing; reset so first card isn’t stretched by neighbour’s margin */
.gallery-grid .card + .card,
.collections-grid .card + .card,
.context-previews-grid .card + .card {
  margin-top: 0;
}

/* Links section: extra space between lines when multiple (Contract + Metadata + Video/Image) */
.work-links-list-spaced li {
  margin-bottom: 1rem;
}
.work-links-list-spaced li:last-child {
  margin-bottom: 0;
}

/* Individual work page: meta line (Collection · Year · Medium  |  Previous · Next) */
.work-meta-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.work-meta-left {
  flex: 0 1 auto;
}
.work-meta-right {
  flex: 0 0 auto;
}

/* Collection card glow (premium, restrained) */
.collection-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px; /* match card radius */
  transition: transform 220ms ease, border-color 220ms ease, filter 220ms ease;
}

/* Outer glow */
.collection-card::before {
  content: "";
  position: absolute;
  inset: -18px; /* gives room for blur */
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  filter: blur(18px);
  background: radial-gradient(
    ellipse 125% 50% at 50% 25%,
    rgba(255,246,230,0.12),
    rgba(233,226,211,0.08) 45%,
    rgba(255,246,230,0.00) 70%
  );
  transition: opacity 220ms ease;
  z-index: -1;
}

/* Thin rim highlight */
.collection-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,246,230,0.14),
    0 0 0 1px rgba(233,226,211,0.08);
  transition: opacity 220ms ease;
  z-index: 1;
}

.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-1px);
}

.collection-card:hover::before,
.collection-card:focus-visible::before,
.collection-card:hover::after,
.collection-card:focus-visible::after {
  opacity: 1;
}

/* Optional: tiny media lift */
.collection-card:hover img,
.collection-card:hover video,
.collection-card:focus-visible img,
.collection-card:focus-visible video {
  filter: brightness(1.03) contrast(1.02);
}

/* Accessibility */
.collection-card:focus-visible {
  outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .collection-card {
    transition: none;
  }
  .collection-card::before,
  .collection-card::after {
    transition: none;
  }
}

.kicker { 
  font-family: var(--font-body);
  font-size: 12px; 
  font-weight: 500;
  letter-spacing: 0.12em; 
  text-transform: uppercase; 
  color: var(--muted); 
}

/* Minimal header + menu overlay */
.header-minimal { position: sticky; top: 0; z-index: 30; background: rgba(11,11,12,0.8); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.header-nav { display: flex; align-items: center; gap: 24px; }
/* Luxury pill buttons: shared base */
.menu-button, .menu-close, .hero-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)) padding-box,
    linear-gradient(180deg, var(--pill-black-1), var(--pill-black-0)) padding-box,
    linear-gradient(135deg,
    rgba(255,246,230,1.00),
    rgba(233,226,211,0.72),
    rgba(255,246,230,0.69),
    rgba(255,246,230,0.92)
  ) border-box;  color: rgba(242,242,242,0.92);
  box-shadow: none;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, color 180ms ease, filter 180ms ease;
}

.menu-button::before, .menu-close::before, .hero-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(110deg,
    rgba(255,255,255,0) 42%,
    rgba(233,226,211,0.08) 48%,
    rgba(255,246,230,0.14) 50%,
    rgba(233,226,211,0.08) 52%,
    rgba(255,255,255,0) 58%
  );
  transform: translateX(-120%);
}

.menu-button::after, .menu-close::after, .hero-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;

  /* soft highlight band near top, not a ring */
  background: linear-gradient(180deg,
    rgba(255,246,230,0.14) 0%,
    rgba(255,246,230,0.06) 18%,
    rgba(255,246,230,0.00) 42%
  );
}

.menu-button:hover, .menu-button:focus-visible,
.menu-close:hover, .menu-close:focus-visible,
.hero-btn:hover, .hero-btn:focus-visible {
  transform: translateY(-1px) scale(1.01);
  color: rgba(242,242,242,0.98);
}

.menu-button:hover::after, .menu-button:focus-visible::after,
.menu-close:hover::after, .menu-close:focus-visible::after,
.hero-btn:hover::after, .hero-btn:focus-visible::after {
  opacity: 1;
}

.menu-button:hover::before, .menu-button:focus-visible::before,
.menu-close:hover::before, .menu-close:focus-visible::before,
.hero-btn:hover::before, .hero-btn:focus-visible::before {
  animation: luxSheen 420ms ease-out 1;
}

.menu-button:active, .menu-close:active, .hero-btn:active {
  transform: translateY(0) scale(0.99);
}

.menu-button:focus-visible, .menu-close:focus-visible, .hero-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(233,226,211,0.12);
}

@keyframes luxSheen {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}
.menu-overlay { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-areas: "overlay"; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.menu-overlay[data-open="true"] { opacity: 1; pointer-events: auto; }
.menu-backdrop { grid-area: overlay; background: rgba(0,0,0,0.6); }
.menu-panel { grid-area: overlay; margin: 32px; border-radius: 16px; background: rgba(20,20,22,0.95); border: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 64px); overflow: auto; }
.menu-panel__header { display: flex; justify-content: space-between; align-items: center; }
.menu-panel__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.menu-section { display: grid; gap: 8px; }
.menu-section a { 
  font-size: 18px; 
  font-weight: 500; 
}
.menu-section .menu-heading { 
  font-weight: 600;
  text-transform: uppercase; 
  letter-spacing: 0.08em; 
  font-size: 14px; 
  color: var(--muted); 
}
.menu-open { overflow: hidden; }
.mobile-menu-button { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.menu-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.menu-icon > span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: rgba(242,242,242,0.92);
}
.menu-close-link {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
}

/* Triptych portals */
.portal-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 32px; }
.portal-card { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); min-height: 220px; background: linear-gradient(135deg, #1a1a1d, #0f0f12); cursor: pointer; }
.portal-card img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform 400ms ease, opacity 400ms ease; }
.portal-card::after { 
  content: attr(data-label); 
  position: absolute; 
  left: 16px; 
  bottom: 16px; 
  padding: 10px 14px; 
  border-radius: 12px; 
  background: rgba(0,0,0,0.55); 
  color: #fff; 
  font-family: var(--font-body);
  font-weight: 500; 
  letter-spacing: 0.05em; 
  text-transform: uppercase; 
}
.portal-card[data-ambient="true"] img { animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: scale(1.05) translate3d(-3px, -3px, 0); }
  to { transform: scale(1.08) translate3d(4px, 4px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .portal-card img { animation: none !important; transition: opacity 200ms ease; }
  .menu-button, .menu-close, .hero-btn {
    transition: none;
  }
  .menu-button::before, .menu-close::before, .hero-btn::before {
    display: none;
  }
  .lux-link::after,
  .menu-overlay a::after,
  footer a::after,
  .nav-link::after {
    transition: none;
  }
  .lux-link,
  header a,
  footer a,
  .menu-overlay a {
    transition: none;
  }
}

@media (max-width: 900px) {
  .header-inner {
    min-height: 72px;
  }
  .header-nav {
    display: none;
  }
  .mobile-menu-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }
  .menu-panel {
    margin: 12px;
    max-height: calc(100vh - 24px);
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(14,14,16,0.98), rgba(11,11,12,0.96));
    align-self: start;
  }
  .menu-panel__header {
    margin-bottom: 8px;
  }
  .menu-panel__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .menu-section {
    gap: 14px;
    padding: 8px 0;
  }
  .menu-section a {
    font-size: 19px;
    line-height: 1.35;
    padding: 4px 0;
  }
  .menu-overlay .menu-section a::after {
    display: none;
  }
}
.portal-set { position: relative; }
.portal-set:hover .portal-card:not(:hover) { transform: scale(0.97); filter: brightness(0.8); }
.portal-card { transition: transform 220ms ease, filter 220ms ease, box-shadow 220ms ease; }
.portal-card:hover, .portal-card:focus-visible { transform: scale(1.03); box-shadow: 0 20px 40px rgba(0,0,0,0.35); }

/* Home hero buttons + reel */
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 24px; }

.reels-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; visibility: hidden; }
.reels-stack--ready { visibility: visible; }
.reel-shell { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: #0c0c0d; }
.reel-track { 
  display: flex; 
  gap: 10px; 
  padding: 18px; 
  width: max-content; 
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
/* Lane animations are set via inline styles from JS based on lane config */
.reel-thumb { 
  flex: 0 0 256px; 
  width: 256px; 
  height: 144px; 
  overflow: visible; 
  border-radius: 12px; 
  border: 1px solid var(--border); 
  background: #000;
  position: relative;
  transition: transform 220ms ease;
  isolation: isolate;
}

/* Thumbnail glow effect */
.reel-thumb::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  filter: blur(12px);
  background: radial-gradient(
    ellipse 200% 200% at 50% 50%,
    rgba(255,246,230,0.12),
    rgba(233,226,211,0.08) 45%,
    rgba(255,246,230,0.00) 70%
  );
  transition: opacity 220ms ease;
  z-index: -1;
}

.reel-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,246,230,0.14),
    0 0 0 1px rgba(233,226,211,0.08);
  transition: opacity 220ms ease;
  z-index: 1;
}

.reel-thumb:hover,
.reel-thumb:focus-visible {
  transform: translateY(-1px);
}

.reel-thumb:hover::before,
.reel-thumb:focus-visible::before,
.reel-thumb:hover::after,
.reel-thumb:focus-visible::after {
  opacity: 1;
}

.reel-thumb:hover img,
.reel-thumb:focus-visible img {
  filter: brightness(1.03) contrast(1.02);
}

.reel-thumb:focus-visible {
  outline: none;
}

.reel-thumb img { 
  width: 256px; 
  height: 144px; 
  object-fit: cover; 
  display: block;
  aspect-ratio: 16 / 9;
  position: relative;
  z-index: 0;
  border-radius: 12px;
}
.reel-shell.is-paused .reel-track { animation-play-state: paused; }
.reel-mask { position: absolute; top: 0; bottom: 0; width: 140px; pointer-events: none; z-index: 1; }
.reel-mask--left { left: 0; background: linear-gradient(90deg, #0c0c0d 0%, rgba(12,12,13,0) 100%); }
.reel-mask--right { right: 0; background: linear-gradient(270deg, #0c0c0d 0%, rgba(12,12,13,0) 100%); }
@keyframes reelScroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@keyframes reelScrollReverse {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .reel-shell { overflow: hidden; }
  .reel-thumb {
    transition: none;
  }
  .reel-thumb::before,
  .reel-thumb::after {
    transition: none;
  }
}

/* Individual work page: video (Memories of Mobility, Freedom of Mobility, etc.) – same rounded display for all */
.work-video-figure {
  --work-media-radius: 12px;
  overflow: hidden;
  border-radius: var(--work-media-radius);
  border: 1px solid var(--border);
  background: #000;
}
.work-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--work-media-radius);
  isolation: isolate;
  /* Keep corner clipping stable across browser video compositors */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  clip-path: inset(0 round var(--work-media-radius));
}
.work-video-figure video {
  display: block;
  border-radius: inherit;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  clip-path: inset(0 round var(--work-media-radius));
}

/* Individual work page: iframe (Ghosts of Mobility) – same rounded display as video */
.work-iframe-figure {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}
.work-iframe-wrapper {
  position: relative;
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  min-height: 405px;
}

/* Ghosts of Mobility SVGs – floating below reels (~same area as 3 reels) */
/* Reels: 3 × (144 + 36 padding) + 2×12 gap ≈ 564px tall */
.ghosts-svgs {
  margin-top: 12px;
  width: 100%;
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease;
}

.ghosts-svgs.ghosts-svgs--ready {
  visibility: visible;
  opacity: 1;
}

/* Invisible container: no border/background; overflow keeps pieces inside */
.ghosts-float-area {
  position: relative;
  width: 100%;
  min-height: 564px;
  overflow: hidden;
}

.ghosts-svg-item.ghosts-svg-float {
  position: absolute;
  left: var(--gom-left, 50%);
  top: var(--gom-top, 50%);
  width: 144px;
  height: 144px;
  margin: 0;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 12px;
  opacity: 0;
}

.ghost-thumb {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: visible;
  border-radius: 12px;
  transition: transform 220ms ease;
  isolation: isolate;
}

.ghost-thumb::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  filter: blur(12px);
  background: radial-gradient(
    ellipse 200% 200% at 50% 50%,
    rgba(255,246,230,0.12),
    rgba(233,226,211,0.08) 45%,
    rgba(255,246,230,0.00) 70%
  );
  transition: opacity 220ms ease;
  z-index: -1;
}

.ghost-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,246,230,0.14),
    0 0 0 1px rgba(233,226,211,0.08);
  transition: opacity 220ms ease;
  z-index: 1;
}

.ghost-thumb:hover,
.ghost-thumb:focus-visible {
  transform: translateY(-1px);
}

.ghost-thumb:hover::before,
.ghost-thumb:focus-visible::before,
.ghost-thumb:hover::after,
.ghost-thumb:focus-visible::after {
  opacity: 1;
}

.ghost-thumb:hover img,
.ghost-thumb:focus-visible img {
  filter: brightness(1.03) contrast(1.02);
}

.ghost-thumb:focus-visible {
  outline: none;
}

/* Pause float when hovering so the piece stops moving */
.ghosts-svg-item.ghosts-svg-float.ghosts-svg-item--visible:has(.ghost-thumb:hover),
.ghosts-svg-item.ghosts-svg-float.ghosts-svg-item--visible:has(.ghost-thumb:focus-visible) {
  animation-play-state: paused;
}

.ghosts-svg-item.ghosts-svg-float .ghost-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  position: relative;
  z-index: 0;
}

/* Ongoing wandering float – like ghosts searching (36–38px range) */
@keyframes gomFloat {
  0%   { transform: translate(-50%, -50%) translate(0, 0); }
  10%  { transform: translate(-50%, -50%) translate(28px, -20px); }
  22%  { transform: translate(-50%, -50%) translate(12px, -36px); }
  35%  { transform: translate(-50%, -50%) translate(-24px, -16px); }
  48%  { transform: translate(-50%, -50%) translate(-32px, 20px); }
  60%  { transform: translate(-50%, -50%) translate(-8px, 32px); }
  72%  { transform: translate(-50%, -50%) translate(20px, 24px); }
  85%  { transform: translate(-50%, -50%) translate(36px, 4px); }
  100% { transform: translate(-50%, -50%) translate(0, 0); }
}

.ghosts-svg-item.ghosts-svg-float.ghosts-svg-item--visible {
  animation:
    gomTileIn var(--gom-duration, 900ms) cubic-bezier(0.2, 0.8, 0.2, 1) both,
    gomFloat calc(28s + var(--gom-float-phase, 0) * 4s) ease-in-out infinite;
  animation-delay:
    var(--gom-delay, 0ms),
    calc(var(--gom-delay, 0ms) + var(--gom-duration, 900ms) + 1.5s * var(--gom-float-phase, 0));
}

@keyframes gomTileIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translate3d(0, 0, 0);
  }
}

@media (max-width: 768px) {
  .ghosts-float-area {
    min-height: 420px;
  }
  .ghosts-svg-item.ghosts-svg-float {
    width: 144px;
    height: 144px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ghost-thumb {
    transition: none;
  }
  .ghost-thumb::before,
  .ghost-thumb::after {
    transition: none;
  }
}
