:root {
  --green: #053223;
  --green-mid: #0A6B47;
  --cream: #F5F1E8;
  --cream-deep: #EAE3D3;
  --ink: #111111;
  --ink-soft: #4A4A44;
  --line: rgba(5, 50, 35, 0.16);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 3px; }

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

/* Type */
.display {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(40px, 7.4vw, 104px);
  margin: 0;
  max-width: 14ch;
}
.display em {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.02;
  font-size: 1.04em;
  color: #CFE3D6;
  margin: 0.06em 0 0.04em;
}
.display-sm { font-size: clamp(34px, 5.4vw, 72px); max-width: 16ch; }
.h2 {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  font-size: clamp(30px, 4.2vw, 52px);
  color: var(--green);
  margin: 0 0 clamp(32px, 5vw, 56px);
  max-width: 18ch;
}
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; max-width: 34em; margin: 0; }
.fine { font-size: 14px; margin: 12px 0 0; opacity: 0.75; max-width: 30em; }

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 15px 26px;
  border-radius: 3px;
  transition: background-color .2s ease, color .2s ease;
}
.btn-cream { background: var(--cream); color: var(--green); }
.btn-cream:hover { background: #fff; }
.btn-ghost { border: 1px solid rgba(245, 241, 232, 0.35); color: var(--cream); padding: 10px 18px; font-size: 14px; }
.btn-ghost:hover { background: rgba(245, 241, 232, 0.1); }

/* Hero */
.hero {
  background: var(--green);
  color: var(--cream);
  padding-bottom: clamp(140px, 22vw, 300px);
}
.nav { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }
.wordmark {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 22px;
  text-decoration: none;
  color: var(--cream);
}
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; color: var(--cream); }
.brand-desc { font-size: 14px; font-weight: 500; color: rgba(245, 241, 232, 0.7); padding-left: 14px; border-left: 1px solid rgba(245, 241, 232, 0.25); line-height: 1.1; }
@media (max-width: 520px) { .brand { flex-direction: column; gap: 2px; } .brand-desc { font-size: 12px; padding-left: 0; border-left: 0; } }
.wordmark-sm { font-size: 18px; color: var(--green); }
.hero-body { padding-top: clamp(48px, 9vw, 120px); }
.hero-foot {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: end;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 32px;
  border-top: 1px solid rgba(245, 241, 232, 0.2);
}
.hero .display { font-size: clamp(40px, 6.6vw, 92px); max-width: 16ch; }
.hero .display em { font-size: 0.66em; max-width: 27ch; margin-top: 0.18em; }
@media (max-width: 520px) {
  .hero .display em { font-size: 0.82em; margin-top: 0.5em; line-height: 1.12; }
  .hero-body { padding-top: 56px; }
  .hero-foot { margin-top: 40px; padding-top: 28px; gap: 36px; }
  .hero-foot .lede { line-height: 1.6; }
  .filter { margin-top: 20px; }
  .fine { margin-top: 16px; }
}
.hero-foot .lede { color: rgba(245, 241, 232, 0.86); }
.filter { margin: 16px 0 0; font-size: 15px; color: rgba(245, 241, 232, 0.6); max-width: 34em; }

/* VSL: monta sobre el límite verde/crema */
.vsl { margin-top: calc(-1 * clamp(110px, 19vw, 260px)); }
.vsl-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(5, 50, 35, 0.55);
}
.vsl-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vsl-play {
  all: unset;
  position: absolute; inset: 0;
  cursor: pointer;
  display: grid; place-items: center;
}
.vsl-play:focus-visible { outline: 2px solid var(--cream); outline-offset: -6px; }
.vsl-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vsl-icon {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--green);
  display: grid; place-items: center;
  transition: transform .25s ease;
}
.vsl-icon svg { margin-left: 4px; }
.vsl-play:hover .vsl-icon { transform: scale(1.06); }
.vsl-frame.is-empty { background: linear-gradient(135deg, #0B3D2C, var(--ink)); }
.vsl-frame.is-empty::after {
  content: "Aquí va el VSL (agrega el ID de YouTube en CONFIG)";
  position: absolute; left: 0; right: 0; bottom: 20px;
  text-align: center; font-size: 13px; color: rgba(245, 241, 232, 0.55);
}
.vsl-progress {
  position: relative; height: 4px; margin-top: 14px;
  background: var(--line); border-radius: 2px; overflow: hidden;
  visibility: hidden; cursor: pointer;
}
.vsl-progress.is-active { visibility: visible; }
.vsl-progress::before { content: ""; position: absolute; inset: -10px 0; } /* área de clic más grande */
.vsl-progress-fill { display: block; height: 100%; width: 0; background: var(--green); transition: width .25s linear; }
.vsl-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 14px; }
.vsl-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--green);
  margin: 0;
}
.vsl-time { margin: 0; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Process */
.process { padding: clamp(96px, 12vw, 160px) 0 clamp(72px, 9vw, 120px); }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 2px solid var(--green);
}
.steps li { padding: 28px 32px 0 0; }
.steps li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.step-n { font-weight: 900; font-size: 15px; color: var(--green-mid); }
.steps h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 10px 0 10px; color: var(--green); }
.steps p { margin: 0; color: var(--ink-soft); max-width: 30em; }

/* Work: riel de historias */
.work { background: var(--cream-deep); padding: clamp(72px, 9vw, 120px) 0; overflow: hidden; }
.work .h2 { margin-bottom: 20px; }
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.work-head p { margin: 0; color: var(--ink-soft); font-size: 16px; max-width: 38em; }
.rail-nav { display: flex; gap: 8px; flex-shrink: 0; }
.rail-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(5, 50, 35, 0.3); background: transparent; color: var(--green);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.rail-btn:hover { background: var(--green); color: var(--cream); }
.rail {
  --card: clamp(200px, 21vw, 264px);
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--card);
  gap: clamp(12px, 1.6vw, 20px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) 8px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
}
.rail::-webkit-scrollbar { display: none; }
.rail:focus-visible { outline-offset: -2px; }
.story {
  all: unset; position: relative; cursor: pointer;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 10px;
}
.story:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 4px; border-radius: 10px; }
.story-img {
  width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block;
  border-radius: 10px; background: var(--green);
  box-shadow: 0 18px 40px -24px rgba(5, 50, 35, 0.6);
  transition: transform .3s ease;
}
.story:hover .story-img { transform: translateY(-4px); }
.is-missing {
  display: grid; place-items: center; text-align: center; padding: 16px;
  background: repeating-linear-gradient(135deg, #0A3A2A 0 14px, var(--green) 14px 28px);
  color: rgba(245, 241, 232, 0.6); font-size: 13px;
}
.story-brand { font-size: 14px; font-weight: 500; color: var(--green); display: flex; align-items: center; gap: 8px; }
.tag {
  display: inline-block;
  background: var(--cream); color: var(--green);
  border: 1px solid rgba(5, 50, 35, 0.2);
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 8px; border-radius: 2px; vertical-align: 1px;
}
.rail-hint { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--green); margin: 20px 0 0; }

/* Visor tipo historia */
.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 26, 18, 0.94);
  display: grid; place-items: center; padding: 16px;
}
.viewer[hidden] { display: none; }
.viewer-stage {
  position: relative; height: min(92vh, 860px); aspect-ratio: 9 / 16; max-width: 100%;
  border-radius: 12px; overflow: hidden; background: var(--green);
}
.viewer-media { position: absolute; inset: 0; }
.viewer-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer-bars { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 3; display: flex; gap: 4px; }
.bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(245, 241, 232, 0.35); overflow: hidden; position: relative; }
.bar.done { background: var(--cream); }
.bar.now::after {
  content: ""; position: absolute; inset: 0; background: var(--cream);
  transform-origin: left; animation: fill var(--dur, 0ms) linear forwards;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.viewer-head {
  position: absolute; top: 22px; left: 14px; right: 8px; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--cream); font-size: 14px; font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.viewer-close { all: unset; cursor: pointer; padding: 8px; display: grid; place-items: center; }
.viewer-close:focus-visible { outline: 2px solid var(--cream); border-radius: 50%; }
.viewer-hit { all: unset; position: absolute; top: 70px; bottom: 0; width: 40%; z-index: 2; cursor: pointer; }
.viewer-prev { left: 0; } .viewer-next { right: 0; width: 60%; }

/* Honest */
.honest { padding: clamp(80px, 10vw, 140px) 0; }
.nots { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); }
.nots dt {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(30px, 3.2vw, 40px); line-height: 1.05;
  color: var(--green);
  text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--green-mid);
}
.nots dd { margin: 14px 0 0; color: var(--ink-soft); max-width: 26em; }

/* Closer */
.closer { background: var(--green); color: var(--cream); padding: clamp(88px, 11vw, 150px) 0; }
.closer .lede { color: rgba(245, 241, 232, 0.86); margin: 24px 0 36px; }

/* Footer */
.footer { padding: 32px 0; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* Responsive */
@media (max-width: 860px) {
  .hero-foot { grid-template-columns: 1fr; gap: 28px; }
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .steps li, .steps li + li { padding: 24px 0; border-left: 0; border-top: 1px solid var(--line); }
  .steps li:first-child { border-top: 2px solid var(--green); }
  .work-head { flex-direction: column; align-items: flex-start; }
  .rail-nav { display: none; }
  .nots { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav .btn-ghost { padding: 9px 14px; font-size: 13px; }
  .vsl-icon { width: 64px; height: 64px; }
  .vsl-caption { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
