/* ============================================================
   premium.css — v3 interaction layer
   Magnetic cursor, page transitions, horizontal carousel,
   magnetic buttons, animated nav links, display typography.
   Uses CCC's own palette + content, no third-party assets.
   ============================================================ */

/* ---------- CUSTOM MAGNETIC CURSOR (desktop only) ---------- */
@media (hover: hover) and (min-width: 900px) {
  body.v3-cursor { cursor: none; }
  body.v3-cursor a, body.v3-cursor button, body.v3-cursor [data-cursor] { cursor: none; }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    mix-blend-mode: difference;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--text-highlight);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 200ms, background 200ms;
  }
  .cursor-ring {
    width: 36px; height: 36px;
    border: 1.5px solid var(--accent-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 260ms var(--ease-out),
                height 260ms var(--ease-out),
                border-color 220ms,
                opacity 200ms,
                background 220ms;
    mix-blend-mode: normal;
  }
  .cursor-ring.is-hovering {
    width: 68px; height: 68px;
    border-color: var(--accent-primary);
    background: rgba(212, 169, 74, 0.12);
  }
  .cursor-ring.is-pressing {
    width: 22px; height: 22px;
    background: var(--accent-primary);
  }
  .cursor-ring.is-text {
    width: 2px; height: 24px;
    border-radius: 1px;
    background: var(--text-highlight);
    border-color: transparent;
  }
}
@media (hover: none), (max-width: 899px) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ---------- PAGE TRANSITION OVERLAY ---------- */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  opacity: 0;
  background: var(--bg-base);
  transform: translateY(100%);
}
.page-transition.is-covering {
  pointer-events: auto;
  animation: pt-cover 520ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
.page-transition.is-revealing {
  animation: pt-reveal 520ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes pt-cover {
  0%   { transform: translateY(100%); opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}
@keyframes pt-reveal {
  0%   { transform: translateY(0);     opacity: 1; }
  100% { transform: translateY(-100%); opacity: 1; }
}
.page-transition__label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--accent-primary);
  text-transform: uppercase;
  opacity: 0;
}
.page-transition.is-covering .page-transition__label {
  animation: pt-label 520ms ease-out 120ms forwards;
}
@keyframes pt-label {
  0%   { opacity: 0; transform: translate(-50%, -40%); }
  60%  { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -60%); }
}

/* ---------- HERO v3 — display type ---------- */
.hero__title--v3 {
  font-size: var(--fs-display);
  line-height: 0.92;
  letter-spacing: -0.025em;
  max-width: 14ch;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
}
.hero__title--v3 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}
.hero__title--v3 .line > span {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}
.hero__title--v3.is-revealed .line > span {
  animation: line-lift 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero__title--v3.is-revealed .line:nth-child(2) > span { animation-delay: 120ms; }
.hero__title--v3.is-revealed .line:nth-child(3) > span { animation-delay: 240ms; }
@keyframes line-lift {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

/* ---------- MAGNETIC BUTTONS ---------- */
[data-magnetic] {
  position: relative;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
[data-magnetic] > * {
  display: inline-block;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  pointer-events: none;
}

/* ---------- ANIMATED NAV / LINK UNDERLINE ---------- */
.v3-link {
  position: relative;
  display: inline-block;
  color: var(--text-highlight);
  text-decoration: none;
  padding-bottom: 2px;
  overflow: hidden;
}
.v3-link::before,
.v3-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 420ms cubic-bezier(0.76, 0, 0.24, 1);
}
.v3-link::after {
  transform-origin: left center;
  background: var(--accent-primary);
}
.v3-link:hover::before { transform: scaleX(1); }
.v3-link:hover::after  { transform: scaleX(0); transition-delay: 0ms; }

/* ---------- HORIZONTAL CAROUSEL — "PACKET GALLERY" ---------- */
.gallery-scroll {
  position: relative;
  padding: var(--space-6) 0;
  background: var(--bg-base);
  overflow: hidden;
}
.gallery-scroll__header {
  max-width: var(--container);
  margin: 0 auto var(--space-4);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.gallery-scroll__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  max-width: 16ch;
}
.gallery-scroll__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.gallery-scroll__track {
  display: flex;
  gap: 24px;
  padding: 0 24px 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gallery-scroll__track::-webkit-scrollbar { display: none; }
.gallery-card {
  flex: 0 0 min(460px, 82vw);
  aspect-ratio: 4/5;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-dim);
  box-shadow: var(--shadow-md);
  transition: transform 620ms var(--ease-out), border-color 420ms;
  will-change: transform;
}
.gallery-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
}
.gallery-card__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-out), filter 600ms;
  filter: saturate(0.92) contrast(1.06);
}
.gallery-card:hover .gallery-card__img {
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.1);
}
.gallery-card__label {
  position: absolute;
  left: 20px; bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-highlight);
  text-transform: uppercase;
  padding: 8px 12px;
  background: rgba(15, 12, 9, 0.6);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 169, 74, 0.3);
}
.gallery-scroll__scrollhint {
  margin-top: 12px;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: right;
  max-width: var(--container);
  margin-inline: auto;
}

/* ---------- IMAGE LINE-MASK REVEAL (scroll-in) ---------- */
.v3-reveal-img {
  position: relative;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1100ms cubic-bezier(0.76, 0, 0.24, 1);
}
.v3-reveal-img.is-revealed {
  clip-path: inset(0 0 0 0);
}
.v3-reveal-img img { width: 100%; height: auto; display: block; }

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none !important; }
  .page-transition { display: none !important; }
  .hero__title--v3 .line > span { transform: none; }
  .v3-reveal-img { clip-path: inset(0 0 0 0); }
  .gallery-scroll__track { scroll-snap-type: none; }
}
