/* ═══════════════════════════════════════════════════════════════
   CARSIFICADOS — SISTEMA DE DISEÑO
   v3.0 — Showroom-Garage de alta gama
   
   CÓMO MODIFICAR:
   • Colores    → sección :root { --color-* }
   • Tipografía → sección :root { --font-* } + @import al inicio
   • Espaciado  → sección :root { --space-* }
   • Animaciones→ sección :root { --ease-* } + { --dur-* }
   
   Un cambio aquí se propaga a todo el sitio.
═══════════════════════════════════════════════════════════════ */

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

/* ── TOKENS ── */
:root {

  /* PALETA — modificar estos cambia toda la identidad visual */
  --col-bg:          #0A0806;   /* negro con temperatura cálida */
  --col-surface:     #120F0C;   /* concreto pulido oscuro */
  --col-panel:       #1A1510;   /* madera oscura / piel */
  --col-panel-mid:   #221C16;   /* panel secundario */
  --col-border:      rgba(242,237,228,0.07);  /* borde sutil, casi invisible */
  --col-border-warm: rgba(200,121,65,0.2);   /* borde con temperatura */

  --col-orange:      #FF6600;   /* el alma de Carsificados */
  --col-orange-dim:  rgba(255,102,0,0.08);
  --col-orange-glow: rgba(255,102,0,0.25);
  --col-copper:      #C87941;   /* herramienta, acero caliente */
  --col-copper-dim:  rgba(200,121,65,0.1);
  --col-red:         #B91C2C;   /* track / danger — más refinado que el anterior */

  --col-ivory:       #F2EDE4;   /* blanco marfil — interior de alta gama */
  --col-ivory-mid:   rgba(242,237,228,0.65);
  --col-ivory-dim:   rgba(242,237,228,0.35);
  --col-ivory-ghost: rgba(242,237,228,0.08);

  --col-dust:        #8A7F74;   /* texto secundario — polvo en concreto */
  --col-dust-dim:    rgba(138,127,116,0.5);

  /* CLIMA — modificados via JS, no tocar manualmente */
  --weather-sky:     #0A0806;
  --weather-ambient: rgba(255,102,0,0.03);
  --weather-tint:    rgba(0,0,0,0);

  /* TIPOGRAFÍA */
  --font-display:  'Barlow Condensed', sans-serif;   /* títulos — impacto, sin serif */
  --font-ui:       'DM Sans', system-ui, sans-serif;  /* cuerpo — cálido, moderno */
  --font-mono:     'DM Mono', monospace;              /* SOLO precios y datos numéricos */
  --font-label:    'DM Sans', system-ui, sans-serif;  /* labels, meta, overlines */

  /* ESCALA TIPOGRÁFICA — proporción áurea 1.618 */
  --text-xs:   0.625rem;   /* 10px — micro labels */
  --text-sm:   0.75rem;    /* 12px — meta, datos */
  --text-base: 0.9375rem;  /* 15px — cuerpo */
  --text-lg:   1.125rem;   /* 18px — subtítulos */
  --text-xl:   1.5rem;     /* 24px — sección */
  --text-2xl:  2.25rem;    /* 36px — títulos menores */
  --text-3xl:  3.5rem;     /* 56px — títulos */
  --text-4xl:  clamp(3rem, 6vw, 5.5rem);     /* hero secundario */
  --text-hero: clamp(4rem, 9vw, 9rem);        /* hero principal */

  /* PESO */
  --weight-light:   300;
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;

  /* ESPACIADO — proporción 1.5 */
  --space-1:  0.25rem;   /* 4px */
  --space-2:  0.5rem;    /* 8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.5rem;    /* 24px */
  --space-6:  2rem;      /* 32px */
  --space-7:  3rem;      /* 48px */
  --space-8:  4.5rem;    /* 72px */
  --space-9:  6rem;      /* 96px */
  --space-10: 9rem;      /* 144px */

  /* LAYOUT */
  --max-w:        1400px;
  --gutter:       clamp(1.25rem, 4vw, 4rem);
  --col-golden-a: 61.8%;   /* proporción áurea mayor */
  --col-golden-b: 38.2%;   /* proporción áurea menor */

  /* ANIMACIONES */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);    /* entrada suave con peso */
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);    /* salida */
  --ease-inout:  cubic-bezier(0.45, 0, 0.55, 1);   /* transición */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);/* rebote sutil */

  --dur-instant: 100ms;
  --dur-fast:    200ms;
  --dur-mid:     400ms;
  --dur-slow:    700ms;
  --dur-crawl:   1100ms;  /* transiciones de página */

  /* RADIO — showroom no tiene esquinas redondeadas */
  --radius-sm: 2px;
  --radius:    4px;
  --radius-lg: 8px;

  /* Z-INDEX */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-overlay:  50;
  --z-modal:    100;
  --z-nav:      200;
  --z-top:      999;
  --z-cursor:   9999;
}

/* ── RESETS & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--col-bg);
  color: var(--col-ivory);
  font-family: var(--font-ui);
  font-weight: var(--weight-light);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: none; }
::selection { background: var(--col-orange); color: #000; }

/* ── CURSOR PERSONALIZADO ── */
#csf-cursor {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  mix-blend-mode: normal;
  transition: opacity 0.3s;
}

/* ── NAVEGACIÓN ── */
.csf-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  background: transparent;
  transition: background var(--dur-mid) ease, backdrop-filter var(--dur-mid) ease;
}
.csf-nav.scrolled {
  background: rgba(10,8,6,0.92);
  backdrop-filter: blur(28px) saturate(1.2);
  border-bottom: 1px solid var(--col-border);
}
.csf-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  margin-right: auto;
}
.csf-logo-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--col-ivory);
  line-height: 1;
  text-transform: uppercase;
}
.csf-logo-mark em {
  color: var(--col-orange);
  font-style: normal;
}
.csf-logo-sub {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--col-dust);
  letter-spacing: 0.2em;
}
.csf-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}
.csf-nav-links a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  color: var(--col-ivory-dim);
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  transition: color var(--dur-fast) ease;
  position: relative;
}
.csf-nav-links a::after {
  content: '';
  position: absolute;
  bottom: 14px;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background: var(--col-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}
.csf-nav-links a:hover,
.csf-nav-links a.active { color: var(--col-ivory); }
.csf-nav-links a:hover::after,
.csf-nav-links a.active::after { transform: scaleX(1); }
.csf-nav-cta {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  color: #000;
  background: var(--col-orange);
  padding: 0.6rem 1.5rem;
  margin-left: 1rem;
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.csf-nav-cta:hover {
  background: #FF7A1A;
  transform: translateY(-1px);
}

/* ── BOTONES — sistema ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  letter-spacing: 0.07em;
  padding: 0.875rem 2rem;
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
  cursor: none;
  border: none;
  text-decoration: none;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  transform: translateX(-100%);
  transition: transform var(--dur-mid) var(--ease-out);
}
.btn:hover::before { transform: translateX(0); }
.btn-primary {
  background: var(--col-orange);
  color: #000;
}
.btn-primary:hover { background: #FF7A1A; transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--col-ivory);
  border: 1px solid var(--col-border);
}
.btn-ghost:hover { border-color: rgba(242,237,228,0.3); }
.btn-copper {
  background: transparent;
  color: var(--col-copper);
  border: 1px solid var(--col-copper-dim);
}
.btn-copper:hover { border-color: var(--col-copper); background: var(--col-copper-dim); }
.btn-arrow::after {
  content: '→';
  transition: transform var(--dur-fast) ease;
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* ── TIPOGRAFÍA — sistema ── */
.t-display {
  font-family: var(--font-display);
  font-weight: var(--weight-light);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.t-title {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.t-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: 0.15em;
  color: var(--col-dust);
  text-transform: none; /* sin all-caps */
}
.t-price {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--col-orange);
  font-variant-numeric: tabular-nums;
}
.t-body {
  font-family: var(--font-ui);
  font-weight: var(--weight-light);
  line-height: 1.7;
  color: var(--col-ivory-mid);
}
.t-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--col-dust);
  letter-spacing: 0.1em;
}

/* ── LAYOUT HELPERS ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.grid-golden {
  display: grid;
  grid-template-columns: var(--col-golden-a) var(--col-golden-b);
  gap: var(--space-7);
}
.grid-golden.flip {
  grid-template-columns: var(--col-golden-b) var(--col-golden-a);
}
.section { padding: var(--space-10) 0; }
.section-sm { padding: var(--space-8) 0; }

/* ── DIVIDER ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--col-border);
}
.divider-warm {
  background: linear-gradient(90deg, transparent, var(--col-border-warm), transparent);
}

/* ── CARD SISTEMA ── */
.card {
  background: var(--col-surface);
  border: 1px solid var(--col-border);
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,102,0,0.08);
  border-color: var(--col-border-warm);
}
.card-img {
  position: relative;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-crawl) var(--ease-out);
  display: block;
}
.card:hover .card-img img {
  transform: scale(1.04);
}

/* ── TRANSICIÓN DE PÁGINA ── */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: var(--z-top);
  pointer-events: none;
  display: flex;
}
.pt-panel {
  flex: 1;
  background: var(--col-orange);
  transform: scaleY(0);
  transform-origin: bottom;
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) ease,
              transform var(--dur-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 350ms; }

/* ── CLIMA — variables modificadas por JS ── */
[data-weather="rain"] {
  --weather-sky:     #0D0B09;
  --weather-ambient: rgba(100,120,160,0.04);
}
[data-weather="fog"] {
  --weather-sky:     #110E0B;
  --weather-ambient: rgba(160,150,140,0.04);
}
[data-weather="sunny"] {
  --weather-sky:     #0C0905;
  --weather-ambient: rgba(255,160,50,0.05);
}
[data-weather="night"] {
  --weather-sky:     #05050A;
  --weather-ambient: rgba(80,80,200,0.03);
}
[data-weather="golden"] {
  --weather-sky:     #130908;
  --weather-ambient: rgba(255,100,30,0.06);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root {
    --gutter: 1.25rem;
    --text-hero: clamp(3rem, 14vw, 5rem);
  }
  .grid-golden,
  .grid-golden.flip {
    grid-template-columns: 1fr;
  }
  .csf-nav-links li:not(:last-child):not(:nth-last-child(2)) { display: none; }
}

/* ── UTILITIES ── */
.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;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
