/* ==========================================================================
   HYPERCAR FLAGSHIP · Unified Motion & Tactile Interaction Layer (shared/v1)
   60fps GPU-only (transform, opacity, clip-path) · Zero transform conflicts
   with [data-parallax] or .reveal-curtain · Dual-polarity aware
   ========================================================================== */

:root {
  --hc-accent: #C8A55B;
  --hc-accent-rgb: 200, 165, 91;
  --hc-scroll: 0;
  --hc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hc-ease-sharp: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 1. Top 2px Brand Scroll Progress Hairline ---------- */
.hc-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 75;
  pointer-events: none;
  background: transparent;
}

.hc-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--hc-accent);
  box-shadow: 0 0 8px rgba(var(--hc-accent-rgb), 0.55);
  transform-origin: left center;
  transform: scaleX(var(--hc-scroll, 0));
  will-change: transform;
}

/* ---------- 2. Hero Subtle Choreographed Settle (Never hides h1) ---------- */
@keyframes hcHeroSettle {
  0% {
    opacity: 0.08;
    transform: translate3d(0, 10px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hc-hero-item {
  animation: hcHeroSettle 0.55s var(--hc-ease) both;
  animation-delay: var(--hc-delay, 0ms);
}

/* Gentle continuous ambient zoom on static non-parallax hero photos */
@keyframes hcHeroDrift {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.045) translate3d(0, -1.2%, 0);
  }
}

.hc-hero-drift {
  animation: hcHeroDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

/* ---------- 3. Section Heading Brand Hairline (Zero height impact) ---------- */
.hc-heading-reveal {
  position: relative;
}

.hc-heading-reveal::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 32px;
  height: 1px;
  background: var(--hc-accent);
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  transition: transform 0.72s var(--hc-ease), opacity 0.5s ease;
  pointer-events: none;
}

.hc-heading-reveal.hc-heading-center::after {
  left: 50%;
  transform-origin: center center;
  transform: translateX(-50%) scaleX(0);
}

.hc-heading-reveal.is-hc-in::after {
  transform: scaleX(1);
  opacity: 0.9;
}

.hc-heading-reveal.hc-heading-center.is-hc-in::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- 4. Rhythmic Grid Stagger ---------- */
.hc-stagger-item {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.62s var(--hc-ease) var(--hc-delay, 0ms),
    transform 0.68s var(--hc-ease) var(--hc-delay, 0ms),
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.hc-stagger-item.is-hc-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ---------- 5. Editorial Media Aperture Reveal + Lens Hover + Inspect Crosshair ---------- */
.hc-media-frame {
  position: relative;
  overflow: hidden;
}

.hc-media-frame > img {
  transition:
    clip-path 0.85s var(--hc-ease),
    transform 0.85s var(--hc-ease),
    opacity 0.7s ease;
}

.hc-media-frame.hc-aperture:not(.is-hc-in) > img {
  clip-path: inset(0 0 6% 0);
  transform: scale(1.045);
}

.hc-media-frame.hc-aperture.is-hc-in > img {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .hc-media-frame.is-hc-in:hover > img {
    transform: scale(1.03);
  }
}

.hc-inspect-target {
  cursor: zoom-in;
}

.hc-inspect-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(8, 9, 12, 0.56);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s var(--hc-ease), border-color 0.25s ease;
  pointer-events: none;
  z-index: 4;
}

.hc-inspect-target:hover .hc-inspect-badge,
.hc-inspect-target:focus-visible .hc-inspect-badge {
  opacity: 0.88;
  transform: scale(1);
  border-color: var(--hc-accent);
}

/* ---------- 6. Fine-Pointer Specular Surface Sheen ---------- */
.hc-sheen {
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .hc-sheen::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
      240px circle at var(--hc-mx, 50%) var(--hc-my, 50%),
      rgba(var(--hc-accent-rgb), 0.09),
      transparent 70%
    );
    z-index: 1;
  }

  .hc-sheen:hover::before {
    opacity: 1;
  }
}

/* ---------- 7. Stage & Spec Tab Swap Micro-Fade ---------- */
@keyframes hcSwapIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hc-swap-in {
  animation: hcSwapIn 0.28s var(--hc-ease) both;
}

/* ---------- 8. Desktop Architectural Chapter Rail HUD ---------- */
.hc-rail {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}

@media (min-width: 1240px) {
  .hc-rail {
    display: flex;
  }
}

.hc-rail__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.25s ease;
}

.hc-rail__label {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 2px;
  background: rgba(8, 10, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  opacity: 0;
  transform: translate3d(6px, 0, 0);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s var(--hc-ease), border-color 0.22s ease;
}

.hc-rail__tick {
  display: block;
  width: 10px;
  height: 1px;
  background: rgba(255, 255, 255, 0.34);
  transition: width 0.28s var(--hc-ease), height 0.2s ease, background-color 0.25s ease;
}

.hc-rail__item:hover .hc-rail__label,
.hc-rail__item:focus-visible .hc-rail__label {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.hc-rail__item:hover .hc-rail__tick,
.hc-rail__item:focus-visible .hc-rail__tick {
  width: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.hc-rail__item.is-active .hc-rail__tick {
  width: 22px;
  height: 2px;
  background: var(--hc-accent);
  box-shadow: 0 0 8px rgba(var(--hc-accent-rgb), 0.45);
}

.hc-rail__item.is-active .hc-rail__label {
  border-color: rgba(var(--hc-accent-rgb), 0.55);
}

/* Light-section polarity adaptation */
.hc-rail.hc-rail--light .hc-rail__tick {
  background: rgba(12, 14, 18, 0.34);
}

.hc-rail.hc-rail--light .hc-rail__item:hover .hc-rail__tick,
.hc-rail.hc-rail--light .hc-rail__item:focus-visible .hc-rail__tick {
  background: rgba(12, 14, 18, 0.88);
}

.hc-rail.hc-rail--light .hc-rail__item.is-active .hc-rail__tick {
  background: var(--hc-accent);
}

.hc-rail.hc-rail--light .hc-rail__label {
  background: rgba(255, 255, 255, 0.94);
  color: #0B0D11;
  border-color: rgba(12, 14, 18, 0.16);
}

/* ---------- 9. Minimal Architectural Back-to-Top Trigger ---------- */
.hc-top-btn {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 54;
  width: 38px;
  height: 38px;
  border-radius: 2px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.3s ease, transform 0.3s var(--hc-ease), border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.hc-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.hc-top-btn:hover {
  border-color: var(--hc-accent);
}

.hc-top-btn.hc-top-btn--light {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(12, 14, 18, 0.18);
  color: #0B0D11;
}

.hc-top-btn__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hc-top-btn__arc {
  fill: none;
  stroke: var(--hc-accent);
  stroke-width: 1.5;
  stroke-dasharray: 144;
  stroke-dashoffset: calc(144 * (1 - var(--hc-scroll, 0)));
}

@media (max-width: 600px) {
  .hc-top-btn {
    right: 14px;
    bottom: 16px;
    width: 34px;
    height: 34px;
  }
}

/* ---------- 10. Enhanced Cinema Lightbox Controls + 2x Zoom/Pan ---------- */
.lightbox:not([hidden]),
.lightbox.is-open {
  z-index: 420;
}

.lightbox img,
.hc-lightbox img {
  transition: transform 0.32s var(--hc-ease);
  transform-origin: center center;
}

.lightbox img.is-zoomable,
.hc-lightbox img.is-zoomable {
  cursor: zoom-in;
}

.lightbox img.is-zoomed,
.hc-lightbox img.is-zoomed {
  cursor: zoom-out;
  transform: scale(2) translate3d(var(--hc-pan-x, 0px), var(--hc-pan-y, 0px), 0);
}

.hc-lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 430;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 9, 12, 0.68);
  color: #FFFFFF;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--hc-ease);
}

.hc-lb-nav:hover {
  border-color: var(--hc-accent);
  background: rgba(var(--hc-accent-rgb), 0.16);
}

.hc-lb-nav--prev {
  left: clamp(12px, 2.5vw, 36px);
}

.hc-lb-nav--next {
  right: clamp(12px, 2.5vw, 36px);
}

.hc-lb-toolbar {
  position: fixed;
  top: 22px;
  left: clamp(16px, 4vw, 48px);
  z-index: 430;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hc-lb-count {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 9, 12, 0.6);
  border-radius: 2px;
}

.hc-lb-zoom {
  height: 30px;
  padding: 0 11px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(8, 9, 12, 0.68);
  color: #FFFFFF;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hc-lb-zoom:hover,
.hc-lb-zoom.is-active {
  border-color: var(--hc-accent);
  background: rgba(var(--hc-accent-rgb), 0.2);
}

/* Fallback architectural lightbox for sites without native #lightbox (e.g. valkyrie) */
.hc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 420;
  background: rgba(6, 8, 11, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.hc-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hc-lightbox__close {
  position: fixed;
  top: 22px;
  right: clamp(16px, 4vw, 48px);
  z-index: 430;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FFFFFF;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(8, 9, 12, 0.68);
  border-radius: 2px;
  cursor: pointer;
}

.hc-lightbox__close:hover {
  border-color: var(--hc-accent);
}

.hc-lightbox__img {
  max-width: min(1240px, 90vw);
  max-height: 76vh;
  object-fit: contain;
  background: #08090B;
}

.hc-lightbox__cap {
  margin-top: 16px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  max-width: 68ch;
}

@media (max-width: 640px) {
  .hc-lb-nav {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* ---------- 11. Spec Ledger Row Click-to-Copy & Micro-Toast ---------- */
.hc-spec-copy {
  cursor: pointer;
  transition: background-color 0.22s ease, border-color 0.22s ease;
}

.hc-spec-copy:hover {
  background-color: rgba(var(--hc-accent-rgb), 0.06);
}

.hc-spec-copy.is-copied {
  background-color: rgba(var(--hc-accent-rgb), 0.13);
}

.hc-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate3d(-50%, 14px, 0);
  z-index: 450;
  padding: 9px 16px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 2px solid var(--hc-accent);
  background: rgba(8, 10, 14, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s var(--hc-ease);
  max-width: min(88vw, 480px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-toast.is-open {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

/* ---------- 12. Reduced Motion Honor ---------- */
@media (prefers-reduced-motion: reduce) {
  .hc-hero-item,
  .hc-hero-drift,
  .hc-swap-in {
    animation: none !important;
  }

  .hc-stagger-item,
  .hc-heading-reveal::after,
  .hc-media-frame > img {
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
    transition: none !important;
  }

  .hc-progress__bar {
    transition: none !important;
  }
}
