/* ==========================================================================
   base.css — cinematic-scrolltelling-skill
   Reset + design tokens + typography.
   Personaliza la página cambiando SOLO las variables :root por proyecto.
   ========================================================================== */

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

html {
  scroll-behavior: auto; /* Lenis/GSAP own the scroll — never 'smooth' here */
  -webkit-text-size-adjust: 100%;
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

/* ---- Design tokens: EDIT PER PROJECT ---- */
:root {
  /* Brand */
  --color-bg: #0a0a0b;
  --color-surface: #131316;
  --color-text: #f5f4f2;
  --color-text-muted: rgba(245, 244, 242, 0.62);
  --color-accent: #c8a96a; /* oro suave — cambia por el color de marca */
  --color-accent-contrast: #0a0a0b;

  /* Typography (self-host real brand fonts in /assets/fonts) */
  --font-display: 'Neue Haas Grotesk', 'Helvetica Neue', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  /* Fluid type scale — clamp(min, preferred, max) */
  --text-hero: clamp(2.6rem, 7.5vw, 7rem);
  --text-h2: clamp(2rem, 4.5vw, 4rem);
  --text-h3: clamp(1.4rem, 2.4vw, 2rem);
  --text-lead: clamp(1.05rem, 1.5vw, 1.35rem);
  --text-body: clamp(0.95rem, 1.1vw, 1.1rem);
  --text-caption: 0.8rem;

  /* Space & rhythm */
  --space-section: clamp(5rem, 12vh, 10rem);
  --space-inline: clamp(1.25rem, 5vw, 5rem);
  --container-max: 1440px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.35s;
  --duration-slow: 0.9s;

  /* Layers */
  --z-sticky-cta: 90;
  --z-loader: 100;
}

/* ---- Base document ---- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* horizontal effects must never create a scrollbar */
}

/* ---- Typography ---- */
h1,
h2,
h3,
.csk-headline {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-hero);
}
h2 {
  font-size: var(--text-h2);
}
h3 {
  font-size: var(--text-h3);
}

.csk-lead {
  font-size: var(--text-lead);
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 38ch;
}

.csk-eyebrow {
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--color-accent);
  font-weight: 500;
}

/* ---- Buttons ---- */
.csk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1em 2.2em;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.csk-btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}
.csk-btn--primary:hover {
  transform: translateY(-2px);
}

.csk-btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(245, 244, 242, 0.28);
}
.csk-btn--ghost:hover {
  border-color: var(--color-text);
}

/* ---- Accessibility ---- */
.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 {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---- Loader overlay (optional [data-loader] element) ---- */
[data-loader] {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: grid;
  place-items: center;
  background: var(--color-bg);
  transition: opacity 0.8s var(--ease-in-out), visibility 0.8s;
}
[data-loader].is-done {
  opacity: 0;
  visibility: hidden;
}
[data-loader-bar] {
  display: block;
  width: min(280px, 50vw);
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s linear;
}
