/* =============================================================================
   SOFFIWEB · hoja de estilos única
   Orden: tokens → reset → tipografía → utilidades → layout → componentes →
          secciones → responsive → accesibilidad
   Regla de especificidad: una sola clase por selector siempre que se pueda.
   El ritmo vertical se controla con las variables --sec-pt / --sec-pb, nunca
   sobrescribiendo el padding de .section desde otra regla.
   ========================================================================== */

/* ── 1. Tokens ────────────────────────────────────────────────────────────── */
:root {
  /* Marca */
  --brand:        #2b3f9c;   /* azul índigo */
  --brand-deep:   #1b2a6b;   /* índigo profundo */
  --sky:          #7fa8e8;   /* azul cielo */
  --magenta:      #d34e9e;   /* acento del logo */
  --magenta-soft: #f6a6d4;

  /* Paleta clara — misma temperatura fría que las apps (SOFFICAJA/SOFFIFACT) */
  --paper: #f4f6fb;
  --panel: #ffffff;
  --ink:   #141420;
  --line:  #dbe1ee;

  /* Roles semánticos (tema claro) */
  --bg:        var(--paper);
  --surface:   var(--panel);
  --surface-2: #eaeef7;
  --text:      var(--ink);
  --muted:     #4f4f66;          /* 7.35:1 sobre el papel: legible a cualquier edad */
  --border:    var(--line);
  --accent:        var(--brand);
  --accent-strong: var(--brand-deep);   /* hover del botón primario */
  --accent-2:  var(--magenta);
  --accent-2-ink: #b8367f;   /* magenta legible: 5.0:1 sobre papel (el de marca queda en 3.6:1) */
  --on-accent: #ffffff;
  --shadow:    0 1px 2px rgba(23, 33, 71, .05), 0 12px 32px -18px rgba(23, 33, 71, .3);
  --ring:      var(--magenta);

  /* Acentos de producto: 5 muestras del mismo gradiente azul→magenta.
     Cada sistema es un punto del degradado de marca, no un color arbitrario. */
  --p-fact: #2b3f9c;
  --p-con:  #5a48a4;
  --p-bod:  #8a51a3;
  --p-nom:  #b04f9f;
  --p-caja: #d34e9e;

  --grad: linear-gradient(96deg, var(--brand) 0%, #7a45a5 55%, var(--magenta) 100%);

  /* Tipografía */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Métrica */
  --shell:  1360px;   /* tope de lectura; los párrafos ya topan aparte en ch */
  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --sec-pt: clamp(4.5rem, 8vw, 7.5rem);
  --sec-pb: clamp(4.5rem, 8vw, 7.5rem);
  --r-sm: 6px;
  --r-md: 10px;
  --ease: cubic-bezier(.22, .68, .32, 1);
}

/* Tema oscuro: por preferencia del sistema (salvo override manual a claro) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0f22;
    --surface:   #1a2140;
    --surface-2: #232b52;
    --text:      #e8ecfb;
    --muted:     #8b93b8;
    --border:    #38416e;
    --accent:    var(--sky);
    --accent-strong: #a9c6f2;
    --accent-2:  var(--magenta-soft);
    --accent-2-ink: var(--magenta-soft);
    --on-accent: #080d24;
    --shadow:    0 1px 2px rgba(0, 0, 0, .5), 0 20px 44px -24px rgba(0, 0, 0, .9);
    --ring:      var(--magenta-soft);
    --p-fact: #7fa8e8;
    --p-con:  #9b8ff0;
    --p-bod:  #c084e0;
    --p-nom:  #e07ac4;
    --p-caja: #f6a6d4;
    --grad: linear-gradient(96deg, var(--sky) 0%, #b98ae4 55%, var(--magenta-soft) 100%);
  }
}

/* Tema oscuro: override manual (gana siempre) */
:root[data-theme="dark"] {
  --bg:        #0b0f22;
  --surface:   #1a2140;
  --surface-2: #232b52;
  --text:      #e8ecfb;
  --muted:     #8b93b8;
  --border:    #38416e;
  --accent:    var(--sky);
  --accent-strong: #a9c6f2;
  --accent-2:  var(--magenta-soft);
  --accent-2-ink: var(--magenta-soft);
  --on-accent: #080d24;
  --shadow:    0 1px 2px rgba(0, 0, 0, .5), 0 20px 44px -24px rgba(0, 0, 0, .9);
  --ring:      var(--magenta-soft);
  --p-fact: #7fa8e8;
  --p-con:  #9b8ff0;
  --p-bod:  #c084e0;
  --p-nom:  #e07ac4;
  --p-caja: #f6a6d4;
  --grad: linear-gradient(96deg, var(--sky) 0%, #b98ae4 55%, var(--magenta-soft) 100%);
}

/* ── 2. Reset acotado ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.15rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -.03em; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
img, video, canvas, iframe, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
strong { font-weight: 600; }
/* El degradado recortado sobre texto se lee mal; el énfasis va en color plano. */
em { font-style: normal; color: var(--accent); font-weight: 600; }
::selection { background: color-mix(in srgb, var(--accent-2) 32%, transparent); }

/* ── 3. Utilidades ────────────────────────────────────────────────────────── */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--sec-pt) var(--sec-pb); }
.mono { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.eyebrow { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.4rem; }
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: .7rem 1.1rem; border-radius: var(--r-sm); font-weight: 500;
  transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 1rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Revelados al hacer scroll */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.no-reveal .reveal { opacity: 1; transform: none; }

/* ── 4. Marca ─────────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
/* Logo oficial: alto fluido, ancho derivado del aspecto real del archivo. */
.brand__mark {
  flex: none;
  height: var(--mark-h, clamp(30px, 2.6vw, 38px));
  width: auto;
  /* El logo es azul oscuro sobre fondo oscuro: se aclara un punto en tema noche */
  transition: filter .3s var(--ease);
}
:root[data-theme="dark"] .brand__mark { filter: brightness(1.22) saturate(1.06); }
.footer .brand__mark { --mark-h: clamp(28px, 2.4vw, 34px); }
.brand__word {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.02rem, .9rem + .5vw, 1.16rem);
  letter-spacing: -.045em;
}

/* ── 5. Nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; gap: 1.4rem; min-height: 72px; }
.nav__menu { margin-left: auto; }
.nav__list { display: flex; gap: clamp(.9rem, 2vw, 1.9rem); }
.nav__list a {
  position: relative; text-decoration: none; font-size: .98rem; color: var(--muted);
  padding-block: .35rem; transition: color .2s var(--ease);
}
.nav__list a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--grad); transition: right .3s var(--ease);
}
.nav__list a:hover, .nav__list a.is-current { color: var(--text); }
.nav__list a:hover::after, .nav__list a.is-current::after { right: 0; }
.nav__actions { display: flex; align-items: center; gap: .6rem; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-12deg); }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }

.burger { display: none; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 0; }
.burger span { display: block; width: 16px; height: 1.5px; margin: 3px auto; background: var(--text); transition: transform .3s var(--ease), opacity .2s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-4.5px) rotate(-45deg); }

/* ── 6. Botones ───────────────────────────────────────────────────────────── */
.btn {
  --btn-py: .85rem; --btn-px: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: var(--btn-py) var(--btn-px);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 1rem; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  will-change: transform;
  transition: background-color .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn--sm { --btn-py: .6rem; --btn-px: 1.15rem; font-size: .94rem; }
/* Primario en azul de marca: el mismo botón que ve dentro de SOFFICAJA. */
.btn--solid { background: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--accent-strong); box-shadow: 0 10px 26px -14px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.link-arrow { display: inline-flex; align-items: center; gap: .4rem; font-size: 1rem; font-weight: 500; color: var(--accent); text-decoration: none; }
.link-arrow::after { content: "→"; transition: transform .25s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ── 7. Badge de estado ───────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 2rem;
  padding: .38rem .8rem .38rem .6rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.status-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-badge.is-live .status-badge__dot { background: #2fbf71; box-shadow: 0 0 0 0 rgba(47, 191, 113, .55); animation: pulse-dot 2.4s infinite; }
.status-badge.is-live { color: var(--text); }
@keyframes pulse-dot {
  70%  { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); }
}

/* ── 8. Cabecera de sección (dossier editorial) ───────────────────────────── */
.sec-head {
  display: grid; gap: .9rem 3rem; align-items: start;
  padding-top: 1.4rem; border-top: 1px solid var(--border);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.sec-head__index { color: var(--accent-2-ink); grid-column: 1 / -1; }
.sec-head__title { font-size: clamp(1.9rem, 1.1rem + 3.1vw, 3.3rem); max-width: 20ch; }
.sec-head__lede { color: var(--muted); max-width: 46ch; font-size: 1.08rem; }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .sec-head__lede { justify-self: end; padding-top: .5rem; }
}

/* ── 9. Hero ──────────────────────────────────────────────────────────────── */
.hero { --sec-pt: clamp(3rem, 6vw, 5.5rem); --sec-pb: clamp(3rem, 5vw, 4.5rem); position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(60% 50% at 78% 12%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 70%),
    radial-gradient(50% 45% at 8% 0%,  color-mix(in srgb, var(--accent) 11%, transparent), transparent 72%);
}
.hero__grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.hero__title { font-size: clamp(2.6rem, 1.3rem + 5.6vw, 5.2rem); letter-spacing: -.042em; line-height: .97; }
.hero__lede { margin-top: 1.6rem; max-width: 52ch; color: var(--muted); font-size: clamp(1.08rem, 1.02rem + .3vw, 1.22rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

.hero__aside { align-self: end; border-left: 1px solid var(--border); padding-left: clamp(1.2rem, 2.5vw, 2rem); }
.hero__ticks { display: grid; gap: 1rem; }
.hero__ticks li { display: grid; grid-template-columns: 2.1rem 1fr; gap: .3rem; font-size: 1.01rem; color: var(--text); }
.hero__ticks .mono { color: var(--accent-2-ink); font-size: .74rem; padding-top: .32rem; }
.hero__aside-note { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .98rem; }
@media (min-width: 980px) {
  .hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); align-items: end; }
}

/* ── 10. Ecosistema (sección firma) ───────────────────────────────────────── */
.eco { --sec-pt: clamp(2.5rem, 4vw, 3.5rem); position: relative; }
.eco__stage-wrap { position: relative; margin-top: -.5rem; }
.eco__layout { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.eco__layout > * { min-width: 0; }
.eco__stage {
  position: relative; border: 1px solid var(--border); border-radius: var(--r-md);
  background:
    radial-gradient(80% 80% at 50% 45%, color-mix(in srgb, var(--surface) 92%, transparent), var(--surface)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Alto derivado del ancho disponible: nunca puede empujar la página a lo ancho.
     (min-height + aspect-ratio sí lo hacía en pantallas estrechas.) */
  width: 100%; max-width: 100%; min-width: 0;
  height: clamp(300px, 84vw, 440px);
}
.eco__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.eco__tip {
  position: absolute; z-index: 3; transform: translate(-50%, -132%);
  background: var(--text); color: var(--bg);
  padding: .42rem .7rem; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; pointer-events: none;
}
.eco__caption {
  position: absolute; left: 1rem; bottom: .9rem; z-index: 2;
  color: var(--muted); font-size: .74rem;
}
.eco__side { align-self: center; }
.eco__side-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; }
.eco__side-text { margin-top: .8rem; color: var(--muted); }
.eco__legend { display: grid; gap: .3rem; margin-top: 1.8rem; padding-top: 1.3rem; border-top: 1px solid var(--border); }
.eco__legend-btn {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .48rem .6rem; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; text-align: left; font-size: 1.01rem; font-weight: 500;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.eco__legend-btn .mono { margin-left: auto; color: var(--muted); font-size: .72rem; }
.eco__legend-btn:hover, .eco__legend-btn.is-active { background: var(--surface-2); border-color: var(--border); }
.eco__swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--sw); flex: none; }
.eco__hint { margin-top: 1rem; color: var(--muted); font-size: .76rem; }
@media (min-width: 980px) {
  .eco__layout { grid-template-columns: minmax(0, 1.5fr) minmax(0, .82fr); align-items: center; }
  .eco__stage { height: auto; aspect-ratio: 16 / 11; }
}

/* ── 11. Flujo (tesis todo en uno) ────────────────────────────────────────── */
.flow { --sec-pt: clamp(4rem, 7vw, 6rem); background: var(--surface-2); }
.flow__steps { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.flow__step { background: var(--bg); padding: clamp(1.6rem, 3vw, 2.4rem); position: relative; }
.flow__num { color: var(--accent-2-ink); }
.flow__title { margin-top: 1.4rem; font-size: 1.45rem; }
.flow__text { margin-top: .7rem; color: var(--muted); font-size: 1.02rem; }
.flow__tag { margin-top: 1.6rem; color: var(--muted); font-size: .74rem; }
.flow__step::after {
  content: ""; position: absolute; right: 1.2rem; top: 1.4rem;
  width: 34px; height: 1px; background: var(--grad); opacity: .8;
}
.flow__closing { margin-top: 2rem; font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); color: var(--muted); max-width: 60ch; }
@media (min-width: 820px) { .flow__steps { grid-template-columns: repeat(3, 1fr); } }

/* ── 12. Bento de productos ───────────────────────────────────────────────── */
.bento { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.tile {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.tile::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent, var(--brand)); opacity: .9;
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); }
.tile.is-open { border-color: var(--accent); box-shadow: var(--shadow); }
.tile.is-target { animation: tile-ping 1.4s var(--ease); }
@keyframes tile-ping { 0%, 100% { box-shadow: var(--shadow); } 35% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }

.tile__head {
  display: grid; gap: .5rem; width: 100%; flex: 1;
  padding: clamp(1.3rem, 2.4vw, 2rem) clamp(1.3rem, 2.4vw, 2rem) clamp(1.1rem, 2vw, 1.5rem) calc(clamp(1.3rem, 2.4vw, 2rem) + 4px);
  background: transparent; border: 0; text-align: left; align-content: start;
}
.tile__cat { color: var(--accent); }
.tile__name { font-family: var(--font-display); font-weight: 600; letter-spacing: -.035em; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); line-height: 1.05; }
.tile__pitch { color: var(--muted); font-size: 1.02rem; max-width: 40ch; }
.tile__more { display: flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: 1.2rem; color: var(--muted); }
.tile__more-label { font-size: .74rem; }
.tile__plus { position: relative; width: 15px; height: 15px; flex: none; }
.tile__plus::before, .tile__plus::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; height: 1.5px; background: currentColor;
  transition: transform .3s var(--ease);
}
.tile__plus::after { transform: rotate(90deg); }
.tile__head[aria-expanded="true"] .tile__plus::after { transform: rotate(0deg); }
.tile__head[aria-expanded="true"] .tile__more { color: var(--accent); }

.tile__detail { padding: 0 clamp(1.3rem, 2.4vw, 2rem) clamp(1.3rem, 2.4vw, 2rem) calc(clamp(1.3rem, 2.4vw, 2rem) + 4px); }
.tile__list { display: grid; gap: .45rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.tile__list li { position: relative; padding-left: 1.1rem; font-size: .99rem; color: var(--muted); }
.tile__list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.tile__media { margin-top: 1.2rem; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.tile__video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }

.tile--note { background: var(--surface-2); }
.tile--note::before { background: var(--grad); }
.tile--note .tile__cat { display: block; }
.tile__note-text { margin: .7rem 0 1.2rem; color: var(--muted); font-size: 1.01rem; }
.tile--note { padding: clamp(1.3rem, 2.4vw, 2rem); padding-left: calc(clamp(1.3rem, 2.4vw, 2rem) + 4px); }

@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile { grid-column: span 2; }
  .tile--lg { grid-column: span 4; }
  .tile--note { grid-column: span 4; }
  .tile--note { display: flex; flex-direction: row; align-items: center; gap: 1.5rem 2rem; flex-wrap: wrap; }
  .tile--note .tile__note-text { margin: 0; flex: 1 1 22rem; }
  .tile--note .tile__cat { flex: 0 0 auto; }
}
/* Soffifact manda ocupando la fila entera. Ya no estira dos filas de alto:
   sin la vista previa que las rellenaba, quedaba un hueco vacío. */

/* ── 13. Diagnóstico ──────────────────────────────────────────────────────── */
.needs__panel { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.needs__chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: clamp(1.2rem, 2.5vw, 1.8rem); border-bottom: 1px solid var(--border); }
.chip {
  padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; font-size: .99rem; font-weight: 500;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.needs__result { padding: clamp(1.4rem, 3vw, 2.4rem); min-height: 12rem; display: grid; align-content: center; }
.needs__idle { color: var(--muted); }
.needs__answer { display: grid; gap: 1.1rem; animation: fade-up .45s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.needs__answer-title { font-family: var(--font-display); font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2rem); font-weight: 600; letter-spacing: -.03em; max-width: 26ch; }
.needs__answer-text { color: var(--muted); max-width: 56ch; }
.needs__picks { display: flex; flex-wrap: wrap; gap: .5rem; }
.needs__pick {
  display: inline-flex; align-items: baseline; gap: .5rem;
  padding: .45rem .85rem; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); text-decoration: none; font-weight: 500; font-size: .99rem;
  border-left: 3px solid var(--pick, var(--accent));
}
.needs__pick span { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.needs__pick:hover { border-color: var(--accent); }
.needs__cta { justify-self: start; margin-top: .3rem; }

/* ── 14. Proyectos ────────────────────────────────────────────────────────── */
.projects { background: var(--surface-2); }
.projects__grid { display: grid; gap: 14px; }
.project { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: clamp(1.5rem, 3vw, 2.2rem); display: flex; flex-direction: column; }
.project__kicker { color: var(--accent-2-ink); }
.project__title { margin-top: 1.2rem; font-size: 1.6rem; }
.project__text { margin-top: .8rem; color: var(--muted); font-size: 1.01rem; }
.project__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: 1.6rem; }
.project__meta li { padding: .25rem .55rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .72rem; }
@media (min-width: 820px) { .projects__grid { grid-template-columns: repeat(3, 1fr); } }

/* ── 15. Equipo ───────────────────────────────────────────────────────────── */
.team__grid { display: grid; gap: clamp(1.4rem, 3vw, 2.2rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.member { position: relative; }
.member__frame { position: relative; }
.member__photo {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-2);
  filter: saturate(.55) contrast(1.03);
  transition: filter .45s var(--ease);
}
.member:hover .member__photo { filter: none; }
.member__name { margin-top: 1rem; font-size: 1.15rem; }
.member__role { color: var(--muted); margin-top: .3rem; }
.member--memoriam .member__photo {
  border-color: color-mix(in srgb, var(--text) 28%, var(--border));
  filter: grayscale(1) contrast(1.02);
}
/* La foto del homenaje no recupera el color al pasar el cursor. */
.member--memoriam:hover .member__photo { filter: grayscale(1) contrast(1.02); }
/* Banda, no pastilla: a este tamaño el texto ocupa dos líneas y un radio de
   999px se deformaría. Ocupa el ancho de la foto y queda centrada. */
/* Cinta en diagonal sobre la esquina superior derecha. Tono sobrio: es un
   homenaje, no una etiqueta de novedad. El marco recorta lo que sobresale. */
.member--memoriam .member__frame { overflow: hidden; border-radius: var(--r-md); }
.member__ribbon {
  position: absolute; z-index: 2;
  top: 1.2rem; right: -3.05rem; width: 10.3rem;
  transform: rotate(45deg);
  padding: .3rem 0; text-align: center;
  font-size: .66rem; letter-spacing: .16em;
  background: color-mix(in srgb, var(--text) 90%, transparent);
  color: var(--bg);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .55);
}
.member__tribute { margin-top: .6rem; color: var(--muted); font-size: .97rem; max-width: 34ch; }
@media (min-width: 900px) { .team__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── 16. Contacto ─────────────────────────────────────────────────────────── */
.contact {
  /* Sin relleno inferior: el mapa cierra la sección a ras y esa reserva dejaba
     una franja vacía entre el borde del mapa y el pie. */
  --sec-pb: 0;
}
.contact__grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .97rem; font-weight: 500; }
.field__opt { color: var(--muted); font-size: .74rem; }
.field input, .field textarea {
  width: 100%; padding: .8rem .9rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 1.03rem; resize: vertical;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #d4453f; }
.field__error { color: #c4342f; font-size: .92rem; }
.form__submit { justify-self: start; margin-top: .4rem; }
.form__status { font-size: .99rem; min-height: 1.4em; }
.form__status.is-ok { color: #1f9d5b; }
.form__status.is-error { color: #d4453f; }

.contact__list { display: grid; gap: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.contact__list dt { color: var(--muted); margin-bottom: .3rem; }
.contact__list dd { font-size: 1.08rem; }
.contact__list a { text-decoration-thickness: 1px; }
.contact__list a:hover { color: var(--accent); }
.contact__note { margin-top: 1.8rem; color: var(--muted); font-size: .99rem; }
@media (min-width: 900px) { .contact__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .75fr); } }

/* ── 17. Mapa ─────────────────────────────────────────────────────────────── */
/* ── 17b. Redes sociales ──────────────────────────────────────────────────── */
.social { display: flex; flex-wrap: wrap; gap: .5rem; }
.social__link {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--muted); text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.social__link:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-2); }

.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: 1.8rem; }
.hero__meta .status-badge { margin: 0; }

.contact__social { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.contact__social-label { color: var(--muted); margin-bottom: .7rem; }

/* ── 18. Mapa ─────────────────────────────────────────────────────────────── */
.map {
  position: relative; overflow: hidden;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  height: clamp(300px, 42vw, 460px);
}
.map__frame { width: 100%; height: 100%; border: 0; filter: grayscale(.35); }
:root[data-theme="dark"] .map__frame { filter: grayscale(.6) invert(.92) hue-rotate(180deg) brightness(.95); }
.map__open {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
  padding: .55rem 1rem; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface);
  font-size: .94rem; font-weight: 500; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
}
.map__open:hover { border-color: var(--accent); color: var(--accent); }

/* ── 18. Footer ───────────────────────────────────────────────────────────── */
.footer { padding-top: clamp(3rem, 6vw, 4.5rem); background: var(--surface-2); }
.footer__grid { display: grid; gap: 2.5rem; }
.footer__tagline { margin-top: 1rem; color: var(--muted); font-size: 1.01rem; max-width: 30ch; }
.footer__brand .status-badge { margin-top: 1.4rem; }
.footer__nav { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.footer__head { color: var(--muted); margin-bottom: .9rem; }
.footer__nav ul { display: grid; gap: .5rem; }
.footer__nav a { font-size: .99rem; text-decoration: none; color: var(--text); }
.footer__nav a:hover { color: var(--accent); text-decoration: underline; }
.footer__base {
  display: flex; justify-content: center; text-align: center;
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-block: 1.4rem;
  border-top: 1px solid var(--border); color: var(--muted);
}
@media (min-width: 900px) { .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 4rem; } }

/* ── 19. Nav móvil ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .burger { display: block; }
  .nav__cta { display: none; }
  .nav__menu {
    position: fixed; inset: 72px 0 auto 0; z-index: 90;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1rem var(--gutter) 1.6rem;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav__menu.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__list { flex-direction: column; gap: .2rem; }
  .nav__list a { display: block; padding: .75rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__list a::after { display: none; }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 20. Movimiento reducido ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  /* El homenaje conserva el blanco y negro: es intención, no decoración. */
  .member:not(.member--memoriam) .member__photo { filter: none; }
}

/* Impresión mínima decente */
@media print {
  .nav, .map, .eco__stage, .footer__nav { display: none; }
  body { background: #fff; color: #000; }
}
