/* =========================================
   BASE — RESET + TIPOGRAFÍA + LAYOUT
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--tr-slow), color var(--tr-slow);
}

/* ── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-violet-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-violet); }

/* ── SELECCIÓN ─────────────────────────────── */
::selection { background: rgba(155, 126, 222, 0.3); color: var(--text-primary); }

/* ── FOCUS ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 3px;
  border-radius: var(--border-radius-sm);
}

/* ── TIPOGRAFÍA ────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, var(--font-5xl)); }
h2 { font-size: clamp(1.8rem, 3.5vw, var(--font-4xl)); }
h3 { font-size: clamp(1.4rem, 2.5vw, var(--font-3xl)); }
h4 { font-size: var(--font-xl); }
h5 { font-size: var(--font-lg); }
h6 { font-size: var(--font-md); }

p { max-width: 70ch; color: var(--text-secondary); }

a {
  color: var(--accent-violet);
  text-decoration: none;
  transition: color var(--tr-fast);
}
a:hover { color: var(--accent-violet-light); }

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

ul, ol { list-style: none; }

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

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

/* ── CONTAINER ─────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 768px) {
  .container { padding-inline: var(--sp-4); }
}

/* ── SECCIÓN ────────────────────────────────── */
.section {
  padding-block: var(--sp-24);
}

@media (max-width: 768px) {
  .section { padding-block: var(--sp-16); }
}

.section-label {
  font-family: var(--font-sans);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: block;
  margin-bottom: var(--sp-3);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, var(--font-4xl));
  font-weight: 600;
  margin-bottom: var(--sp-6);
}

.section-subtitle {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  max-width: 60ch;
}

/* ── GRID ───────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── FLEX HELPERS ───────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* ── UTILIDADES ─────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--accent-gold); }
.text-violet { color: var(--accent-violet); }
.text-muted { color: var(--text-muted); }
.text-serif { font-family: var(--font-serif); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.divider {
  width: 60px;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: var(--border-radius-full);
  margin-block: var(--sp-6);
}

/* ── LOADER GLOBAL ──────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-6);
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-symbol {
  width: 64px;
  height: 64px;
  animation: loaderSpin 2s linear infinite;
}

.loader-text {
  font-family: var(--font-serif);
  font-size: var(--font-lg);
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

@keyframes loaderSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── CURSOR PERSONALIZADO ───────────────────── */
#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent-violet);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.3s ease;
}

#cursor-halo {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent-violet);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
  opacity: 0.5;
}

body.cursor-hover #cursor-dot { transform: translate(-50%, -50%) scale(2); }
body.cursor-hover #cursor-halo { width: 52px; height: 52px; opacity: 0.8; }

@media (hover: none) {
  #cursor-dot, #cursor-halo { display: none; }
}

/* ── SKIP LINK ──────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--sp-4);
  background: var(--accent-violet);
  color: white;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--border-radius-sm);
  z-index: 99999;
  transition: top var(--tr-fast);
}
.skip-link:focus { top: var(--sp-4); }

/* ── BADGE ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--border-radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-violet { background: rgba(155,126,222,0.15); color: var(--accent-violet); border: 1px solid rgba(155,126,222,0.3); }
.badge-gold { background: rgba(212,175,122,0.15); color: var(--accent-gold); border: 1px solid rgba(212,175,122,0.3); }
.badge-success { background: rgba(76,175,135,0.15); color: var(--color-success); border: 1px solid rgba(76,175,135,0.3); }
.badge-error { background: rgba(224,112,112,0.15); color: var(--color-error); border: 1px solid rgba(224,112,112,0.3); }
.badge-warning { background: rgba(224,184,112,0.15); color: var(--color-warning); border: 1px solid rgba(224,184,112,0.3); }
