/* ============================================
   BALÚN — Café de Chiapas
   Editorial chiapaneco contemporáneo
   ============================================ */

:root {
  /* Paleta oficial */
  --cream: #F5F4F2;
  --black: #151515;
  --coffee: #1A120B;
  --green: #2F4B3C;
  --terracotta: #8B5E3C;
  --gold: #C9A24B;
  --warm-white: #FFFEFA;
  --divider: #D9D4CC;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "DM Sans", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --container: 1220px;
}

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

html { scroll-behavior: smooth; }

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

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.eyebrow.on-dark { color: var(--gold); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h2 { font-size: clamp(34px, 4.2vw, 52px); }
h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; }

p { color: #3A3733; }

.on-dark p { color: #D8D2C8; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 30px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.btn-solid {
  background: var(--warm-white);
  color: var(--coffee);
}
.btn-solid:hover { background: var(--gold); color: var(--black); transform: translateY(-2px); }

.btn-ghost {
  border-color: rgba(245,244,242,0.4);
  color: var(--warm-white);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--warm-white); background: rgba(245,244,242,0.08); transform: translateY(-2px); }

.btn-solid-dark {
  background: var(--coffee);
  color: var(--warm-white);
}
.btn-solid-dark:hover { background: var(--green); transform: translateY(-2px); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Nine-dot signature motif ---------- */
.dotgrid {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 24px;
  height: 24px;
}
.dotgrid span {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: currentColor;
}

.divider-dots {
  display: flex;
  justify-content: center;
  padding: 0;
  color: var(--divider);
}
.divider-dots .dotgrid { width: 30px; height: 30px; gap: 6px; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 40px;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.scrolled {
  background: rgba(245, 244, 242, 0.94);
  backdrop-filter: blur(8px);
  padding: 16px 40px;
  box-shadow: 0 1px 0 var(--divider);
}
.nav-logo { display: flex; align-items: center; gap: 12px; }
.nav-logo img { height: 26px; width: auto; filter: brightness(0) invert(1); transition: filter 0.5s var(--ease); }
.nav.scrolled .nav-logo img { filter: none; }
.nav-logo span {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  color: var(--warm-white);
  transition: color 0.5s var(--ease);
}
.nav.scrolled .nav-logo span { color: var(--black); }

.nav-links {
  display: flex;
  gap: 38px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm-white);
  opacity: 0.88;
  transition: color 0.5s var(--ease), opacity 0.3s;
  position: relative;
  padding-bottom: 4px;
}
.nav.scrolled .nav-links a { color: var(--black); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.35s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { opacity: 1; }

.nav-cta {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 22px;
  border: 1px solid rgba(245,244,242,0.5);
  border-radius: 3px;
  color: var(--warm-white);
  transition: all 0.4s var(--ease);
}
.nav.scrolled .nav-cta { border-color: var(--black); color: var(--black); }
.nav-cta:hover { background: var(--warm-white); color: var(--coffee); }
.nav.scrolled .nav-cta:hover { background: var(--black); color: var(--cream); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  background: var(--coffee);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0.56;
  transform: scale(1.08);
  animation: hero-settle 2.4s var(--ease) forwards;
}
@keyframes hero-settle {
  from { transform: scale(1.14); opacity: 0.2; }
  to { transform: scale(1.08); opacity: 0.56; }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(26,18,11,0.62) 0%, rgba(26,18,11,0.4) 26%, rgba(26,18,11,0.12) 48%, rgba(26,18,11,0) 66%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 40px 100px;
  max-width: var(--container);
  margin: 0 auto;
}
.hero-block { max-width: 650px; }

.hero h1 {
  font-size: clamp(39px, 6vw, 78px);
  color: var(--warm-white);
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 0.5s forwards;
}
.hero-sub {
  margin-top: 24px;
  max-width: 46ch;
  font-size: 17px;
  color: #D8D2C8;
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 0.75s forwards;
}
.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 1s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-solid-green {
  background: var(--green);
  color: var(--warm-white);
}
.btn-solid-green:hover { background: var(--gold); color: var(--black); transform: translateY(-2px); }

/* ============ SECTION SHARED ============ */
section { position: relative; }
.section-pad { padding: 130px 0; }
.section-pad--tight { padding: 100px 0; }
.section-head {
  max-width: 640px;
  margin-bottom: 64px;
}
.section-head .eyebrow { margin-bottom: 16px; display: block; }
.section-head p { margin-top: 20px; font-size: 17px; }
.section-head.centered { margin-left: auto; margin-right: auto; text-align: center; }

.on-dark { background: var(--coffee); color: var(--warm-white); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--warm-white); }

/* ============ LÍNEAS (products) ============ */
.lineas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}
.linea-card {
  background: var(--warm-white);
  border: 1px solid var(--divider);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.linea-figure {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--coffee);
}
.linea-figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.linea-card:hover .linea-figure img {
  transform: translateY(-4px);
  filter: brightness(1.05);
}
.linea-body {
  padding: 30px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.linea-accent {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 16px;
}
.linea-body .linea-name {
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 600;
  margin-bottom: 4px;
}
.linea-claim {
  font-size: 14px;
  font-style: italic;
  margin-bottom: 14px;
  font-family: var(--font-display);
}
.linea-desc { font-size: 14.5px; margin-bottom: 18px; }
.linea-datos {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6660;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  margin-top: auto;
  margin-bottom: 18px;
}
.linea-cta {
  width: 100%;
  justify-content: center;
  border: 1px solid var(--black);
  color: var(--black);
  background: transparent;
}
.linea-cta:hover { background: var(--black); color: var(--warm-white); }

.linea-card[data-line="clasico"] .linea-accent { background: var(--green); }
.linea-card[data-line="clasico"] .linea-claim { color: var(--green); }
.linea-card[data-line="intenso"] .linea-accent { background: var(--terracotta); }
.linea-card[data-line="intenso"] .linea-claim { color: var(--terracotta); }
.linea-card[data-line="maestro"] .linea-accent { background: var(--gold); }
.linea-card[data-line="maestro"] .linea-claim { color: #96771f; }

.lineas-more {
  margin-top: 60px;
  padding-top: 50px;
  border-top: 1px solid var(--divider);
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.lineas-more h3 { margin-bottom: 14px; }
.lineas-more p { margin-bottom: 26px; }

/* ============ ORIGEN ============ */
.origen {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 90px;
  align-items: center;
}
.origen-visual {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4/5;
}
.origen-visual img { width: 100%; height: 100%; object-fit: cover; }
.origen-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,18,11,0) 55%, rgba(26,18,11,0.5) 100%);
}
.origen-mark {
  position: absolute;
  bottom: 26px; left: 26px;
  z-index: 2;
  color: var(--warm-white);
}
.origen-mark .dotgrid { width: 38px; height: 38px; gap: 7px; margin-bottom: 10px; }
.origen-mark span.wordname { font-family: var(--font-display); font-size: 22px; display: block; }

.origen-text p { margin-bottom: 20px; font-size: 16px; }
.origen-text p:last-of-type { margin-bottom: 0; }
.origen-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--warm-white);
  margin: 30px 0;
  padding-left: 24px;
  border-left: 2px solid var(--gold);
}

/* ============ PROCESO ============ */
.proceso-intro { max-width: 640px; margin-bottom: 76px; }
.proceso-intro p { font-size: 16.5px; margin-top: 18px; }
.proceso-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 44px;
}
.proceso-item {
  display: flex;
  flex-direction: column;
}
.proceso-num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 500;
  color: var(--terracotta);
  line-height: 1;
  margin-bottom: 16px;
}
.proceso-item h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}
.proceso-item p { font-size: 14px; max-width: 32ch; }

.proceso-closing {
  margin-top: 60px;
  padding-top: 36px;
  border-top: 1px solid var(--divider);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--black);
}

/* ============ B2B ============ */
.b2b {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}
.b2b-visual { position: relative; overflow: hidden; min-height: 520px; }
.b2b-visual img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.b2b-text {
  background: var(--coffee);
  color: var(--warm-white);
  padding: 90px 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.b2b-text p { margin: 22px 0 34px; font-size: 16px; }
.b2b-list { list-style: none; margin-bottom: 36px; }
.b2b-list li {
  display: flex;
  gap: 12px;
  font-size: 14.5px;
  padding: 12px 0;
  border-top: 1px solid rgba(217,212,204,0.18);
  color: #D8D2C8;
}
.b2b-list li:last-child { border-bottom: 1px solid rgba(217,212,204,0.18); }
.b2b-list li::before { content: "—"; color: var(--gold); flex-shrink: 0; }

/* ============ GALERÍA EDITORIAL ============ */
.galeria-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: auto auto;
  gap: 24px;
}
.galeria-grid .g-tall { grid-row: 1 / 3; aspect-ratio: 3/4; overflow: hidden; border-radius: 4px; }
.galeria-grid .g-wide { aspect-ratio: 16/10; overflow: hidden; border-radius: 4px; }
.galeria-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.galeria-grid a:hover img { transform: scale(1.04); }
.galeria-grid > div, .galeria-grid > a { display: block; }

/* ============ FORMULARIO ============ */
.contacto {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 90px;
}
.contacto-info h2 { margin-bottom: 20px; }
.contacto-info p { font-size: 16px; margin-bottom: 30px; }
.contacto-meta { margin-top: 46px; }
.contacto-meta-item { padding: 18px 0; border-top: 1px solid var(--divider); }
.contacto-meta-item:last-child { border-bottom: 1px solid var(--divider); }
.contacto-meta-item b {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8580;
  font-weight: 600;
  margin-bottom: 5px;
}
.contacto-meta-item a, .contacto-meta-item span { font-size: 15.5px; }

.form {
  background: var(--warm-white);
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 46px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6660;
  margin-bottom: 8px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  padding: 10px 2px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--black);
  transition: border-color 0.35s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--terracotta);
}
.field textarea { resize: vertical; min-height: 90px; }
.field-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: #6b6660;
  margin: 22px 0 26px;
}
.field-check input { width: auto; margin-top: 3px; accent-color: var(--terracotta); }
.field-check a { text-decoration: underline; color: #6b6660; }
.form-note {
  font-size: 12px;
  color: #9a958e;
  margin-top: 16px;
}
.form-success {
  display: none;
  padding: 18px 20px;
  background: rgba(47,75,60,0.08);
  border: 1px solid var(--green);
  border-radius: 3px;
  font-size: 14px;
  color: var(--green);
  margin-bottom: 22px;
}
.form-success.show { display: block; }
.form-error {
  display: none;
  padding: 18px 20px;
  background: rgba(139,94,60,0.08);
  border: 1px solid var(--terracotta);
  border-radius: 3px;
  font-size: 14px;
  color: var(--terracotta);
  margin-bottom: 22px;
}
.form-error a { color: var(--terracotta); }
.form-error.show { display: block; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ============ FOOTER ============ */
.footer {
  background: var(--coffee);
  color: #D8D2C8;
  padding: 90px 0 30px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 50px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(217,212,204,0.15);
}
.footer-brand .nav-logo img { height: 28px; filter: brightness(0) invert(1); }
.footer-brand .nav-logo span { color: var(--warm-white); font-size: 22px; }
.footer-brand p { margin-top: 18px; font-size: 14px; max-width: 30ch; color: #A79E90; }
.footer-col h5 {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #A79E90;
  margin-bottom: 18px;
  font-weight: 600;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { font-size: 14.5px; color: #D8D2C8; transition: color 0.3s; }
.footer-col a:hover { color: var(--gold); }
.footer-ig { display: inline-flex; align-items: center; gap: 8px; }
.footer-ig svg { flex-shrink: 0; opacity: 0.85; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  font-size: 12.5px;
  color: #8A8177;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============ LEGAL PAGES ============ */
.legal-page { padding: 160px 0 120px; max-width: 780px; }
.legal-page h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 30px; }
.legal-page h2 { font-size: 20px; margin: 40px 0 14px; font-family: var(--font-body); font-weight: 600; }
.legal-page p, .legal-page li { font-size: 15px; margin-bottom: 14px; color: #3A3733; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin-bottom: 14px; }
.legal-page .placeholder { background: rgba(201,162,75,0.18); padding: 1px 6px; border-radius: 2px; }
.legal-back { display: inline-block; margin-bottom: 40px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--terracotta); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .lineas-grid { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .origen { grid-template-columns: 1fr; gap: 46px; }
  .origen-visual { max-width: 420px; }
  .proceso-list { grid-template-columns: repeat(2, 1fr); gap: 40px 30px; }
  .b2b { grid-template-columns: 1fr; }
  .b2b-visual { min-height: 340px; }
  .b2b-text { padding: 60px 40px; }
  .galeria-grid { grid-template-columns: 1fr; }
  .galeria-grid .g-tall { grid-row: auto; aspect-ratio: 4/3; }
  .contacto { grid-template-columns: 1fr; gap: 50px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px 30px; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 22px; }
  .nav { padding: 20px 22px; }
  .nav.scrolled { padding: 14px 22px; }
  .nav-links { display: none; }
  .hero-content { padding: 0 22px 70px; }
  .section-pad { padding: 90px 0; }
  .section-pad--tight { padding: 70px 0; }
  .form { padding: 30px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .proceso-list { grid-template-columns: 1fr; gap: 34px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .contacto-info p br { display: none; }
}
