/* Landing Empaque App: fuentes locales, sin dependencias. Comparte hooks con main.js */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-var.woff2") format("woff2"); font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* Paleta: azul marino + marfil + bronce */
:root {
  --paper: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F0EEE7;
  --ink: #13233A;
  --ink-soft: #44526A;
  --ink-faint: #6B778A;
  --line: #E2DFD6;
  --accent: #B8924A;
  --accent-deep: #8A6A2B;
  --accent-soft: #F3EBDA;
  --btn-bg: #13233A;
  --btn-ink: #FFFFFF;
  --btn-hover: #1E3556;
  --brand-bg: #13233A;
  --brand-fg: #F2F0EA;
  --brand-filter: invert(1);
  --band: #13233A;
  --band-ink: #F2F0EA;
  --band-soft: #AEB8C8;
  --band-line: rgba(242,240,234,.14);
  --shadow: 0 1px 2px rgba(19,35,58,.05), 0 18px 40px -18px rgba(19,35,58,.25);

  --f-display: "Archivo", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-3: clamp(1.7rem, 1.25rem + 1.8vw, 2.4rem);
  --step-4: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem);
  --wrap: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1520; --surface: #142030; --surface-2: #1A283A; --ink: #EEF0F3; --ink-soft: #B5BECB; --ink-faint: #8792A3;
    --line: #26354A; --accent: #C9A45A; --accent-deep: #D8B66E; --accent-soft: #2C2617;
    --btn-bg: #C9A45A; --btn-ink: #0D1520; --btn-hover: #D8B66E; --brand-bg: #C9A45A; --brand-fg: #0D1520; --brand-filter: none;
    --band: #08101A; --band-ink: #EEF0F3; --band-soft: #9AA6B8; --band-line: rgba(238,240,243,.12);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1520; --surface: #142030; --surface-2: #1A283A; --ink: #EEF0F3; --ink-soft: #B5BECB; --ink-faint: #8792A3;
  --line: #26354A; --accent: #C9A45A; --accent-deep: #D8B66E; --accent-soft: #2C2617;
  --btn-bg: #C9A45A; --btn-ink: #0D1520; --btn-hover: #D8B66E; --brand-bg: #C9A45A; --brand-fg: #0D1520; --brand-filter: none;
  --band: #08101A; --band-ink: #EEF0F3; --band-soft: #9AA6B8; --band-line: rgba(238,240,243,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: var(--step-0); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--wrap); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

h1, h2, h3 { font-family: var(--f-display); font-weight: 650; text-wrap: balance; margin: 0; line-height: 1.12; letter-spacing: -.015em; }
p { margin: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: var(--step--1); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-deep);
}
.eyebrow::before { content: ""; width: 24px; height: 1.5px; background: currentColor; }
.lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 60ch; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--f-body); font-weight: 600; font-size: .95rem; letter-spacing: .01em;
  padding: .85rem 1.4rem; border-radius: 8px; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-faint); }

/* Header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); transition: box-shadow .2s ease;
}
.top.scrolled { box-shadow: 0 6px 24px -16px rgba(19,35,58,.4); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .85rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
/* Ícono negro (assets/images/eco-packaging.png) sobre cuadrado de color; --brand-filter lo pasa a claro en modo claro */
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--brand-bg); }
.brand-mark img { width: 20px; height: 20px; filter: var(--brand-filter); }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.nav { display: none; gap: 2rem; font-weight: 500; color: var(--ink-soft); font-size: .93rem; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 7px; }
@media (min-width: 900px) { .nav { display: flex; } }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.top .btn { padding: .6rem 1rem; font-size: .88rem; }
.menu-toggle {
  display: inline-grid; place-content: center; gap: 4px; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-nav { border-top: 1px solid var(--line); background: var(--paper); }
.mobile-nav .wrap { display: grid; padding-block: .5rem 1rem; }
.mobile-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; }
.mobile-nav a:last-child { border-bottom: 0; }
@media (max-width: 479px) { .top .btn-primary { display: none; } }
@media (min-width: 900px) { .menu-toggle, .mobile-nav { display: none !important; } }
[id] { scroll-margin-top: 80px; }

/* Hero */
.hero { padding-block: clamp(3rem, 7vw, 6rem); }
.hero-grid { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }
.hero-copy { display: grid; gap: 1.5rem; min-width: 0; }
.hero h1 { font-size: var(--step-4); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; padding-top: .25rem; }

/* Foto del hero + tarjeta resumen superpuesta */
.hero-visual { position: relative; min-width: 0; }
.hero-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.hero-visual .summary { position: relative; margin: -3.5rem 12px 0; }
@media (min-width: 980px) {
  .hero-visual { padding-bottom: 2.5rem; }
  .hero-photo { width: 76%; margin-left: auto; aspect-ratio: 4 / 5; max-height: 560px; }
  .hero-visual .summary { position: absolute; left: 0; bottom: 0; width: min(370px, 74%); margin: 0; }
}

/* Tarjeta resumen (hero) */
.summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 1.75rem); display: grid; gap: 1.25rem; min-width: 0;
}
.summary-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.summary-head b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.k { display: block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); }
.status {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .65rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent-deep);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kpi { background: var(--surface); padding: .9rem 1rem; display: grid; gap: .3rem; align-content: start; min-width: 0; }
.kpi .v { font-size: clamp(1.05rem, 2.6vw, 1.35rem); font-weight: 500; overflow-wrap: anywhere; }
.bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: .2rem; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.summary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .9rem; }
.summary-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: .6rem; align-items: center; color: var(--ink-soft); }
.summary-list svg { width: 16px; height: 16px; color: var(--accent-deep); }
.summary-list b { font-size: .85rem; font-weight: 500; color: var(--ink); }

/* Franja */
.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip .wrap { padding-block: 1.1rem; }
.strip p { font-size: .92rem; color: var(--ink-faint); text-align: center; }

/* Secciones */
section.block { padding-block: clamp(4rem, 9vw, 7rem); }
.head { display: grid; gap: 1rem; margin-bottom: clamp(2.25rem, 4vw, 3.25rem); max-width: 760px; }
.head h2 { font-size: var(--step-3); }

/* Soluciones */
.solutions { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
@media (min-width: 760px) { .solutions { grid-template-columns: 1fr 1fr; } }
.sol { background: var(--surface); padding: clamp(1.5rem, 3vw, 2.25rem); display: grid; gap: .75rem; align-content: start; min-width: 0; }
.sol .n { font-family: var(--f-mono); font-size: .8rem; color: var(--accent-deep); }
.sol .problem { font-size: .9rem; color: var(--ink-faint); font-style: italic; padding-bottom: .75rem; border-bottom: 1px dashed var(--line); }
.sol h3 { font-size: 1.3rem; }
.sol p:last-child { color: var(--ink-soft); }

/* Banda de foto */
.photo-band { padding-bottom: clamp(4rem, 9vw, 7rem); }
.photo-frame { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.photo-frame img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
@media (min-width: 760px) { .photo-frame img { aspect-ratio: 1800 / 760; max-height: 420px; } }
/* Velo azul marino que cubre toda la foto: casi sólido a la izquierda (donde va el texto) y se abre hacia la derecha */
.photo-frame figcaption {
  position: absolute; inset: 0; display: grid; gap: .6rem; align-content: end;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  background:
    linear-gradient(to top, rgba(13,21,32,.75), rgba(13,21,32,0) 60%),
    linear-gradient(to right, rgba(13,21,32,.92), rgba(13,21,32,.7) 45%, rgba(13,21,32,.1) 80%);
  color: #FFFFFF;
}
@media (max-width: 759px) { .photo-frame figcaption { background: rgba(13,21,32,.72); } }
.photo-frame .eyebrow { color: #E9C987; }
.photo-frame figcaption p {
  font-family: var(--f-display); font-weight: 650; font-size: clamp(1.3rem, 1rem + 1.4vw, 2.1rem); line-height: 1.2;
  max-width: 24ch; text-wrap: balance; text-shadow: 0 1px 12px rgba(0,0,0,.45);
}

/* Beneficios (banda) */
.band { background: var(--band); color: var(--band-ink); }
.band .eyebrow { color: var(--accent); }
.benefits { display: grid; gap: 0; }
@media (min-width: 640px) { .benefits { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .benefits { grid-template-columns: repeat(4, 1fr); } }
.benefits div { padding: 1.5rem 0; border-top: 1px solid var(--band-line); display: grid; gap: .5rem; align-content: start; }
@media (min-width: 640px) { .benefits div { padding: 1.75rem 1.5rem 1.75rem 0; } }
.benefits h3 { font-size: 1.25rem; }
.benefits h3::before { content: ""; display: block; width: 28px; height: 2px; background: var(--accent); margin-bottom: 1rem; }
.benefits p { color: var(--band-soft); font-size: .95rem; }

/* Implementación: foto + texto y pasos */
/* La foto no define la altura: se estira (absolute) a lo que ocupan los pasos y se recorta con object-fit */
.impl { display: grid; gap: clamp(1rem, 3vw, 1.5rem); }
@media (min-width: 960px) { .impl { grid-template-columns: .8fr 1.2fr; align-items: stretch; } }
.impl-media { position: relative; min-height: 220px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.impl-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; counter-reset: step; }
.steps li {
  counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.4rem;
  display: grid; grid-template-columns: 36px 1fr; column-gap: 1rem; row-gap: .3rem; align-content: start;
}
.steps li::before {
  content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent-deep); font-family: var(--f-display); font-weight: 600;
}
.steps h3 { font-size: 1.2rem; }
.steps p { color: var(--ink-soft); font-size: .95rem; }

/* Contacto */
.contact-section { background: var(--surface-2); border-top: 1px solid var(--line); }
.cta-grid { display: grid; gap: 2.5rem; }
@media (min-width: 940px) { .cta-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.cta-copy { display: grid; gap: 1.25rem; }
.cta-copy h2 { font-size: var(--step-3); }
.checks { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .7rem; color: var(--ink-soft); }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: .6rem; }
.checks svg { width: 18px; height: 18px; color: var(--accent-deep); margin-top: 4px; }
form.contact { display: grid; gap: 1.1rem; padding: clamp(1.25rem, 3vw, 2rem); border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fields { display: grid; gap: 1rem; }
@media (min-width: 560px) { .fields { grid-template-columns: 1fr 1fr; } .fields .full { grid-column: 1 / -1; } }
.field { display: grid; gap: .35rem; min-width: 0; }
.field label { font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: .7rem .8rem; width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.form-note { font-size: .85rem; color: var(--ink-faint); }

/* Footer */
footer { background: var(--band); color: var(--band-soft); }
footer .wrap { display: grid; gap: 1.5rem; padding-block: 2.5rem; font-size: .88rem; }
@media (min-width: 760px) { footer .wrap { grid-template-columns: 1fr auto; align-items: end; } }
.foot-brand { display: grid; gap: .3rem; }
.foot-brand .brand-name { color: var(--band-ink); }
.foot-meta { display: grid; gap: .4rem; }
@media (min-width: 760px) { .foot-meta { justify-items: end; text-align: right; } }
.powered { text-decoration: none; color: var(--band-soft); }
.powered b { color: var(--accent); font-weight: 600; }
.powered:hover b { text-decoration: underline; text-underline-offset: 4px; }

/* Aparición al scrollear: solo con JS y sin "reducir movimiento" */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; translate: 0 16px; transition: opacity .6s ease, translate .6s cubic-bezier(.2,.7,.2,1); }
  .js .reveal.in { opacity: 1; translate: 0 0; }
  .js .solutions .reveal:nth-child(2n) { transition-delay: .08s; }
  .js .bar i { transition: width 1.1s .5s cubic-bezier(.2,.7,.2,1); }
  .js .bar.pending i { width: 0 !important; }
}

/* Botón flotante de WhatsApp */
.wa-float {
  position: fixed; z-index: 30;
  right: max(16px, env(safe-area-inset-right, 0px) + 16px);
  bottom: max(16px, env(safe-area-inset-bottom, 0px) + 16px);
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(13,21,32,.28);
  transition: transform .2s ease, box-shadow .2s ease;
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(13,21,32,.34); }
.wa-float:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
