/* =============================================================
   NG LOGÍSTICA v5 — 1/3 BASE
   Tokens · sistema editorial Roboto · reset · utilidades · scrollbar
   ============================================================= */

/* ── Tokens ── */
:root {
  /* Papel cálido con profundidad */
  --paper: #f2efe8;
  --paper-deep: #e9e4d8;
  --card: #fbf9f4;
  --mist: #f0ece1;
  --ink: #2e2a22;
  --ink-soft: #4a453b;
  --dim: #6c6558;
  --mute: #948d7f;
  --hairline: rgba(46, 42, 34, 0.11);
  --hairline-2: rgba(46, 42, 34, 0.2);

  /* Momentos oscuros */
  --void: #171510;
  --panel: #201d16;
  --hairline-dark: rgba(242, 239, 232, 0.1);

  /* Señales */
  --signal: #65a817;
  --signal-dark: #477a10;
  --signal-bright: #7bd11f;

  /* Puente de tokens con el sistema de familia (family.css / modules) */
  --accent: var(--signal);
  --accent-dark: var(--signal-dark);
  --accent-bright: var(--signal-bright);
  --accent-rgb: 101, 168, 23;

  /* Elevación (sombras cálidas de dos capas) */
  --elev-1: 0 1px 2px rgba(46, 42, 34, 0.05), 0 8px 22px rgba(46, 42, 34, 0.07);
  --elev-2: 0 2px 5px rgba(46, 42, 34, 0.07), 0 20px 46px rgba(46, 42, 34, 0.12);
  --elev-3: 0 10px 26px rgba(46, 42, 34, 0.16), 0 44px 96px rgba(46, 42, 34, 0.22);

  /* ── Sistema editorial ROBOTO ──
     Display  → Roboto Condensed (titulares, condensada, tracking apretado)
     Cuerpo   → Roboto (lectura)
     Datos    → Roboto Mono (labels, cifras, sistema)
     Cita     → Roboto Serif itálica (momentos editoriales) */
  --display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --sans: Roboto, system-ui, -apple-system, sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
  --serif: "Roboto Serif", Georgia, serif;

  /* Escala tipográfica (mayor→menor) */
  --t-hero: clamp(2.5rem, 5.6vw, 4.6rem);      /* H1 · Condensed 800 */
  --t-h2: clamp(1.9rem, 3.6vw, 2.75rem);        /* H2 · Condensed 700 */
  --t-h3: clamp(1.15rem, 2vw, 1.4rem);          /* H3 · Condensed 700 */
  --t-stat: clamp(2.6rem, 4.6vw, 3.8rem);       /* cifras · Condensed 800 */
  --t-lead: clamp(1.05rem, 1.5vw, 1.18rem);     /* entradilla */
  --t-body: 17px;                                /* cuerpo */
  --t-small: 14.5px;                             /* apoyo */
  --t-caption: 12px;                             /* mono captions */
  --t-label: 10.5px;                             /* mono labels */

  /* Ritmo de espaciado */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 40px;
  --s-5: 64px; --s-6: clamp(72px, 10vw, 130px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
html.smoother-on { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(120% 70% at 18% 0%, #faf8f2 0%, transparent 55%),
    radial-gradient(90% 50% at 92% 100%, rgba(101, 168, 23, 0.05) 0%, transparent 60%),
    var(--paper);
}
/* Grano fotográfico global */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 96;
  pointer-events: none; opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3 { text-wrap: balance; }
h2 {
  font-family: var(--display); font-weight: 700;
  font-size: var(--t-h2);
  line-height: 1.05; letter-spacing: -0.01em;
  text-transform: none;
}
h3 { font-family: var(--display); font-weight: 700; font-size: var(--t-h3); line-height: 1.15; }
::selection { background: var(--signal); color: #fff; }
:focus-visible { outline: 2px solid var(--signal-dark); outline-offset: 3px; }

/* ── Scrollbar de marca ── */
html { scrollbar-width: thin; scrollbar-color: var(--ink-soft) var(--paper-deep); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb {
  background: var(--ink-soft);
  border: 3px solid var(--paper-deep);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--signal-dark); }

/* ── Smooth scroll wrappers ── */
#smooth-wrapper { overflow: clip; }
#smooth-content { will-change: transform; }
main { padding-top: var(--header-h); }

/* ── Utilidades ── */
.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 99;
  padding: 10px 16px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--signal-dark); border-radius: 4px;
  box-shadow: var(--elev-2);
  font-family: var(--mono); font-size: 13px;
}
.skip-link:focus { top: 12px; }

.shell { width: min(1240px, calc(100% - clamp(36px, 6vw, 72px))); margin-inline: auto; position: relative; z-index: 1; }
.section { position: relative; padding-block: var(--s-6); overflow: clip; }
.section-deep {
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(46, 42, 34, 0.035) 0%, transparent 60%),
    var(--paper-deep);
  border-block: 1px solid var(--hairline);
}
.section-head { max-width: 640px; margin-bottom: clamp(30px, 4vw, 48px); }
.section-head .dim { margin-top: 12px; }
.lead { margin-top: var(--s-2); font-size: var(--t-lead); color: var(--ink-soft); }
.dim { margin-top: 12px; color: var(--dim); font-size: var(--t-body); }

/* Grilla editorial de 12 columnas */
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 3vw, 40px); }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }

/* Etiqueta de módulo */
.mod-label {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.22em; color: var(--mute);
  margin-bottom: clamp(18px, 3vw, 30px);
}
.mod-label i { font-style: normal; color: var(--signal-dark); }
.mod-label-dark { color: rgba(242, 239, 232, 0.45); }
.mod-label-dark i { color: var(--signal-bright); }

/* Números fantasma */
.ghost {
  position: absolute; top: clamp(20px, 4vw, 56px); right: clamp(-10px, 1vw, 60px);
  z-index: 0;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(9rem, 22vw, 19rem); line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(46, 42, 34, 0.08);
  user-select: none; pointer-events: none;
}
.section-deep .ghost { -webkit-text-stroke-color: rgba(46, 42, 34, 0.1); }

/* Señales */
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal); margin-right: 8px;
  box-shadow: 0 0 0 3px rgba(101, 168, 23, 0.16);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(101, 168, 23, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(101, 168, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(101, 168, 23, 0); }
}

/* Revelado (solo con JS; sin JS todo visible) */
html.js .reveal {
  opacity: 0; transform: translateY(26px); filter: blur(7px);
  transition:
    opacity .8s var(--ease) var(--rd, 0s),
    transform .8s var(--ease) var(--rd, 0s),
    filter .8s var(--ease) var(--rd, 0s);
}
html.js .reveal.is-visible { opacity: 1; transform: none; filter: blur(0); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(5px); } to { opacity: 1; transform: none; filter: blur(0); } }
