/* ==========================================================================
   1TAKE COLLECTIVE (1TC) - BASE & PRELOADER
   ========================================================================== */

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

html {
  font-size: 16px;
  background-color: var(--c-navy-deep);
  color: var(--c-baige);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto; /* Handled via smooth inertia scroll */
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--c-baige);
  background-color: var(--c-navy-deep);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Text Selection */
::selection {
  background-color: var(--c-orange);
  color: #000;
}

/* Film Grain Texture (Authentic 35mm Analog Noise) */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Three.js Canvas Container */
#three-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  pointer-events: none;
  overflow: hidden;
}

#three-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Global Container */
.container {
  width: var(--container-width);
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

/* Typography Base */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--c-baige);
}

a {
  color: inherit;
  text-decoration: none;
}

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

img, video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   EDITORIAL PRELOADER
   -------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--c-navy-deep);
  z-index: var(--z-preloader);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem);
  transition: transform 1.2s var(--ease-cinematic), opacity 0.8s ease;
}

.preloader.hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.preloader-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-muted-blue);
}

.preloader-center {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preloader-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--c-baige);
  overflow: hidden;
}

.preloader-title-line {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-cinematic);
}

.preloader.active .preloader-title-line {
  transform: translateY(0);
}

.preloader-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.preloader-counter {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  color: var(--c-orange);
  line-height: 0.85;
}

.preloader-meta {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: 0.12em;
  color: var(--c-baige-muted);
  text-align: right;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   CUSTOM MAGNETIC CURSOR
   -------------------------------------------------------------------------- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--c-baige);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: var(--z-cursor);
  mix-blend-mode: difference;
  transition: width 0.4s var(--ease-smooth),
              height 0.4s var(--ease-smooth),
              background-color 0.4s ease,
              border-color 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-cursor-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-smooth);
  pointer-events: none;
  white-space: nowrap;
}

/* Cursor Active States */
body.cursor-hover .custom-cursor {
  width: 52px;
  height: 52px;
  background-color: var(--c-orange);
  mix-blend-mode: normal;
  box-shadow: var(--shadow-glow);
}

body.cursor-hover .custom-cursor-text {
  opacity: 1;
  transform: scale(1);
}

body.cursor-hidden .custom-cursor {
  opacity: 0;
}

@media (hover: none) and (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }
}
