/*
 * Ozark ultra-fidelity layer.
 *
 * This is intentionally a finish pass, not another layout system. It upgrades
 * type rasterization, high-DPI edges, material depth, and the existing reveal
 * choreography without adding live blur, pointer tracking, or idle loops.
 */

:root {
  --oz-fidelity-ease: cubic-bezier(.16, 1, .3, 1);
  --oz-fidelity-line: 1px;
  --oz-fidelity-depth: rgba(8, 124, 167, .1);
  --oz-performance-medium: 420ms;
  --oz-performance-ease: var(--oz-fidelity-ease);
  --oz-core-ease: var(--oz-fidelity-ease);
  --oz-core-material:
    linear-gradient(145deg, rgba(255, 255, 255, .965), rgba(243, 251, 254, .79));
  --oz-core-material-strong:
    linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(244, 252, 255, .91));
  --oz-core-shadow:
    0 1px 2px rgba(10, 27, 34, .035),
    0 16px 40px rgba(8, 124, 167, .085);
  --oz-core-shadow-high:
    0 2px 5px rgba(10, 27, 34, .045),
    0 24px 62px rgba(8, 124, 167, .13);
}

html {
  text-rendering: optimizeLegibility;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-synthesis: none;
}

body :where(h1, h2, h3, .pc-name, .hero-title, .acc-title) {
  text-wrap: balance;
}

body :where(.hero-sub, .pc-desc, .section-lead, .guide-hero p, .content-page p) {
  text-wrap: pretty;
}

/* Keep approved source artwork smooth at every device-pixel ratio. */
body :where(
  .pc-media,
  .hero-media,
  .home-bundle-media,
  .gpc-showcase-stage,
  .product-details-art,
  .oz-explorer-product-media
) img {
  image-rendering: auto;
  backface-visibility: hidden;
}

/* Product color remains the source of every reflected edge and depth cue. */
body.home-shine :is(.gp-basketball, .home-products .pc.nba),
body.product-page:has(.hero.nba) {
  --oz-fidelity-depth: rgba(241, 38, 130, .105);
}

body.home-shine :is(.gp-shooters, .home-products .pc.cod),
body.product-page:has(.hero.cod) {
  --oz-fidelity-depth: rgba(0, 154, 91, .105);
}

body.home-shine :is(.gp-aim, .acc, .home-products .pc.aim),
body.product-page:has(.hero.fn) {
  --oz-fidelity-depth: rgba(201, 52, 147, .105);
}

body.home-shine :is(.gp-all, .home-bundle-card),
body.product-page:has(.hero.plus) {
  --oz-fidelity-depth: rgba(8, 124, 167, .105);
}

/* Fine double-edge highlights read as polished material on Retina/4K panels. */
body :where(
  .home-products .pc,
  .home-bundle-card,
  .purchase-assurance,
  .acc,
  .demo-teaser .dt-card,
  .ownership-path,
  .review-scoreboard,
  .review-toolbar,
  .product-details-panel,
  .purchase-command,
  .pnp-hero,
  .install-app,
  .product-review-scoreboard,
  .product-review-report,
  .mod-showcase,
  .gd-wrap,
  .gpc-manifest,
  .gpc-library-stats,
  .gpc-library-grid .ucard,
  .gpc-compare .compare-col,
  .gpc-benefits,
  .gpc-final-cta,
  .content-page,
  .guide-hero,
  .guide-link-grid > a,
  .guide-band,
  .guide-checklist,
  .welcome-hero,
  .welcome-step,
  .welcome-complete
) {
  --oz-gloss-inset:
    inset 0 var(--oz-fidelity-line) 0 rgba(255, 255, 255, .99),
    inset var(--oz-fidelity-line) 0 0 rgba(255, 255, 255, .55),
    inset 0 calc(var(--oz-fidelity-line) * -1) 0 rgba(var(--oz-gloss-rgb, 8, 124, 167), .085),
    inset calc(var(--oz-fidelity-line) * -1) 0 0 rgba(var(--oz-gloss-rgb, 8, 124, 167), .045);
  --oz-gloss-depth:
    0 1px 2px rgba(10, 27, 34, .035),
    0 6px 16px rgba(10, 27, 34, .025),
    0 20px 48px var(--oz-fidelity-depth);
  outline: var(--oz-fidelity-line) solid rgba(255, 255, 255, .52);
  outline-offset: -2px;
}

body .site-header {
  border-bottom-color: rgba(8, 124, 167, .14);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, .9),
    0 10px 32px rgba(8, 124, 167, .055);
}

body :where(
  .pc-btn,
  .btn-primary,
  .acc-btn,
  .product-details-buy,
  .guide-primary,
  .content-primary-link,
  .mobile-purchase-action
) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .32),
    inset 0 -1px 0 rgba(10, 27, 34, .14),
    0 8px 20px rgba(var(--oz-gloss-rgb, 8, 124, 167), .16);
}

/* Refine the existing animation system; all movement stays transform/opacity-only. */
.motion-ready .motion-hero {
  translate: 0 18px;
  transition-duration: 700ms, 900ms;
  transition-timing-function: var(--oz-fidelity-ease);
  transition-delay: calc(var(--motion-order, 0) * 78ms);
}

.motion-ready .motion-reveal.motion-pending {
  translate: 0 14px;
}

.motion-ready .motion-reveal.is-visible {
  transition-duration: 520ms, 720ms !important;
  transition-timing-function: var(--oz-fidelity-ease) !important;
  transition-delay: calc(var(--motion-order, 0) * 54ms) !important;
}

.motion-ready.motion-loaded .motion-heading.is-visible .motion-word {
  animation-duration: 760ms;
  animation-timing-function: var(--oz-fidelity-ease);
  animation-delay: calc(86ms + (var(--word-order, 0) * 48ms));
}

body :where(
  .home-products .pc,
  .review-item,
  .path-step,
  .product-review-card,
  .product-review-report,
  .mod-showcase,
  .guide-link-grid > a,
  .welcome-step
) {
  transition-duration: 340ms !important;
  transition-timing-function: var(--oz-fidelity-ease) !important;
}

@media (hover: hover) and (pointer: fine) {
  body :where(
    .home-products .pc,
    .review-item,
    .path-step,
    .product-review-card,
    .product-review-report,
    .mod-showcase,
    .guide-link-grid > a,
    .welcome-step
  ):hover {
    transform: translateY(-4px);
  }

  body :where(
    .home-products .pc,
    .product-review-report,
    .mod-showcase,
    .guide-link-grid > a
  ):hover {
    outline-color: rgba(var(--oz-gloss-rgb, 8, 124, 167), .22);
  }
}

/* Physical half-pixel edges on high-density screens, not browser zoom tricks. */
@media (min-resolution: 1.5dppx) {
  :root {
    --oz-fidelity-line: .5px;
  }

  body :where(.pc-media, .hero-media, .home-bundle-media, .gpc-showcase-stage) img {
    object-fit: contain;
  }
}

/* Wider-gamut displays receive richer accents while sRGB remains the fallback. */
@media (color-gamut: p3) {
  body.home-shine :is(.gp-basketball, .home-products .pc.nba),
  body.product-page:has(.hero.nba) {
    --oz-fidelity-depth: color(display-p3 .96 .08 .46 / .115);
  }

  body.home-shine :is(.gp-shooters, .home-products .pc.cod),
  body.product-page:has(.hero.cod) {
    --oz-fidelity-depth: color(display-p3 0 .62 .32 / .115);
  }

  body.home-shine :is(.gp-aim, .acc, .home-products .pc.aim),
  body.product-page:has(.hero.fn) {
    --oz-fidelity-depth: color(display-p3 .79 .13 .57 / .115);
  }

  body.home-shine :is(.gp-all, .home-bundle-card),
  body.product-page:has(.hero.plus) {
    --oz-fidelity-depth: color(display-p3 0 .49 .68 / .115);
  }
}

@media (prefers-contrast: more) {
  body :where(.home-products .pc, .product-review-report, .mod-showcase, .content-page) {
    outline-color: rgba(7, 94, 128, .34);
  }
}

/* Mobile keeps the sharper edge treatment but avoids large moving shadows. */
@media (max-width: 900px), (hover: none), (pointer: coarse) {
  body :where(
    .home-products .pc,
    .review-item,
    .path-step,
    .product-review-card,
    .product-review-report,
    .mod-showcase,
    .guide-link-grid > a,
    .welcome-step
  ) {
    transition-duration: 220ms !important;
  }

  .motion-ready .motion-hero {
    translate: 0 10px;
    transition-duration: 460ms, 560ms;
    transition-delay: calc(var(--motion-order, 0) * 42ms);
  }

  .motion-ready .motion-reveal.is-visible {
    transition-duration: 360ms, 480ms !important;
    transition-delay: 0ms !important;
  }

  .motion-ready.motion-loaded .motion-heading.is-visible .motion-word {
    animation-duration: 560ms;
    animation-delay: calc(42ms + (var(--word-order, 0) * 30ms));
  }
}

@media (prefers-reduced-motion: reduce), (update: slow) {
  .motion-ready .motion-hero,
  .motion-ready.motion-loaded .motion-hero,
  .motion-ready .motion-reveal,
  .motion-ready .motion-reveal.motion-pending,
  .motion-ready .motion-reveal.is-visible,
  .motion-ready .motion-heading .motion-word,
  .motion-ready.motion-loaded .motion-heading.is-visible .motion-word,
  body :where(
    .home-products .pc,
    .review-item,
    .path-step,
    .product-review-card,
    .product-review-report,
    .mod-showcase,
    .guide-link-grid > a,
    .welcome-step
  ) {
    animation: none !important;
    opacity: 1 !important;
    translate: none !important;
    transform: none !important;
    transition: none !important;
  }
}
