/* =================================================================
   TERRA OLEA — Sistema de diseño premium
   Dark luxury editorial · Concepto "Del olivar al plato"
   ================================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Color · base oscura */
  --c-ink:        #0E0F0B;   /* negro-oliva profundo (fondo)   */
  --c-ink-2:      #14160F;   /* superficie elevada             */
  --c-ink-3:      #1C1E15;   /* tarjetas                       */
  --c-line:       rgba(244, 239, 230, 0.10);
  --c-line-strong:rgba(244, 239, 230, 0.18);

  /* Color · texto */
  --c-cream:      #F4EFE6;   /* texto principal                */
  --c-cream-dim:  #C7C2B5;   /* texto secundario               */
  --c-muted:      #8A887C;   /* texto terciario                */

  /* Color · acento AOVE */
  --c-gold:       #C8A24A;   /* dorado aceite                  */
  --c-gold-2:     #E6C572;   /* dorado claro                   */
  --c-gold-soft:  rgba(200, 162, 74, 0.14);
  --c-olive:      #5A6B43;   /* verde oliva apagado            */
  --c-terra:      #B5663C;   /* terracota cordobesa (puntual)  */

  /* Gradientes */
  --grad-gold: linear-gradient(135deg, var(--c-gold-2), var(--c-gold));
  --grad-veil: linear-gradient(180deg, rgba(14,15,11,0) 0%, rgba(14,15,11,0.6) 60%, var(--c-ink) 100%);

  /* Tipografía */
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;

  /* Escala fluida (clamp) */
  --fs-hero:  clamp(3rem, 9vw, 8.5rem);
  --fs-h1:    clamp(2.4rem, 6vw, 5rem);
  --fs-h2:    clamp(1.9rem, 4vw, 3.4rem);
  --fs-h3:    clamp(1.3rem, 2.2vw, 1.9rem);
  --fs-lead:  clamp(1.05rem, 1.6vw, 1.35rem);
  --fs-body:  clamp(0.98rem, 1.1vw, 1.08rem);
  --fs-small: 0.85rem;
  --fs-eyebrow: 0.78rem;

  /* Espaciado */
  --space-section: clamp(5rem, 12vw, 11rem);
  --gutter: clamp(1.25rem, 5vw, 6rem);
  --maxw: 1320px;
  --maxw-text: 720px;

  /* Radios y sombras */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow-soft: 0 18px 50px -20px rgba(0,0,0,0.7);
  --shadow-card: 0 30px 80px -30px rgba(0,0,0,0.85);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--c-cream);
  background: var(--c-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--c-gold); color: var(--c-ink); }

/* Grano sutil de fondo cinematográfico */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 3. Tipografía ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.04; letter-spacing: -0.02em; }
.font-display { font-family: var(--font-display); }
.display-hero { font-size: var(--fs-hero); }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.lead { font-size: var(--fs-lead); color: var(--c-cream-dim); line-height: 1.6; }
em, .italic { font-style: italic; }
.text-gold { color: var(--c-gold-2); }
.text-dim { color: var(--c-cream-dim); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--c-gold);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.7rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--c-gold); opacity: 0.6;
}
.eyebrow.center::before { display: none; }

/* ---------- 4. Layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space-section); position: relative; }
.text-col { max-width: var(--maxw-text); }
.center { text-align: center; }
.center .text-col { margin-inline: auto; }
.divider { height: 1px; background: var(--c-line); border: 0; }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 3rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- 5. Botones ---------- */
.btn {
  --bg: var(--c-gold);
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.8rem;
  border-radius: var(--r-pill);
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--bg); color: var(--c-ink);
  position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -12px rgba(200,162,74,0.5); }
.btn:active { transform: translateY(-1px); }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent; color: var(--c-cream);
  border: 1px solid var(--c-line-strong);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--c-gold); color: var(--c-gold-2); box-shadow: none; }

/* Enlace con subrayado animado */
.link-u { position: relative; color: var(--c-cream); }
.link-u::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 100%;
  background: var(--c-gold); transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur) var(--ease);
}
.link-u:hover { color: var(--c-gold-2); }
.link-u:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 6. Navegación ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gutter);
  transition: background var(--dur) var(--ease), padding var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(14, 15, 11, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--c-line);
  padding-block: 0.75rem;
}
.nav__brand { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.04em; display: flex; align-items: center; gap: 0.55rem; white-space: nowrap; }
.nav__brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad-gold); box-shadow: 0 0 14px var(--c-gold); }
.nav__brand b { font-weight: 400; }
.nav__brand span { color: var(--c-gold-2); }
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a { font-size: 0.9rem; color: var(--c-cream-dim); letter-spacing: 0.02em; transition: color var(--dur) var(--ease); }
.nav__links a:hover, .nav__links a.active { color: var(--c-cream); }
.nav__right { display: flex; align-items: center; gap: 1.2rem; }

/* Conmutador de idioma */
.lang {
  display: flex; align-items: center; gap: 0.15rem;
  border: 1px solid var(--c-line-strong); border-radius: var(--r-pill); padding: 0.2rem;
  font-size: 0.78rem; font-weight: 600;
}
.lang button { padding: 0.3rem 0.65rem; border-radius: var(--r-pill); color: var(--c-muted); transition: all var(--dur) var(--ease); }
.lang button.active { background: var(--c-gold); color: var(--c-ink); }

/* Botón hamburguesa */
.nav__burger { display: none; flex-direction: column; gap: 5px; width: 28px; }
.nav__burger span { height: 1.5px; background: var(--c-cream); transition: all var(--dur) var(--ease); }

@media (max-width: 880px) {
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center;
    background: rgba(14,15,11,0.96); backdrop-filter: blur(20px);
    gap: 2rem; font-size: 1.4rem;
    transform: translateY(-100%); transition: transform var(--dur) var(--ease);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { font-family: var(--font-display); color: var(--c-cream); }
  .nav__burger { display: flex; z-index: 1001; }
  .nav__burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}
@media (max-width: 520px) {
  .nav { padding-inline: 1.1rem; }
  .nav__right { gap: 0.7rem; }
  .nav__right .btn { display: none; } /* CTA disponible dentro del menú y en secciones */
  .nav__brand { font-size: 1.2rem; }
}

/* ---------- 7. Tarjetas ---------- */
.card {
  background: var(--c-ink-3);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--c-line-strong); box-shadow: var(--shadow-card); }

.glass {
  background: rgba(244, 239, 230, 0.04);
  border: 1px solid var(--c-line-strong);
  backdrop-filter: blur(18px) saturate(130%);
  border-radius: var(--r-lg);
}

/* Imagen con overlay */
.media { position: relative; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.media:hover img { transform: scale(1.06); }
.media__veil { position: absolute; inset: 0; background: var(--grad-veil); }

/* ---------- 8. Insignias ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.95rem; border-radius: var(--r-pill);
  border: 1px solid var(--c-line-strong); background: var(--c-gold-soft);
  font-size: var(--fs-small); color: var(--c-gold-2); letter-spacing: 0.02em;
}
.badge .star { color: var(--c-gold); }

/* ---------- 9. Footer ---------- */
.footer { background: var(--c-ink-2); border-top: 1px solid var(--c-line); padding-block: clamp(3.5rem, 7vw, 6rem) 2.5rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.footer h4 { font-family: var(--font-body); font-size: var(--fs-eyebrow); letter-spacing: 0.2em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 1.2rem; }
.footer a { color: var(--c-cream-dim); transition: color var(--dur) var(--ease); }
.footer a:hover { color: var(--c-gold-2); }
.footer__bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 3.5rem; padding-top: 1.8rem; border-top: 1px solid var(--c-line); font-size: var(--fs-small); color: var(--c-muted); }

/* ---------- 10. Animaciones de entrada (revelados) ---------- */
[data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }

/* Texto revelado por líneas/palabras */
.reveal-text .word { display: inline-block; overflow: hidden; }
.reveal-text .word > span { display: inline-block; transform: translateY(110%); transition: transform 0.9s var(--ease-out); }
.reveal-text.in .word > span { transform: none; }

/* ---------- 11. Cursor custom ---------- */
.cursor { position: fixed; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--c-gold); pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); mix-blend-mode: difference; transition: width .3s var(--ease), height .3s var(--ease), background .3s; }
.cursor-ring { position: fixed; top: 0; left: 0; width: 38px; height: 38px; border: 1px solid var(--c-gold); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); opacity: 0.5; transition: width .35s var(--ease), height .35s var(--ease), opacity .35s; }
.cursor-ring.hover { width: 64px; height: 64px; opacity: 1; }
@media (hover: none), (max-width: 880px) { .cursor, .cursor-ring { display: none; } }

/* ---------- 12. Utilidades ---------- */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: 1rem; } .gap-2 { gap: 1.5rem; }
.wrap-narrow { max-width: 980px; }
[hidden] { display: none !important; }

/* ---------- 13. Scroll hint ---------- */
.scroll-hint { position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.7rem; font-size: var(--fs-eyebrow); letter-spacing: 0.25em; text-transform: uppercase; color: var(--c-muted); }
.scroll-hint .line { width: 1px; height: 46px; background: linear-gradient(var(--c-gold), transparent); position: relative; overflow: hidden; }
.scroll-hint .line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--c-gold-2); animation: scrolldot 2s var(--ease) infinite; }
@keyframes scrolldot { 0% { top: -50%; } 100% { top: 100%; } }

/* ---------- 14. Preloader ---------- */
.loader { position: fixed; inset: 0; z-index: 10000; background: var(--c-ink); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.5rem; transition: opacity 0.8s var(--ease), visibility 0.8s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader__mark { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: 0.06em; }
.loader__bar { width: min(220px, 60vw); height: 1px; background: var(--c-line-strong); overflow: hidden; }
.loader__bar i { display: block; height: 100%; width: 0; background: var(--grad-gold); transition: width 0.4s linear; }

/* ---------- 15. prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { 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-text .word > span { transform: none !important; }
  .scroll-hint .line::after { display: none; }
}
