/* ==========================================================================
   TALLER CACHO — Sistema de diseño
   Paleta extraída del logotipo original (grafito #5F6266).
   No se agregan colores ajenos a la identidad: toda la escala deriva
   del mismo grafito frío, con blanco y una veta metálica como acento.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tipografías (self-hosted, sin request a terceros)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/instrument-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/instrument-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Fallbacks ajustados: evitan el salto de layout mientras carga la webfont */
@font-face {
  font-family: 'Archivo Fallback';
  src: local('Arial');
  size-adjust: 100%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Instrument Fallback';
  src: local('Arial');
  size-adjust: 99%;
  ascent-override: 96%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Escala grafito — el 500 es el color exacto del logotipo */
  --g-950: #0e1013;
  --g-900: #16181b;
  --g-850: #1b1e22;
  --g-800: #23262a;
  --g-700: #2f3338;
  --g-600: #454a50;
  --g-500: #5f6266; /* LOGO */
  --g-400: #7c8187;
  --g-300: #a3a8ae;
  --g-200: #c9cdd2;
  --g-150: #dde0e4;
  --g-100: #e8eaed;
  --g-050: #f3f4f6;
  --white: #ffffff;

  /* Veta metálica: único acento, derivado de la misma familia fría */
  --sheen: linear-gradient(90deg, transparent, var(--g-200) 22%, #f6f7f8 50%, var(--g-200) 78%, transparent);
  --sheen-dark: linear-gradient(90deg, transparent, var(--g-600) 22%, var(--g-300) 50%, var(--g-600) 78%, transparent);

  /* Semánticos — tema claro por defecto */
  --bg: var(--white);
  --bg-soft: var(--g-050);
  --ink: var(--g-900);
  --ink-soft: var(--g-500);
  /* Interpolado entre 500 y 400: mantiene la jerarquía visual sin bajar de
     4.5:1 sobre blanco y sobre el gris suave de fondo. */
  --ink-muted: #6b7076;
  --line: var(--g-150);

  --whatsapp: #25d366;
  --whatsapp-dark: #14a83f;

  /* Tipografía */
  --font-display: 'Archivo', 'Archivo Fallback', system-ui, sans-serif;
  --font-body: 'Instrument Sans', 'Instrument Fallback', system-ui, sans-serif;

  --fs-display: clamp(2.15rem, 7.6vw, 5.4rem);
  --fs-h2: clamp(1.85rem, 5vw, 3.25rem);
  --fs-h3: clamp(1.15rem, 2.4vw, 1.45rem);
  --fs-lead: clamp(1.02rem, 2.1vw, 1.24rem);
  --fs-body: 1.0313rem;
  --fs-small: 0.9063rem;
  --fs-eyebrow: 0.7188rem;

  /* Ritmo */
  --container: 1240px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(3.25rem, 8vw, 7rem);
  --radius: 4px;
  --radius-lg: 8px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 68px;
}

@media (min-width: 900px) {
  :root { --header-h: 84px; }
}

/* --------------------------------------------------------------------------
   3. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.68;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img, svg, video, iframe {
  display: block;
  max-width: 100%;
}
img { height: auto; }

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

button { background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--g-500);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--g-900); color: var(--white); }

/* --------------------------------------------------------------------------
   4. Tipografía base
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.22; }

p { text-wrap: pretty; }

strong { font-weight: 600; color: var(--ink); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  flex: none;
}

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: clamp(2.5rem, 5.5vw, 4.5rem); }

.section--dark {
  background: var(--g-950);
  color: var(--g-150);
  --ink: var(--white);
  --ink-soft: var(--g-300);
  --ink-muted: var(--g-400);
  --line: rgba(255, 255, 255, 0.11);
}
.section--dark h2, .section--dark h3 { color: var(--white); }

.section-head {
  display: grid;
  gap: 1.1rem;
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head--wide { max-width: none; }

@media (min-width: 900px) {
  .section-head--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    max-width: none;
    align-items: end;
  }
  .section-head--split .eyebrow { grid-column: 1 / -1; }
}

.rule {
  height: 1px;
  border: 0;
  background: var(--sheen);
  opacity: 0.85;
}
.section--dark .rule { background: var(--sheen-dark); }

/* --------------------------------------------------------------------------
   6. Botones
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--g-900);
  --btn-ink: var(--white);
  --btn-line: var(--g-900);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  padding: 0.95em 1.6em;
  min-height: 50px;
  border: 1px solid var(--btn-line);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font-display);
  font-size: 0.9063rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
    background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--g-700);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px rgba(14, 16, 19, 0.6); }
.btn:hover::after { transform: translateY(0); }
.btn:active { transform: translateY(0); }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--g-900);
  --btn-line: var(--g-200);
}
.btn--ghost::after { background: var(--g-900); }
.btn--ghost:hover { --btn-ink: var(--white); border-color: var(--g-900); }

.btn--light {
  --btn-bg: var(--white);
  --btn-ink: var(--g-900);
  --btn-line: var(--white);
}
.btn--light::after { background: var(--g-100); }
.btn--light:hover { --btn-ink: var(--g-900); }

.btn--outline-light {
  --btn-bg: transparent;
  --btn-ink: var(--white);
  --btn-line: rgba(255, 255, 255, 0.32);
}
.btn--outline-light::after { background: var(--white); }
.btn--outline-light:hover { --btn-ink: var(--g-900); border-color: var(--white); }

.btn--wa {
  --btn-bg: var(--whatsapp);
  --btn-ink: #08321a;
  --btn-line: var(--whatsapp);
}
.btn--wa::after { background: var(--whatsapp-dark); }
.btn--wa:hover { --btn-ink: #ffffff; }

.btn--sm { padding: 0.72em 1.15em; min-height: 42px; font-size: 0.8438rem; }
.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Enlace con subrayado animado */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 3px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease-out);
}
.link-arrow svg { width: 14px; height: 14px; transition: transform 0.35s var(--ease-out); }
.link-arrow:hover { background-size: 100% 1px; }
.link-arrow:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   7. Animaciones de entrada
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

[data-reveal='fade'] { transform: none; }
[data-reveal='left'] { transform: translate3d(-24px, 0, 0); }
[data-reveal='right'] { transform: translate3d(24px, 0, 0); }
[data-reveal='scale'] { transform: scale(1.04); }
[data-reveal='scale'].is-visible { transform: none; }

/* Cortina que revela imágenes */
.reveal-media {
  position: relative;
  overflow: hidden;
  background: var(--g-100);
}
.reveal-media img { transition: transform 1.4s var(--ease-out); }
.reveal-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--g-050);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 1s var(--ease-out);
}
.reveal-media.is-visible::after { transform: scaleX(0); }
.section--dark .reveal-media::after { background: var(--g-850); }

@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;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reveal-media::after { display: none; }
}

/* --------------------------------------------------------------------------
   8. Utilidades
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--g-900);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.mono-num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.04em;
}
