/* ===========================================================
   Reino Cereza — hoja de estilos principal
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,ital@9..144,300..700,0..1;9..144,600,1&family=Public+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --cherry-950: #2a0d16;
  --cherry-900: #4a1220;
  --cherry-700: #7e1f34;
  --cherry-600: #9c2740;
  --cherry-500: #b83654;
  --ink-900: #1c1712;
  --ink-700: #3a332b;
  --ink-500: #6b6155;
  --stone-50: #f6f2ea;
  --stone-100: #efe9dd;
  --stone-200: #e2d9c8;
  --sage-600: #56624a;
  --sage-400: #7c8a6b;
  --gold-500: #b8893f;
  --gold-300: #d9b06a;
  --rule: rgba(28, 23, 18, 0.12);

  --paper: var(--stone-50);
  --paper-raised: #fffdf8;
  --text: var(--ink-900);
  --text-soft: var(--ink-500);
  --accent: var(--cherry-700);
  --accent-bright: var(--cherry-600);

  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Public Sans', ui-sans-serif, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

:root[data-theme="dark"] {
  --paper: #17130f;
  --paper-raised: #201a14;
  --text: #f1e9dc;
  --text-soft: #b4a794;
  --accent: #d9738c;
  --accent-bright: #e58ba0;
  --rule: rgba(241, 233, 220, 0.12);
  --gold-300: #e2bd80;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17130f;
    --paper-raised: #201a14;
    --text: #f1e9dc;
    --text-soft: #b4a794;
    --accent: #d9738c;
    --accent-bright: #e58ba0;
    --rule: rgba(241, 233, 220, 0.12);
    --gold-300: #e2bd80;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; color: var(--text); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s cubic-bezier(.16,.8,.24,1), transform 0.9s cubic-bezier(.16,.8,.24,1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.4rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--rule);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  color: var(--nav-ink, #fff);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.nav-logo em { font-style: italic; color: var(--gold-300); }
.site-nav.scrolled .nav-logo { color: var(--text); }

.nav-links {
  display: flex;
  gap: 2.1rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  font-size: 0.86rem;
  text-decoration: none;
  color: var(--nav-ink, rgba(255,255,255,0.86));
  position: relative;
  padding-bottom: 3px;
  transition: color 0.3s ease;
}
.site-nav.scrolled .nav-links a { color: var(--text-soft); }
.nav-links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--nav-ink, #fff); }
.site-nav.scrolled .nav-links a:hover { color: var(--accent); }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nav-ink, #fff);
  border: 1px solid color-mix(in srgb, var(--nav-ink, #fff) 45%, transparent);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: all 0.3s ease;
}
.site-nav.scrolled .nav-cta { color: var(--accent); border-color: var(--accent); }
.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: #fdf9f2;
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
  animation: hero-zoom 16s ease-out forwards;
}
@keyframes hero-zoom { to { transform: scale(1); } }
.hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,10,10,0.35) 0%, rgba(20,10,10,0.15) 35%, rgba(16,8,8,0.78) 100%);
}
.hero-inner {
  padding: 0 var(--gutter) 5.5rem;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 1.4rem;
  display: block;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 0.98;
  color: #fdf9f2;
  max-width: 15ch;
}
.hero h1 em { font-style: italic; font-weight: 300; color: var(--gold-300); }
.hero-sub {
  margin-top: 1.4rem;
  font-size: 1.08rem;
  max-width: 42ch;
  color: rgba(253,249,242,0.86);
}
.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(253,249,242,0.7);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
  border-right: 1px solid rgba(253,249,242,0.3);
  padding-right: 1.6rem;
}
.hero-meta b { color: #fdf9f2; font-size: 1.05rem; display: block; font-family: var(--font-display); font-weight: 600; }

.scroll-cue {
  position: absolute;
  bottom: 2rem; left: var(--gutter);
  display: flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(253,249,242,0.75);
}
.scroll-cue .line { width: 32px; height: 1px; background: rgba(253,249,242,0.6); position: relative; overflow: hidden; }
.scroll-cue .line::after {
  content: ''; position: absolute; top:0; left:-100%; width: 100%; height: 100%;
  background: var(--gold-300);
  animation: cue-slide 2.2s ease-in-out infinite;
}
@keyframes cue-slide { 0% { left: -100%; } 60%,100% { left: 100%; } }

/* ---------- Sections generic ---------- */
section { position: relative; }
.section-pad { padding: clamp(4.5rem, 9vw, 8rem) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(2rem, 4vw, 3.1rem); margin-top: 0.9rem; line-height: 1.06; }
.section-head p { font-size: 1.08rem; color: var(--text-soft); margin-top: 1.1rem; max-width: 56ch; }

/* ---------- Historia ---------- */
.historia { background: var(--paper); }
.story-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  margin-bottom: clamp(3.5rem, 7vw, 6rem);
}
.story-row:nth-child(even) .story-media { order: 2; }
.story-media { border-radius: 6px; overflow: hidden; aspect-ratio: 4/5; }
.story-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s cubic-bezier(.16,.8,.24,1); }
.story-media:hover img { transform: scale(1.06); }
.story-year {
  font-family: var(--font-mono);
  color: var(--gold-500);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.9rem;
}
.story-text h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin-bottom: 1rem; }
.story-text p { color: var(--text-soft); font-size: 1.02rem; max-width: 46ch; }

.timeline-strip {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--rule);
  padding-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.4rem;
}
.timeline-strip .t-item { border-left: 2px solid var(--accent); padding-left: 0.9rem; }
.timeline-strip .t-yr { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-size: 0.95rem; display: block; margin-bottom: 0.3rem; font-variant-numeric: tabular-nums; }
.timeline-strip .t-desc { font-size: 0.82rem; color: var(--text-soft); line-height: 1.45; }

/* ---------- El lugar ---------- */
.lugar {
  background: var(--ink-900);
  color: var(--stone-50);
}
:root[data-theme="light"] .lugar,
:root:not([data-theme="dark"]) .lugar { }
.lugar .eyebrow { color: var(--gold-300); }
.lugar .eyebrow::before { background: var(--gold-300); }
.lugar .section-head h2 { color: var(--stone-50); }
.lugar .section-head p { color: rgba(246,242,234,0.68); }
.lugar-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.lugar-media { border-radius: 6px; overflow: hidden; aspect-ratio: 16/11; }
.lugar-media img { width: 100%; height: 100%; object-fit: cover; }
.stat-list { display: grid; gap: 1.6rem; }
.stat { border-top: 1px solid rgba(246,242,234,0.18); padding-top: 1.1rem; }
.stat .num { font-family: var(--font-display); font-size: 2.4rem; color: var(--gold-300); line-height: 1; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 0.92rem; color: rgba(246,242,234,0.7); margin-top: 0.4rem; }

/* ---------- Producto ---------- */
.producto { background: var(--paper); }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.product-grid figure { margin: 0; border-radius: 6px; overflow: hidden; aspect-ratio: 3/4; }
.product-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.product-grid figure:hover img { transform: scale(1.05); }
.product-grid figure:nth-child(1) { grid-row: span 2; aspect-ratio: 3/5.3; }

.spec-bar {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.spec { padding: 1.5rem 1.4rem; border-right: 1px solid var(--rule); }
.spec:last-child { border-right: none; }
.spec .spec-lbl { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); display: block; margin-bottom: 0.5rem; }
.spec .spec-val { font-family: var(--font-display); font-size: 1.25rem; }

/* ---------- Alcance ---------- */
.alcance { background: var(--paper-raised); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
}
.market {
  padding: 1.8rem 1.6rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.market .m-region { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sage-600); }
.market .m-name { font-family: var(--font-display); font-size: 1.5rem; margin-top: 0.5rem; }
.market .m-yr { font-size: 0.82rem; color: var(--text-soft); margin-top: 0.3rem; font-family: var(--font-mono); }

/* ---------- Familia ---------- */
.familia { background: var(--paper); position: relative; overflow: hidden; }
.familia-layout { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.familia-media { border-radius: 6px; overflow: hidden; aspect-ratio: 3/4; }
.familia-media img { width: 100%; height: 100%; object-fit: cover; }
.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  line-height: 1.35;
  color: var(--text);
  max-width: 26ch;
}
.pull-quote::before { content: '“'; color: var(--accent); }
.pull-quote::after { content: '”'; color: var(--accent); }
.pq-attr { margin-top: 1.6rem; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-soft); }
.pq-attr b { color: var(--text); }
.familia-note { margin-top: 2rem; color: var(--text-soft); max-width: 48ch; }

/* ---------- Contacto ---------- */
.contacto {
  background: var(--ink-900);
  color: var(--stone-50);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.contacto-media { position: absolute; inset: 0; z-index: -1; opacity: 0.28; }
.contacto-media img { width: 100%; height: 100%; object-fit: cover; }
.contacto::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--ink-900) 0%, rgba(28,20,15,0.86) 60%, var(--ink-900) 100%);
}
.contacto .eyebrow { color: var(--gold-300); }
.contacto .eyebrow::before { background: var(--gold-300); }
.contacto .section-head h2 { color: var(--stone-50); }
.contacto .section-head p { color: rgba(246,242,234,0.7); }
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}
.contact-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.5rem; }
.field label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(246,242,234,0.65); }
.field input, .field select, .field textarea {
  background: rgba(246,242,234,0.06);
  border: 1px solid rgba(246,242,234,0.22);
  border-radius: 4px;
  color: var(--stone-50);
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.96rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-300);
  background: rgba(246,242,234,0.1);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

.btn-submit {
  margin-top: 0.4rem;
  justify-self: start;
  background: var(--accent-bright);
  color: #fff;
  border: none;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.btn-submit:hover { background: var(--gold-500); transform: translateY(-2px); }
.form-note { font-size: 0.8rem; color: rgba(246,242,234,0.55); margin-top: -0.2rem; }

.contact-alt { display: flex; flex-direction: column; justify-content: space-between; }
.wa-card {
  border: 1px solid rgba(246,242,234,0.22);
  border-radius: 8px;
  padding: 1.8rem;
}
.wa-card h3 { font-size: 1.3rem; color: var(--stone-50); margin-bottom: 0.6rem; }
.wa-card p { color: rgba(246,242,234,0.7); font-size: 0.94rem; margin: 0 0 1.4rem; }
.wa-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  background: #25D366;
  color: #08320f;
  font-weight: 600;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.wa-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

.direct-info { margin-top: 2rem; display: grid; gap: 0.9rem; font-size: 0.92rem; color: rgba(246,242,234,0.75); }
.direct-info div b { display: block; color: var(--stone-50); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }

.form-success {
  display: none;
  border: 1px solid var(--gold-300);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  font-size: 0.92rem;
  color: var(--gold-300);
}
.form-success.show { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 3rem 0 2rem;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--rule);
}
.footer-logo { font-family: var(--font-display); font-size: 1.4rem; }
.footer-logo em { font-style: italic; color: var(--accent); }
.footer-addr { font-size: 0.92rem; color: var(--text-soft); margin-top: 0.7rem; max-width: 30ch; }
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); margin-bottom: 0.9rem; font-weight: 600; }
.footer-col a { display: block; text-decoration: none; color: var(--text); font-size: 0.92rem; margin-bottom: 0.55rem; transition: color 0.25s ease; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-soft);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  bottom: 1.6rem; right: 1.6rem;
  z-index: 90;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.theme-toggle svg { width: 18px; height: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle {
    display: block;
    background: none; border: none;
    color: var(--nav-ink, #fff);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .site-nav.scrolled .nav-toggle { color: var(--text); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-meta { flex-direction: row; text-align: left; border-right: none; border-top: 1px solid rgba(253,249,242,0.3); padding-right: 0; padding-top: 1rem; gap: 1.6rem; flex-wrap: wrap; }
  .story-row, .story-row:nth-child(even) .story-media { grid-template-columns: 1fr; order: 0; }
  .story-row { grid-template-columns: 1fr; }
  .timeline-strip { grid-template-columns: repeat(2, 1fr); }
  .lugar-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid figure:nth-child(1) { grid-row: span 1; aspect-ratio: 3/4; }
  .spec-bar { grid-template-columns: repeat(2, 1fr); }
  .spec:nth-child(2) { border-right: none; }
  .familia-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-links { gap: 2rem; }
}
