/* ============ Tokens ============ */
:root {
  --night: #24161d;      /* fondo oscuro, ciruela profunda */
  --plum: #33202a;       /* superficies oscuras */
  --wax: #f3ece4;        /* cera / fondo claro */
  --paper: #fbf7f2;
  --flame: #e9b25a;      /* llama */
  --ember: #c8643c;      /* brasa */
  --mist: #b8a8b0;       /* texto secundario sobre oscuro */
  --ink: #2b1d24;        /* texto sobre claro */
  --ink-soft: #6b5a62;
  --wa: #25d366;

  --display: "Gilda Display", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 6px;
  --wrap: 1180px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--wax);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: .005em; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--flame); color: var(--night); padding: 8px 14px; z-index: 100; border-radius: 4px; }
.skip:focus { left: 8px; }

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

/* ============ Header ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100% - var(--wrap)) / 2));
  z-index: 50;
  transition: background .35s, box-shadow .35s;
}
.site-header.scrolled { background: rgba(36, 22, 29, .92); backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(243, 236, 228, .08); }
.brand { font-family: var(--display); font-size: 1.5rem; text-decoration: none; letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { text-decoration: none; font-size: .95rem; color: var(--wax); opacity: .82; transition: opacity .2s, color .2s; }
.nav a:hover { opacity: 1; color: var(--flame); }
.nav .nav-cta { opacity: 1; border: 1px solid rgba(233, 178, 90, .55); padding: 9px 18px; border-radius: 999px; color: var(--flame); }
.nav .nav-cta:hover { background: var(--flame); color: var(--night); }

.menu-btn { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--wax); transition: transform .3s, top .3s; }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 24px;
  padding: calc(var(--header-h) + 32px) max(24px, calc((100% - var(--wrap)) / 2)) 64px;
  background: var(--night);
  isolation: isolate;
}
.hero-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--gx, 72%) var(--gy, 48%), rgba(233, 178, 90, .26), rgba(200, 100, 60, .1) 45%, transparent 70%);
  transition: opacity .8s;
}
.hero.is-off .hero-glow { opacity: .05; }

.hero-kicker { color: var(--flame); font-size: 1rem; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 5.2rem); max-width: 14ch; margin-bottom: 26px; }
.hero-lead { max-width: 46ch; color: var(--mist); font-size: 1.15rem; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > *:nth-child(2) { animation-delay: .12s; }
.hero-copy > *:nth-child(3) { animation-delay: .24s; }
.hero-copy > *:nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.hero-candle { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.candle-btn { background: none; border: 0; padding: 12px; cursor: pointer; border-radius: 16px; }
.candle { width: min(300px, 62vw); height: auto; overflow: visible; filter: drop-shadow(0 0 60px rgba(233, 178, 90, .35)); transition: filter .8s; }
.flame { transform-origin: 120px 174px; animation: flicker 3.4s ease-in-out infinite; transition: opacity .6s, transform .6s; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  18% { transform: scale(.97, 1.04) rotate(-1.4deg); }
  37% { transform: scale(1.02, .97) rotate(1.2deg); }
  58% { transform: scale(.98, 1.05) rotate(-.8deg); }
  76% { transform: scale(1.01, .98) rotate(1deg); }
}
.hero.is-off .flame { opacity: 0; transform: scale(.2); animation: none; }
.hero.is-off .candle { filter: none; }
.candle-hint { font-size: .9rem; color: var(--mist); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 1rem/1 var(--body);
  padding: 16px 28px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--flame); color: var(--night); }
.btn-primary:hover { background: #f2c37c; }
.btn-ghost { border-color: rgba(243, 236, 228, .35); color: var(--wax); }
.btn-ghost:hover { border-color: var(--wax); }
.btn-wa { background: var(--wa); color: #0b2a17; justify-content: center; width: 100%; }
.btn-wa:hover { background: #3be07c; }

/* ============ Sections ============ */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section.light { background: var(--wax); color: var(--ink); }
.section.dark { background: var(--night); color: var(--wax); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-bottom: 16px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.dark .section-head p { color: var(--mist); }

/* ============ Gallery ============ */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filters button {
  font: 500 .95rem/1 var(--body); cursor: pointer;
  padding: 11px 20px; border-radius: 999px;
  background: transparent; color: var(--ink); border: 1px solid rgba(43, 29, 36, .25);
  transition: background .2s, color .2s, border-color .2s;
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--wax); border-color: var(--ink); }

.gallery { columns: 3 280px; column-gap: 20px; }
.card {
  display: block; width: 100%; break-inside: avoid; margin: 0 0 20px; padding: 0;
  position: relative; overflow: hidden; border: 0; border-radius: var(--radius);
  background: var(--plum); cursor: zoom-in; text-align: left;
  animation: cardIn .5s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.card img { width: 100%; height: auto; transition: transform .8s cubic-bezier(.2, .7, .2, 1), filter .5s; }
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(36, 22, 29, .88), transparent 55%);
  opacity: 0; transition: opacity .4s;
}
.card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; z-index: 1; color: var(--wax); transform: translateY(8px); opacity: 0; transition: opacity .4s, transform .4s; }
.card-info h3 { font-size: 1.35rem; margin-bottom: 4px; }
.card-info span { font-size: .9rem; color: var(--flame); }
.card:hover img, .card:focus-visible img { transform: scale(1.05); }
.card:hover::after, .card:focus-visible::after,
.card:hover .card-info, .card:focus-visible .card-info { opacity: 1; transform: none; }
@media (hover: none) {
  .card::after { opacity: 1; }
  .card-info { opacity: 1; transform: none; }
}

/* ============ Process ============ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid rgba(243, 236, 228, .15); }
.steps li { padding: 32px 28px 8px 0; position: relative; }
.steps li + li { padding-left: 28px; border-left: 1px solid rgba(243, 236, 228, .15); }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--flame); color: var(--night); font-family: var(--display); font-size: 1.15rem; margin-bottom: 20px; }
.steps h3 { font-size: 1.4rem; margin-bottom: 10px; }
.steps p { color: var(--mist); font-size: 1rem; }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.about-text h2 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: 24px; }
.about-text p { color: var(--ink-soft); margin-bottom: 18px; max-width: 56ch; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.facts li { padding-left: 22px; position: relative; font-weight: 500; }
.facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
.about-photo { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--plum); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-bottom: 20px; }
.contact-lead { color: var(--mist); max-width: 44ch; margin-bottom: 24px; }
.contact-direct a { color: var(--flame); }

.form { background: var(--plum); padding: clamp(24px, 4vw, 40px); border-radius: 10px; display: grid; gap: 20px; border: 1px solid rgba(243, 236, 228, .08); }
.form label { display: grid; gap: 8px; font-size: .95rem; color: var(--wax); }
.form input, .form select, .form textarea {
  font: inherit; color: var(--wax); background: var(--night);
  border: 1px solid rgba(243, 236, 228, .18); border-radius: var(--radius); padding: 13px 14px;
  transition: border-color .2s;
}
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(233, 178, 90, .2); }
.form-error { color: #ffb4a0; font-size: .95rem; }

/* ============ Footer ============ */
.site-footer { background: #1b1015; color: var(--mist); padding: 40px 0; font-size: .95rem; }
.footer-in { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; }
.footer-in .brand { color: var(--wax); font-size: 1.3rem; }

/* ============ WhatsApp flotante ============ */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--wa); color: #0b2a17; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: transform .25s;
}
.wa-float:hover { transform: scale(1.08); }

/* ============ Lightbox ============ */
.lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; color: var(--wax); }
.lightbox::backdrop { background: rgba(20, 11, 16, .94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; max-width: min(92vw, 1000px); text-align: center; }
.lightbox img { max-height: 78vh; width: auto; margin: 0 auto; border-radius: var(--radius); }
.lightbox figcaption { margin-top: 16px; font-family: var(--display); font-size: 1.3rem; }
.lightbox figcaption small { display: block; font-family: var(--body); font-size: .95rem; color: var(--mist); margin-top: 4px; }
.lb-close, .lb-nav { position: absolute; background: rgba(243, 236, 228, .08); border: 0; color: var(--wax); cursor: pointer; border-radius: 50%; width: 48px; height: 48px; font-size: 1.8rem; line-height: 1; transition: background .2s; }
.lb-close:hover, .lb-nav:hover { background: rgba(243, 236, 228, .2); }
.lb-close { top: 20px; right: 20px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: left; padding-top: calc(var(--header-h) + 24px); gap: 8px; }
  .hero-candle { order: -1; }
  .candle { width: min(190px, 46vw); }
  .hero h1 { max-width: 16ch; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(3) { border-left: 0; padding-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid rgba(243, 236, 228, .15); margin-top: 24px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 4 / 3; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(36, 22, 29, .97); padding: 8px 24px 24px;
    transform: translateY(-120%); transition: transform .35s ease; visibility: hidden;
  }
  .nav.open { transform: none; visibility: visible; }
  .nav a { padding: 16px 0; border-bottom: 1px solid rgba(243, 236, 228, .08); }
  .nav .nav-cta { margin-top: 16px; text-align: center; }
  .site-header.menu-open { background: var(--night); }
  .gallery { columns: 2 150px; column-gap: 12px; }
  .card { margin-bottom: 12px; }
  .card-info { padding: 12px; }
  .card-info h3 { font-size: 1.05rem; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding-left: 0; border-left: 0; }
  .steps li + li { border-top: 1px solid rgba(243, 236, 228, .15); margin-top: 24px; }
  .facts { grid-template-columns: 1fr; }
  .lb-nav { top: auto; bottom: 20px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
