/* ==========================================================================
   BARBERÍA GHIL — MAIN STYLESHEET & DESIGN TOKENS
   ========================================================================== */

:root {
  /* Paleta de Identidad Visual */
  --color-black: #0B0C0D;
  --color-charcoal: #151719;
  --color-surface: #1D2023;
  --color-surface-elevated: #24282C;

  --color-cream: #F4EFE7;
  --color-white: #FFFFFF;

  --color-gold: #C9A96E;
  --color-gold-light: #E0C28E;
  --color-bronze: #8F6841;

  --color-gray: #A7A8AA;
  --color-gray-soft: #D8D8D8;

  --color-success: #71866F;
  --color-error: #D46A5E;

  /* Gradientes Moderados */
  --gradient-dark: linear-gradient(135deg, #0B0C0D 0%, #191B1E 60%, #25211B 100%);
  --gradient-gold: linear-gradient(135deg, #A77D48 0%, #E1C38D 50%, #B68A53 100%);
  --gradient-surface: linear-gradient(180deg, rgba(29, 32, 35, 0.92) 0%, rgba(21, 23, 25, 0.98) 100%);

  /* Bordes y Líneas Finas */
  --border-subtle: rgba(244, 239, 231, 0.08);
  --border-gold: rgba(201, 169, 110, 0.32);
  --border-gold-strong: rgba(201, 169, 110, 0.65);

  /* Tipografías */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Contenedor y Dimensiones */
  --container: 1200px;
  --header-height: 84px;

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Espaciado */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 6rem;

  /* Sombras */
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, 0.58);
  --shadow-gold: 0 10px 28px rgba(201, 169, 110, 0.22);

  /* Transiciones */
  --transition-fast: 180ms ease;
  --transition-normal: 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-slow: 550ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==========================================================================
   RESET Y BASE
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  background-color: var(--color-black);
  color: var(--color-cream);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-cream);
  background-color: var(--color-black);
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Textura arquitectónica extremadamente ligera */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: radial-gradient(rgba(244, 239, 231, 0.7) 0.75px, transparent 0.75px);
  background-size: 24px 24px;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
}

main {
  flex: 1;
  position: relative;
  z-index: 2;
}

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

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

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
}

::selection {
  background-color: rgba(201, 169, 110, 0.3);
  color: var(--color-white);
}

/* Foco visible accesible */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* Skip link para accesibilidad de teclado */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--gradient-gold);
  color: var(--color-black);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   JERARQUÍA TIPOGRÁFICA
   ========================================================================== */

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4 {
  font-family: var(--font-heading);
  color: var(--color-cream);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1,
.h1 {
  font-size: clamp(2.35rem, 4.6vw + 0.8rem, 4.35rem);
  line-height: 1.08;
}

h2,
.h2 {
  font-size: clamp(1.85rem, 3.2vw + 0.5rem, 3rem);
  line-height: 1.14;
}

h3,
.h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.65rem);
  line-height: 1.25;
}

h4,
.h4 {
  font-size: 1.15rem;
  line-height: 1.35;
}

p {
  color: var(--color-gray-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.lead {
  font-size: clamp(1.05rem, 1.1vw + 0.6rem, 1.22rem);
  color: var(--color-gray-soft);
  line-height: 1.75;
}

small,
.text-small {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-gray);
}

.caption {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-gold);
}

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

.text-gold-gradient {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-italic {
  font-style: italic;
  font-weight: 400;
}

/* ==========================================================================
   CONTAINER Y ESTRUCTURA DE SECCIONES
   ========================================================================== */

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-xl);
  position: relative;
}

.section--charcoal {
  background-color: var(--color-charcoal);
}

.section--gradient {
  background: var(--gradient-dark);
}

.section--bordered {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* Cabeceras de sección con numeración editorial */
.section-header {
  max-width: 720px;
  margin-bottom: var(--space-lg);
}

.section-header--center {
  margin-inline: auto;
  text-align: center;
}

.section-header--split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
}

.section-header--split .section-header__copy {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.9rem;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gradient-gold);
  display: inline-block;
}

.section-header--center .eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gradient-gold);
  display: inline-block;
}

.section-number {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-gold-light);
  opacity: 0.85;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--color-gray);
  font-size: 1.05rem;
}

/* Separador decorativo sutil */
.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-block: var(--space-md);
  color: var(--color-gold);
  opacity: 0.65;
}

.divider-ornament::before,
.divider-ornament::after {
  content: "";
  height: 1px;
  width: min(140px, 28vw);
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.divider-ornament__diamond {
  width: 7px;
  height: 7px;
  background: var(--color-gold);
  transform: rotate(45deg);
}

/* ==========================================================================
   SISTEMA DE GRIDS REUTILIZABLES
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ==========================================================================
   ANIMACIONES DE SCROLL (IntersectionObserver)
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity 580ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 580ms cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal="fade-up"] {
  transform: translateY(26px);
}

[data-reveal="fade-left"] {
  transform: translateX(-28px);
}

[data-reveal="fade-right"] {
  transform: translateX(28px);
}

[data-reveal="scale"] {
  transform: scale(0.96);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* ==========================================================================
   REDUCED MOTION (Accesibilidad)
   ========================================================================== */

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