/* =========================================================
   PROJECT DETAIL — Ruby template
   Based on the user's RACCOON RUBY layout. Data-driven from
   Supabase gallery row. Accent color overridable via --ruby CSS var.
   ========================================================= */

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

/* === BRAND TYPE — Judas gothic blackletter (matches the GAMMA logo wordmark) === */
@font-face {
  font-family: 'Judas';
  src: url('../fonts/judas.ttf') format('truetype');
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

:root {
  --ruby:           #dc1e28;
  /* Derived shades — auto-update when --ruby is overridden per-project */
  --ruby-dark:      color-mix(in srgb, var(--ruby) 55%, #000);
  --ruby-light:     color-mix(in srgb, var(--ruby) 85%, #fff);
  --ruby-glow:      rgba(var(--ruby-rgb), 0.4);
  --burgundy:       #4a0d1a;
  --burgundy-deep:  #2c050d;
  /* RGB tuples — overridable per-project via JS for full theme adaptation */
  --ruby-rgb:       220, 30, 40;
  --burgundy-rgb:   74, 13, 26;
  --bg:             #0a0608;
  /* Derived from --burgundy so card/badge/poster fills follow the per-project
     ambient color. Was #1a0408 (red-brown) which leaked red into every dark
     surface — replaced by a clamped mix so it always stays subtly dark + warm. */
  --bg-light:       color-mix(in srgb, var(--burgundy) 50%, var(--bg));
  --text:           #e8e8e8;
  --text-dim:       #888;
  --text-faint:     #444;
  --font-gothic:    'Judas', 'UnifrakturCook', 'Old English Text MT', serif;
  --brand-watermark: 'GAMMA';
}

/* Utility — apply gothic Judas font to any element */
.font-gothic { font-family: var(--font-gothic); letter-spacing: 0.04em; }

html {
  /* bg painted on html (the canvas) so body has no opaque layer of its own.
     Without this split, body's bg would mask body::before .has-bg-texture
     (z-index:-1 pseudo). Texture now sits between html bg and body content. */
  background: var(--bg);
}
html, body {
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
::selection { background: var(--ruby); color: var(--bg); }
img { display: block; max-width: 100%; }

/* === BACK LINK === */
.back-link {
  position: fixed; top: 14px; left: 16px; z-index: 200;
  padding: 8px 14px;
  background: rgba(10, 6, 8, 0.85);
  border: 1px solid rgba(var(--ruby-rgb), 0.35);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--ruby);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.back-link:hover { background: rgba(var(--ruby-rgb), 0.15); border-color: var(--ruby); }

/* === TOP BAR === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Removed glassmorphism (brand DA forbids backdrop-filter) — solid opaque bg */
  background: var(--bg, #0a0608);
  border-bottom: 1px solid rgba(var(--ruby-rgb), 0.25);
  padding: 14px 40px 14px 140px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.topbar .left { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.topbar .right { display: flex; gap: 24px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; font-size: 10px; flex-wrap: wrap; }
.warn { color: var(--ruby); font-weight: 600; }
.series { color: var(--text-dim); }
.dot { color: var(--ruby); animation: blink 2s infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.3; } }

/* === HERO === */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  background: var(--bg-light) center/cover;
  background-image: linear-gradient(135deg, #1a0408 0%, #0a0608 100%);
  filter: brightness(1.05) contrast(1.05);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top, transparent 0%, rgba(10,6,8,0.4) 70%, rgba(10,6,8,0.95) 100%),
    linear-gradient(180deg, transparent 50%, rgba(10,6,8,0.9) 100%);
}
/* Decorative art layer ABOVE the hero base image, BELOW the darkening gradient.
   Driven by item.heroOverlayImage + item.heroOverlayOpacity (default 0.5). */
.hero-overlay-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--hero-art-opacity, 0.5);
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
}
.hero-content {
  position: absolute;
  bottom: 60px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 2;
}
.hero-title-block .pretitle {
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--ruby);
  margin-bottom: 14px;
  font-weight: 600;
}
.hero-title-block .pretitle::before {
  content: "▼ ";
  margin-right: 6px;
}
.hero-title-block h1 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(56px, 9vw, 140px);
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 0.9;
  color: #fff;
  text-shadow: 0 0 60px rgba(var(--ruby-rgb), 0.3);
}
.hero-title-block .subtitle {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-top: 18px;
  font-weight: 300;
}
.hero-meta {
  text-align: right;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}
.hero-meta div { margin-bottom: 6px; }
.hero-meta .legendary { color: var(--ruby); font-weight: 600; }
.scroll-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-faint);
  z-index: 2;
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* === SECTIONS === */
.section {
  padding: 100px 60px;
  max-width: 1600px;
  margin: 0 auto;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}
.section-label .line {
  width: 40px;
  height: 1px;
  background: var(--ruby);
}
.section-label .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--ruby);
  text-transform: uppercase;
}

/* (Drop-cap gothique retiré — restait monospace JetBrains, plus dans la DA "bold modern shop") */

/* === OVERVIEW === */
.overview {
  text-align: center;
  padding: 80px 60px;
  border-top: 1px solid rgba(var(--ruby-rgb), 0.15);
  border-bottom: 1px solid rgba(var(--ruby-rgb), 0.15);
}
.overview .label {
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--ruby);
  margin-bottom: 24px;
  font-weight: 600;
}
.overview h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 36px;
  letter-spacing: 2px;
  margin-bottom: 24px;
  font-weight: 500;
}
.overview p {
  font-size: 16px;
  line-height: 1.9;
  color: #bbb;
  max-width: 680px;
  margin: 0 auto 50px;
  font-weight: 300;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  flex-wrap: wrap;
}
.stat {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
}
.stat .num {
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 600;
  color: var(--ruby);
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

/* === PROFILES === */
.profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-card {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid rgba(var(--ruby-rgb), 0.15);
  transition: transform 0.6s, border-color 0.6s;
  background: var(--bg-light);
}
.profile-card:hover {
  transform: scale(1.01);
  border-color: rgba(var(--ruby-rgb), 0.5);
}
.profile-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-card .label {
  position: absolute;
  bottom: 16px;
  left: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--ruby);
  background: rgba(10, 6, 8, 0.7);
  padding: 6px 12px;
  border-left: 2px solid var(--ruby);
}

/* === DETAIL GRID === */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.detail-block img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border: 1px solid rgba(var(--ruby-rgb), 0.15);
  margin-bottom: 20px;
  background: var(--bg-light);
}
.detail-block h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  margin-bottom: 12px;
  color: #fff;
}
.detail-block p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  font-weight: 300;
}

/* === POSTER SECTION === */
.poster-section {
  position: relative;
  padding: 120px 60px;
  background: var(--bg-light) center/cover;
  border-top: 1px solid rgba(var(--ruby-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--ruby-rgb), 0.2);
}
.poster-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 8, 0.7), rgba(10, 6, 8, 0.85));
}
.poster-section .inner {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.poster-section img {
  width: 100%;
  max-width: 480px;
  border: 1px solid rgba(var(--ruby-rgb), 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(var(--ruby-rgb), 0.15);
  margin: 0 auto;
}
.poster-kicker {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--ruby);
  margin-bottom: 24px;
  font-weight: 600;
}
.poster-caption {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-top: 24px;
  font-family: 'JetBrains Mono', monospace;
}

/* === SPECS === */
.specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(var(--ruby-rgb), 0.2);
  border: 1px solid rgba(var(--ruby-rgb), 0.2);
}
.spec {
  background: var(--bg);
  padding: 32px 28px;
}
.spec .key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-faint);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.spec .val {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
  font-weight: 500;
}
.spec .val.accent { color: var(--ruby); }

/* === EXTRA IMAGES (galerie pleine largeur) === */
.extra-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.extra-images figure {
  position: relative;
  margin: 0;
  border: 1px solid rgba(var(--ruby-rgb), 0.15);
  background: var(--bg-light);
}
.extra-images img {
  width: 100%;
  display: block;
}
.extra-images figcaption {
  padding: 12px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  border-top: 1px solid rgba(var(--ruby-rgb), 0.15);
}

/* === TOOLS USED (icons grid) === */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tool-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--bg-light);
  border: 1px solid rgba(var(--ruby-rgb), 0.2);
  transition: border-color 0.25s, transform 0.25s;
  text-decoration: none;
  color: var(--text);
}
.tool-badge:hover { border-color: var(--ruby); transform: translateY(-2px); }
.tool-badge__icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tool-badge__icon img { width: 100%; height: 100%; object-fit: contain; }
.tool-badge__txt {
  display: flex; flex-direction: column; gap: 2px;
}
.tool-badge__name {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: #fff;
}
.tool-badge__role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* === RENDER GROUPS (named sub-galleries — pipeline stages) === */
.render-group {
  margin-bottom: 56px;
}
.render-group:last-child { margin-bottom: 0; }
.render-group__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(var(--ruby-rgb), 0.15);
}
.render-group__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--ruby);
  text-transform: uppercase;
}
.render-group__title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: #fff;
  font-weight: 500;
  text-transform: uppercase;
}
.render-group__caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-left: auto;
  text-transform: uppercase;
}
.render-group__grid {
  display: grid;
  gap: 12px;
}
.render-group__grid.cols-1 { grid-template-columns: 1fr; }
.render-group__grid.cols-2 { grid-template-columns: 1fr 1fr; }
.render-group__grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.render-group__img {
  width: 100%;
  display: block;
  border: 1px solid rgba(var(--ruby-rgb), 0.15);
  background: var(--bg-light);
  transition: border-color 0.25s;
}
.render-group__img:hover { border-color: rgba(var(--ruby-rgb), 0.4); }
@media (max-width: 768px) {
  .render-group__grid.cols-2,
  .render-group__grid.cols-3 { grid-template-columns: 1fr; }
}

/* === COLOR PALETTE (swatches grid) === */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: rgba(var(--ruby-rgb), 0.15);
  border: 1px solid rgba(var(--ruby-rgb), 0.15);
}
.swatch {
  background: var(--bg);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.swatch__color {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #888;
  position: relative;
}
.swatch__color::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -20px 30px rgba(0,0,0,0.2);
}
.swatch__info {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.swatch__name {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: #fff;
}
.swatch__hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.swatch__role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 2px;
}

/* === CTA === */
.cta {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-light) 100%);
  padding: 80px 60px;
  border-top: 1px solid rgba(var(--ruby-rgb), 0.3);
}
.cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-price .label {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.cta-price .label::before { content: "▼ "; }
.cta-price .amount {
  font-family: 'Oswald', sans-serif;
  font-size: 56px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 3px;
  line-height: 1;
}
.cta-price .amount .currency {
  color: var(--ruby);
  margin-right: 8px;
}
.cta-price .amount .sub {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
  letter-spacing: 2px;
  margin-left: 12px;
  font-family: 'Inter', sans-serif;
}
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 18px 36px;
  font-size: 11px;
  letter-spacing: 4px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  display: inline-block;
}
.btn.outline {
  background: transparent;
  color: var(--ruby);
  border: 1px solid rgba(var(--ruby-rgb), 0.5);
}
.btn.outline:hover {
  background: rgba(var(--ruby-rgb), 0.1);
  border-color: var(--ruby);
}
.btn.primary {
  background: var(--ruby);
  color: var(--bg);
}
.btn.primary:hover {
  background: var(--ruby-light);
  box-shadow: 0 0 30px rgba(var(--ruby-rgb), 0.5);
}
.btn.primary::after { content: " →"; }

/* === FOOTER === */
.footer {
  background: #050304;
  border-top: 1px solid rgba(var(--ruby-rgb), 0.15);
  padding: 24px 60px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.footer .jp { color: var(--ruby); letter-spacing: 4px; }

/* === NOT FOUND === */
.notfound {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 2rem; text-align: center;
}
.notfound h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 3rem; color: var(--ruby);
  margin-bottom: 1rem;
}
.notfound a { color: var(--ruby); }

[hidden] { display: none !important; }

/* =========================================================
   ANIMATIONS — layout-level, applied to every Ruby project page.
   Driven by IntersectionObserver toggling .is-visible.
   ========================================================= */

/* Scroll-reveal base */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* Section-label line — animated draw-in */
.section-label .line {
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
[data-section-label].is-visible .section-label .line,
.section.is-visible .section-label .line {
  width: 40px;
}

/* Section-label number — slide-in from left */
.section-label .num {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.6s ease 0.45s, transform 0.6s ease 0.45s;
}
[data-section-label].is-visible .section-label .num,
.section.is-visible .section-label .num {
  opacity: 1;
  transform: translateX(0);
}

/* Hero title — letter-by-letter cinematic reveal on load */
.hero-title-block h1 .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(-30deg);
  transform-origin: bottom;
  animation: letterUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) calc(0.4s + var(--i, 0) * 0.045s) forwards;
}
.hero-title-block h1 .char--space { width: 0.25em; }
@keyframes letterUp {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* Hero title — once revealed, very subtle continuous shimmer on the scarlet word */
.hero-title-block h1 .char--accent {
  color: var(--ruby);
  text-shadow: 0 0 24px rgba(var(--ruby-rgb), 0.4);
}

/* Hero pretitle — animated arrow */
.hero-title-block .pretitle::before {
  display: inline-block;
  animation: arrowPulse 2s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(2px); opacity: 0.5; }
}

/* Hero image — subtle slow zoom */
.hero-img {
  animation: heroZoom 28s ease-in-out infinite alternate;
  transform-origin: center center;
}
@keyframes heroZoom {
  0%   { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Hero overlay — pulsing radial */
.hero-overlay::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(var(--ruby-rgb), 0.08) 0%, transparent 60%);
  animation: heroPulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* Stats numbers — count-up effect (numeric flicker on reveal) */
.stat .num {
  display: inline-block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease;
}
.overview.is-visible .stat .num {
  animation: numPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes numPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.1);   opacity: 1; }
  100% { transform: scale(1);     opacity: 1; }
}

/* Tool badges — hover lift + icon rotate */
.tool-badge {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s,
              box-shadow 0.4s;
}
.tool-badge:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(var(--ruby-rgb), 0.15);
}
.tool-badge:hover .tool-badge__icon {
  animation: iconWobble 0.5s ease;
}
@keyframes iconWobble {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-8deg); }
  75%      { transform: rotate(8deg); }
}

/* Profile cards — image zoom + label slide */
.profile-card img {
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.profile-card:hover img {
  transform: scale(1.05);
}
.profile-card .label {
  transition: transform 0.4s ease, padding 0.4s ease;
}
.profile-card:hover .label {
  transform: translateX(4px);
  padding-right: 18px;
}

/* Detail blocks — image hover zoom + text slide */
.detail-block img {
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s;
}
.detail-block:hover img {
  transform: scale(1.03);
  border-color: var(--ruby);
}
.detail-block h3 {
  transition: color 0.3s, transform 0.4s ease;
}
.detail-block:hover h3 {
  color: var(--ruby);
  transform: translateX(4px);
}

/* Render-group images — staggered hover */
.render-group__img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s;
}
.render-group__img:hover {
  transform: translateY(-4px);
  border-color: var(--ruby);
}

/* Specs — subtle row highlight on hover */
.spec {
  transition: background 0.3s ease;
  position: relative;
}
.spec::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--ruby);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.spec:hover { background: rgba(var(--ruby-rgb), 0.04); }
.spec:hover::before { transform: scaleY(1); }

/* Palette swatches — hover color preview */
.swatch {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.swatch:hover { transform: translateY(-3px); z-index: 2; }
.swatch__color {
  transition: filter 0.3s;
}
.swatch:hover .swatch__color {
  filter: saturate(1.15) brightness(1.05);
}

/* Extra images — fade-in on appear */
.extra-images figure {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.extra-images figure:hover {
  transform: scale(1.005);
}
.extra-images img {
  transition: filter 0.5s;
}
.extra-images figure:hover img {
  filter: brightness(1.08);
}

/* CTA buttons — enhanced press feel */
.btn.primary {
  position: relative;
  overflow: hidden;
}
.btn.primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn.primary:hover::before { transform: translateX(100%); }

/* Back link — slide arrow on hover */
.back-link {
  transition: padding-left 0.3s ease, border-color 0.2s, background 0.2s;
}
.back-link:hover {
  padding-left: 22px;
}

/* Poster — subtle floating animation */
.poster-section img {
  transition: transform 0.6s ease;
  animation: posterFloat 8s ease-in-out infinite;
}
@keyframes posterFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.poster-section img:hover {
  animation-play-state: paused;
  transform: scale(1.02);
}

/* Scroll-hint — fade-out as user scrolls */
.scroll-hint {
  transition: opacity 0.6s ease;
}

/* Decorative scan line over hero (subtle film grain feel) */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(255, 255, 255, 0.01) 3px,
    rgba(255, 255, 255, 0.01) 4px
  );
  pointer-events: none;
  z-index: 3;
}

/* =========================================================
   BRAND TEXTURES — inspired by the Gamma logo
   (faceted geometric shapes + burgundy depth)
   ========================================================= */

/* Faceted-glass pattern background — repeats as a subtle texture */
.brand-facet-bg {
  position: relative;
}
.brand-facet-bg::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><g fill='none' stroke='%23ffffff' stroke-width='0.6'><polygon points='90,10 130,40 130,90 90,120 50,90 50,40'/><polygon points='90,10 90,60 50,40'/><polygon points='90,10 90,60 130,40'/><polygon points='50,40 50,90 90,60'/><polygon points='130,40 130,90 90,60'/><polygon points='90,60 50,90 90,120'/><polygon points='90,60 130,90 90,120'/></g></svg>");
  background-size: 240px 240px;
  background-repeat: repeat;
  mix-blend-mode: screen;
  z-index: 1;
}

/* Apply faceted texture to hero + cta + poster sections */
.hero, .cta, .poster-section, .overview { position: relative; }
.hero::before { animation: heroPan 40s linear infinite; }
@keyframes heroPan {
  0%   { background-position: 0 0; }
  100% { background-position: 240px 240px; }
}

/* Burgundy radial bloom — anchored bottom-right of hero, matches logo background */
.hero {
  background-image:
    radial-gradient(ellipse at 85% 100%, rgba(var(--burgundy-rgb), 0.55) 0%, transparent 60%),
    radial-gradient(ellipse at 0% 0%,    rgba(var(--ruby-rgb), 0.12) 0%, transparent 50%);
  background-color: var(--bg);
  background-attachment: scroll;
}

/* Inject SVG faceted overlay into hero, cta, overview, poster */
.hero::before,
.cta::before,
.poster-section::before,
.overview::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><g fill='none' stroke='%23ffffff' stroke-width='0.5' stroke-opacity='0.8'><polygon points='90,5 135,32 135,90 90,118 45,90 45,32'/><polygon points='90,5 90,60 45,32'/><polygon points='90,5 90,60 135,32'/><polygon points='45,32 45,90 90,60'/><polygon points='135,32 135,90 90,60'/><polygon points='90,60 45,90 90,118'/><polygon points='90,60 135,90 90,118'/></g></svg>");
  background-size: 200px 200px;
  background-repeat: repeat;
  mix-blend-mode: screen;
}

/* Burgundy gradient accent on CTA (depth signature from the brand) */
.cta {
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(var(--burgundy-rgb), 0.4) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-light) 100%);
}

/* Poster section background — burgundy crystalline bloom */
.poster-section {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(var(--burgundy-rgb), 0.4) 0%, rgba(10, 6, 8, 0) 70%);
  background-color: var(--bg-light);
}

/* Hero pretitle — subtle scarlet glow (kept from previous iteration) */
.hero-title-block .pretitle {
  text-shadow: 0 0 12px rgba(var(--ruby-rgb), 0.5);
}

/* =========================================================
   BRAND STRIP — editorial layered typography (EXA-inspired,
   not copied). 3 layers : outlined ghost + solid + scarlet
   ghost, all stacked with offsets. Optional kanji/sub layer.
   ========================================================= */
.brand-strip {
  position: relative;
  padding: clamp(5rem, 10vw, 9rem) clamp(1rem, 3vw, 3rem);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(var(--burgundy-rgb), 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(var(--ruby-rgb), 0.08) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-light) 100%);
  border-top: 1px solid rgba(var(--ruby-rgb), 0.18);
  border-bottom: 1px solid rgba(var(--ruby-rgb), 0.18);
}

.brand-strip__stack {
  position: relative;
  display: inline-block;
  line-height: 0.78;
  /* Decorative — push outside container slightly for editorial overflow feel */
  margin: 0 auto;
}

.brand-strip__big {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(70px, 18vw, 280px);
  letter-spacing: -0.025em;
  line-height: 0.8;
  text-transform: uppercase;
  white-space: nowrap;
  display: block;
  position: relative;
  z-index: 2;
  color: #fff;
}

/* Ghost outline layer behind, offset top-left */
.brand-strip__big::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.25);
  transform: translate(-2.5%, -8%);
  z-index: -1;
}

/* Scarlet ghost layer, offset bottom-right */
.brand-strip__big::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--ruby);
  opacity: 0.45;
  transform: translate(2.5%, 8%);
  z-index: -2;
  mix-blend-mode: screen;
}

/* Sub text — kanji or secondary phrase, slightly smaller, overlapping bottom */
.brand-strip__sub {
  font-family: 'Oswald', 'Noto Serif JP', serif;
  font-weight: 400;
  font-size: clamp(20px, 3vw, 36px);
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: clamp(0.8rem, 2vw, 1.5rem);
  position: relative;
  z-index: 3;
}
.brand-strip__sub::before {
  content: '✦ ';
  color: var(--ruby);
  margin-right: 0.6em;
}
.brand-strip__sub::after {
  content: ' ✦';
  color: var(--ruby);
  margin-left: 0.6em;
}

/* Tagline tiny line under */
.brand-strip__tagline {
  margin-top: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* Pre-label above */
.brand-strip__label {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--ruby);
  text-transform: uppercase;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.brand-strip__label::before,
.brand-strip__label::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--ruby);
}

/* Hover: subtle separation of layers */
.brand-strip:hover .brand-strip__big::before { transform: translate(-3.5%, -10%); }
.brand-strip:hover .brand-strip__big::after  { transform: translate(3.5%, 10%); }
.brand-strip__big::before,
.brand-strip__big::after {
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* When section reveals via scroll, animate layer separation in */
.brand-strip.is-visible .brand-strip__big::before { animation: ghostSeparateUp   0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }
.brand-strip.is-visible .brand-strip__big::after  { animation: ghostSeparateDown 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both; }
@keyframes ghostSeparateUp {
  from { transform: translate(0, 0); opacity: 0; }
  to   { transform: translate(-2.5%, -8%); opacity: 1; }
}
@keyframes ghostSeparateDown {
  from { transform: translate(0, 0); opacity: 0; }
  to   { transform: translate(2.5%, 8%); opacity: 0.45; }
}

/* =========================================================
   PRIORITY ANIMATIONS — §4.3 of PROMPT_PROJECT_PAGE.md
   ========================================================= */

/* 1. Scroll progress bar (top of page, scroll-driven) */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ruby), var(--ruby-dark));
  transform-origin: 0 0;
  transform: scaleX(0);
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(var(--ruby-rgb), 0.6);
  will-change: transform;
}
/* Modern browsers — use scroll-driven animations (no JS needed) */
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: scrollGrow linear;
    animation-timeline: scroll(root);
  }
  @keyframes scrollGrow {
    to { transform: scaleX(1); }
  }
}

/* 3. 3D tilt — applied via inline transform from JS using --tx/--ty */
.tilt {
  transform-style: preserve-3d;
  transform: perspective(800px)
             rotateX(calc(var(--ty, 0) * -1deg))
             rotateY(calc(var(--tx, 0) * 1deg));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* 4. Magnetic buttons — translate via JS-set --mx/--my */
.btn.magnetic {
  transform: translate3d(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px), 0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* 5. Image fade-in (blur → sharp + opacity) on load */
img[loading="lazy"], .visual-img, .profile-card img, .detail-block img,
.extra-images img, .render-group__img, .poster-section img {
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.7s ease, filter 0.7s ease;
}
img.is-loaded {
  opacity: 1;
  filter: blur(0);
}

/* 6. Hero cursor parallax — applied via --px/--py from JS */
.hero-img {
  transform: scale(1.08) translate3d(calc(var(--px, 0) * 12px), calc(var(--py, 0) * 12px), 0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Override the continuous heroZoom to keep parallax working */
@keyframes heroZoom {
  0%   { transform: scale(1.04) translate3d(calc(var(--px, 0) * 12px), calc(var(--py, 0) * 12px), 0); }
  100% { transform: scale(1.10) translate3d(calc(var(--px, 0) * 12px), calc(var(--py, 0) * 12px), 0); }
}

/* =========================================================
   JUXTAPOSE SLIDER — before/after drag comparison.
   Driven by item.juxtapose{Before,After,…} fields. Section
   auto-hides if data is empty. Uses only existing CSS tokens
   (no hex hardcoded — derived alpha via color-mix).
   ========================================================= */
.jx-wrapper {
  /* Local tunables — kept in this block, no leak to :root */
  --jx-border-alpha:    0.3;
  --jx-handle-size:     56px;
  --jx-handle-size-sm:  64px;
  --jx-label-inset:     18px;
  --jx-label-inset-sm:  10px;
  --jx-label-padding:   10px 14px;
  --jx-label-padding-sm: 7px 10px;
  --jx-handle-line:     2px;
  --jx-pos:             50%;
  --jx-transition:      0.18s ease;
  --jx-label-bg:        color-mix(in srgb, var(--bg) 82%, transparent);

  position: relative;
  width: 100%;
  /* Fallback only — overridden by JS once images load (data-driven from their natural dimensions) */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(var(--ruby-rgb), var(--jx-border-alpha));
  background: var(--bg);
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.jx-wrapper.is-dragging { cursor: ew-resize; }

.jx-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.jx-img--after {
  clip-path: inset(0 0 0 var(--jx-pos));
  -webkit-clip-path: inset(0 0 0 var(--jx-pos));
}

.jx-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--jx-pos);
  width: var(--jx-handle-line);
  transform: translateX(-50%);
  background: var(--ruby);
  box-shadow: 0 0 12px rgba(var(--ruby-rgb), 0.6);
  z-index: 4;
  pointer-events: none;
}
.jx-handle__btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--jx-handle-size);
  height: var(--jx-handle-size);
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--ruby);
  color: var(--ruby);
  display: grid;
  place-items: center;
  padding: 30%;
  box-shadow: 0 0 24px rgba(var(--ruby-rgb), 0.45),
              inset 0 0 12px rgba(var(--ruby-rgb), 0.15);
  transition: transform var(--jx-transition), box-shadow var(--jx-transition);
}
.jx-wrapper:hover .jx-handle__btn,
.jx-wrapper.is-dragging .jx-handle__btn {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 32px rgba(var(--ruby-rgb), 0.6),
              inset 0 0 14px rgba(var(--ruby-rgb), 0.2);
}

.jx-label {
  position: absolute;
  top: var(--jx-label-inset);
  padding: var(--jx-label-padding);
  background: var(--jx-label-bg);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  z-index: 3;
  pointer-events: none;
}
.jx-label--before {
  left: var(--jx-label-inset);
  border-left: 2px solid var(--ruby);
}
.jx-label--after {
  right: var(--jx-label-inset);
  border-right: 2px solid var(--ruby);
}

.jx-percent {
  position: absolute;
  right: var(--jx-label-inset);
  bottom: var(--jx-label-inset);
  padding: 4px 10px;
  background: var(--jx-label-bg);
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  z-index: 3;
  pointer-events: none;
}

/* Mobile — bigger handle for touch, tighter labels.
   Reuses the breakpoint already defined further down for .topbar / .hero-content. */
@media (max-width: 900px) {
  .jx-wrapper {
    --jx-handle-size: var(--jx-handle-size-sm);
    --jx-label-inset: var(--jx-label-inset-sm);
    --jx-label-padding: var(--jx-label-padding-sm);
  }
  .jx-label, .jx-percent { font-size: 9px; letter-spacing: 2px; }
}
/* === END JUXTAPOSE === */

/* =========================================================
   AMBIENT PAGE TEXTURE — fixed backdrop overlay driven by
   per-project `backgroundTexture` field. Applied as a low-
   opacity screen-blended ::before so it adds depth without
   competing with content. No-op when --page-texture unset.
   ========================================================= */
body.has-bg-texture::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--page-texture);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: 0.18;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}

/* Reduced motion — kill heavy animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-img, .poster-section img { animation: none; }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .back-link { top: 8px; left: 8px; padding: 6px 10px; font-size: 9px; }
  .topbar { padding: 12px 20px 12px 100px; flex-wrap: wrap; gap: 10px; }
  .topbar .left, .topbar .right { gap: 14px; font-size: 9px; }
  .hero-content { left: 24px; right: 24px; bottom: 40px; flex-direction: column; gap: 30px; align-items: flex-start; }
  .hero-meta { text-align: left; }
  .section, .overview, .poster-section, .cta, .footer { padding-left: 24px; padding-right: 24px; }
  .section { padding-top: 60px; padding-bottom: 60px; }
  .profiles, .detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .specs { grid-template-columns: 1fr 1fr; }
  .stats { gap: 40px; }
  .stat .num { font-size: 36px; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-price .amount { font-size: 40px; }
  .footer { font-size: 9px; }
}
