/* ==========================================================================
   9POINT DIGITAL - Premium Motion & Header/Cursor System
   Progressive enhancement: everything is visible without JS or with
   prefers-reduced-motion. Reveal hiding only applies once .js-ready lands.
   ========================================================================== */

:root {
  --pd-blue: #0047AB;
  --pd-black: #000000;
  --pd-white: #FFFFFF;
  --pd-grey-100: #F5F7FA;
  --pd-grey-200: #E8ECF2;
  --pd-ink: #111111;
  --pd-ink-soft: #555555;
}

html.menu-open { overflow: hidden; }

/* ---- Reveal system ---- */
.js-ready .reveal { opacity: 0; transform: translateY(28px); }
.js-ready .reveal.is-inview,
.reduced-motion .reveal { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }
.js-ready .reveal.is-inview { transition: opacity 0.6s ease, transform 0.6s ease; }

/* ---- Hero intro elements: hidden until GSAP timeline runs ---- */
.js-ready .hero-eyebrow,
.js-ready .hero-line,
.js-ready .hero-copy,
.js-ready .hero-cta,
.js-ready .hero-visual,
.js-ready .hero-card,
.js-ready .hero-glow { opacity: 0; }
.reduced-motion .hero-eyebrow,
.reduced-motion .hero-line,
.reduced-motion .hero-copy,
.reduced-motion .hero-cta,
.reduced-motion .hero-visual,
.reduced-motion .hero-card,
.reduced-motion .hero-glow { opacity: 1 !important; transform: none !important; clip-path: none !important; }
html:not(.js-ready) .hero-eyebrow,
html:not(.js-ready) .hero-line,
html:not(.js-ready) .hero-copy,
html:not(.js-ready) .hero-cta,
html:not(.js-ready) .hero-visual,
html:not(.js-ready) .hero-card,
html:not(.js-ready) .hero-glow { opacity: 1; }
.pd-nav-reveal { opacity: 1; }
.js-ready .pd-nav-reveal { opacity: 0; }
html:not(.js-ready) .pd-nav-reveal, .reduced-motion .pd-nav-reveal { opacity: 1 !important; }

/* ---- Sticky header states ---- */
.pd-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.0);
  transition: background 350ms ease, box-shadow 350ms ease, padding 350ms ease, backdrop-filter 350ms ease;
  padding-block: 22px;
}
.pd-header.is-scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  padding-block: 14px;
}

/* ---- Nav underline hover ---- */
.pd-nav-link { position: relative; text-decoration: none; }
.pd-nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--pd-blue); transition: width 300ms cubic-bezier(.22,1,.36,1);
}
.pd-nav-link:hover::after, .pd-nav-link.is-active::after { width: 100%; }

/* ---- Mobile menu ---- */
.pd-mobile-menu {
  position: fixed; inset: 0; z-index: 300; background: #000;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 28px;
  padding: 40px; transform: translateY(-100%); transition: transform 420ms cubic-bezier(.22,1,.36,1);
}
.pd-mobile-menu.is-open { transform: translateY(0); }
.pd-mobile-menu a { color: #fff; font-size: 2rem; font-weight: 700; text-decoration: none; text-transform: uppercase; }

/* ---- Magnetic buttons ---- */
[data-magnetic] { display: inline-flex; will-change: transform; }

/* ---- Custom cursor (desktop only) ---- */
.pd-cursor {
  position: fixed; top: 0; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: var(--pd-blue); pointer-events: none; z-index: 9999;
  opacity: 0; transition: opacity 200ms ease, width 300ms cubic-bezier(.22,1,.36,1), height 300ms cubic-bezier(.22,1,.36,1), background 300ms ease;
  display: flex; align-items: center; justify-content: center;
}
.pd-cursor.is-visible { opacity: 1; }
.pd-cursor.is-hover { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: rgba(0,71,171,0.5); }
.pd-cursor.is-view {
  width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--pd-black);
}
.pd-cursor-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: #fff; opacity: 0; transition: opacity 200ms ease;
}
.pd-cursor.is-view .pd-cursor-label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .pd-cursor { display: none !important; } }

/* ---- Process line ---- */
.pd-process-track { position: relative; height: 3px; background: var(--pd-grey-200); border-radius: 2px; overflow: hidden; }
.pd-process-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--pd-blue); }

/* ---- Portfolio / card image zoom ---- */
.pd-media-zoom { overflow: hidden; }
.pd-media-zoom img { transition: transform 600ms cubic-bezier(.22,1,.36,1); }
.pd-media-zoom:hover img { transform: scale(1.05); }

/* ---- Reduced motion: hard override everything to safe/instant ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.2s !important; scroll-behavior: auto !important; }
  .pd-cursor { display: none !important; }
}
