/* ==========================================================================
   BASE STYLES & RESET - KINETIC BRUTALISM (ULTRA PERFORMANCE OPTIMIZED)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Strict Brutalist zero radius */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 16px;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  scroll-behavior: smooth;
  overflow-x: hidden;
  text-rendering: speedOptimization;
}

body {
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Cursor GPU Hardware Accelerated */
body.has-custom-cursor {
  cursor: none;
}

body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor input,
body.has-custom-cursor select,
body.has-custom-cursor textarea,
body.has-custom-cursor [role="button"] {
  cursor: none;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  background-color: transparent;
  position: absolute;
  top: -4px;
  left: -4px;
  transition: transform 0.1s ease-out;
}

.cursor-circle {
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  background-color: var(--red);
  position: absolute;
  top: -22px;
  left: -22px;
  opacity: 0;
  transform: scale(0.2) translateZ(0);
  transition: transform 0.2s var(--ease-brutal), opacity 0.15s ease-out;
  mix-blend-mode: difference;
}

body.cursor-active .cursor-circle {
  opacity: 1;
  transform: scale(1) translateZ(0);
}

body.cursor-active .cursor-dot {
  opacity: 0;
}

/* 12-Column Hairline Grid Background Overlay (GPU Layer Separated) */
.hairline-grid-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  width: 100%;
  max-width: var(--container-max);
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-grid-lines);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding: 0 var(--space-md);
  contain: strict;
}

.hairline-col {
  border-right: 1px solid var(--grid-line);
  height: 100%;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: transform 0.3s var(--ease-brutal);
}

.hairline-col:first-child {
  border-left: 1px solid var(--grid-line);
}

/* Selection & Focus States */
::selection {
  background-color: var(--ink);
  color: var(--paper);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

/* Typography Base Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-weight: 900;
  color: var(--ink);
}

p {
  font-family: var(--font-body);
  color: var(--ink-subtle);
  font-size: var(--font-body-base);
}

.font-mono {
  font-family: var(--font-mono);
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Structural Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Curtain Line Reveal Masking */
.line-mask {
  overflow: hidden;
  display: block;
  padding-block: 0.05em;
}

.line-mask > .line-inner {
  display: block;
  transform: translate3d(0, 110%, 0);
  opacity: 0;
  will-change: transform, opacity;
  transition: transform 0.6s var(--ease-brutal), opacity 0.6s var(--ease-brutal);
}

.line-mask.is-revealed > .line-inner {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Reduced Motion Override */
@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;
  }
  .line-mask > .line-inner {
    transform: none !important;
    opacity: 1 !important;
  }
  .custom-cursor {
    display: none !important;
  }
}
