/* ==========================================================================
   MY WORKS // PACÔME PERTANT INSPIRED SHOWCASE
   Dual-Mode: WebGL 3D Curved Spiral & Typographic List View
   ========================================================================== */

:root {
  --works-bg: #070707;
  --works-text: #fafafa;
  --works-text-dim: rgba(250, 250, 250, 0.45);
  --works-border: rgba(255, 255, 255, 0.12);
  --works-accent: #ffffff;
}

body.works-page {
  background-color: var(--works-bg);
  color: var(--works-text);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  position: fixed;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   Custom Cursor Visibility Fix
   ========================================================================== */
body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor canvas,
body.has-custom-cursor [role="button"],
body.has-custom-cursor .pacome-list-item,
body.has-custom-cursor .switch-item {
  cursor: none !important;
}

body.has-custom-cursor .custom-cursor {
  display: block !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 100000;
}

body.has-custom-cursor .cursor-dot {
  opacity: 1 !important;
  display: block !important;
}

/* ==========================================================================
   Header Bar (Minimalist Layout matching pacomepertant.com)
   ========================================================================== */
.pacome-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  z-index: 100;
  pointer-events: none;
}

.pacome-header > * {
  pointer-events: auto;
}

/* Back Link & Brand */
.pacome-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--works-text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid var(--works-border);
  background: rgba(14, 14, 14, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 9999px;
  transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pacome-logo-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.pacome-back-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.pacome-back-btn:hover .pacome-logo-icon {
  filter: invert(1);
}

/* Minimalist Center Switcher: spiral • list */
.pacome-switch-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.pacome-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 4px 8px;
}

.switch-item {
  background: none;
  border: none;
  color: rgba(250, 250, 250, 0.45);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.switch-item:hover {
  color: #ffffff;
}

.switch-item.active {
  color: #ffffff;
  font-weight: 600;
}

.switch-dot {
  font-size: 10px;
  color: rgba(250, 250, 250, 0.45);
  user-select: none;
}

/* Right Meta & Controls */
.pacome-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pacome-sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 14, 14, 0.7);
  border: 1px solid var(--works-border);
  backdrop-filter: blur(12px);
  border-radius: 9999px;
  color: var(--works-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, transform 0.15s ease;
}

.pacome-sound-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.pacome-sound-btn:active {
  transform: scale(0.96);
}

.pacome-sound-btn .sound-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pacomeSoundDotPulse 2s infinite ease-in-out;
}

@keyframes pacomeSoundDotPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.95);
  }
}

.pacome-sound-btn.is-muted .sound-indicator {
  background: #ff3366;
  box-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
  animation: none;
}

.pacome-sound-btn.is-muted {
  color: var(--works-text-dim);
}

#works-sound-label {
  display: inline-block;
  min-width: 86px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pacome-counter-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--works-text-dim);
  text-transform: uppercase;
  padding: 8px 14px;
  background: rgba(14, 14, 14, 0.7);
  border: 1px solid var(--works-border);
  backdrop-filter: blur(12px);
  border-radius: 9999px;
}

/* ==========================================================================
   Main Viewport
   ========================================================================== */
.pacome-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.view-panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   1. SPIRAL 3D WEBGL VIEW (Locked Center Stage with Continuous Orbit)
   ========================================================================== */
.spiral-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.spiral-stage:active {
  cursor: grabbing;
}

.spiral-stage canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.spiral-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(250, 250, 250, 0.35);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spiral-hint::before,
.spiral-hint::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   2. LIST VIEW (Pacôme Pertant Monumental Typographic Showcase)
   ========================================================================== */
.list-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 120px 24px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  scroll-behavior: auto !important;
}

/* Lenis Smooth Scroll Engine (List View) */
.list-stage.lenis.lenis-smooth,
.list-stage.lenis-smooth {
  scroll-behavior: auto !important;
}

.list-stage.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.list-stage {
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-track: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@supports not (scrollbar-color: auto) {
  .list-stage {
    scrollbar-width: auto;
  }
  .list-stage::-webkit-scrollbar {
    width: 4px;
  }
  .list-stage::-webkit-scrollbar-track {
    background: transparent;
  }
  .list-stage::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
  }
}

.pacome-list-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.pacome-list-item {
  width: 100%;
  padding: 24px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  text-decoration: none;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  transition: opacity 0.35s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  .pacome-list-container:has(.pacome-list-item:hover) .pacome-list-item:not(:hover) {
    opacity: 0.25;
  }
}

.pacome-list-item:hover {
  transform: translateX(14px);
}

.item-left {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.item-index {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--works-text-dim);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}

.pacome-list-item:hover .item-index {
  color: #ffffff;
}

.item-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  color: #ffffff;
}

.item-right {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: right;
}

.item-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--works-text-dim);
  transition: color 0.25s ease;
}

.pacome-list-item:hover .item-tag {
  color: #ffffff;
}

.item-arrow {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--works-text-dim);
  transition: transform 0.25s ease, color 0.25s ease;
}

.pacome-list-item:hover .item-arrow {
  color: #ffffff;
  transform: translateX(6px);
}

/* ==========================================================================
   3D Spiral Tactical Hover Detail Badge (Cyberpunk Glass / Monospace Layout)
   ========================================================================== */
.spiral-hover-pill {
  position: fixed;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.96);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(8, 8, 12, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #ffffff;
  padding: 8px 18px 8px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.92), 0 0 1px 1px rgba(255, 255, 255, 0.12), 0 0 20px rgba(255, 255, 255, 0.05);
  pointer-events: none;
  z-index: 85;
  opacity: 0;
  visibility: hidden;
}

.spiral-hover-pill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.15), transparent);
}

/* Entering / Active State - Smooth Glide In from Below (Slowed Down) */
.spiral-hover-pill.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1), transform 0.40s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Exiting State - Floats Smoothly Upward As It Fades Out (Slowed Down) */
.spiral-hover-pill.is-exiting {
  opacity: 0;
  visibility: visible;
  transform: translateX(-50%) translateY(-18px) scale(0.96);
  transition: opacity 0.34s cubic-bezier(0.16, 1, 0.3, 1), transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-pill-media {
  position: relative;
  width: 58px;
  height: 34px;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #000000;
  flex-shrink: 0;
}

.hover-pill-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hover-pill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.hover-pill-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hover-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

.hover-pill-tag {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hover-pill-title {
  font-family: var(--font-display, 'Space Mono', sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.15;
}

.hover-pill-sub {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}

.modal-image-display {
  width: 100%;
  height: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: #050507;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

/* ==========================================================================
   Cursor Image Follower (Smooth Main Page Dual-Layer Crossfade Portal)
   ========================================================================== */
.cursor-image-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 180px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  will-change: transform, opacity;
  background-color: #0c0c0e;
  transition: opacity 0.25s ease;
}

.cursor-image-follower.is-active {
  opacity: 1;
}

.cursor-image-follower .hover-preview-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.cursor-image-follower .hover-preview-layer.is-active {
  opacity: 1;
  transform: scale(1);
}

.cursor-follower-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ffffff;
  text-transform: uppercase;
  z-index: 2;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .pacome-header {
    padding: 0 16px;
    height: 68px;
  }

  .pacome-meta {
    display: none;
  }

  .cursor-image-follower {
    display: none;
  }

  .pacome-list-item {
    padding: 18px 0;
  }

  .item-title {
    font-size: clamp(24px, 7vw, 36px);
  }

  .item-left {
    gap: 12px;
  }

  .item-tag {
    font-size: 9px;
  }
}

/* ==========================================================================
   Tactical Page Transition Curtain (Smooth Navigation Between Main & Works)
   ========================================================================== */
.page-transition-curtain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000000;
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.36s;
}

.page-transition-curtain.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.transition-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: rgba(12, 12, 16, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.page-transition-curtain.is-active .transition-indicator {
  transform: translateY(0);
  opacity: 1;
}

.transition-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  animation: radarPulse 1.2s infinite ease-in-out;
}

.transition-text {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
}
