*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black:   #000000;
  --orange:  #ff5500;
  --red:     #ff1a1a;
  --white:   #ffffff;
  --off-white: #f0ede8;
  --dim:     #3d3d3d;
  --border:  #151515;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: #000;
  /* stop mobile pull-to-refresh / overscroll from reloading the whole page mid-scroll */
  overscroll-behavior-y: contain;
}

/* Full-page zuma video backdrop — fixed behind the whole landing page */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.page-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.12) brightness(0.82);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(120,200,255,0.035) 0px, rgba(120,200,255,0.035) 1px, transparent 2px, transparent 4px),
    radial-gradient(120% 90% at 50% 30%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.32) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0.12) 45%, rgba(0,0,0,0.45) 100%);
}

body {
  background: transparent;
  color: var(--white);
  font-family: 'Space Mono', monospace;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;   /* belt-and-braces: no pull-to-refresh reload on phones */
}

body.modal-open {
  position: fixed;
  width: 100%;
  overflow-y: scroll;
}

.orange { color: var(--orange); }
.red    { color: var(--red); }

/* ── Top bar ─────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 36px;
  border-bottom: 1px solid rgba(255, 85, 0, 0.28);
  background: linear-gradient(180deg, rgba(8,6,10,0.62) 0%, rgba(8,6,10,0.28) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 10px 30px rgba(0,0,0,0.45), 0 0 24px rgba(255,85,0,0.12);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Futuristic neon ring frame around the Rex Trueform logo */
.nav-logo-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.nav-logo-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff5500, #ffb070, #5eeaff, #7da8ff, #ff5500);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: navRingSpin 6s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255,85,0,0.6));
}
.nav-logo-wrap::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,85,0,0.30), rgba(94,234,255,0.10) 55%, transparent 72%);
  pointer-events: none;
  animation: navGlowPulse 3.4s ease-in-out infinite;
}
@keyframes navRingSpin { to { transform: rotate(360deg); } }
@keyframes navGlowPulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

.nav-logo {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.7);
}

.nav-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 0.16em;
  /* was a loud black-on-solid-orange pill — now a quiet tonal label that sits
     in the header instead of shouting from it. Brand lives in the logo ring + hero. */
  color: rgba(236,231,221,0.66);
  background: none;
  padding: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Auth buttons live hard against the right edge, stacked: Sign Up above Login */
#navRight {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* Order-of-the-Skull crest — small mark at the far right of the top banner.
   44px hit area for touch; the skull itself stays visually small. */
.skull-nav {
  width: 44px;
  height: 44px;
  padding: 8px;
  margin: -6px 0;           /* keep the 44px hit area from growing the banner */
  border: none;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 6px rgba(255,85,0,.45));
  transition: transform 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.skull-nav img { width: 28px; height: 28px; object-fit: contain; display: block; }
.skull-nav:hover { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(255,85,0,.9)); }
@keyframes skullFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* Three-Body — sits directly above the REX orb (middle of the stack), same column */
.tb3-float {
  position: fixed;
  right: 33px;             /* 50px wide → centred on the 64px orb's column */
  bottom: 102px;           /* just above the REX orb */
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  background: radial-gradient(circle at 50% 38%, rgba(22,12,6,.92), rgba(8,5,10,.94));
  border: 1px solid rgba(255,85,0,.5);
  box-shadow: 0 0 16px rgba(255,85,0,.32), inset 0 0 12px rgba(255,85,0,.1);
  z-index: 99997;
  animation: skullFloat 3.6s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.tb3-float:hover { transform: scale(1.1); box-shadow: 0 0 22px rgba(255,85,0,.6), inset 0 0 12px rgba(255,85,0,.16); }
.tb3-logo-lg { transform: scale(1.65); }   /* blow the 22px nav logo up to fill the smaller button */
@media (max-width: 520px) {
  .tb3-float { right: 23px; bottom: 92px; }
}

.nav-meside-logo {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* ── Hero ────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: clamp(420px, 62vh, 760px);
}

/* Cinematic vignette — frames the hero, darkens the corners (over the moon/video,
   under the lettering so text stays crisp) */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 42% 42%, transparent 38%, rgba(0,0,0,0.62) 100%);
}

@keyframes moonSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-22px); }
}

/* the molten body is rendered on a canvas (see sun.js): churning photosphere,
   limb darkening, glowing corona and prominence loops that arch out and retract */
.hero-sun-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes sunFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-26px); }
}

.hero-content {
  position: relative;
  z-index: 3;
  top: -5vh;                 /* lift the title to sit centered in the (raised) Möbius loop */
  padding: 64px 36px 52px;
  will-change: transform, opacity;
  perspective: 1100px;
  /* keep lettering legible against the bright moon behind it */
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 0, 0, 0.45);
}

.site-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 13vw, 160px);
  line-height: 0.88;
  letter-spacing: 0.03em;
  color: var(--white);
  display: block;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Animatable hero letters (driven by herotext.js) */
.hero-letter {
  display: inline-block;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  color: #e6e0d4;              /* warm off-white, one notch softer — lit by the scene */
  /* flat now: no chrome extrusion, just a soft ambient shadow so it stays legible
     over the video while sitting fully IN the scene (the title plane's rotateX
     still carries the subtle 3D lean). */
  text-shadow:
    0 2px 11px rgba(0,0,0,0.55),
    0 0 16px rgba(150,200,255,0.10);
}
.hero-letter.side {
  color: var(--orange);        /* brand orange face; the pop is gone from the glow, not the hue */
  text-shadow:
    0 2px 11px rgba(0,0,0,0.6),
    0 0 14px rgba(255,85,0,0.20);
}

/* Independently-floating accent words (driven by herotext.js) */
.floaty {
  display: inline-block;
  will-change: transform;
}
.shake1 { animation: shake1 0.16s linear infinite; }
.shake2 { animation: shake2 0.11s linear infinite; }
.shake3 { animation: shake3 0.19s linear infinite; }
.shake4 { animation: shake4 0.13s linear infinite; }

@keyframes shake1 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-1px, 1px) rotate(-1deg); }
  50%  { transform: translate(1px, -1px) rotate(1deg); }
  75%  { transform: translate(-1px, -1px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes shake2 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(1px, -1px) rotate(1deg); }
  50%  { transform: translate(-1px, 1px) rotate(-1.5deg); }
  75%  { transform: translate(1px, 1px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes shake3 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-1px, -1px) rotate(1deg); }
  50%  { transform: translate(1px, 1px) rotate(-1deg); }
  75%  { transform: translate(-1px, 1px) rotate(1.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes shake4 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(1px, 1px) rotate(-1deg); }
  50%  { transform: translate(-1px, -1px) rotate(1deg); }
  75%  { transform: translate(1px, -1px) rotate(-0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes growLine {
  to { width: 100%; }
}

.site-sub-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(27px, 4.4vw, 58px);
  color: var(--white);
  margin-top: 8px;
  letter-spacing: 0.06em;
}

/* Hero kicker — the lead line above the name */
.hero-kicker {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: clamp(11px, 1.6vw, 15px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(210,140,86,0.82); /* dimmed amber whisper above the name, quieter still */
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(255,85,0,0.22);
  animation: kickerFlicker 6s infinite;
}
@keyframes kickerFlicker { 0%,97%,100%{opacity:1;} 98%{opacity:.55;} 99%{opacity:1;} }

/* Hero breadth — the cycling "We build …" line under the name */
.hero-breadth {
  font-family: 'Space Mono', monospace;
  font-size: clamp(12px, 1.9vw, 18px);
  letter-spacing: 0.12em;
  color: rgba(240,237,232,0.78);
  margin-top: 14px;
}
.hero-cycle {
  color: var(--orange);
  font-weight: 700;
  text-shadow: 0 0 14px rgba(255,85,0,0.6);
  display: inline-block;
  min-width: 6.5em;
  text-align: left;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hero-cycle.swap { opacity: 0; transform: translateY(-6px); }
.nowrap { white-space: nowrap; }

/* ── Filter bar ──────────────────────────── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--black);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.filter-scroll {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 16px 22px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover { color: var(--off-white); }

.filter-btn.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.filter-count {
  display: flex;
  align-items: center;
  padding: 0 28px;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--dim);
  border-left: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── #5 Hero Explore CTA ─────────────────────────────── */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 14px 38px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,85,0,0.18) 0%, rgba(51,182,255,0.12) 100%);
  border: 1px solid rgba(255,85,0,0.55);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  box-shadow: 0 0 18px rgba(255,85,0,0.22), inset 0 0 14px rgba(255,85,0,0.08);
}
.hero-cta::after {
  content: "↓";
  font-family: inherit;
  font-size: 0.85em;
  transition: transform 0.3s;
  display: inline-block;
}
.hero-cta:hover {
  border-color: rgba(255,85,0,0.9);
  box-shadow: 0 0 36px rgba(255,85,0,0.45), inset 0 0 20px rgba(255,85,0,0.14);
  transform: translateY(-2px);
}
.hero-cta:hover::after { transform: translateY(3px); }

/* ── #1 Gallery search + style pills ─────────────────────────────── */
.gallery-search-row {
  background: rgba(0,0,0,0.82);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.gallery-search {
  flex: 0 0 auto;
  width: min(260px, 100%);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: var(--off-white);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.gallery-search:focus {
  border-color: rgba(255,85,0,0.6);
  box-shadow: 0 0 0 2px rgba(255,85,0,0.12);
}
.gallery-search::placeholder { color: rgba(255,255,255,0.28); }
.gallery-search::-webkit-search-cancel-button { cursor: pointer; }

.style-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.style-pill {
  background: none;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: rgba(255,255,255,0.45);
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 14px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.style-pill:hover { color: var(--off-white); border-color: rgba(255,255,255,0.35); }
.style-pill.active {
  color: var(--orange);
  border-color: rgba(255,85,0,0.6);
  box-shadow: 0 0 10px rgba(255,85,0,0.18);
}

/* ── #5 Latest Drop featured card ─────────────────────────────── */
.latest-drop {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 28px 40px 0;
  border: 1px solid rgba(255,85,0,0.3);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255,85,0,0.05);
  transition: border-color 0.25s, box-shadow 0.25s;
  max-height: 180px;
}
.latest-drop:hover {
  border-color: rgba(255,85,0,0.65);
  box-shadow: 0 0 30px rgba(255,85,0,0.18);
}
.latest-drop-thumb {
  width: 260px;
  flex-shrink: 0;
  overflow: hidden;
  background: #111;
}
.latest-drop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
  transition: filter 0.3s, transform 0.4s;
}
.latest-drop:hover .latest-drop-thumb img {
  filter: brightness(1);
  transform: scale(1.04);
}
.latest-drop-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 24px 32px;
}
.latest-badge {
  display: inline-block;
  background: var(--orange);
  color: #000;
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  align-self: flex-start;
}
.latest-drop-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  font-weight: 500;
  color: var(--off-white);
  line-height: 1.2;
}
.latest-drop-tag {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
.latest-drop-cta {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
  margin-top: 4px;
  transition: letter-spacing 0.2s;
}
.latest-drop:hover .latest-drop-cta { letter-spacing: 0.22em; }

@media (max-width: 640px) {
  .latest-drop { margin: 20px 16px 0; flex-direction: column; max-height: none; }
  .latest-drop-thumb { width: 100%; height: 140px; }
  .latest-drop-info { padding: 16px 20px; }
}

/* ── #3 Brand footer ─────────────────────────────── */
.site-footer {
  background: linear-gradient(180deg, rgba(0,0,0,0.92) 0%, #000 100%);
  border-top: 1px solid rgba(255,85,0,0.2);
  padding: 48px 40px 36px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.15em;
}
.footer-tagline {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.footer-link {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--link-color, var(--dim));
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 6px 14px;
  opacity: 0.6;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.footer-link:hover { opacity: 1; box-shadow: 0 0 12px currentColor; }
.footer-legal {
  display: flex;
  justify-content: flex-end;
}
.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.18);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-legal { justify-content: center; }
  .footer-brand { align-items: center; }
  .site-footer { padding: 36px 20px 28px; }
}

/* ── Gallery ─────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
  min-height: 50vh;
}

@media (max-width: 960px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .gallery { grid-template-columns: 1fr; } }

.gallery-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 120px 0;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.18s; }
.loading-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* ── Card ────────────────────────────────── */
.card {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #080808;
  cursor: pointer;
  perspective: 900px;
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Scroll reveal — cards rise + fade in as they enter the viewport */
.card.reveal      { opacity: 0; transform: translateY(46px); }
.card.reveal.in   { opacity: 1; transform: translateY(0); }

/* filtered-out is declared AFTER reveal so it wins the transform cascade */
.card.filtered-out {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.card.hidden { display: none; }

/* The tilting 3D plane — clips the video, holds the depth layers */
.card-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease;
  will-change: transform;
}

/* While actively tracking the cursor we drop the transform easing for 1:1 follow */
.card.tilting .card-inner { transition: box-shadow 0.4s ease; }

.card:hover { z-index: 5; }

.card:hover .card-inner {
  box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.85);
}

.card-video,
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* On hover the thumbnail lifts off the card surface (parallax float) */
.card:hover .card-video,
.card:hover .card-image { transform: scale(1.12) translateZ(38px); }

/* Music tile — no thumbnail, so a branded orange cover */
.card-audio {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,120,40,0.55), transparent 55%),
    linear-gradient(135deg, #1a0a02 0%, #3a1402 55%, #ff5500 200%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card-audio { transform: scale(1.06) translateZ(30px); }
/* When a song has a picture (e.g. Cotton Ball Fire), show it as the card art with
   a soft dark scrim so the ♫ + title stay legible. */
.card-audio.has-thumb {
  background-size: cover;
  background-position: center;
}
.card-audio.has-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0.35) 100%);
}
.card-audio-note {
  position: relative;
  font-size: clamp(40px, 6vw, 72px);
  color: var(--orange);
  text-shadow: 0 0 26px rgba(255,85,0,0.7);
}
.card-audio.has-thumb .card-audio-note {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.85);
}
/* When a song's cover is one of Rex's art clips, it loops softly behind the tile,
   under the scrim and the ♫ so they stay legible. */
.card-audio-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.card-audio.has-thumb::before { z-index: 1; }   /* scrim sits above the clip */
.card-audio-note { z-index: 2; }                /* ♫ sits above everything */

/* ── Media sections (Video / Images / Music) ─────────────── */
/* A media section can carry a full-bleed background video (Music = Zuma loop). The
   clip sits behind everything under a heavy dark veil so the section stays moody and
   the cards/coverflow read clearly on top. */
.media-section.has-bg-video {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.section-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}
.section-bg-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* barely-there veil — Zuma clip shows through almost fully; just a whisper at the
     very bottom so the section edge blends into the page */
  background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.18) 100%);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 30px 18px 12px;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(26px, 4vw, 46px);
  letter-spacing: 0.06em;
  color: var(--white);
}
.section-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--orange);
}
.section-empty {
  padding: 0 18px 26px;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
}

/* Modal — image + audio variants */
.modal-image {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}
.modal-audio-wrap {
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 64px 30px;
}
.modal-audio-art {
  font-size: 90px;
  color: var(--orange);
  text-shadow: 0 0 40px rgba(255,85,0,0.6);
}
.modal-audio { width: 100%; max-width: 520px; }

/* Cursor-tracked sheen — sells the 'physical print' feel */
.card-sheen {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%),
              rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 45%);
  mix-blend-mode: overlay;
  transition: opacity 0.4s ease;
}
.card:hover .card-sheen { opacity: 1; }

/* Orange style badge — slides down from top on hover */
.card-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--orange);
  color: var(--black);
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 7px 14px;
  transform: translateY(-110%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card-badge { transform: translateY(0); }

/* Title overlay — slides up from bottom on hover */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0) 55%);
  display: flex;
  align-items: flex-end;
  padding: 22px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card-overlay { transform: translateY(0); }

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--off-white);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

/* ── Modal ───────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  cursor: pointer;
  animation: bgFadeIn 0.3s ease forwards;
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 1080px;
  animation: boxIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

@keyframes boxIn {
  from { opacity: 0; transform: scale(0.93) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Close + fullscreen sit over the video's top-right. Smaller now, and they fade
   away while a clip plays (a tap/move over the modal brings them back — main.js). */
.modal-close,
.modal-fs {
  position: absolute;
  top: 12px;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--orange);
  color: var(--orange);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  z-index: 6;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: opacity 0.35s ease, background 0.2s, color 0.2s;
}
.modal-close { right: 12px; }
.modal-fs    { right: 50px; }

.modal-close:hover,
.modal-fs:hover {
  background: var(--orange);
  color: var(--black);
}

.modal.controls-hidden .modal-close,
.modal.controls-hidden .modal-fs {
  opacity: 0;
  pointer-events: none;
}

.modal-video-wrap {
  background: #000;
  line-height: 0;
}

.modal-video {
  width: 100%;
  display: block;
  outline: none;
  max-height: 80vh;
}

.modal-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 2px 0;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

.modal-info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--off-white);
}

.modal-style-tag {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
}

/* ── Touch / Mobile ──────────────────────── */

/* On touch devices: title + badge always visible, no hover preview */
@media (hover: none) {
  .card-overlay {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 60%);
  }

  .card-badge {
    transform: translateY(0);
  }

  .card-video {
    transform: scale(1.04);
  }
}

/* Tablet + phone layout */
@media (max-width: 768px) {
  .top-bar {
    padding: 10px 20px;
  }

  .hero-content {
    padding: 36px 20px 30px;
  }

  .filter-btn {
    padding: 12px 14px;
    min-height: 44px;
  }

  .filter-count {
    padding: 0 14px;
  }

  /* Close + fullscreen: a touch larger for tapping, still auto-hiding while playing */
  .modal-close,
  .modal-fs {
    top: 10px;
    background: rgba(0, 0, 0, 0.6);
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .modal-close { right: 10px; }
  .modal-fs    { right: 54px; }

  .modal-box {
    width: 96vw;
  }

  .modal-video {
    max-height: 55vh;
  }

  .modal-title {
    font-size: 17px;
  }
}

/* Gallery: 2 columns on phones */
@media (max-width: 560px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .card-title { font-size: 13px; }
}

/* Safe area for iPhone notch / home bar */
@supports (padding: env(safe-area-inset-bottom)) {
  .filter-bar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mobile nav tweaks */
@media (max-width: 560px) {
  .top-bar { padding: 12px 16px; }
  .nav-label { display: none; }
}

/* ── Atmosphere FX (cursor spotlight + film grain + vignette) ───────────── */
/* These are injected into <body> by effects.js. All pointer-events: none and
   sit below the modal (z 1000) so they never block interaction. */
.fx-spotlight {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 85, 0, 0.10), rgba(255, 85, 0, 0) 62%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.fx-spotlight.on { opacity: 1; }

.fx-vignette {
  position: fixed;
  inset: 0;
  z-index: 58;
  pointer-events: none;
  background: radial-gradient(125% 95% at 50% 38%,
              rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
}

.fx-grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 59;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.7s steps(3) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .fx-grain { animation: none; }
  .card-inner { transition: box-shadow 0.4s ease; }
}

/* ── Scroll-through solar system ─────────────────────────────────────────── */
.solar {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 70% 40%, #0a1020 0%, #05060c 55%, #000 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Fallback shown only when WebGL can't run (canvas never gets added on top). */
.solar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.solar-hud {
  position: absolute;
  left: clamp(18px, 5vw, 64px);
  bottom: clamp(80px, 14vh, 140px);
  max-width: min(440px, 80vw);
  pointer-events: none;
  z-index: 3;
}
.solar-kicker {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 6px;
}
.solar-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(46px, 9vw, 104px);
  line-height: 0.92;
  letter-spacing: 0.03em;
  color: #fff;
  margin: 0;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.8);
}
.solar-fact {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(15px, 2.2vw, 20px);
  line-height: 1.4;
  color: var(--off-white);
  margin: 10px 0 0;
  opacity: 0.92;
}

.solar-scrub {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(34px, 7vh, 56px);
  display: flex;
  gap: 14px;
  z-index: 3;
  padding: 10px 16px;
  background: rgba(8, 10, 18, 0.45);
  border: 1px solid var(--border);
  border-radius: 40px;
  backdrop-filter: blur(8px);
}
.solar-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.solar-dot:hover { background: rgba(255, 255, 255, 0.6); transform: scale(1.25); }
.solar-dot.active {
  background: var(--orange);
  transform: scale(1.4);
  box-shadow: 0 0 14px rgba(255, 85, 0, 0.8);
}

.solar-hint {
  position: absolute;
  right: clamp(18px, 5vw, 48px);
  bottom: clamp(34px, 7vh, 56px);
  margin: 0;
  z-index: 3;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}

@media (max-width: 640px) {
  .solar-hint { display: none; }
  .solar { height: 86vh; }
}

/* ── 3D Coverflow rail ───────────────────────────────────────────────────── */
.coverflow {
  position: relative;
  height: clamp(300px, 52vh, 560px);
  margin: 6px 0 46px;
  perspective: 1700px;
  overflow: hidden;
  cursor: grab;
  outline: none;
}
.coverflow.grabbing { cursor: grabbing; }

.cf-viewport {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* Coverflow cards are positioned by JS; override the grid card defaults. */
.coverflow .card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62vw, 540px);
  height: auto;
  margin: 0;
  opacity: 0;                       /* set inline by layout() */
  transform: translate(-50%, -50%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
  will-change: transform, opacity;
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.9);
  backface-visibility: hidden;
}

/* The centred card glows forward and reveals its title + badge. */
.coverflow .card.cf-active {
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95),
              0 0 0 1px rgba(255, 255, 255, 0.06);
}
.coverflow .card.cf-active .card-overlay,
.coverflow .card.cf-active .card-badge { transform: translateY(0); }

.cf-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(10, 10, 14, 0.5);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, opacity 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.cf-arrow.prev { left: clamp(8px, 2vw, 26px); }
.cf-arrow.next { right: clamp(8px, 2vw, 26px); }
.cf-arrow:hover { background: var(--orange); color: var(--black); }
.cf-arrow:disabled { opacity: 0.2; cursor: default; }

.cf-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--dim);
  pointer-events: none;
}

@media (max-width: 640px) {
  .coverflow .card { width: 80vw; }
  .cf-arrow { width: 42px; height: 42px; font-size: 24px; }
}
.sub-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 20px 0;
}
.sub-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(18px, 2.6vw, 28px);
  letter-spacing: 0.08em;
  color: var(--off-white);
  margin: 0;
}
.sub-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--dim);
}
/* AI Music heading doubles as the "play the intro" button. */
.sub-title-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.sub-title-btn:hover { color: var(--orange); }
.sub-title-btn .ai-info {
  font-size: 0.62em;
  color: var(--orange);
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ── Rex's Products ──────────────────────────────────────────────────────── */
.products { padding-bottom: 40px; }

/* ── The Rex Trueform World (3D neural map) ──────────────────────────────── */
.world {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  /* Galaxy 2 (Hubble deep field) behind the 3D planets; a dark gradient veil
     over it keeps the orbiting nodes and labels legible. The world-stage canvas
     is transparent (alpha), so this image reads as the section's deep space. */
  /* --sky-veil is retinted by the living-sky cycle (world.js) per time of day. */
  --sky-veil: 10, 4, 12;
  background:
    radial-gradient(120% 90% at 50% 38%, rgba(var(--sky-veil),0.55) 0%, rgba(var(--sky-veil),0.64) 42%, rgba(var(--sky-veil),0.80) 72%, rgba(0,0,0,0.9) 100%),
    #000 url("/static/galaxy-2.jpg") center center / cover no-repeat;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.world-stage { position: absolute; inset: 0; z-index: 1; }
.world-stage canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }

/* Rex Trueform logo (MP4) pinned at the galaxy core (origin always projects to centre) */
.world-logo {
  position: absolute;
  left: 50%; top: 50%;
  width: 172px; height: 172px;
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 50%;                     /* circular medallion at the core */
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 0 36px rgba(255, 85, 0, 0.65));
  transition: opacity 0.3s ease;
}
.world-logo.dimmed { opacity: 0; }

.world-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 30px;
  pointer-events: none;
}
.world-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 4vw, 52px);
  letter-spacing: 0.06em;
  color: #fff;
  margin: 0;
  text-shadow: 0 0 32px rgba(255, 85, 0, 0.45);
}
.world-expand {
  pointer-events: auto;
  width: 40px; height: 40px;
  background: rgba(8, 6, 10, 0.6);
  border: 1px solid var(--orange);
  color: var(--orange);
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.world-expand:hover { background: var(--orange); color: #000; }
.world-head-actions { display: flex; align-items: center; gap: 10px; }
/* Tour button: same shell as expand; lights up + pulses while a tour is running. */
.world-tour { font-size: 13px; }
.world-tour.touring { background: var(--orange); color: #000; animation: tourPulse 1.6s ease-in-out infinite; }
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 85, 0, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 85, 0, 0); }
}

.world-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.world-label {
  position: absolute;
  transform: translate(-50%, -160%);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}
.world-label.core { color: var(--orange); font-size: 14px; letter-spacing: 0.18em; }
.world-label.hub  { color: rgba(255, 200, 160, 0.85); font-size: 11px; }
.world-label.portal {
  color: rgba(255, 170, 90, 0.92);
  font-size: 10px;
  white-space: normal;
  max-width: 150px;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 90, 0, 0.5), 0 0 8px rgba(0, 0, 0, 0.9);
}
/* Rich hover/peek card: floats above whatever node is under the cursor (or tapped
   on touch). Pointer-events off so it never blocks the drag-to-orbit canvas. */
.world-hovercard {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, calc(-100% - 22px));
  width: 232px;
  display: flex;
  gap: 11px;
  padding: 11px;
  background: rgba(10, 9, 12, 0.93);
  border: 1px solid rgba(255, 85, 0, 0.42);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px -22px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  white-space: normal;
}
.world-hovercard::after {            /* little tail pointing down at the node */
  content: "";
  position: absolute;
  left: 50%; bottom: -7px;
  width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(10, 9, 12, 0.93);
  border-right: 1px solid rgba(255, 85, 0, 0.42);
  border-bottom: 1px solid rgba(255, 85, 0, 0.42);
}
.whc-thumb {
  width: 54px; height: 54px; flex-shrink: 0;
  border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  background: #111;
}
.whc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.whc-thumb.icon { text-shadow: 0 0 12px rgba(0, 0, 0, 0.55); }
.whc-body { flex: 1; min-width: 0; }
.whc-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 0.03em; line-height: 1.04;
  color: #fff; margin-bottom: 3px;
}
.whc-desc {
  font-family: 'Space Mono', monospace;
  font-size: 9.5px; line-height: 1.38;
  color: rgba(255, 255, 255, 0.72);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 7px;
}
.whc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.whc-tag {
  font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--orange);
}
.whc-go {
  font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.whc-go.soon { color: rgba(255, 255, 255, 0.3); }

.world-hint {
  position: absolute;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  z-index: 4;
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.world-fallback {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: 0.1em;
  color: var(--dim);
}
.world:fullscreen { min-height: 100vh; }
.world:fullscreen .world-stage { position: absolute; inset: 0; }

/* ── App (in-site product) modal ─────────────────────────────────────────── */
.app-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  flex-direction: column;
  background: rgba(6, 4, 2, 0.98);
}
.app-modal.open { display: flex; animation: bgFadeIn 0.3s ease forwards; }

.app-modal-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 16px;
  background: #0c0c0e;
  border-bottom: 1px solid var(--border);
}
.app-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-modal-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.app-modal-new {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  transition: border-color 0.2s, background 0.2s;
}
.app-modal-new:hover { border-color: var(--orange); background: rgba(255, 85, 0, 0.1); }
.app-modal-close {
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.app-modal-close:hover { background: var(--orange); color: var(--black); }

.app-modal-frame-wrap { position: relative; flex: 1 1 auto; background: #000; }
.app-modal-frame { width: 100%; height: 100%; border: 0; display: block; }
.app-modal-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
}
.app-modal-loader span {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 85, 0, 0.25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: appSpin 0.8s linear infinite;
}
@keyframes appSpin { to { transform: rotate(360deg); } }

.skull-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 24px;
}
.skull-modal.open { display: flex; }
.skull-modal-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(25,12,0,0.7), rgba(0,0,0,0.93));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.manuscript {
  position: relative; width: min(640px, 94vw); max-height: 88vh;
  color: #2a1c0c; border-radius: 4px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,250,235,0.55), transparent 60%),
    radial-gradient(circle at 18% 22%, rgba(150,110,60,0.18), transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(120,80,40,0.22), transparent 45%),
    linear-gradient(160deg, #efe3c6 0%, #e6d6b0 45%, #d9c39a 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 60px rgba(120,80,30,0.35), inset 0 0 0 1px rgba(80,50,20,0.4);
  outline: 2px solid rgba(60,38,14,0.55); outline-offset: -10px;
  animation: msIn 0.5s cubic-bezier(0.2,1,0.3,1);
}
@keyframes msIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97) rotate(-0.4deg); }
  to   { opacity: 1; transform: none; }
}
.manuscript-scroll { max-height: 88vh; overflow-y: auto; padding: 46px clamp(26px,5vw,60px) 40px; text-align: center; }
.skull-close {
  position: absolute; top: 12px; right: 14px; z-index: 3; width: 34px; height: 34px;
  border: 1px solid rgba(60,38,14,0.5); background: rgba(255,250,235,0.4); color: #3a2510;
  border-radius: 50%; cursor: pointer; font-size: 14px; transition: background 0.2s, transform 0.2s;
}
.skull-close:hover { background: rgba(180,60,0,0.9); color: #fff; transform: rotate(90deg); }

.ms-crest { font-size: 46px; color: #3a2510; line-height: 1; margin-bottom: 6px; text-shadow: 0 1px 0 rgba(255,255,255,0.3); }
.ms-title { font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(26px,5vw,40px); letter-spacing: 0.08em; text-transform: uppercase; color: #2a1c0c; }
.ms-sub { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: #6b4a22; margin-top: 8px; }
.ms-rule { height: 0; border-top: 1px solid rgba(80,50,20,0.45); width: 70%; margin: 20px auto; position: relative; }
.ms-rule::after {
  content: "\2766"; position: absolute; top: -0.72em; left: 50%; transform: translateX(-50%);
  color: #6b4a22; font-size: 16px; padding: 0 10px;
  background: linear-gradient(160deg, #ebdfc2, #e3d3ac);
}
.ms-welcome { font-family: 'Cormorant Garamond', serif; font-size: clamp(17px,2.4vw,21px); line-height: 1.6; color: #34230f; text-align: left; max-width: 48ch; margin: 0 auto; }
.ms-drop { float: left; font-family: 'Cinzel', serif; font-weight: 700; font-size: 3.4em; line-height: 0.72; padding: 6px 10px 0 0; color: #7a2a08; }
.ms-commandments-title { font-family: 'Cinzel', serif; font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; color: #5a3a18; margin: 26px 0 14px; }
.ms-commandments { list-style: none; counter-reset: cmd; text-align: left; max-width: 48ch; margin: 0 auto; padding: 0; }
.ms-commandments li {
  counter-increment: cmd; font-family: 'Cormorant Garamond', serif; font-size: clamp(16px,2.2vw,19px);
  font-style: italic; line-height: 1.5; color: #34230f; position: relative;
  padding: 9px 0 9px 54px; border-bottom: 1px dashed rgba(90,60,25,0.25);
}
.ms-commandments li:last-child { border-bottom: 0; }
.ms-commandments li::before {
  content: counter(cmd, upper-roman); position: absolute; left: 0; top: 8px; width: 40px; text-align: right;
  font-family: 'Cinzel', serif; font-style: normal; font-weight: 700; font-size: 15px; color: #7a2a08;
}
.ms-charge { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: clamp(16px,2.3vw,20px); color: #4a2f12; max-width: 44ch; margin: 0 auto; line-height: 1.55; }
.ms-seal {
  margin: 22px auto 6px; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  color: #fbe6c8; background: radial-gradient(circle at 35% 30%, #b5391a, #7c1f08 70%);
  box-shadow: 0 6px 16px rgba(80,20,0,0.5), inset 0 2px 6px rgba(255,180,140,0.4), inset 0 -6px 14px rgba(0,0,0,0.45);
  border: 2px solid rgba(120,40,10,0.6); transform: rotate(-8deg);
}
.ms-seal span { font-size: 40px; line-height: 1; }
.ms-sign { font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #5a3a18; margin-top: 6px; }
.ms-sign em { font-style: italic; text-transform: none; font-family: 'Cormorant Garamond', serif; font-size: 15px; }
@media (max-width: 600px) { .manuscript-scroll { padding: 40px 22px 32px; } }

/* ── Mobile ergonomics ─────────────────────────────────────────────────────────
   iOS Safari auto-zooms any focused input under 16px, and fingertips need ~44px
   targets (Luke's mobile-first rule). Scoped to touch devices only. */
@media (pointer: coarse) {
  .gallery-search { font-size: 16px; }
  .style-pill { min-height: 44px; padding: 10px 18px; }
  .galaxy-toggle { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .modal-close, .modal-fs { width: 44px; height: 44px; }
  .modal-fs { right: 60px; }   /* keep clear of the bigger close button */
}
