/* ============================================================
   VETEX · Sistema de diseño compartido
   Editorial + Industrial · Paleta Tierras
   ============================================================ */

:root {
  /* === MARCA OFICIAL VETEX === */
  /* Primarios */
  --blue-deep: #061A38;     /* Azul profundo, marca */
  --blue: #0F4F92;          /* Azul logo */
  --blue-accent: #1E5BA8;   /* Azul accent secundario */
  --bone: #FAF7F2;          /* Fondo principal — domina 60% */
  --sand: #E8DFD3;          /* Fondo secundario cálido */
  --gold: #F0D219;          /* Amarillo eléctrico Vetex · acento principal */
  --gold-deep: #C9A800;     /* Amarillo deep para hover/contrasteado */
  --clay: #B8845F;          /* Secundario cálido */

  /* Tinta y papel */
  --ink: #061A38;           /* Tinta = blue deep */
  --ink-2: #0F2845;
  --ink-3: #4A5A72;         /* Texto secundario azulado */
  --paper: #FAF7F2;         /* Bone */
  --paper-2: #E8DFD3;       /* Sand */
  --paper-3: #D8CFC0;
  --line: rgba(6,26,56,0.14);
  --line-2: rgba(6,26,56,0.07);

  /* Estados (alineados a la paleta) */
  --success: #2D6E4E;
  --warn: #B8924A;          /* Mostaza sobrio para alertas (≠ gold accent) */
  --danger: #A85B3E;

  /* Tipografía */
  --font-serif: 'Fraunces', 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radios (del manual: 1mm / 1.5mm / 2mm) */
  --r-1: 3px;
  --r-2: 5px;
  --r-3: 8px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.64, 0, 0.78, 0);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 620ms;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Defensa global contra desbordes en mobile */
img, video, svg, iframe { max-width: 100%; height: auto; }
img[width][height] { height: auto; }
table { width: 100%; max-width: 100%; }
pre, code { white-space: pre-wrap; word-wrap: break-word; }
/* Cualquier wrapper que necesite scroll horizontal local debe declarar .scroll-x */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

body {
  min-height: 100vh;
  cursor: none; /* Custom cursor */
}

/* Custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--paper);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 120ms var(--ease);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(244,239,232,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 280ms var(--ease), height 280ms var(--ease), border-color 280ms var(--ease), background 280ms var(--ease);
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  background: rgba(15,79,146,0.14);
  border-color: var(--blue);
}
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* Tipografía helpers */
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; }
.mono { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ink-3);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}

.h-display { font-size: clamp(64px, 11vw, 180px); line-height: 0.92; letter-spacing: -0.035em; }
.h-xl { font-size: clamp(48px, 6.5vw, 96px); line-height: 0.95; }
.h-lg { font-size: clamp(36px, 4.5vw, 64px); line-height: 1; }
.h-md { font-size: clamp(24px, 2.6vw, 36px); line-height: 1.05; }

/* Italic accent on serif */
.serif em, .italic { font-style: italic; font-family: var(--font-serif); }

/* Layout containers */
.container { max-width: 1480px; margin: 0 auto; padding: 0 48px; }
.container-wide { max-width: 1720px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 768px) {
  .container, .container-wide { padding: 0 20px; }
}

/* =================== NAV =================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244,239,232,0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-2);
  transition: all var(--t-med) var(--ease);
}
.nav.on-dark {
  background: rgba(6,26,56,0.55);
  color: var(--paper);
  border-bottom-color: rgba(244,239,232,0.08);
}
.nav.on-dark .logo,
.nav.on-dark .nav-links a,
.nav.on-dark .nav-right button,
.nav.on-dark .nav-right a { color: var(--paper); }
.nav.on-dark .nav-right button:hover,
.nav.on-dark .nav-right a:hover { color: var(--gold); }

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  font-size: 0; /* anula cualquier texto fallback dentro del <a> */
}
.logo .logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  /* Transition incluye filter para que el cambio de azul a blanco al pasar a on-dark sea suave */
  transition: transform var(--t-med) var(--ease), filter var(--t-med) var(--ease);
}
.logo:hover .logo-img { transform: scale(1.04); }

/* Variantes por contexto */
.nav.on-dark .logo .logo-img,
.nav-mobile .logo .logo-img {
  filter: brightness(0) invert(1);
}
/* Footer wordmark (texto serif, sin pincelada del PNG) */
.footer-wordmark {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.03em;
  color: var(--paper);
  text-decoration: none;
  line-height: 1;
}
.footer-wordmark sup {
  font-size: 11px;
  color: var(--gold);
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0;
}

@media (max-width: 700px) {
  .logo .logo-img { height: 28px; max-width: 110px; }
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding: 6px 0;
  transition: color var(--t-fast);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-med) var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--blue); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-right button, .nav-right a {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: none;
  padding: 8px 10px;
  text-decoration: none;
  /* Transición unificada con el nav (mismo timing que background del nav) */
  transition: color var(--t-med) var(--ease), background var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  border-radius: var(--r-1);
}
/* SVG hereda color por currentColor — incluyo transición explícita por si el browser no la heredase */
.nav-right .nav-ico { transition: color var(--t-med) var(--ease); }
.nav-right button:hover, .nav-right a:hover { color: var(--blue); background: rgba(15,79,146,0.06); }
.nav.on-dark .nav-right button:hover, .nav.on-dark .nav-right a:hover { background: rgba(244,239,232,0.08); color: var(--gold); }
.nav-ico { width: 20px; height: 20px; flex-shrink: 0; }
.nav-ico-label { display: inline-block; }

/* Carrito: contenedor del icono con badge encima */
.nav-cart { padding: 8px 10px; }
.cart-count {
  position: absolute;
  top: -2px; right: -4px;
  background: var(--blue);
  color: var(--paper);
  border-radius: 999px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  line-height: 18px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 2px solid var(--paper);
  box-sizing: content-box;
  /* Transición consistente con el nav: el badge "respira" el modo igual que los íconos */
  transition: transform 220ms var(--ease),
              background-color var(--t-med) var(--ease),
              color var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
  transform-origin: center;
}
/* En modo oscuro el badge invierte: fondo claro + texto azul para contrastar contra el azul del nav */
.nav.on-dark .cart-count {
  background: var(--paper);
  color: var(--blue-deep);
  border-color: rgba(244,239,232,0.85);
}

/* Hamburguesa (oculta en desktop) */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  background: transparent; border: 0;
  position: relative;
  cursor: pointer;
  margin-right: -8px;
}
.nav-burger span {
  position: absolute;
  left: 8px; right: 8px; height: 1.5px;
  background: var(--ink);
  /* Mismo timing que el resto del nav: cuando el modo cambia, las 3 líneas transicionan en sync */
  transition: transform var(--t-med) var(--ease),
              opacity 200ms ease,
              top var(--t-med) var(--ease),
              background-color var(--t-med) var(--ease);
}
.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 20px; }
.nav-burger span:nth-child(3) { top: 26px; }
.nav.on-dark .nav-burger span { background: var(--paper); }
.nav-burger.is-open span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* Menú overlay mobile */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: var(--paper);
  z-index: 90;
  padding: 90px 24px 32px;
  display: flex; flex-direction: column;
  transform: translateY(-100%);
  transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
  overflow-y: auto;
  visibility: hidden;
}
.nav-mobile.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform var(--t-med) var(--ease), visibility 0s linear 0s;
}
.nav-mobile a {
  display: block; padding: 18px 0;
  font-family: var(--font-serif);
  font-size: 32px; line-height: 1;
  letter-spacing: -0.02em;
  color: var(--paper); text-decoration: none;
  border-bottom: 1px solid rgba(244,239,232,0.1);
}
.nav-mobile a.active { color: var(--gold); }
.nav-mobile .nav-mobile-foot {
  margin-top: auto;
  padding-top: 32px;
  display: flex; gap: 24px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(244,239,232,0.55);
}
.nav-mobile .nav-mobile-foot a {
  border-bottom: 0; padding: 0;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(244,239,232,0.7);
}
.nav-mobile .nav-mobile-foot a:hover { color: var(--gold); }

body.nav-locked { overflow: hidden; }

/* ============ DESKTOP / TABLET MEDIO (≥769px) ============ */
/* Nav-links visible, hamburguesa y menú mobile fuera. */
@media (min-width: 769px) {
  .nav-burger,
  .nav-mobile { display: none !important; }
}

/* ============ TABLET CHICO + MOBILE (≤768px) ============ */
@media (max-width: 768px) {
  .nav { padding: 10px 14px; gap: 8px; }
  .nav-links { display: none; }                /* Links del nav top fuera */
  .nav-right #navSearchBtn { display: none; }  /* Buscador vive en el menú overlay */
  .nav-ico-label { display: none; }            /* Sólo iconos en mobile */

  .nav-right { gap: 2px; flex-shrink: 0; }
  .nav-right button, .nav-right a { padding: 8px; }
  .nav-cart { padding: 8px; }
  .nav-burger { display: block; }              /* Hamburguesa visible */
}

/* ============ MOBILE CHICO (≤390px / iPhone SE etc) ============ */
@media (max-width: 400px) {
  .nav { padding: 8px 10px; gap: 4px; }
  .nav-right { gap: 0; }
  .nav-right button, .nav-right a, .nav-cart { padding: 6px; }
  .nav-ico { width: 18px; height: 18px; }
  .nav-burger { width: 36px; height: 36px; margin-right: -4px; }
  .logo .logo-img { height: 24px; max-width: 92px; }
}

/* =================== BUTTONS =================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: none;
  position: relative;
  overflow: hidden;
  transition: color var(--t-med) var(--ease);
  border-radius: 0;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform: translateY(100%);
  transition: transform var(--t-med) var(--ease);
  z-index: 0;
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--ink); }
.btn > * { position: relative; z-index: 1; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost::before { background: var(--ink); }
.btn-ghost:hover { color: var(--paper); }

.btn-clay {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--paper);
}
.btn-clay::before { background: var(--blue-deep); }
.btn-clay:hover { color: var(--paper); }

/* Botón azul (CTA principal con autoridad) */
.btn-blue { background: var(--blue); color: var(--paper); border-color: var(--blue); }
.btn-blue::before { background: var(--blue-deep); }
.btn-blue:hover { color: var(--paper); }

.btn .arrow {
  display: inline-block;
  transition: transform var(--t-med) var(--ease);
}
.btn:hover .arrow { transform: translateX(6px); }

/* Link arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  transition: all var(--t-med) var(--ease);
}
.link-arrow:hover { color: var(--blue); border-color: var(--blue); gap: 14px; }

/* =================== CHIPS / BADGES =================== */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.chip-clay { background: var(--clay); color: var(--paper); border-color: var(--clay); }
.chip-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-dot::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* =================== FOOTER =================== */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 120px 0 40px;
  margin-top: 160px;
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 100px;
  border-bottom: 1px solid rgba(244,239,232,0.12);
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244,239,232,0.55);
  font-weight: 400;
  margin-bottom: 24px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer a {
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--t-fast);
}
.footer a:hover { color: var(--gold); }
.footer-hero {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  padding: 100px 0;
  text-align: left;
  color: var(--paper);
}
.footer-hero em { color: var(--gold); font-style: italic; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,239,232,0.55);
}
.footer { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.footer-hero { padding: 100px 0 60px; }

@media (max-width: 900px) {
  .footer { padding: 80px 0 32px; margin-top: 90px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; padding-bottom: 60px; }
  .footer-hero { padding: 40px 0; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; padding-top: 24px; font-size: 10px; }
  .footer-bottom span { line-height: 1.6; }
}

/* =================== PLACEHOLDERS =================== */
.ph { /* placeholder image container */
  position: relative;
  background: var(--paper-2);
  overflow: hidden;
}
.ph-label {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(244,239,232,0.85);
  padding: 5px 9px;
  z-index: 2;
}
.ph-corner {
  position: absolute;
  bottom: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  z-index: 2;
}

/* Stripe texture for placeholders */
.ph-stripes {
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0, transparent 8px,
      rgba(6,26,56,0.035) 8px, rgba(6,26,56,0.035) 9px
    );
}

/* =================== REVEAL (scroll-triggered) =================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

.reveal-split {
  overflow: hidden;
  display: inline-block;
}
.reveal-split > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 900ms var(--ease);
}
.reveal-split.in > span { transform: translateY(0); }

/* Loading marquee */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.marquee-track {
  display: inline-flex;
  gap: 60px;
  animation: marquee 40s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.marquee-track span::before {
  content: "◆";
  margin-right: 60px;
  color: var(--gold);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =================== SCROLL BAR =================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* Selection */
::selection { background: var(--blue); color: var(--paper); }

/* Form elements */
input, select, textarea, button {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
}
input[type="text"], input[type="email"], input[type="number"], input[type="search"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--r-1);
  outline: none;
  transition: border-color var(--t-fast);
  cursor: none;
}
input:focus { border-color: var(--ink); }

/* Utility */
.sr { position: absolute; left: -9999px; }
