/* ============================================================
   Barbatelli Abogado — sistema visual
   Paleta: burdeos editorial sobre crema, serif + sans + mono
   ============================================================ */

:root {
  --ink: #201a17;
  --ink-soft: #4a4038;
  --paper: #FBFAF7;
  --paper-alt: #F3EEE7;
  --line: #E4DACD;
  --burgundy: #7A2E2E;
  --burgundy-deep: #5C2222;
  --burgundy-soft: #9C4A44;
  --gold: #B98A3E;
  --shadow-sm: 0 1px 2px rgba(32, 26, 23, 0.06);
  --shadow-md: 0 8px 24px rgba(32, 26, 23, 0.08);
  --shadow-lg: 0 24px 64px rgba(32, 26, 23, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font-serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
body > * { position: relative; z-index: 2; }

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border: 1px solid rgba(122,46,46,0.28);
  border-radius: 4px;
  background: rgba(122,46,46,0.05);
  font-size: 11px;
  letter-spacing: 0.03em;
}
.contact-section .eyebrow-num {
  border-color: rgba(251,250,247,0.3);
  background: rgba(251,250,247,0.08);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--burgundy);
  color: var(--paper);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--burgundy);
  transition: transform .35s var(--ease), background .25s ease, box-shadow .35s var(--ease);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.btn:hover { background: var(--burgundy-deep); border-color: var(--burgundy-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  color: var(--burgundy);
  border: 1px solid var(--burgundy);
}
.btn-ghost:hover { background: var(--burgundy); color: var(--paper); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark { color: var(--burgundy); flex-shrink: 0; }
.wordmark .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--burgundy);
  margin-left: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.main-nav { display: flex; gap: 34px; }
.main-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--burgundy);
  transition: right .3s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  margin: 0 auto;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------------- Hero ---------------- */
.hero {
  padding: 92px 0 96px;
  background:
    radial-gradient(700px 420px at 82% -10%, rgba(122,46,46,0.08), transparent 65%),
    radial-gradient(rgba(122,46,46,0.14) 1px, transparent 1px) 0 0/28px 28px,
    var(--paper);
}
.hero .eyebrow { font-size: 13px; }
.hero h1 {
  font-size: clamp(36px, 5.2vw, 58px);
  line-height: 1.1;
  max-width: 15.5ch;
  margin-bottom: 22px;
  letter-spacing: -0.015em;
}
.hero .lede {
  font-size: 17.5px;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-bottom: 32px;
}
.hero .lede strong { color: var(--ink); font-weight: 600; }

[data-hero-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-hero-reveal].is-visible { opacity: 1; transform: translateY(0); }

.chart-card {
  margin-top: 56px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-md);
  max-width: 820px;
}
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 6px;
}
.chart-head h2 { font-size: 17px; font-weight: 600; }
.legend { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend .l1 i { background: var(--burgundy); }
.legend .l2 i { background: #C9BBA6; }

.scroll-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  margin: 4px 0 8px;
}
.chart-scroll { overflow-x: auto; }
#gap-chart { width: 100%; min-width: 560px; height: auto; display: block; margin-top: 8px; }

.grid-lines line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; opacity: 0.7; }
.axis-line { stroke: var(--line); stroke-width: 1.5; }
.gap-fill { stroke: none; opacity: 0; transition: opacity .8s ease .9s; }
.chart-card.is-visible .gap-fill { opacity: 1; }
.grad-stop-a { stop-color: var(--burgundy); stop-opacity: 0.16; }
.grad-stop-b { stop-color: var(--burgundy); stop-opacity: 0; }
.tick-label { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-soft); }
.gap-label { font-family: var(--font-mono); font-size: 12px; fill: var(--burgundy-soft); letter-spacing: 0.04em; }

.chart-dots .dot {
  fill: var(--paper);
  stroke: var(--burgundy);
  stroke-width: 2;
  opacity: 0;
  transition: opacity .4s ease;
}
.chart-card.is-visible .chart-dots .dot { opacity: 1; transition-delay: 1.3s; }
.dot-last { fill: var(--burgundy); }
@media (prefers-reduced-motion: no-preference) {
  .chart-card.is-visible .dot-last {
    animation: dot-pulse 2.2s ease-out 1.6s infinite;
  }
}
@keyframes dot-pulse {
  0% { filter: drop-shadow(0 0 0 rgba(122,46,46,0.5)); }
  70% { filter: drop-shadow(0 0 8px rgba(122,46,46,0)); }
  100% { filter: drop-shadow(0 0 0 rgba(122,46,46,0)); }
}

.line-drawable {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.line-ipc { stroke: #C9BBA6; }
.line-cuota { stroke: var(--burgundy); }
.chart-card.is-visible .line-drawable { stroke-dashoffset: 0; }
.chart-card.is-visible .line-ipc { transition-delay: .05s; }
.chart-card.is-visible .line-cuota { transition-delay: .35s; }

.chart-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ---------------- Sections ---------------- */
main section { padding: 92px 0; }
main section.alt { background: var(--paper-alt); }

.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.25; }

.section-media {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.section-media .prose p { color: var(--ink-soft); font-size: 16px; margin-bottom: 18px; }
.section-media .prose p:last-child { margin-bottom: 0; }
.section-media .prose strong { color: var(--ink); font-weight: 600; }

.section-media figure {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.section-media figure img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.section-media figure:hover img { transform: scale(1.035); }

/* En secciones .alt el fondo es mas oscuro y la sombra estandar se nota menos;
   se refuerza para que ambas fotos se vean con el mismo peso visual. */
section.alt .section-media figure {
  box-shadow: 0 30px 70px rgba(32, 26, 23, 0.24);
}

.section-media figure.duotone img { filter: grayscale(1) contrast(1.08) brightness(1.02); }
.section-media figure.duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--burgundy) 0%, #2c1111 100%);
  mix-blend-mode: color;
  opacity: 0.82;
  pointer-events: none;
}
.media-credit {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--paper);
}
.media-credit a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Calculadora ---------------- */
.calc-intro {
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 68ch;
}

.calc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 36px;
  max-width: 620px;
}

.calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
.calc-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 0 4px 0 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.calc-input-wrap:focus-within {
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(122,46,46,0.1);
}
.calc-input-wrap span {
  font-family: var(--font-sans);
  color: var(--ink-soft);
  font-size: 15px;
}
.calc-input-wrap input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  padding: 12px 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
.calc-input-wrap input::-webkit-outer-spin-button,
.calc-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input-wrap input[type="number"] { -moz-appearance: textfield; }
.calc-input-wrap:has(.input-error) { border-color: var(--burgundy); }

.calc-btn { width: 100%; justify-content: center; }

.calc-result {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
.calc-result[hidden] { display: none; }
.calc-result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.calc-result-row strong { color: var(--ink); font-family: var(--font-serif); font-size: 18px; flex-shrink: 0; }
.calc-result-highlight {
  background: rgba(122,46,46,0.06);
  border: 1px solid rgba(122,46,46,0.18);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.calc-result-highlight strong { color: var(--burgundy); font-size: 22px; }
.calc-result-highlight.calc-result-neutral {
  background: rgba(74,64,56,0.05);
  border-color: var(--line);
}
.calc-result-highlight.calc-result-neutral strong { color: var(--ink-soft); font-size: 16px; }
.calc-footnote { font-size: 12.5px; color: var(--ink-soft); }
.calc-cta { margin-top: 6px; justify-content: center; width: 100%; }

.calc-disclaimer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.calc-disclaimer strong { color: var(--ink); }

/* ---------------- Steps ---------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.step {
  position: relative;
  background: var(--paper);
  padding: 34px 26px;
  overflow: hidden;
  transition: background .3s ease;
}
.step::before {
  content: attr(data-n);
  position: absolute;
  top: -0.28em;
  right: 6px;
  font-family: var(--font-serif);
  font-size: 88px;
  font-weight: 600;
  color: var(--burgundy);
  opacity: 0.05;
  line-height: 1;
  pointer-events: none;
  transition: opacity .3s ease;
}
.step:hover { background: #fff; }
.step:hover::before { opacity: 0.09; }
.step .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--burgundy);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.step h3 { font-size: 17px; margin-bottom: 10px; }
.step p { font-size: 14.5px; color: var(--ink-soft); position: relative; }

.step {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease), background .3s ease, transform .6s var(--ease);
}
.steps.is-visible .step { opacity: 1; transform: translateY(0); }
.steps.is-visible .step:nth-child(1) { transition-delay: .05s; }
.steps.is-visible .step:nth-child(2) { transition-delay: .15s; }
.steps.is-visible .step:nth-child(3) { transition-delay: .25s; }
.steps.is-visible .step:nth-child(4) { transition-delay: .35s; }

/* ---------------- Criteria ---------------- */
.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.criteria-grid > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: opacity .7s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.criteria-grid > div:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.criteria-grid > div:nth-child(2) { transition-delay: .1s; }
.criteria-grid h3 { font-size: 16.5px; margin-bottom: 18px; }
.criteria-grid ul { display: grid; gap: 13px; }
.criteria-grid li {
  font-size: 14.5px;
  color: var(--ink-soft);
  padding-left: 22px;
  position: relative;
}
.criteria-grid li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--burgundy);
  opacity: 0.55;
}
.fine-note {
  margin-top: 32px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 70ch;
}

/* ---------------- Contact ---------------- */
.contact-section {
  background: var(--burgundy);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.contact-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 320px at 90% 0%, rgba(255,255,255,0.08), transparent 70%);
  pointer-events: none;
}
.contact-section .eyebrow { color: var(--gold); }
.contact-section h2 { color: var(--paper); font-size: clamp(24px, 3vw, 34px); max-width: 20ch; }
.contact-top { height: 8px; }

.contact-grid {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(251,250,247,0.18);
  padding-top: 36px;
}
.contact-details {
  font-size: 15px;
  line-height: 1.85;
  color: rgba(251,250,247,0.88);
}
.contact-details .name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 6px;
}
.contact-whatsapp {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.contact-whatsapp img {
  width: 128px;
  height: 128px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  flex-shrink: 0;
}
.contact-whatsapp p {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(251,250,247,0.85);
  letter-spacing: 0.02em;
}
.contact-section .btn { background: var(--paper); color: var(--burgundy); border-color: var(--paper); }
.contact-section .btn:hover { background: transparent; color: var(--paper); }
.contact-section .btn-ghost { background: transparent; color: var(--paper); border-color: rgba(251,250,247,0.5); }
.contact-section .btn-ghost:hover { background: var(--paper); color: var(--burgundy); }

/* ---------------- Footer ---------------- */
footer {
  background: var(--ink);
  color: rgba(251,250,247,0.6);
  padding: 36px 0;
  border-top: 1px solid rgba(185,138,62,0.25);
}
footer .wrap { display: flex; flex-direction: column; gap: 6px; }
.disclaimer { font-size: 12px; max-width: 78ch; }
footer p { font-size: 12px; }

/* ---------------- Reveal animation ---------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ---------------- Responsive ---------------- */
@media (max-width: 920px) {
  .section-media { grid-template-columns: 1fr; }
  .section-media figure { order: -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .criteria-grid { grid-template-columns: 1fr; }
  .scroll-hint { display: block; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn { display: none; }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 78px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 28px 20px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav.is-open a:last-child { border-bottom: none; }

  .steps { grid-template-columns: 1fr; }
  main section { padding: 68px 0; }
  .chart-card { padding: 20px 18px 16px; }
  .contact-grid { align-items: flex-start; }
  .calc-card { padding: 24px 20px; }
  .calc-inputs { grid-template-columns: 1fr; }
}
