/* ============================================================
   ANTIPHASE TECHNOLOGIES — GLOBAL STYLES v2.0
   Reset, base typography, layout primitives, utilities,
   scroll-reveal system, and custom cursor.
   ============================================================ */

/* ────────────────────────────────────────
   GOOGLE FONTS IMPORT
   Space Grotesk for display, Inter for body.
──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ────────────────────────────────────────
   MODERN CSS RESET
──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first last;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ────────────────────────────────────────
   SELECTION
──────────────────────────────────────── */
::selection {
  background-color: #FFFFFF;
  color: #000000;
}

/* ────────────────────────────────────────
   CUSTOM SCROLLBAR
──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 2px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ────────────────────────────────────────
   FOCUS
──────────────────────────────────────── */
:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ────────────────────────────────────────
   TYPOGRAPHY BASE
──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

p {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 68ch;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-in-out);
}

img,
video {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* ────────────────────────────────────────
   LAYOUT PRIMITIVES
──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: 840px;
}

/* ────────────────────────────────────────
   SECTION BASE
──────────────────────────────────────── */
.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.section--flush-top {
  padding-top: 0;
}

.section--dark {
  background-color: var(--color-surface);
}

.section--darker {
  background-color: var(--color-surface-2);
}

/* ────────────────────────────────────────
   SECTION HEADER
──────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-16);
}

.section-header--centered {
  text-align: center;
}

.section-header--centered p {
  margin: 0 auto;
}

/* ────────────────────────────────────────
   UTILITY — Screen reader only
──────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ────────────────────────────────────────
   UTILITY — Text
──────────────────────────────────────── */
.text-accent    { color: var(--color-accent); }
.text-muted     { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
}

/* ────────────────────────────────────────
   NOISE TEXTURE OVERLAY
──────────────────────────────────────── */
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
}

/* ────────────────────────────────────────
   SCROLL REVEAL ANIMATIONS
   Enhanced: blur + translate for depth.
──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(8px);
  transition:
    opacity var(--duration-reveal) var(--ease-out-expo),
    transform var(--duration-reveal) var(--ease-out-expo),
    filter var(--duration-reveal) var(--ease-out-expo);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Staggered delays */
.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }
.reveal--delay-4 { transition-delay: 320ms; }
.reveal--delay-5 { transition-delay: 400ms; }
.reveal--delay-6 { transition-delay: 480ms; }

.reveal--from-left {
  transform: translateX(-24px);
  filter: blur(6px);
}
.reveal--from-left.is-visible {
  transform: translateX(0);
  filter: blur(0);
}

/* ────────────────────────────────────────
   REDUCED MOTION — Accessibility
──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* ────────────────────────────────────────
   RESPONSIVE HELPERS
──────────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-5);
  }
  .section-header {
    margin-bottom: var(--space-10);
  }
}

/* ────────────────────────────────────────
   CUSTOM CURSOR — Dot + Circle
──────────────────────────────────────── */
@media (hover: hover) {
  html, body {
    cursor: none;
  }

  a, button, select, input, textarea,
  .star-rating__label, .lightbox__close, .showcase__play-btn {
    cursor: none;
  }

  .custom-cursor {
    width: 28px;
    height: 28px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
    margin-top: -14px;
    margin-left: -14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .custom-cursor__dot {
    width: 4px;
    height: 4px;
    background-color: #FFFFFF;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 150ms var(--ease-out-expo),
                background-color 150ms var(--ease-out-expo);
  }

  .custom-cursor__ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    transition: border-color 150ms var(--ease-out-expo),
                background-color 150ms var(--ease-out-expo),
                transform 150ms var(--ease-out-expo);
  }
}

/* ────────────────────────────────────────
   UTILITY CLASSES (For Strict CSP)
──────────────────────────────────────── */
.u-hidden {
  display: none !important;
}

.u-spacer-42 {
  width: 42px;
}

.u-text-normal {
  text-transform: none !important;
  letter-spacing: 0 !important;
}
