/* ==========================================================
   Colony Creative — Global Design System
   Tokens, resets, utilities, cursor, noise, accessibility
   ========================================================== */

/* --- Lenis smooth scroll (required by lenis.js) --- */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: url('../images/cursor.svg') 2 1, auto;
}

img, video { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; cursor: url('../images/cursor.svg') 2 1, pointer; }
button { border: none; background: none; font-family: inherit; cursor: url('../images/cursor.svg') 2 1, pointer; }
ul, ol { list-style: none; }

/* --- Theme: Dark --- */
:root {
  --bg: #0A0A0A;
  --bg-elevated: #111111;
  --bg-surface: #161616;
  --bg-surface-hover: #1C1C1C;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-primary: #FAFAFA;
  --text-secondary: #888888;
  --text-muted: #555555;
  --text-faint: #333333;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 80px rgba(0,0,0,0.5);

  --selection-bg: #FAFAFA;
  --selection-text: #0A0A0A;

  --client-filter: none;
  --client-filter-hover: none;
  --owl-filter: none;
  --footer-owl-filter: none;
  --topo-opacity: 0.04;
  --btn-bg: #FAFAFA;
  --btn-text: #0A0A0A;
  --btn-hover-bg: #E0E0E0;

  color-scheme: dark;
}

/* --- Base --- */
body {
  background: var(--bg);
  color: var(--text-primary);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* --- Typography --- */
.t-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.t-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-muted);
}

.t-label--center::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-muted);
}

/* --- Noise Overlay --- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
}

.noise svg {
  width: 100%;
  height: 100%;
}

/* --- Custom Cursor --- */
/* The native cursor stays visible. The ring is a subtle,
   gracefully-trailing companion — not a replacement. */

.cursor-dot {
  /* Hidden — the native OS cursor serves as the precise pointer */
  display: none !important;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  will-change: transform;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  opacity: 1;
  /* Center the ring on its own origin so GSAP positions it at the cursor tip */
  transform: translate(-50%, -50%);
  transition: width 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              height 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.4s ease,
              background 0.4s ease;
}

/* Hovering a link / button — grow + gentle tinted fill */
.cursor-ring.is-hovering {
  width: 48px;
  height: 48px;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* Pressing down — compact squeeze */
.cursor-ring.is-clicking {
  width: 24px;
  height: 24px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

@media (hover: none), (max-width: 768px) {
  body { cursor: auto; }
  a { cursor: pointer; }
  button { cursor: pointer; }
  .cursor-ring {
    display: none !important;
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 1px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Skip to Content --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 60px;
  padding: 0.75rem 1.5rem;
  background: var(--text-primary);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 8px 8px;
  z-index: 10001;
  transition: top 0.25s ease;
}

.skip-link:focus { top: 30px; }

/* --- Screen Reader --- */
.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;
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Pill buttons — inset focus ring */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

/* Form inputs — highlight border */
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 0;
}

/* Tab-focus utility — visible focus indicator for section landmarks */
section:focus-visible {
  outline: none;
}

/* --- Reduced Motion --- */
@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;
  }
}
