/* ============================================================
   LUMORA Coffee Lab — main.css
   Variables · Reset · Global · Grain · Cursor · Progress · Buttons
   ============================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */

:root {
  /* FONDOS */
  --bg:         #0A0A0A;
  --bg-mid:     #141414;
  --bg-warm:    #120D07;
  --bg-vault:   #0C0C0C;
  --bg-lab:     #050505;
  --ivory:      #F0EDE8;
  --ivory-text: #1A1208;

  /* TEXTO */
  --text:       #F0EDE8;
  --text-muted: #8A8A8A;
  --text-dim:   #737373;

  /* ACENTO */
  --terracota:     #C4622A;
  --terracota-dim: rgba(196, 98, 42, 0.15);
  --separator:     rgba(240, 237, 232, 0.08);

  /* TIPOGRAFÍA */
  --font-main:   'Instrument Sans', sans-serif;
  --font-serif:  'EB Garamond', serif;
  --font-mono:   'DM Mono', monospace;
  --font-gothic: 'UnifrakturMaguntia', cursive;

  /* MOTION */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io:  cubic-bezier(0.77, 0, 0.175, 1);
  --fast:  150ms;
  --mid:   350ms;
  --slow:  600ms;

  /* RITMO DE SECCIONES — usar con padding-block o margin */
  --section-pad:    clamp(80px, 10vw, 140px);
  --section-pad-sm: clamp(48px, 6vw, 80px);
  --section-pad-lg: clamp(100px, 14vw, 180px);

  /* ANNOUNCEMENT BAR — altura dinámica (JS puede sobreescribir a 0px) */
  --ann-height: 36px;

  /* FOTOS DE PRODUCTORES — ILUSTRATIVAS · Reemplazar con fotos reales cuando estén disponibles */
  --producer-1-bg: url('https://images.pexels.com/photos/29799580/pexels-photo-29799580.jpeg?auto=compress&cs=tinysrgb&w=1200');  /* productor 1 — placeholder ilustrativo */
  --producer-2-bg: url('https://images.pexels.com/photos/36040338/pexels-photo-36040338.jpeg?auto=compress&cs=tinysrgb&w=1200');  /* productor 2 — placeholder ilustrativo */
  --producer-3-bg: url('https://images.pexels.com/photos/13802102/pexels-photo-13802102.jpeg?auto=compress&cs=tinysrgb&w=1200');  /* productor 3 — placeholder ilustrativo */
}

/* Cuando el usuario cerró el announcement bar */
html.ann-dismissed {
  --ann-height: 0px;
}


/* ── 2. RESET ─────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis maneja el scroll */
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* cursor custom activo en desktop */
}

body.home-redesign-ready {
  background: var(--bg);
}

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

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

ul,
ol {
  list-style: none;
}

button,
input,
textarea {
  font-family: var(--font-main);
  border: none;
  background: none;
  outline: none;
  appearance: none;
}

button {
  cursor: none;
}

::selection {
  background: var(--terracota);
  color: var(--bg);
}


/* ── 3. GRAIN TEXTURE ─────────────────────────────────────── */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9998;
}


/* ── 4. SCROLL PROGRESS BAR ───────────────────────────────── */

#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 100%;
  background: var(--terracota);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 9999;
  transition: transform 0.08s linear;
  pointer-events: none;
}


/* ── 5. CUSTOM CURSOR ─────────────────────────────────────── */

#cur-dot {
  position: fixed;
  top: -2.5px;
  left: -2.5px;
  width: 5px;
  height: 5px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
  opacity: 0; /* invisible hasta primer mousemove */
  transition: opacity var(--fast);
  mix-blend-mode: difference;
}

#cur-ring {
  position: fixed;
  top: -16px;
  left: -16px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  mix-blend-mode: difference;
  opacity: 0; /* invisible hasta primer mousemove */
  transition:
    width var(--mid) var(--ease-out),
    height var(--mid) var(--ease-out),
    border-color var(--mid) var(--ease-out),
    opacity var(--fast);
}

#cur-ring.expanded {
  width: 54px;
  height: 54px;
  border-color: rgba(255, 255, 255, 0.9);
}


/* ── 6. LANGUAGE TOGGLE ──────────────────────────────────── */

.nav-lang {
  background: none;
  border: 1px solid var(--separator);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-radius: 0;
  margin-left: 8px;
}
.nav-lang-btn {
  padding: 2px 5px;
  cursor: pointer;
  transition: color var(--fast);
}
.nav-lang-btn:hover { color: var(--text-muted); }
.nav-lang-btn.is-active {
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 768px) {
  .nav-lang { display: none; }
}


/* ── 7. BOTONES ───────────────────────────────────────────── */

/* Base compartida */
.btn-ghost,
.btn-outline,
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 0;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: none;
  transition:
    opacity var(--fast),
    color var(--fast),
    background var(--fast),
    border-color var(--fast),
    transform var(--mid) var(--ease-out);
  white-space: nowrap;
}

/* Ghost — solo texto + flecha, sin borde, sin fondo (90% de uso) */
.btn-ghost {
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
}

.btn-ghost:hover {
  color: var(--terracota);
}

/* Ghost en fondo claro / sobre fotos */
.btn-ghost.btn-ghost--light {
  color: var(--ivory);
}

.btn-ghost.btn-ghost--light:hover {
  color: var(--terracota);
}

/* Outline — secundario, borde blanco, hover blanco */
.btn-outline {
  padding: 10px 20px;
  border: 1px solid rgba(240,237,232,0.4);
  color: rgba(240,237,232,0.7);
  background: none;
}

.btn-outline:hover {
  border-color: var(--text);
  color: var(--text);
  background: rgba(240,237,232,0.05);
}

/* Solid — outline terracota, texto terracota, hover terracota */
.btn-solid {
  padding: 10px 20px;
  background: none;
  color: var(--terracota);
  border: 1px solid var(--terracota);
  font-weight: 400;
}

.btn-solid:hover {
  background: rgba(196,98,42,0.1);
}


/* ── 7. EYEBROW LABEL ─────────────────────────────────────── */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--terracota);
  text-transform: uppercase;
}


/* ── 8. UTILIDADES GLOBALES ───────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(24px, 5vw, 64px);
}

.section-pad {
  padding-block: clamp(80px, 10vw, 140px);
}

/* Separador horizontal */
.sep {
  width: 40px;
  height: 1px;
  background: rgba(196, 98, 42, 0.25);
  border: none;
  margin-block: 20px;
}


/* ── 9. MOBILE — cursor desactivado ───────────────────────── */

@media (max-width: 768px) {
  :root {
    --ann-height: 44px;
  }

  body {
    cursor: auto;
  }

  button {
    cursor: pointer;
  }

  .btn-ghost,
  .btn-outline,
  .btn-solid {
    cursor: pointer;
    min-height: 44px;
    justify-content: center;
  }

  .btn-ghost {
    padding-block: 12px;
  }

  #cur-dot,
  #cur-ring {
    display: none;
  }
}


/* ── Logo fallbacks (cuando assets/logos/ no existe aún) ── */

.pre-logo-fallback {
  display: none;   /* JS onerror lo muestra */
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--text);
}

/* Nav logo — defined in sections.css (.nav-logo img) */


/* ── Skip-to-content link (accessibility) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100000;
  padding: 8px 16px;
  background: var(--terracota);
  color: var(--bg);
  font-family: var(--font-main);
  font-size: 14px;
  text-decoration: none;
  border-radius: 0;
}
.skip-link:focus {
  top: 8px;
}

/* ── Structured data helper (oculto) ── */
.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;
}
