/* ============================================================
   NEXUM — Landing
   ============================================================ */

:root {
  /* Surfaces — vainilla cálido */
  --paper:   #F1EBDB;
  --paper-2: #F6F2E7;
  --paper-3: #FCFAF3;

  /* Text — tinta cálida sobre vainilla */
  --ink:   #262219;
  --ink-2: #5C5446;
  --ink-3: #8A8068;

  /* Accent — verde oliva, con moderación */
  --accent:      #5F6B33;
  --accent-soft: rgba(95,107,51,0.10);
  --accent-glow: rgba(95,107,51,0.22);

  --good: #4C7A3F;
  --warn: #A9781F;

  /* Borders */
  --line:  rgba(58,48,24,0.12);
  --line-2: rgba(58,48,24,0.07);

  /* Typography — Caslon (tradición jurídica impresa), Public Sans
     (sobriedad institucional), Courier Prime (escritos judiciales) */
  --font-serif:   "Libre Caslon Text", Georgia, serif;
  --font-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --font-sans:    "Public Sans", system-ui, sans-serif;
  --font-mono:    "Courier Prime", "Courier New", ui-monospace, monospace;

  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-pill: 999px;

  --shadow-card:  0 1px 2px rgba(58,48,24,.06), 0 8px 28px -14px rgba(58,48,24,.16);
  --shadow-float: 0 2px 6px rgba(58,48,24,.08), 0 28px 60px -22px rgba(58,48,24,.20);
  --shadow-nav:   0 1px 2px rgba(58,48,24,.06), 0 12px 36px -18px rgba(58,48,24,.16);
}

/* ── Reset ────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Layout ───────────────────────────────────────────────── */
.wrap          { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 32px; }
.section       { position: relative; padding: 108px 0; }
.section-tight { padding: 80px 0; }

/* ── Type ─────────────────────────────────────────────────── */
.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin: 0 0 20px;
  font-weight: 600;
}

/* Only the demo section uses an accent-colored label */
.label-accent { color: var(--accent); }

.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.04;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: transform .16s cubic-bezier(.2,.8,.3,1),
              box-shadow .16s cubic-bezier(.2,.8,.3,1),
              opacity .12s ease;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: #FCFAF3;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(58,48,24,.10), 0 6px 20px -6px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(58,48,24,.12), 0 12px 28px -6px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover {
  color: var(--ink);
  background: rgba(237,232,223,0.05);
  border-color: rgba(237,232,223,0.13);
}
.btn-lg { padding: 14px 26px; font-size: 15.5px; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav-shell {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 80;
  display: flex; justify-content: center;
  pointer-events: none;
  padding: 0 16px;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  background: rgba(248,244,234,0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 7px 7px 18px;
  box-shadow: var(--shadow-nav);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand-mark {
  width: 34px; height: 23px;
  flex: none;
  background: url('/assets/nexum-mark.png') center / contain no-repeat;
}
.brand-mark::before { content: none; }

.nav-links { display: flex; align-items: center; gap: 1px; margin: 0 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--ink-3);
  padding: 8px 12px; border-radius: var(--r-pill); white-space: nowrap;
  transition: color .13s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { padding: 136px 0 92px; }

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 72px;
  align-items: center;
}
@media (max-width: 920px) {
  .hero-split { grid-template-columns: 1fr; gap: 44px; }
  .hero-right  { order: -1; }
}

.hero-title {
  font-size: clamp(42px, 6vw, 84px);
  line-height: 1.0;
  /* Upright, not italic — more authoritative than playful */
}
.hero-sub {
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 42ch;
}
.hero-cta  { margin-top: 32px; display: inline-flex; }
.hero-note {
  margin-top: 15px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

/* ── Feed card ────────────────────────────────────────────── */
.pcard {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.pcard-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(255,255,255,.015);
  gap: 12px;
}
.pcard-title {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.pcard-title .ic {
  width: 27px; height: 27px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.pcard-title .ic svg { width: 14px; height: 14px; }
.feed-count {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--ink-3); font-weight: 500;
}
.feed-count .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  60%       { box-shadow: 0 0 0 6px rgba(0,0,0,0); }
}
.pcard-cols {
  display: grid; grid-template-columns: 1fr 120px 110px; gap: 10px;
  padding: 10px 18px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
  border-bottom: 1px solid var(--line-2);
}
.feed-list { list-style: none; margin: 0; padding: 4px 0; }
.feed-row {
  display: grid; grid-template-columns: 1fr 120px 110px; gap: 10px;
  align-items: center;
  padding: 10px 18px; border-bottom: 1px solid var(--line-2);
  animation: feedIn .45s cubic-bezier(.2,.8,.3,1) both;
}
.feed-row:last-child { border-bottom: none; }
@keyframes feedIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feed-doc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.feed-doc .fic {
  width: 22px; height: 27px; border-radius: 3px;
  background: var(--paper-2); border: 1px solid var(--line);
  flex: none; position: relative;
}
.feed-doc .fic::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 6px;
  height: 1.5px; background: var(--ink-3); border-radius: 2px;
  box-shadow: 0 4px 0 var(--ink-3), 0 8px 0 var(--ink-3); opacity: .3;
}
.feed-name  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-meta  { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.feed-pages { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.feed-status { justify-self: start; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em;
  padding: 3px 8px; border-radius: var(--r-pill); font-weight: 600;
}
.chip-done { background: rgba(45,158,107,.09); color: var(--good); }
.chip-proc { background: var(--accent-soft); color: var(--accent); }
.chip-proc .spin {
  width: 8px; height: 8px;
  border: 1.5px solid var(--accent); border-right-color: transparent;
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider line between sections ───────────────────────── */
.section-rule { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ── Chat demo section ────────────────────────────────────── */
.demo-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 960px) {
  .demo-grid { grid-template-columns: 1fr; gap: 44px; }
}

.demo-heading {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.1;
}
.demo-desc {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.72;
  margin-top: 16px;
  max-width: 36ch;
}
.demo-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.demo-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.5;
}
.demo-dash { color: var(--ink-3); flex: none; }

/* Chat window */
.chat-window {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.chat-case-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: .025em;
  background: rgba(255,255,255,.01);
}
.chat-messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-q {
  align-self: flex-end;
  background: var(--accent);
  color: #FCFAF3;
  padding: 9px 13px;
  border-radius: 13px 13px 3px 13px;
  font-size: 13.5px;
  line-height: 1.52;
  max-width: 78%;
  font-weight: 600;
}
.chat-a { align-self: flex-start; max-width: 95%; }
.chat-a-text {
  background: rgba(58,48,24,.04);
  border: 1px solid var(--line);
  border-radius: 3px 13px 13px 13px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}
.chat-a-text mark {
  background: rgba(191,154,63,.12);
  color: var(--ink);
  border-radius: 2px;
  padding: 0 2px;
}
.chat-sources {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 7px;
  padding-left: 2px;
}
.chat-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: .025em;
  opacity: .8;
}

/* ── What you get — bordered list ─────────────────────────── */
.wyg-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 860px) {
  .wyg-grid { grid-template-columns: 1fr; gap: 40px; }
}
.wyg-head { position: sticky; top: 110px; }
.wyg-head-title {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.1;
}
.wyg-list { display: flex; flex-direction: column; }
.wyg-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  transition: none;
}
.wyg-item:last-child { border-bottom: 1px solid var(--line); }
.wyg-label {
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -.01em;
}
.wyg-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ── Privacy ──────────────────────────────────────────────── */
.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 860px) {
  .privacy-grid { grid-template-columns: 1fr; gap: 44px; }
}
.privacy-title {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.1;
}
.privacy-lead {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.72;
  margin-top: 18px;
  max-width: 38ch;
}
.pfacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.pfact {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.pfact:nth-child(odd)  { padding-right: 28px; border-right: 1px solid var(--line); }
.pfact:nth-child(even) { padding-left: 28px; }
.pfact-t {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.pfact-d {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ── CTA ──────────────────────────────────────────────────── */
.cta {
  border-top: 1px solid var(--line);
  padding: 80px 0;
  text-align: center;
}
.cta-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 20px;
}
.cta-title {
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.05;
}
.cta-sub {
  margin: 16px auto 30px;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.7;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.foot-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.foot-brand { font-size: 17px; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a {
  font-size: 13.5px;
  color: var(--ink-3);
  transition: color .13s ease;
}
.foot-links a:hover { color: var(--ink-2); }
.foot-copy {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: .03em;
}

/* ── Fade in (hero only — sections don't animate) ─────────── */
.hero-left {
  animation: heroIn .6s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The feed card gets its own animation (feedIn above) */

/* ── Historia con scroll-scrub (sección fijada) ───────────────
   GSAP fija la sección y avanza la secuencia de fotogramas del
   canvas con el scroll. Los pasos de texto se alternan con la
   clase .on según el progreso. */
.story {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.story-pin {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 90px 0 48px;
}
.story-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 64px;
  align-items: center;
  width: 100%;
}
.story-steps { position: relative; min-height: 270px; margin-top: 6px; }
.story-step {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.3,1);
  pointer-events: none;
}
.story-step.on { opacity: 1; transform: none; }
.story-step-n {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--accent);
}
.story-step-t {
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.04;
  margin-top: 12px;
}
.story-step-d {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 34ch;
}
.story-meter { display: flex; align-items: center; gap: 14px; margin-top: 34px; }
.story-num, .story-total {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.story-num { color: var(--accent); font-weight: 600; }
.story-bar {
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  display: block;
}
.story-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
.story-frame {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-float);
  background: var(--paper-2);
  aspect-ratio: 16 / 9.4;
}
.story-canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 920px) {
  .story-grid { grid-template-columns: 1fr; gap: 28px; align-content: center; }
  .story-frame { order: -1; aspect-ratio: 16 / 10; }
  .story-steps { min-height: 230px; }
  .story-step-t { font-size: clamp(26px, 7vw, 38px); }
}

/* ── Banda fotográfica con parallax ───────────────────────────── */
.band {
  position: relative;
  overflow: hidden;
  height: min(72vh, 620px);
  display: grid;
  align-items: end;
  border-top: 1px solid var(--line);
}
.band-media { position: absolute; inset: 0; }
.band-media img {
  position: relative;
  display: block;
  width: 100%;
  height: 128%;
  top: -14%;
  object-fit: cover;
  will-change: transform;
}
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(241,235,219,.30) 0%,
    rgba(241,235,219,0) 32%,
    rgba(38,34,25,.42) 100%);
  pointer-events: none;
}
.band-quote { position: relative; z-index: 2; padding-bottom: 60px; }
.band-line {
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.18;
  color: var(--paper-3);
  text-shadow: 0 1px 24px rgba(38,34,25,.35);
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
}

/* ── Figura en la columna sticky de funciones ─────────────────── */
.wyg-figure {
  margin: 32px 0 0;
  width: min(82%, 300px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.wyg-figure img { display: block; width: 100%; height: auto; }
@media (max-width: 860px) { .wyg-figure { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
