/* ============================================================
   GRUPO MAGJOSE — "El Prospecto Confidencial" (v3)
   Editorial noir · Newsreader + Archivo + IBM Plex Mono
   base.css — tokens, temas, tipografía, nav, hero, tesis
   ============================================================ */

:root {
  --bg-0: #0a0805;          /* noir cálido */
  --bg-1: #0f0c08;          /* superficie */
  --bg-2: #15110b;          /* superficie elevada */
  --ink: #f1e9d7;           /* marfil — titulares */
  --body-c: #b0a890;        /* texto */
  --muted: #6f6957;         /* secundario */
  --gold: #c2a165;          /* champagne */
  --gold-bright: #e8d3a4;   /* champagne claro */
  --gold-soft: rgba(194, 161, 101, 0.07);
  --accent: var(--gold);
  --line: rgba(194, 178, 140, 0.14);
  --line-strong: rgba(206, 192, 156, 0.3);
  --lede-c: #cfc5a9;
  --wa: var(--gold);
  --seal-opacity: 0.09;

  --font-display: "Spectral", Georgia, serif;
  --font-body: "Archivo", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;

  --container: 1240px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Tema: Grafito (banca privada, casi monocromo) ---- */
[data-theme="grafito"] {
  --bg-0: #0b0c0e;
  --bg-1: #101113;
  --bg-2: #16171a;
  --ink: #ecebe6;
  --body-c: #a4a49c;
  --muted: #686861;
  --gold: #cfccc2;
  --gold-bright: #f0eee6;
  --gold-soft: rgba(207, 204, 194, 0.06);
  --line: rgba(200, 200, 192, 0.13);
  --line-strong: rgba(210, 210, 200, 0.28);
  --lede-c: #c6c6bd;
}

/* ---- Tema: Marfil (papel claro, lujo diurno) ---- */
[data-theme="marfil"] {
  --bg-0: #f2ecdf;
  --bg-1: #ece5d4;
  --bg-2: #e6decb;
  --ink: #1d1812;
  --body-c: #4f483a;
  --muted: #837a64;
  --gold: #8a6b35;
  --gold-bright: #6e5526;
  --gold-soft: rgba(138, 107, 53, 0.08);
  --line: rgba(70, 58, 36, 0.16);
  --line-strong: rgba(70, 58, 36, 0.34);
  --lede-c: #3c352a;
}



* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--body-c);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: rgba(194, 161, 101, 0.25); color: var(--ink); }

/* ---------- Grano de papel ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="marfil"] .grain { opacity: 0.07; mix-blend-mode: multiply; }

/* ---------- Reglas de margen (prospecto) ---------- */
.page-rules { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.page-rules span {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.rule-l { left: max(18px, calc((100vw - var(--container)) / 2 - 28px)); }
.rule-r { right: max(18px, calc((100vw - var(--container)) / 2 - 28px)); }
@media (max-width: 1100px) { .page-rules { display: none; } }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.hero-inner > *, .split > *, .contact-grid > *, .footer-grid > *, .fork > * { min-width: 0; }
img, svg { max-width: 100%; }

/* ============ Tipografía ============ */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(3rem, 8.2vw, 6.6rem);
  line-height: 1.0;
  letter-spacing: -0.018em;
  font-weight: 300;
}
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--gold); }

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  font-weight: 300;
}
h3 { font-size: 1.4rem; line-height: 1.3; font-weight: 500; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); font-weight: 600; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.28rem);
  line-height: 1.62;
  color: var(--lede-c);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ============ Botones ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1em 1.8em;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--gold);
  color: var(--bg-0);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: transparent;
  color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-lg { padding: 1.2em 2.4em; font-size: 0.9rem; }

.btn-whatsapp {
  background: transparent;
  color: var(--gold);
  border-color: var(--line-strong);
}
.btn-whatsapp:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-bright); }

/* ============ Barra de lectura ============ */
.read-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  z-index: 120;
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg-0) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 18px clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 9px; height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.13em;
  color: var(--ink);
  margin: 0;
}
.brand-dot { color: var(--gold); }

.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a i { font-style: normal; color: var(--gold); opacity: 0.65; margin-right: 4px; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.btn-nav { padding: 0.7em 1.3em; font-size: 0.73rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 10px clamp(20px, 4vw, 40px) 26px;
  background: color-mix(in srgb, var(--bg-0) 97%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-mobile a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--body-c);
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.nav-mobile a:last-child { border-bottom: 0; }
.nav-mobile-cta { color: var(--gold) !important; }
.nav.open .nav-mobile { display: flex; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding-top: clamp(150px, 20vh, 220px);
  overflow: hidden;
  background:
    radial-gradient(1000px 560px at 80% -12%, var(--gold-soft), transparent 65%),
    var(--bg-0);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes seal-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.015); }
}
.hero-seal {
  position: absolute;
  top: 2%;
  right: clamp(-240px, -13vw, -90px);
  width: clamp(480px, 52vw, 820px);
  opacity: var(--seal-opacity);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: seal-breathe 14s ease-in-out infinite;
}
[data-theme="marfil"] .hero-seal { mix-blend-mode: multiply; }
@media (max-width: 880px) {
  .hero-seal { width: 400px; right: -170px; }
}

.hero-inner { position: relative; }

.hero-folio {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(34px, 5vh, 52px);
}
.folio-rule { flex: 0 0 auto; width: 56px; height: 1px; background: var(--line-strong); }
.folio-conf {
  color: var(--gold);
  border: 1px solid var(--line-strong);
  padding: 5px 12px;
  letter-spacing: 0.26em;
}

/* — Revelado del titular — */
.mask-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}
.mask-inner {
  display: block;
  transform: translateY(112%);
  animation: line-rise 1.1s var(--ease-out) forwards;
}
.mask-line:nth-child(2) .mask-inner { animation-delay: 0.16s; }
@keyframes line-rise { to { transform: translateY(0); } }

.hero-sub {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 90px);
  align-items: start;
  margin-top: clamp(40px, 6vh, 64px);
  padding-top: clamp(28px, 4vh, 40px);
  border-top: 1px solid var(--line);
}
.hero-sub .lede { max-width: 54ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-claims {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hero-claims li {
  position: relative;
  padding: 10px 0 10px 26px;
  font-size: 0.93rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.hero-claims li:first-child { border-top: 0; }
.hero-claims li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.32em;
  width: 12px; height: 1px;
  background: var(--gold);
}

.hero-strip {
  position: relative;
  margin-top: clamp(60px, 9vh, 110px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-1) 65%, transparent);
}
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 15px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.strip-sep { flex: 1; height: 1px; min-width: 30px; background: var(--line); }

/* ============ Tesis ============ */
.thesis {
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
  padding-block: clamp(70px, 11vh, 120px);
}
.thesis-inner { text-align: center; max-width: 880px; }
.thesis-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 30px;
}
.thesis blockquote {
  margin: 0 0 26px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.34;
  color: var(--ink);
  font-weight: 300;
}
.thesis blockquote em { color: var(--gold); font-style: italic; }
.thesis-att {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ============ Encabezados de sección ============ */
.section { position: relative; padding-block: clamp(90px, 13vh, 150px); }

.section-deep {
  background:
    radial-gradient(900px 480px at 85% 0%, var(--gold-soft), transparent 60%),
    var(--bg-1);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: clamp(22px, 3vw, 46px);
  align-items: baseline;
  margin-bottom: clamp(40px, 6vh, 64px);
}
.sec-num {
  grid-row: 1 / 3;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 300;
  font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--gold) 45%, transparent);
  line-height: 1;
  align-self: start;
}
[data-theme="marfil"] .sec-num { -webkit-text-stroke-color: color-mix(in srgb, var(--gold) 65%, transparent); }

.sec-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}
.sec-intro {
  font-size: clamp(1.1rem, 1.6vw, 1.26rem);
  line-height: 1.62;
  color: var(--lede-c);
  max-width: 64ch;
  margin-bottom: clamp(40px, 5vh, 60px);
}

/* ============ Animaciones ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

.d-1 { transition-delay: 0.1s; }
.d-2 { transition-delay: 0.2s; }
.d-3 { transition-delay: 0.32s; }
.d-4 { transition-delay: 0.44s; }

/* Intensidad de animación (Tweaks) */
[data-anim="off"] .reveal { opacity: 1; transform: none; transition: none; }
[data-anim="off"] .mask-inner { transform: none; animation: none; }
[data-anim="off"] .hero-canvas { display: none; }
[data-anim="off"] .hero-seal { animation: none; }
[data-anim="subtle"] .hero-canvas { opacity: 0.4; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
  .mask-inner { transform: none; }
  .hero-canvas { display: none; }
}
