/* ============================================================
   DE GELRE A JELDRES — Identidad visual
   Concepto: cartografía histórica + los tres ríos de Gelre.
   Paleta anclada en el subject: tinta de mapa antiguo, oro de
   documento, y el azul profundo del Rin. No es el "azul+dorado
   heráldico" genérico: el oro es cálido (pergamino) y el azul
   tiende a verdinegro fluvial.
   ============================================================ */

:root {
  /* Núcleo */
  --ink:        #14181f;   /* tinta casi negra, texto y fondos hondos */
  --river:      #1b3a4b;   /* azul-verdoso del Rin, color de marca */
  --river-deep: #0f2530;
  --gold:       #c9a24b;   /* oro de documento, cálido, no amarillo puro */
  --gold-soft:  #e6cd8f;
  --paper:      #f6f1e7;   /* pergamino */
  --paper-warm: #efe7d6;
  --white:      #ffffff;
  --muted:      #8a8375;   /* sepia apagado para metadatos */
  --text-body:  var(--text-body);   /* texto de cuerpo secundario sobre papel */
  --line:       #d8cdb6;   /* hairline sobre papel */
  --success:    #4a7c59;
  --danger:     #a4443b;

  --sans: 'Inter', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'IBM Plex Mono', monospace;

  --wrap: 1200px;
  --radius: 4px;         /* muy sutil: esto es cartografía, no fintech */
  --shadow: 0 8px 30px rgba(20,24,31,.12);
  --shadow-lg: 0 20px 60px rgba(20,24,31,.22);
  --t: .35s cubic-bezier(.2,.7,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-block;
}

/* ---------- Barra superior de anuncios ---------- */
.topstrip {
  background: var(--ink);
  color: var(--paper);
  font-size: .82rem;
  text-align: center;
  padding: 8px 16px;
  font-family: var(--mono);
  letter-spacing: .02em;
}
.topstrip a { color: var(--gold-soft); border-bottom: 1px solid transparent; transition: border-color var(--t); }
.topstrip a:hover { border-color: var(--gold-soft); }

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,241,231,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.brand .mark { font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; color: var(--gold); border: 1px solid var(--gold); padding: 3px 7px; border-radius: 3px; }

/* ---------- Logo: escudo + "J" que se dibuja al cargar ---------- */
.brand-logo { width: 28px; height: 33px; flex: none; overflow: visible; }
.brand-logo path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand-logo .logo-shield {
  stroke: var(--river); stroke-width: 2;
  stroke-dasharray: 160; stroke-dashoffset: 160;
  animation: draw-logo 1s .1s cubic-bezier(.4,0,.2,1) forwards;
}
.brand-logo .logo-j {
  stroke: var(--gold); stroke-width: 2.4;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw-logo .6s .85s cubic-bezier(.4,0,.2,1) forwards;
}
.brand-logo .logo-river {
  stroke: var(--river); stroke-width: 1.4; opacity: .7;
  stroke-dasharray: 16; stroke-dashoffset: 16;
  animation: draw-logo .35s ease forwards;
}
.brand-logo .r1 { animation-delay: 1.35s; }
.brand-logo .r2 { animation-delay: 1.48s; }
.brand-logo .r3 { animation-delay: 1.61s; }
@keyframes draw-logo { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .brand-logo path { animation: none !important; stroke-dashoffset: 0 !important; }
}
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-size: .92rem; font-weight: 500; position: relative; padding: 4px 0; transition: color var(--t); }
.nav-links a::after { content:''; position:absolute; left:0; bottom:-2px; width:0; height:2px; background: var(--gold); transition: width var(--t); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  background: var(--river); color: var(--paper);
  padding: 10px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem;
  transition: background var(--t), transform var(--t);
}
.nav-cta:hover { background: var(--river-deep); transform: translateY(-1px); }
.burger { display:none; flex-direction:column; gap:5px; cursor:pointer; background:none; border:none; }
.burger span { width:26px; height:2px; background: var(--ink); transition: var(--t); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--river-deep);
  color: var(--paper);
  overflow: hidden;
  padding: 120px 0 90px;
}
/* mapa de fondo, tenue, como marca de agua cartográfica */
.hero::before {
  content:''; position:absolute; inset:0;
  background: url('../img/mapa-gelre.jpg') center/cover;
  opacity: .10; filter: saturate(.4) contrast(1.1);
  mix-blend-mode: luminosity;
}
/* líneas fluviales SVG: se trazan solas al cargar, una tras otra */
.hero .river-line {
  stroke-dasharray: 1600; stroke-dashoffset: 1600;
  animation: draw-logo 1.4s .2s cubic-bezier(.4,0,.2,1) forwards;
}
.hero .river-line:nth-of-type(2) { animation-delay: .35s; }
.hero .river-line:nth-of-type(3) { animation-delay: .5s; }

.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); color: var(--white); margin: 18px 0 24px; }
.hero h1 .river-word { color: var(--gold-soft); font-style: italic; }
.hero .lede { font-size: 1.18rem; color: rgba(246,241,231,.82); max-width: 44ch; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* masthead: entrada escalonada al cargar, como una portada que se asienta */
.hero .eyebrow, .hero h1, .hero .lede, .hero .hero-actions, .hero .hero-stats {
  opacity: 0; transform: translateY(18px);
  animation: hero-fade-up .7s cubic-bezier(.2,.7,.2,1) forwards;
}
.hero .eyebrow { animation-delay: 0s; }
.hero h1 { animation-delay: .09s; }
.hero .lede { animation-delay: .18s; }
.hero .hero-actions { animation-delay: .27s; }
.hero .hero-stats { animation-delay: .36s; }
@keyframes hero-fade-up { to { opacity: 1; transform: translateY(0); } }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: var(--radius);
  font-weight: 600; font-size: .98rem; cursor: pointer; border: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-soft); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--paper); border: 1px solid rgba(246,241,231,.35); }
.btn-ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

.hero-book { position: relative; justify-self: center; }
.hero-book img { width: 300px; height: auto; border-radius: 6px; box-shadow: var(--shadow-lg); transform: rotate(-3deg); transition: transform var(--t); }
.hero-book img:hover { transform: rotate(0) scale(1.02); }
.hero-book .badge {
  position: absolute; bottom: -14px; right: -14px;
  background: var(--gold); color: var(--ink);
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  padding: 8px 14px; border-radius: 20px; box-shadow: var(--shadow);
  letter-spacing: .05em;
}

/* dato flotante sobre el hero: panel de vidrio con barrido de luz */
.hero-stats {
  position: relative; display: flex; gap: 40px;
  margin-top: 60px; padding: 26px 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 8px 32px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
}
.hero-stats::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 35%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.35) 45%, rgba(255,255,255,.06) 55%, transparent);
  transform: skewX(-20deg);
  animation: hero-sweep 5s 1.3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hero-sweep { 0% { left: -60%; } 22% { left: 130%; } 100% { left: 130%; } }
.hero-stat { position: relative; padding-right: 40px; border-right: 1px solid rgba(246,241,231,.15); }
.hero-stat:last-child { padding-right: 0; border-right: none; }
.hero-stat .n { font-family: var(--serif); font-size: 2.2rem; color: var(--gold-soft); font-weight: 600; }
.hero-stat .l { font-size: .82rem; color: rgba(246,241,231,.6); font-family: var(--mono); letter-spacing: .05em; }
@media (prefers-reduced-motion: reduce) {
  .hero-stats::after { animation: none; display: none; }
  .hero .river-line { animation: none !important; stroke-dashoffset: 0 !important; }
  .hero .eyebrow, .hero h1, .hero .lede, .hero .hero-actions, .hero .hero-stats {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
}

/* ---------- Secciones ---------- */
.section { padding: 90px 0; }
.section-tight { padding: 70px 0; }
#origen { padding: 120px 0; }
.section-head { max-width: 60ch; margin-bottom: 50px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 14px 0 18px; }
.section-head p { color: var(--text-body); font-size: 1.08rem; }
.section.alt { background: var(--paper-warm); }
.section.dark { background: var(--ink); color: var(--paper); }
.section.dark h2 { color: var(--white); }
.section.dark .section-head p { color: rgba(246,241,231,.7); }

/* ---------- Árbol del cromosoma Y ---------- */
.dna-label { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; color: var(--gold); margin-bottom: 20px; text-align: center; }
.dna-tree { display: inline-block; text-align: left; font-family: var(--mono); font-size: .9rem; }
.dna-node { padding: 6px 0; white-space: nowrap; }
.dna-root { color: rgba(246,241,231,.5); }
.dna-branch { border-left: 1px solid rgba(246,241,231,.2); margin-left: 10px; padding-left: 18px; }
.dna-reject { color: rgba(246,241,231,.35); }
.dna-reject em { font-style: italic; }
.dna-x { color: var(--danger); margin-left: 2px; }
.dna-confirm, .dna-final { color: var(--gold-soft); }
.dna-check { color: var(--gold-soft); margin-left: 2px; }

/* ---------- Timeline etimológico (signature) ---------- */
.etymo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 40px; position: relative; }
.etymo::before {
  content:''; position:absolute; top: 34px; left: 8%; right: 8%; height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--gold) 0 5px, transparent 5px 11px);
  opacity: .55;
}
.etymo-step { text-align: center; padding: 0 10px; position: relative; }
.etymo-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--gold); margin: 28px auto 18px; position: relative; z-index: 2; transition: transform var(--t), background var(--t); }
.etymo-step:hover .etymo-dot { transform: scale(1.4); background: var(--gold); }
.etymo-word { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--river); }
.etymo-word .etymo-hl { color: var(--gold); }
.etymo-lang { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.etymo-note { font-size: .82rem; color: var(--text-body); margin-top: 8px; }

/* ---------- Cards de contenido ---------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--river-deep); }
.card-img img {
  width:100%; height:100%; object-fit: cover;
  filter: grayscale(.45) sepia(.18) contrast(1.05);
  transition: transform .6s ease, filter .6s ease;
}
.card:hover .card-img img { transform: scale(1.05); filter: grayscale(0) sepia(0) contrast(1); }
.card-plate {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--paper);
  background: rgba(15,37,48,.75); padding: 5px 10px; border-radius: 2px;
}
.card-body { padding: 26px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.35rem; margin-bottom: 10px; }
.card-body p { color: var(--text-body); font-size: .96rem; flex: 1; }
.card-link { margin-top: 16px; font-family: var(--mono); font-size: .82rem; color: var(--river); font-weight: 600; letter-spacing: .03em; display: inline-flex; align-items: center; gap: 6px; }
.card-link::after { content:'→'; transition: transform var(--t); }
.card:hover .card-link::after { transform: translateX(4px); }

/* ---------- Cita documental ---------- */
.docquote {
  display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.docquote-img { height: 100%; min-height: 420px; background: var(--ink); }
.docquote-img img { width:100%; height:100%; object-fit: cover; }
.docquote-text { padding: 50px 50px 50px 0; }
.docquote blockquote { font-family: var(--serif); font-size: 1.6rem; font-style: italic; line-height: 1.4; color: var(--river); margin: 20px 0; }
.docquote cite { font-family: var(--mono); font-size: .82rem; color: var(--muted); font-style: normal; }

/* ---------- Carrusel publicidad ---------- */
.carousel { position: relative; overflow: hidden; border-radius: var(--radius); }
.carousel-track { display: flex; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.slide { min-width: 100%; position: relative; }
.slide a { display: block; position: relative; }
.slide img { width: 100%; aspect-ratio: 21/7; object-fit: cover; }
.slide img.fit-contain { object-fit: contain; object-position: 85% center; background: var(--river-deep); }
.slide-caption {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 8%; background: linear-gradient(90deg, rgba(15,37,48,.92) 0%, rgba(15,37,48,.4) 60%, transparent 100%);
  color: var(--paper);
}
.slide-caption .tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; color: var(--gold-soft); text-transform: uppercase; }
.slide-caption h3 { color: var(--white); font-size: clamp(1.4rem, 3vw, 2.2rem); margin: 8px 0; max-width: 20ch; }
.slide-caption p { max-width: 34ch; color: rgba(246,241,231,.85); margin-bottom: 16px; }
.slide-caption .btn-gold { align-self: flex-start; padding: 12px 24px; font-size: .9rem; }
.carousel-dots { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.carousel-dots button { width: 10px; height: 10px; border-radius: 50%; border: none; background: var(--line); cursor: pointer; transition: var(--t); padding: 0; }
.carousel-dots button.active { background: var(--gold); width: 28px; border-radius: 5px; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(246,241,231,.9); border: none; width: 46px; height: 46px; border-radius: 50%;
  cursor: pointer; font-size: 1.2rem; z-index: 3; transition: var(--t); display:flex; align-items:center; justify-content:center;
}
.carousel-arrow:hover { background: var(--gold); }
.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }
.ad-label { font-family: var(--mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .15em; text-align: center; margin-bottom: 12px; }

/* ---------- Bloque afiliados / recursos ---------- */
.resource { display: flex; gap: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: var(--t); }
.resource:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.resource-icon { width: 54px; height: 54px; flex-shrink: 0; border-radius: var(--radius); background: var(--river); color: var(--gold-soft); display:flex; align-items:center; justify-content:center; font-size: 1.5rem; }
.resource h4 { font-size: 1.1rem; font-family: var(--sans); font-weight: 700; margin-bottom: 4px; }
.resource p { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.resource .price { font-family: var(--mono); font-size: .82rem; color: var(--success); font-weight: 600; }
.aff-note { font-size: .72rem; color: var(--muted); font-style: italic; margin-top: 8px; }

/* ---------- MyHeritage CTA ---------- */
.mh-cta {
  background: linear-gradient(135deg, var(--river-deep), var(--river));
  color: var(--paper); border-radius: var(--radius); padding: 60px; text-align: center; position: relative; overflow: hidden;
}
.mh-rivers { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .22; }
.mh-cta > * { position: relative; }
.mh-cta h2 { color: var(--white); font-size: 2.4rem; margin-bottom: 16px; }
.mh-cta p { max-width: 52ch; margin: 0 auto 28px; color: rgba(246,241,231,.85); }

/* ---------- Newsletter ---------- */
.news-form { display: flex; gap: 12px; max-width: 480px; margin-top: 24px; }
.news-form input { flex:1; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--sans); font-size: .95rem; }
.news-form input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(246,241,231,.7); padding: 70px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 50px; }
.footer h4 { color: var(--paper); font-family: var(--sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 18px; }
.footer a { display: block; color: rgba(246,241,231,.6); font-size: .92rem; padding: 5px 0; transition: color var(--t); }
.footer a:hover { color: var(--gold-soft); }
.footer-brand p { font-size: .92rem; margin-top: 12px; max-width: 40ch; }
.footer-bottom { border-top: 3px double rgba(246,241,231,.22); padding-top: 24px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: .78rem; letter-spacing: .02em; color: rgba(246,241,231,.45); flex-wrap: wrap; gap: 10px; }
.footer-disclaimer { font-size: .74rem; color: rgba(246,241,231,.4); margin-top: 16px; line-height: 1.6; }

/* ---------- Artículo de blog ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.article-body { font-size: 1.12rem; line-height: 1.8; color: #2a2820; }
.article-body p { margin-bottom: 22px; }
.article-body h3 { font-size: 1.6rem; margin: 36px 0 16px; color: var(--river); }
.article-body blockquote { border-left: 3px solid var(--gold); padding: 8px 0 8px 24px; margin: 28px 0; font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--river); }
.article-body strong { color: var(--ink); }
.article-hero-img { width:100%; aspect-ratio:21/9; object-fit:cover; border-radius:var(--radius); margin-bottom:36px; }
.inline-ad { background:linear-gradient(135deg,var(--river-deep),var(--river)); color:var(--paper); padding:32px; border-radius:var(--radius); margin:40px 0; text-align:center; }
.inline-ad h4 { color:#fff; font-family:var(--sans); font-size:1.2rem; margin-bottom:8px; }
.inline-ad p { color:rgba(246,241,231,.8); font-size:.95rem; margin-bottom:16px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-book { order: -1; }
  .hero-book img { width: 220px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .docquote { grid-template-columns: 1fr; }
  .docquote-img { min-height: 260px; }
  .docquote-text { padding: 36px; }
  .etymo { grid-template-columns: 1fr 1fr; gap: 30px; }
  .etymo::before { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { position: fixed; inset: 68px 0 auto 0; background: var(--paper); flex-direction: column; padding: 24px; gap: 8px; border-bottom: 1px solid var(--line); transform: translateY(-150%); transition: transform var(--t); z-index: -1; box-shadow: var(--shadow); }
  .nav-links.open { transform: translateY(0); z-index: 99; }
  .nav-links.open { transform: none; }
  .burger { display: flex; }
  .news-form { flex-direction: column; }
  .mh-cta { padding: 40px 24px; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
}
@media (max-width: 520px) {
  .etymo { grid-template-columns: 1fr; }
  .slide img { aspect-ratio: 3/2; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
