/**
 * base.css — Estilos base, reset, tipografía y utilidades globales para ARK
 */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg) !important;
}

body {
  background-color: var(--bg) !important;
  color: var(--fg);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
  line-height: 1.5;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ CONTENEDOR COMÚN ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.ark-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 4vw, 4rem);
  padding-right: clamp(1.25rem, 4vw, 4rem);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ CUSTOM CURSOR ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor-dot);
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor-ring);
  transform: translate(-50%, -50%);
  transition: all 0.15s ease;
  mix-blend-mode: difference;
  opacity: 0;
}

body:hover .cursor-ring {
  opacity: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ SCROLLBAR ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ SELECTION ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ NOISE OVERLAY ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-noise);
  opacity: 0.4;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ GRAIN OVERLAY ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.grain-overlay {
  position: relative;
}

.grain-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.12'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-grain);
  mix-blend-mode: overlay;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ TYPOGRAPHY UTILITIES ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.font-display {
  font-family: var(--font-display);
}

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

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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION DIVIDER ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-line {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ SCROLL REVEAL ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s var(--ease-ark),
    transform 0.8s var(--ease-ark);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ RESPONSIVE ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
  body {
    cursor: auto;
  }
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}
