/* ==========================================================================
   D'Martín Decoración — base.css
   Reset, design tokens, tipografía y utilidades
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

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

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

table { border-collapse: collapse; width: 100%; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* Tipografía */
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* Paleta — maderas nobles */
  --c-ink:        #1B1512;   /* Nogal muy oscuro — texto principal */
  --c-ink-soft:   #2E241D;   /* Fondos oscuros */
  --c-ink-warm:   #3D3025;

  --c-oak:        #B8823C;   /* Roble — color de marca */
  --c-oak-light:  #D6A768;
  --c-oak-pale:   #EBD4B0;
  --c-oak-dark:   #8E6229;

  /* Verde esmeralda — acento secundario.
     Se usa en marcas de verificación, estados de éxito y elementos
     destacados, para dar aire al marrón sin competir con él. */
  --c-esmeralda:       #0E7A5C;
  --c-esmeralda-light: #2FA680;   /* sobre fondos oscuros */
  --c-esmeralda-pale:  #DCF0E7;   /* fondos suaves */
  --c-esmeralda-dark:  #0A5942;

  --c-cream:      #FAF6F0;   /* Fondo general */
  --c-sand:       #F1E8DB;   /* Fondo alterno */
  --c-line:       #E4D8C6;   /* Bordes */
  --c-muted:      #6E6155;   /* Texto secundario */
  --c-white:      #FFFFFF;

  --c-success:    var(--c-esmeralda);
  --c-danger:     #A6402F;

  /* Espaciado */
  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: .75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Radios */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Sombras */
  --sh-sm: 0 1px 2px rgba(27, 21, 18, .06), 0 2px 6px rgba(27, 21, 18, .04);
  --sh-md: 0 4px 12px rgba(27, 21, 18, .08), 0 12px 32px rgba(27, 21, 18, .06);
  --sh-lg: 0 12px 28px rgba(27, 21, 18, .12), 0 32px 64px rgba(27, 21, 18, .10);

  /* Layout */
  --container: 1200px;
  --container-narrow: 820px;
  --header-h: 76px;

  /* Transiciones */
  --t-fast: 160ms cubic-bezier(.4, 0, .2, 1);
  --t-base: 280ms cubic-bezier(.4, 0, .2, 1);
  --t-slow: 520ms cubic-bezier(.16, 1, .3, 1);
}

/* --- Tipografía ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--c-ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; letter-spacing: -.01em; }

p { text-wrap: pretty; }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.7;
  color: var(--c-muted);
}

strong { font-weight: 600; }

/* Ojo tipográfico de sección */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-oak-dark);
  margin-bottom: var(--sp-3);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--c-oak);
  border-radius: 2px;
}

.eyebrow--light { color: var(--c-oak-light); }
.eyebrow--center { justify-content: center; }

/* Variante esmeralda, para destacar la especialidad de la casa.
   Usa el tono oscuro: el esmeralda medio no llega a AA sobre el fondo arena. */
.eyebrow--esmeralda { color: var(--c-esmeralda-dark); }
.eyebrow--esmeralda::before { background: var(--c-esmeralda); }
.eyebrow--esmeralda.eyebrow--light { color: var(--c-esmeralda-light); }
.eyebrow--esmeralda.eyebrow--light::before { background: var(--c-esmeralda-light); }

/* --- Utilidades ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

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

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--sand { background: var(--c-sand); }
.section--dark { background: var(--c-ink-soft); color: var(--c-cream); }
.section--dark h2,
.section--dark h3 { color: var(--c-white); }
.section--dark .lead { color: rgba(250, 246, 240, .74); }

.section-head { max-width: 680px; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }

.text-center { text-align: center; }
.text-oak { color: var(--c-oak); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }

.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: -100px;
  left: var(--sp-4);
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-ink);
  color: var(--c-white);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--t-fast);
}

.skip-link:focus { top: var(--sp-4); }

/* Divisor de veta de madera */
.wood-rule {
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--c-oak-dark) 0%, var(--c-oak) 22%, var(--c-oak-light) 46%,
    var(--c-oak) 70%, var(--c-oak-dark) 100%);
  opacity: .5;
}

/* --- Animación de aparición al hacer scroll ------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}

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

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
