/* ============================================================
   Nuevo Rumbo · Buzón — base de diseño (Parte 1: fondo vivo)
   Identidad nueva (no el B/N+Bodoni del portafolio): papel cálido,
   crimson institucional, brochazos. Tipo provisional (Space Grotesk
   + Inter) hasta definir tipografía como parte propia.
   Nada plano: fondo con grano + brochazos + parallax por escena.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --paper: #efe9e1;
    --paper-2: #e6ddd1;
    --ink: #1a1411;
    --muted: #6b625b;
    --brand: #96131d;
    --brand-deep: #6f0e16;
    --line: rgba(26, 20, 17, .14);

    --display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;

    --ease: cubic-bezier(.2, .7, .2, 1);
    --gutter: clamp(20px, 5vw, 56px);
}

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--sans);
    background: var(--paper);          /* color de respaldo bajo el SVG */
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
::selection { background: var(--brand); color: #fff; }

/* ---------- FONDO VIVO (fijo, no teselado, siempre detrás) ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-svg { width: 100%; height: 100%; display: block; }
.grain { mix-blend-mode: multiply; }

main { position: relative; }

/* ---------- NAVBAR · logo NR transparente + links ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: 0 50%; z-index: 60; }
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: clamp(14px, 2.6vw, 26px) var(--gutter); }
.nav-logo { position: relative; }
.nav-logo::before {            /* halo de papel: limpia la zona del brochazo → el logo SIEMPRE se lee */
    content: ''; position: absolute; inset: -55% -40%; z-index: -1;
    background: radial-gradient(55% 60% at 50% 50%, var(--paper) 20%, rgba(239, 233, 225, .78) 52%, transparent 78%);
    filter: blur(5px);
}
.nav-logo img {
    display: block; width: auto; height: clamp(56px, 7.2vw, 78px);
    opacity: .95;
    mix-blend-mode: multiply;          /* el papel se ve A TRAVÉS del trazo: mismo color, con textura */
    transition: opacity .35s var(--ease), transform .35s var(--ease);
    will-change: transform, opacity;
}
.nav-logo:hover img { opacity: 1; transform: translateY(2px); }
.nav-logo:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 2px; }

.nav-links { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px); padding-top: 10px; }
.nav-links a { position: relative; padding: 6px 0; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); text-decoration: none; transition: color .25s var(--ease); }
.nav-links a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav-links a:not(.nav-cta):hover { color: var(--brand); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-links a.nav-cta { background: var(--brand); color: #fff; font-size: 13.5px; letter-spacing: .04em; padding: 13px 26px; border-radius: 999px; box-shadow: 0 10px 20px rgba(111, 14, 22, .22); transition: transform .25s var(--ease), background .25s, box-shadow .25s; }
.nav-links a.nav-cta::after { display: none; }
.nav-links a.nav-cta:hover { color: #fff; background: var(--brand-deep); transform: translateY(-2px); box-shadow: 0 14px 26px rgba(111, 14, 22, .28); }
.nav-links a:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }

/* ---------- HERO ---------- */
.hero {
    min-height: 100svh;
    display: grid;
    place-items: center;
    text-align: center;
    position: relative;
    padding: var(--gutter);
}
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; z-index: 2; }
.hero > .scroll-hint { position: relative; z-index: 2; }

.kicker {
    font-family: var(--sans);
    font-size: clamp(11px, 1.4vw, 13px);
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--brand);
    font-weight: 600;
    margin-bottom: clamp(14px, 2vw, 22px);
}
.hero-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(46px, 11vw, 132px);
    line-height: .92;
    letter-spacing: -.03em;
    color: var(--ink);
}
.hero-title .hl { position: relative; display: inline-block; color: var(--brand); }
.hl-swash { position: absolute; left: -2%; width: 104%; bottom: -.14em; height: .2em; overflow: visible; }
.hl-swash path { fill: none; stroke: var(--brand-deep); stroke-width: 8; stroke-linecap: round; opacity: .9; }

.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: clamp(22px, 4vh, 36px); position: relative; z-index: 2; }
.badges li { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .5); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.badges li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }

/* ---------- LA CARTA VIAJERA (hilo del scroll) + BUZÓN institucional ---------- */
.mb-ghost-wrap { position: fixed; inset: 0; display: grid; place-items: center; z-index: 1; pointer-events: none; }
.mb-ghost-rise { display: grid; place-items: center; will-change: opacity; }   /* entrada la maneja bg.js; el scrub viaja en .ghost-letter */
.no-motion .mb-ghost-wrap { display: none; }   /* sin JS/motion: la carta fija no queda flotando sobre el sitio */
.ghost-letter { width: min(170px, 38vw); filter: drop-shadow(0 16px 24px rgba(26, 20, 17, .16)); }
.gl-body { fill: #fffdf9; stroke: var(--ink); stroke-width: 2.5; }
.gl-flap { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; opacity: .75; }
.gl-crease { fill: none; stroke: var(--ink); stroke-width: 1.4; opacity: .3; }
.gl-seal { fill: var(--brand-deep); }
.gl-mark { fill: none; stroke: #f6efe9; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mb { overflow: visible; }
.mb-shadow { fill: var(--ink); opacity: .08; }
.mb-cap { fill: var(--ink); }                    /* chapa superior tinta: sobria, institucional */
.mb-cpline { fill: var(--brand-deep); }
.mb-body { fill: var(--brand-deep); stroke: var(--ink); stroke-width: 2.5; }
.mb-shade { fill: #14100d; opacity: .34; }       /* sombra lateral → cilindro */
.mb-hi { fill: #fff; opacity: .10; }             /* luz lateral sutil (seria, no brillante) */
.mb-plate { fill: var(--ink); }                  /* placa de ranura negra */
.mb-slot { fill: #0b0908; }
.mb-emblem { fill: none; stroke: #f3ece7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }   /* ↗ de marca */
.mb-door { fill: none; stroke: var(--ink); stroke-width: 1.8; opacity: .4; }   /* puerta de retiro discreta */
.mb-lock { fill: var(--ink); opacity: .45; }
.mb-base2 { fill: #241c18; }
.mb-base { fill: var(--ink); }
.mb-letter rect { fill: #fffdf9; stroke: var(--ink); stroke-width: 3; }
.mb-letter path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mb-letter circle { fill: var(--brand); stroke: #fffdf9; stroke-width: 1.4; }
.mb-real .mb-letter { opacity: 0; }              /* en reposo NO se ve; asoma solo al mandar la carta */

.scroll-hint {
    position: absolute; bottom: clamp(18px, 4vh, 34px); left: 50%; transform: translateX(-50%);
    display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
    font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
    text-decoration: none; z-index: 2;
}
.scroll-hint__line { width: 1.5px; height: 46px; background: linear-gradient(var(--brand), transparent); }

/* ---------- MÍNIMA EXPLICACIÓN (donde aterriza el símbolo) ---------- */
.intro { min-height: 82svh; display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.intro-line {
    font-family: var(--display); font-weight: 500;
    font-size: clamp(21px, 3.6vw, 38px); line-height: 1.24; letter-spacing: -.01em;
    max-width: 22ch; color: var(--ink);
}
.intro-line::first-line { color: var(--brand); }

/* spacer de demostración para ver el cambio de escena del fondo */

/* ---------- CÓMO FUNCIONA ---------- */
.como { padding: clamp(90px, 16vh, 170px) var(--gutter); text-align: center; }
.como > .kicker { margin-bottom: clamp(36px, 6vh, 64px); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); max-width: 1060px; margin: 0 auto; text-align: left; }
.step { position: relative; border-top: 1px solid var(--line); padding-top: 22px; }
.step::before { content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.step:hover::before { transform: scaleX(1); }
.step-n { font-size: 12px; font-weight: 700; letter-spacing: .24em; color: var(--brand); font-variant-numeric: tabular-nums; }
.step h3 { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 2.3vw, 25px); letter-spacing: -.01em; margin: 12px 0 8px; }
.step p { color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 34ch; }
.live-line { margin-top: clamp(38px, 6vh, 64px); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); text-align: center; }

/* ---------- EL BUZÓN REAL (3D + formulario) ---------- */
.report { min-height: 100svh; display: grid; grid-template-columns: 1.02fr 1fr; align-items: center; gap: clamp(36px, 6vw, 96px); padding: clamp(90px, 12vh, 140px) var(--gutter); max-width: 1180px; margin: 0 auto; }
.report-scene { perspective: 1000px; display: grid; place-items: center; }
.mb-real { width: min(340px, 70vw); transform-style: preserve-3d; filter: drop-shadow(0 26px 34px rgba(111, 14, 22, .16)); }
.report-panel { max-width: 520px; }
.report-panel h2 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.6vw, 52px); letter-spacing: -.02em; margin: 6px 0 26px; }
.report-panel .kicker { margin-bottom: 4px; }

form label { display: block; margin-bottom: 18px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
form label em { text-transform: none; letter-spacing: .04em; font-weight: 400; font-style: normal; opacity: .8; }
form input, form textarea, form select {
    display: block; width: 100%; margin-top: 8px; padding: 14px 16px; min-height: 52px;
    font: 500 16px/1.5 var(--sans); color: var(--ink);
    background: rgba(255, 255, 255, .62); border: 1.5px solid var(--line); border-radius: 10px;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
    appearance: none; -webkit-appearance: none;
}
form textarea { resize: vertical; min-height: 120px; }
form select { background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%); background-position: calc(100% - 22px) 24px, calc(100% - 16px) 24px; background-size: 6px 6px; background-repeat: no-repeat; }
form input:focus, form textarea:focus, form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(150, 19, 29, .12); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit {
    display: block; width: 100%; margin-top: 6px; min-height: 56px; padding: 16px 30px;
    background: var(--brand); color: #fff; border: 0; border-radius: 10px;
    font: 600 15.5px var(--sans); letter-spacing: .05em; cursor: pointer;
    box-shadow: 0 14px 26px rgba(111, 14, 22, .22);
    transition: transform .2s var(--ease), background .25s, box-shadow .25s;
}
.submit:hover:not(:disabled) { background: var(--brand-deep); transform: translateY(-2px); box-shadow: 0 18px 30px rgba(111, 14, 22, .26); }
.submit:active:not(:disabled) { transform: scale(.98); }
.submit:disabled { opacity: .6; cursor: default; }
.form-msg { margin-top: 12px; min-height: 20px; font-size: 14px; color: var(--brand-deep); }

.done { text-align: center; padding: clamp(18px, 4vh, 36px) 0; }
.done p { color: var(--muted); font-size: 15px; }
.check { width: 54px; height: 54px; margin-bottom: 10px; }
.check path { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.code { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 6vw, 54px); letter-spacing: .3em; color: var(--brand); font-variant-numeric: tabular-nums; margin: 10px 0 14px; }
.done-hint { max-width: 36ch; margin: 0 auto; }
.form-priv { font-size: 11.5px; letter-spacing: .08em; color: var(--muted); text-align: center; margin: 10px 0 0; }
.done-id { font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.done-id b { color: var(--ink); font-variant-numeric: tabular-nums; }
.done-link { display: inline-block; margin-bottom: 16px; padding: 12px 26px; border-radius: 999px; background: var(--brand); color: #fff; text-decoration: none; font: 700 13px var(--display); letter-spacing: .05em; text-transform: uppercase; box-shadow: 0 12px 22px rgba(111, 14, 22, .2); transition: background .3s var(--ease), transform .2s; }
.done-link:hover { background: var(--brand-deep); }
.done-link:active { transform: scale(.98); }
.transp-link { color: var(--brand-deep); text-decoration: none; border-bottom: 1px solid rgba(113, 13, 21, .35); transition: border-color .3s var(--ease); }
.transp-link:hover { border-color: var(--brand-deep); }

/* ---------- TRANSPARENCIA (datos reales de /api/resumen) ---------- */
.transp { padding: clamp(100px, 16vh, 180px) var(--gutter); max-width: 1100px; margin: 0 auto; text-align: center; }
.sec-h { position: relative; font-family: var(--display); font-weight: 700; font-size: clamp(34px, 6vw, 72px); line-height: 1.02; letter-spacing: -.025em; margin: 10px 0 clamp(44px, 8vh, 84px); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 3vw, 44px); margin-bottom: clamp(54px, 9vh, 96px); }
.stat { border-top: 1px solid var(--line); padding-top: 18px; }
.stat-n { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(44px, 7vw, 88px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat:nth-child(2) .stat-n { color: var(--brand); }
.stat-l { display: block; margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.cats { max-width: 680px; margin: 0 auto clamp(54px, 9vh, 96px); text-align: left; }
.cat-row { display: grid; grid-template-columns: 140px 1fr 64px; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cat-l { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cat-t { height: 8px; background: rgba(26, 20, 17, .08); border-radius: 99px; overflow: hidden; }
.cat-t i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-deep), var(--brand)); border-radius: 99px; }
.cat-n { font-size: 12px; font-weight: 700; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.recientes { max-width: 680px; margin: 0 auto 34px; text-align: left; }
.recientes h3 { font-family: var(--display); font-weight: 600; font-size: 21px; margin-bottom: 8px; }
.recientes ul { list-style: none; }
.recientes li { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 14px 2px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.r-meta { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.muted { color: var(--muted); }
.transp-note { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: clamp(30px, 5vh, 52px); }

/* ---------- FOOTER ---------- */
.foot { padding: clamp(52px, 9vh, 96px) var(--gutter) 46px; border-top: 1px solid var(--line); text-align: center; }
.foot-logo { height: 48px; width: auto; opacity: .92; mix-blend-mode: multiply; margin-bottom: 16px; }
.foot p { color: var(--muted); font-size: 14.5px; }
.foot-links { display: flex; justify-content: center; gap: 26px; margin: 14px 0 6px; font-size: 13.5px; }
.foot-links a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .3s var(--ease); }
.foot-links a:hover { border-color: var(--brand); }
.foot-mini { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; margin-top: 8px; opacity: .8; }

/* ---------- Lenis ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .nav-links a:not(.nav-cta) { display: none; }
    .nav-links { padding-top: 0; }
}
@media (max-width: 900px) {
    .report { grid-template-columns: 1fr; gap: clamp(28px, 6vw, 48px); padding-top: clamp(70px, 12vh, 110px); }
    .report-scene { order: -1; }
    .mb-real { width: min(260px, 60vw); }
    .report-panel { max-width: 560px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
    .hero-title { font-size: clamp(40px, 13vw, 64px); }
    .ghost-letter { width: min(130px, 34vw); }
    .steps { grid-template-columns: 1fr; gap: 30px; max-width: 420px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 26px 18px; }
    .cat-row { grid-template-columns: 100px 1fr 54px; }
    .recientes li { flex-direction: column; gap: 4px; }
}

/* ---------- Accesibilidad: sin movimiento, todo visible y estático ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    .mb-ghost { opacity: .9; }
    .mb-real { transform: none !important; }
    .bg-smudge { opacity: .35 !important; }
}
