/* Design tokens, reset and typography */

/* Local fallbacks with similar metrics to reduce layout shift while web fonts load */
@font-face {
  font-family: "Raleway Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica");
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 105%;
}

@font-face {
  font-family: "League Spartan Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold");
  font-weight: 700;
  ascent-override: 72%;
  descent-override: 20%;
  line-gap-override: 0%;
  size-adjust: 100%;
}

:root {
  /* Brand palette from the CANÁ brand guide: sun #D4AF37, letters #C99933, car #E4AB41, background #000 */
  --oro: #d4af37;
  --oro-letras: #c99933;
  --ambar: #e4ab41;
  --oro-claro: #f3dc8b;
  --oro-oscuro: #7a5a12; /* gold text on light backgrounds (AA contrast) */
  --oro-titulo: #9a7413; /* gold words inside large headings on light backgrounds (AA large text) */
  --negro: #0b0b0b;
  --negro-suave: #1a1814;
  --crema: #fbf6ec;
  --crema-2: #f4e8cf;
  --blanco: #ffffff;
  --texto: #1c1913;
  --texto-suave: #3f392c;
  --borde: #e8dcc2;
  --whatsapp: #25d366;
  --whatsapp-oscuro: #0e7a41;
  --error: #b42318;
  --exito: #0e7a41;

  /* Typography (brand fonts: League Spartan + Raleway) */
  --font-titulos: "League Spartan", "League Spartan Fallback", "Arial Black", sans-serif;
  --font-texto: "Raleway", "Raleway Fallback", "Segoe UI", Roboto, Arial, sans-serif;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-h2: clamp(2rem, 1.5rem + 2vw, 3.1rem);
  --fs-h1: clamp(2.6rem, 1.7rem + 4.2vw, 5rem);

  /* Spacing, radius, shadows */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px rgb(60 40 0 / 0.08);
  --shadow: 0 12px 30px rgb(60 40 0 / 0.12);
  --shadow-lg: 0 24px 60px rgb(0 0 0 / 0.28);

  --header-h: 72px;
  --container: 1180px;
  --gutter: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  min-height: 100vh;
  font-family: var(--font-texto);
  font-size: var(--fs-base);
  font-variant-numeric: lining-nums;
  line-height: 1.65;
  color: var(--texto);
  background-color: var(--blanco);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-titulos);
  font-weight: 700;
  line-height: 1.05;
  color: var(--negro);
  text-wrap: balance;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.15;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 700;
}

a {
  color: var(--oro-oscuro);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--negro);
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--ambar);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--oro);
  color: var(--negro);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--oro);
  color: var(--negro);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--negro);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
