/* ==========================================================================
   base.css — Reset, design tokens, tipografía y utilidades
   Grup SUERC
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Paleta — cálida, hostelería/restauración */
  --ink-900: #100e0c;
  --ink-800: #191614;
  --ink-700: #241f1b;
  --ink-600: #3a322c;
  --ink-400: #6b6058;
  --ink-300: #9a8f86;

  --cream-50:  #fdfbf8;
  --cream-100: #f8f3ec;
  --cream-200: #efe7dc;
  --cream-300: #e2d6c6;

  --accent-600: #9d4a24;
  --accent-500: #b4552d;
  --accent-400: #c8763f;
  --accent-300: #ddA26a;

  --olive-600: #4d5a45;
  --olive-500: #66765b;

  --danger:  #a8322b;
  --success: #3f6b4a;

  /* Roles semánticos */
  --bg:            var(--cream-50);
  --bg-alt:        var(--cream-100);
  --bg-inverse:    var(--ink-900);
  --surface:       #ffffff;
  --text:          var(--ink-800);
  --text-muted:    var(--ink-400);
  --text-inverse:  var(--cream-100);
  --border:        var(--cream-300);
  --border-strong: #d2c3af;
  --accent:        var(--accent-500);

  /* Tipografía */
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino,
                  "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", sans-serif;

  /* Escala fluida */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.20vw, 1.09rem);
  --step-1:  clamp(1.18rem, 1.10rem + 0.40vw, 1.42rem);
  --step-2:  clamp(1.42rem, 1.26rem + 0.78vw, 1.94rem);
  --step-3:  clamp(1.70rem, 1.42rem + 1.40vw, 2.64rem);
  --step-4:  clamp(2.05rem, 1.56rem + 2.44vw, 3.60rem);
  --step-5:  clamp(2.45rem, 1.60rem + 4.25vw, 4.90rem);

  /* Espaciado */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-s:   1rem;
  --space-m:   1.5rem;
  --space-l:   2.25rem;
  --space-xl:  3.5rem;
  --space-2xl: 5rem;
  --space-3xl: 7.5rem;

  /* Layout */
  --container: 74rem;
  --container-narrow: 46rem;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --header-h: 4.5rem;

  /* Forma y profundidad */
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --radius-pill: 999px;

  --shadow-s: 0 1px 2px rgb(24 18 12 / 0.06), 0 2px 6px rgb(24 18 12 / 0.05);
  --shadow-m: 0 4px 10px rgb(24 18 12 / 0.07), 0 12px 28px rgb(24 18 12 / 0.08);
  --shadow-l: 0 10px 24px rgb(24 18 12 / 0.10), 0 28px 60px rgb(24 18 12 / 0.14);

  /* Movimiento */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-back: cubic-bezier(0.34, 1.28, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 620ms;
}

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

* { margin: 0; }

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

body {
  min-height: 100svh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

button { background: none; border: 0; }

p,
li,
figcaption { text-wrap: pretty; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: var(--space-l);
}

::selection {
  background-color: var(--accent-400);
  color: #fff;
}

/* --------------------------------------------------------------------------
   3. Accesibilidad
   -------------------------------------------------------------------------- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent-400);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-s);
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background-color: var(--ink-900);
  color: var(--cream-50);
  border-radius: 0 0 var(--radius-m) var(--radius-m);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus-visible {
  top: 0;
  outline-offset: -4px;
}

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

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

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3.5rem, 8vw, var(--space-3xl)); }
.section--tight { padding-block: clamp(2.5rem, 5vw, var(--space-2xl)); }
.section--alt { background-color: var(--bg-alt); }

.section--inverse {
  background-color: var(--bg-inverse);
  color: var(--text-inverse);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--space-xs);
  color: var(--accent-500);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background-color: currentColor;
}

.section--inverse .eyebrow { color: var(--accent-300); }

.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--text-muted);
}

.section--inverse .lead { color: var(--cream-300); }

.text-center { text-align: center; }
.text-center .eyebrow::before { display: none; }

.flow > * + * { margin-top: var(--space-s); }
.flow-l > * + * { margin-top: var(--space-m); }

/* --------------------------------------------------------------------------
   5. Animaciones de entrada (progresivas: sin JS el contenido es visible)
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 1;
  transform: none;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.75rem);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@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;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
