/* ============================================================
   Dr. Camilo Tarazona — Cirugía Hepatobiliar
   Visual system: warm, authoritative private-practice medical
   ============================================================ */

:root {
  /* Brand palette */
  --forest: #2D3B18;   /* headings, dark sections */
  --olive:  #4A5D23;   /* primary actions, links */
  --olive-d:#3C4D1C;   /* hover */
  --gold:   #C9A05C;   /* accents, hairlines */
  --gold-d: #B58A45;
  --wine:   #8B2D3A;   /* subtle highlights */
  --cream:  #F7F5F0;   /* page background */
  --white:  #FFFFFF;   /* cards */
  --sand:   #EFEAE0;   /* alt panel / inputs */

  /* Typographic ink — warm near-blacks */
  --ink:    #2B2A23;
  --ink-2:  #5A574C;   /* secondary text */
  --ink-3:  #8B887C;   /* tertiary / captions */
  --hair:   #E2DCD0;   /* hairline borders */

  /* Fonts (tweakable) */
  --font-display: "Lora", Georgia, serif;
  --font-body: "Mulish", system-ui, sans-serif;

  /* Rhythm */
  --maxw: 1240px;
  --gutter: clamp(22px, 5vw, 80px);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(45,59,24,.05), 0 1px 2px rgba(45,59,24,.04);
  --shadow:    0 18px 50px -22px rgba(45,59,24,.30), 0 4px 16px -8px rgba(45,59,24,.14);
  --shadow-lg: 0 40px 90px -40px rgba(45,59,24,.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

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

/* Eyebrow / section index label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive);
}
.eyebrow::before {
  content: "";
  width: 30px; height: 1.5px;
  background: var(--gold);
}
.eyebrow .num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--gold-d);
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--olive);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 15px 26px;
  background: var(--bg);
  color: var(--fg);
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, background .25s;
  box-shadow: 0 10px 24px -12px rgba(74,93,35,.6);
}
.btn:hover { background: var(--olive-d); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(74,93,35,.7); }
.btn .wa { width: 19px; height: 19px; flex: none; }
.btn-ghost {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--hair);
  box-shadow: none;
}
.btn-ghost:hover { background: #fff; border-color: var(--gold); transform: translateY(-2px); }
.btn-gold { --bg: var(--gold-d); box-shadow: 0 10px 24px -12px rgba(181,138,69,.6); }
.btn-gold:hover { background: #a37c3c; }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--olive);
  font-weight: 600;
  border-bottom: 1.5px solid transparent;
  transition: border-color .2s, gap .2s;
  width: fit-content;
}
.textlink:hover { border-color: var(--gold); gap: 12px; }
.textlink .arr { transition: transform .25s; }
.textlink:hover .arr { transform: translateX(3px); }

/* ---------- Section scaffolding ---------- */
section { position: relative; }
.section-pad { padding-block: clamp(36px, 6vw, 80px); }
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  opacity: .5;
  max-width: var(--maxw);
  margin: 0 auto;
}

.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); line-height: 1.6; }

/* Leaf watermark motif */
.leaf-mark {
  position: absolute;
  pointer-events: none;
  opacity: .05;
  z-index: 0;
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s cubic-bezier(.2,.7,.3,1), transform .9s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
/* Failsafe: when JS detects a non-painting context (transitions frozen),
   force everything visible with no transition so content always paints. */
html.reveal-force .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce){ .reveal{opacity:1;transform:none;transition:none;} html{scroll-behavior:auto;} }

/* Image placeholder (striped) */
.ph {
  position: relative;
  background-color: var(--sand);
  background-image: repeating-linear-gradient(135deg, rgba(74,93,35,.06) 0 2px, transparent 2px 11px);
  border: 1px solid var(--hair);
  overflow: hidden;
  display: flex; align-items: flex-end;
}
.ph .ph-tag {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink-3);
  background: rgba(255,255,255,.82);
  padding: 6px 10px;
  margin: 12px;
  border-radius: 6px;
  border: 1px solid var(--hair);
}

/* ============================================================
   DENSITY PASS — tighten the rhythm between sections.
   Collapse doubled padding so back-to-back sections read as a
   single ~80px gap (not 160px), with 40px around dividers and
   the named transitions.
   ============================================================ */
.section-pad + .section-pad { padding-top: 0; }

/* 40px of breathing room on each side of a gold divider */
section.section-pad:has(+ .divider-gold) { padding-bottom: 40px; }
.divider-gold + section.section-pad { padding-top: 40px; }

/* Named transitions */
.stats + section.section-pad { padding-top: 40px; }   /* stats bar → 01 Quién soy (halved) */
#para-pacientes { padding-bottom: 40px; }              /* diagnosis cards → video section */
section:has(#vidGrid) { padding-bottom: 40px; }        /* video grid → 03 Contacto */

/* Eyebrow → heading: tight */
.eyebrow + h1,
.eyebrow + h2,
.eyebrow + h3 { margin-top: 10px !important; }

/* Mobile: dense, purposeful */
@media (max-width: 768px) {
  .section-pad { padding-block: 36px; }
  .section-pad + .section-pad { padding-top: 0; }
  section.section-pad:has(+ .divider-gold) { padding-bottom: 28px; }
  .divider-gold + section.section-pad { padding-top: 28px; }
  .stats + section.section-pad,
  #para-pacientes,
  section:has(#vidGrid) { padding-bottom: 28px; }
  .stats + section.section-pad { padding-top: 28px; }
}
