/* ====================================================
   DESIGN SYSTEM — ¡QUE COCINE VALENTINA!
   Trattoria rural italiana · Villaviciosa, Asturias
   Paleta: naranja carpa (icono del local), azul cobalto
   mantel italiano, crema, terracota, dorado viejo.
==================================================== */

:root {
  /* === BASE / PAPEL === */
  --color-bg: #f6ecd6;              /* crema papel de cocina */
  --color-bg-alt: #eadcbe;          /* crema tostado */
  --color-bg-warm: #efd9b2;         /* ocre cálido */
  --color-bg-dark: #1a1410;         /* madera quemada */
  --color-bg-darker: #0d0805;       /* noche en la trattoria */

  --color-surface: #fbf4e3;         /* papel de receta */
  --color-surface-alt: #f2e5c9;     /* papel envejecido */

  /* === NARANJA VALENTINA (icono del local: carpa + delantal) === */
  --color-orange: #ed6a2b;          /* naranja carpa vibrante */
  --color-orange-light: #f68648;    /* naranja iluminado */
  --color-orange-dark: #c24a13;     /* naranja tostado */
  --color-orange-deep: #8f3208;     /* naranja fuego */
  --color-orange-rgb: 237, 106, 43;

  /* === AZUL COBALTO (mantel a cuadros italiano) === */
  --color-blue: #1e4a8a;            /* cobalto profundo */
  --color-blue-light: #2e66b5;      /* cobalto vivo */
  --color-blue-soft: #5d82b8;       /* azul lavado */
  --color-blue-rgb: 30, 74, 138;

  /* === TIERRA TOSCANA === */
  --color-primary: var(--color-orange);
  --color-primary-light: var(--color-orange-light);
  --color-primary-dark: var(--color-orange-dark);
  --color-primary-rgb: var(--color-orange-rgb);

  --color-terracotta: #8b3a1e;      /* barro de horno */
  --color-terracotta-light: #b55a32;

  /* === OLIVO === */
  --color-accent: #5f7038;          /* oliva joven */
  --color-accent-light: #8a9f56;    /* oliva brillante */
  --color-accent-dark: #3f4d1f;     /* oliva profundo */

  /* === DORADO VIEJO === */
  --color-gold: #d4a24a;            /* oro envejecido */
  --color-gold-light: #eac072;      /* oro luminoso */
  --color-gold-dark: #9a7328;       /* oro tostado */

  /* === ROJO VINO === */
  --color-wine: #5c1818;            /* chianti oscuro */
  --color-wine-light: #8b2d2d;

  /* === TEXTO === */
  --color-text: #261a10;            /* madera noble */
  --color-text-muted: #5e4a33;      /* sepia */
  --color-text-faded: #8a755a;      /* sepia claro */
  --color-text-light: #f6ecd6;      /* crema para fondos oscuros */
  --color-text-dim: #d7c59f;        /* crema oscurecida */

  /* === BORDES === */
  --color-border: rgba(90, 36, 16, 0.14);
  --color-border-dark: rgba(246, 236, 214, 0.15);
  --color-border-gold: rgba(212, 162, 74, 0.4);
  --color-border-orange: rgba(237, 106, 43, 0.35);

  /* === OVERLAYS === */
  --color-overlay-dark: rgba(26, 20, 16, 0.65);
  --color-overlay-warm: rgba(237, 106, 43, 0.1);
  --color-overlay-cream: rgba(246, 236, 214, 0.92);

  /* === TIPOGRAFÍA === */
  --font-heading: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Dancing Script', cursive;
  --font-italic: 'Playfair Display', 'Cormorant Garamond', serif;

  --text-xs: clamp(0.72rem, 0.78vw, 0.82rem);
  --text-sm: clamp(0.82rem, 0.92vw, 0.92rem);
  --text-base: clamp(0.98rem, 1.05vw, 1.12rem);
  --text-lg: clamp(1.1rem, 1.3vw, 1.3rem);
  --text-xl: clamp(1.3rem, 1.8vw, 1.65rem);
  --text-2xl: clamp(1.7rem, 2.6vw, 2.4rem);
  --text-3xl: clamp(2.1rem, 3.6vw, 3.2rem);
  --text-4xl: clamp(2.6rem, 5vw, 4.4rem);
  --text-5xl: clamp(3.2rem, 6.5vw, 5.8rem);
  --text-hero: clamp(3.5rem, 10vw, 9.5rem);

  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.55;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.16em;
  --tracking-widest: 0.28em;

  /* === SPACING === */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;
  --section-padding: clamp(5rem, 12vh, 9rem);
  --section-padding-sm: clamp(3rem, 8vh, 6rem);

  /* === LAYOUT === */
  --container-max: 1400px;
  --container-narrow: 880px;
  --container-wide: 1600px;
  --container-text: 680px;
  --border-radius: 4px;
  --border-radius-lg: 14px;
  --border-radius-xl: 24px;
  --border-radius-full: 999px;

  /* === SOMBRAS === */
  --shadow-sm: 0 2px 8px rgba(44, 31, 22, 0.08);
  --shadow-md: 0 12px 32px rgba(44, 31, 22, 0.14);
  --shadow-lg: 0 25px 60px rgba(44, 31, 22, 0.2);
  --shadow-xl: 0 40px 100px rgba(44, 31, 22, 0.28);
  --shadow-warm: 0 15px 40px rgba(237, 106, 43, 0.22);
  --shadow-orange: 0 0 50px rgba(237, 106, 43, 0.35);
  --shadow-gold: 0 0 40px rgba(212, 162, 74, 0.28);
  --shadow-inset: inset 0 2px 8px rgba(44, 31, 22, 0.08);

  /* === TRANSICIONES === */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow: cubic-bezier(0.7, 0, 0.3, 1);
  --duration-fast: 0.25s;
  --duration-normal: 0.5s;
  --duration-slow: 0.9s;
  --duration-slower: 1.4s;

  /* === Z-INDEX === */
  --z-behind: -1;
  --z-default: 1;
  --z-above: 10;
  --z-nav: 100;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-loader: 9999;
  --z-cursor: 10000;

  /* === EFECTOS === */
  --blur-sm: 4px;
  --blur-md: 12px;
  --blur-lg: 24px;
  --blur-xl: 48px;

  --vh: 1vh;
  --dvh: 1dvh;

  /* === PATRÓN MANTEL ITALIANO (cuadros azul/blanco) === */
  --pattern-mantel: repeating-conic-gradient(
    var(--color-blue) 0% 25%,
    transparent 0% 50%
  ) 0 0 / 18px 18px;
}

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* === TIPOGRAFÍA === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-5xl); font-weight: 500; }
h2 { font-size: var(--text-4xl); font-weight: 500; }
h3 { font-size: var(--text-3xl); font-weight: 500; }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* === TEXTURA DE PAPEL (sutil) === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-behind);
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.15 0 0 0 0 0.1 0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* === SELECCIÓN === */
::selection {
  background: var(--color-orange);
  color: var(--color-text-light);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
}
::-webkit-scrollbar-thumb {
  background: var(--color-orange);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-orange-dark);
}

/* === UTILIDADES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.italic-accent {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-orange);
}

.hand-note {
  font-family: var(--font-hand);
  color: var(--color-orange);
  font-size: 1.4em;
  line-height: 1;
}

.gold-text { color: var(--color-gold); }
.orange-text { color: var(--color-orange); }
.blue-text { color: var(--color-blue); }

.uppercase-spaced {
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--text-xs);
}

/* === PATRÓN MANTEL (utilizable como fondo) === */
.mantel-check {
  background-image:
    linear-gradient(45deg, rgba(30, 74, 138, 0.14) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(30, 74, 138, 0.14) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(30, 74, 138, 0.14) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(30, 74, 138, 0.14) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0px;
}

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