/* ============================================================
   Primeautoparts — shared "wow" polish for the multi-page site.
   Reused across all 6 pages. Depends on tokens.css variables:
   --color-black, --color-white, --color-bg-light, --color-gray,
   --color-gray-light, --color-text, --color-text-muted,
   --color-accent, --color-accent-hover, --font-heading,
   --weight-heading, --tracking-heading, --fs-small, --radius-sm, --radius-md
   ============================================================ */

html { scroll-behavior: smooth; }

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--color-accent);
  z-index: 500;
  transition: width 0.05s linear;
}

/* ---------- FILM GRAIN OVERLAY ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  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");
}

/* ---------- CUSTOM CURSOR (desktop only) ---------- */
@media (pointer: fine) {
  .cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 600;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  .cursor-dot { width: 4px; height: 4px; background: var(--color-accent); opacity: .7; }
  .cursor-ring {
    width: 26px; height: 26px;
    border: 1px solid var(--color-accent);
    opacity: .45;
    transition: width 0.15s ease, height 0.15s ease, opacity 0.15s ease, border-color .15s ease;
  }
  .cursor-ring.on-dark { border-color: var(--color-white); }
  .cursor-ring.hover { width: 40px; height: 40px; opacity: .7; }
}

/* ---------- SCROLL REVEAL: sections fade + slide up into view ---------- */
section.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.16,.9,.28,1);
}
section.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- HOVER: generic photo containers colorize on hover ---------- */
.media-cell, .photo-card {
  filter: grayscale(100%);
  transition: filter .4s ease;
  overflow: hidden;
}
.media-cell:hover, .photo-card:hover { filter: grayscale(0%); }
.media-cell img, .photo-card img { transition: transform .5s ease; display: block; width: 100%; height: 100%; object-fit: cover; }
.media-cell:hover img, .photo-card:hover img { transform: scale(1.06); }

/* ---------- HOVER: cards lift ---------- */
.card, .value-card {
  transition: transform .3s ease, box-shadow .3s ease;
  min-width: 0; /* grid tracks default to minmax(auto,1fr); this stops a long uppercase heading from forcing the column wider than its track and causing horizontal overflow on mobile */
}
.card:hover, .value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(10,10,10,.1);
}

/* ---------- MAGNETIC BUTTONS ---------- */
.magnetic { transition: transform .15s ease; }

/* ---------- MULTI-PAGE NAV ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-gray-light);
  position: sticky;
  top: 0;
  background: var(--color-white);
  z-index: 300;
  row-gap: var(--space-2);
}
.site-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-heading);
  font-size: var(--fs-small);
  text-decoration: none;
  color: var(--color-text);
}
.logo-mark { height: 28px; width: auto; object-fit: contain; flex-shrink: 0; background: #000; padding: 6px 10px; border-radius: var(--radius-sm); }
.main-nav { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.main-nav a {
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: var(--tracking-heading);
  text-decoration: none;
  color: var(--color-text);
  padding: 13px 4px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: inline-block;
}
.main-nav a:hover, .main-nav a.active { border-bottom-color: var(--color-accent); }
@media (max-width: 640px) {
  .site-header { justify-content: center; text-align: center; }
  .main-nav { gap: var(--space-2) var(--space-3); justify-content: center; width: 100%; }
  .main-nav a { font-size: 0.7rem; }
}

/* ---------- PAGE HERO (simple, non-cinema, used on inner pages) ---------- */
.page-hero {
  text-align: center;
  padding: var(--space-7) var(--space-4) var(--space-5);
  background: var(--color-bg-light);
}
.page-hero .kicker {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-heading);
  font-size: var(--fs-small);
  color: var(--color-gray);
  margin: 0 0 var(--space-2);
}
.page-hero h1 {
  font-size: var(--fs-h1);
  max-width: 780px;
  margin: 0 auto;
}
.page-hero p.lede {
  font-size: var(--fs-body);
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  max-width: 560px;
  margin: var(--space-2) auto 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  section.reveal { transition: none; opacity: 1; transform: none; }
}
