/* ============================================================
   NOZOMI FLOW — Sistema de estilos
   Basado en NozomiFlow_BrandBook_V2_v1
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS DE MARCA
   ------------------------------------------------------------ */
:root {
  /* Paleta — BrandBook 04 Sistema Visual */
  --red:        #FF3300;   /* Bermellón · el 10% · un solo elemento por bloque */
  --red-faint:  rgba(255,51,0,0.05);
  --graphite:   #121212;   /* Sumi · titulares y textos de peso */
  --body:       #475569;   /* Slate-600 · cuerpo de texto */
  --muted:      #94a3b8;   /* Slate-400 · micro-copy y labels */
  --border:     #e2e8f0;
  --off:        #fafafa;   /* Off-white · fondos · el 90% */
  --white:      #ffffff;

  /* Retícula de fondo */
  --grid-size:  40px;
  --grid-line:  rgba(226,232,240,0.45);

  /* Medidas */
  --wrap:       1080px;
  --wrap-text:  680px;
  --nav-h:      72px;
}

/* ------------------------------------------------------------
   2. RESET
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

body {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.7;
  color: var(--body);
  background: var(--off);
  background-image:
    linear-gradient(to right,  var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   3. TIPOGRAFÍA — escala BrandBook
   ------------------------------------------------------------ */
.t-hero {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 200;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--graphite);
}
.t-section {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 200;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--graphite);
}
.t-card {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--graphite);
}
.t-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 200;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--graphite);
}
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-weight: 400;
}
.label-red { color: var(--red); }

.lead { font-size: 16px; line-height: 1.75; max-width: var(--wrap-text); }
.small { font-size: 13px; }

/* ------------------------------------------------------------
   4. LAYOUT
   ------------------------------------------------------------ */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 3rem; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 3rem; }

.section { padding: 5rem 0; }
.section-sm { padding: 3.5rem 0; }
.section-dark { background: var(--graphite); }
.section-white { background: var(--white); }

.divider { height: 1px; background: var(--border); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.stack-sm > * + * { margin-top: 0.75rem; }
.stack   > * + * { margin-top: 1.25rem; }
.stack-lg > * + * { margin-top: 2rem; }

/* ------------------------------------------------------------
   5. NAVEGACIÓN
   ------------------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(250,250,250,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 3rem; height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo svg { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--muted); transition: color .2s; padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav-link:hover { color: var(--graphite); }
.nav-link.is-active { color: var(--graphite); border-bottom-color: var(--red); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  width: 40px; height: 36px; cursor: pointer; align-items: center;
  justify-content: center; flex-direction: column; gap: 4px;
}
.nav-toggle span { display: block; width: 16px; height: 1px; background: var(--graphite); }

/* ------------------------------------------------------------
   6. BOTONES
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em;
  padding: 13px 24px; border: 1px solid var(--graphite);
  background: var(--graphite); color: var(--white);
  cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--red); border-color: var(--red); }

.btn-outline { background: transparent; color: var(--graphite); border-color: var(--border); }
.btn-outline:hover { background: transparent; border-color: var(--graphite); color: var(--graphite); }

.btn-red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-red:hover { background: var(--graphite); border-color: var(--graphite); }

.btn-ghost-light {
  background: transparent; color: var(--white);
  border-color: rgba(255,255,255,0.25);
}
.btn-ghost-light:hover { background: var(--white); color: var(--graphite); border-color: var(--white); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--graphite); border-bottom: 1px solid var(--red);
  padding-bottom: 3px; transition: gap .2s;
}
.link-arrow:hover { gap: 14px; }

/* ------------------------------------------------------------
   7. TARJETAS
   ------------------------------------------------------------ */
.card {
  background: var(--white); border: 1px solid var(--border); padding: 32px;
}
.card-red { border-left: 2px solid var(--red); padding-left: 30px; }
.card-dark { background: var(--graphite); border-color: var(--graphite); color: rgba(255,255,255,0.6); }
.card-dark .t-card, .card-dark .t-section { color: var(--white); }
.card-dark .label { color: rgba(255,255,255,0.35); }

.nav-card { display: block; transition: border-color .2s, transform .2s; }
.nav-card:hover { border-color: var(--graphite); transform: translateY(-2px); }
.nav-card:hover .link-arrow { gap: 14px; }

.tag {
  display: inline-block; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 4px 10px;
  border: 1px solid var(--border); color: var(--muted); margin: 2px 4px 2px 0;
}
.tag-red { border-color: var(--red); color: var(--red); background: var(--red-faint); }

/* ------------------------------------------------------------
   8. HERO
   ------------------------------------------------------------ */
.hero { padding: 6rem 0 4.5rem; position: relative; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; }
.hero .t-hero { max-width: 15ch; }
.hero-lines {
  margin-top: 1.5rem;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 200;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--body);
  max-width: 26ch;
}
.hero-lines span { color: var(--muted); }

.hero-sub { margin-top: 2rem; max-width: 620px; font-size: 16px; line-height: 1.75; }
.hero-cta { margin-top: 2.5rem; display: flex; gap: 14px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   9. SITUACIONES (quotes de dolor)
   ------------------------------------------------------------ */
.pain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.pain {
  background: var(--white); padding: 32px 34px;
  font-family: 'Fraunces', Georgia, serif; font-weight: 200; font-style: italic;
  font-size: 1.15rem; line-height: 1.5; color: var(--graphite);
}
.pain::before {
  content: ''; display: block; width: 20px; height: 1px;
  background: var(--red); margin-bottom: 18px;
}

/* ------------------------------------------------------------
   10. BLOQUES DEL CATÁLOGO (antes "fases del sistema")
   ------------------------------------------------------------ */
.phase { display: flex; gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--border); }
.phase:last-child { border-bottom: none; }
.phase-index {
  flex-shrink: 0; width: 90px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red);
  padding-top: 6px;
}
.phase-body { flex: 1; }
.phase-name {
  font-family: 'Fraunces', Georgia, serif; font-weight: 300;
  font-size: 1.4rem; letter-spacing: -0.01em; color: var(--graphite);
  margin-bottom: 10px;
}
.phase-agents { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.phase-agents .label { display: block; margin-bottom: 10px; }
.agent-list { font-size: 13px; color: var(--graphite); line-height: 2; }
.agent-list span { color: var(--muted); margin: 0 6px; }

/* ------------------------------------------------------------
   11. CASOS DE USO
   ------------------------------------------------------------ */
.case { background: var(--white); border: 1px solid var(--border); border-top: 2px solid var(--red); padding: 30px 32px; }
.case-title {
  font-family: 'Fraunces', Georgia, serif; font-weight: 300; font-size: 1.2rem;
  color: var(--graphite); margin-bottom: 12px; line-height: 1.25;
}
.case p { font-size: 14px; line-height: 1.75; }

/* ------------------------------------------------------------
   12. PRICING
   ------------------------------------------------------------ */
.tier { background: var(--white); border: 1px solid var(--border); padding: 34px 32px; display: flex; flex-direction: column; }
.tier-featured { border: 1px solid var(--graphite); position: relative; }
.tier-flag {
  position: absolute; top: -1px; right: -1px;
  background: var(--red); color: var(--white);
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; padding: 5px 12px;
}
.tier-name { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--graphite); margin-bottom: 16px; }
.tier-price {
  font-family: 'Fraunces', Georgia, serif; font-weight: 200; font-size: 3rem;
  line-height: 1; color: var(--graphite); margin-bottom: 6px;
}
.tier-price small { font-size: 1.5rem; }
.tier-price-note { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 22px; }
.tier-desc { font-size: 14px; line-height: 1.7; margin-bottom: 24px; }
.tier-includes { border-top: 1px solid var(--border); padding-top: 20px; margin-top: auto; }
.tier-includes .label { display: block; margin-bottom: 12px; }
.tier-agents { font-size: 13px; line-height: 1.9; color: var(--graphite); }
.tier-agents span { color: var(--muted); }
.tier-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.tier-custom { background: var(--graphite); border-color: var(--graphite); color: rgba(255,255,255,0.6); }
.tier-custom .tier-name, .tier-custom .tier-price { color: var(--white); }
.tier-custom .tier-includes, .tier-custom .tier-foot { border-color: rgba(255,255,255,0.15); }

/* ------------------------------------------------------------
   13. EQUIPO
   ------------------------------------------------------------ */
.person {
  background: var(--white); border: 1px solid var(--border);
  display: grid; grid-template-columns: 280px 1fr; align-items: stretch;
}
.person + .person { margin-top: 24px; }

/* Foto del equipo — blanco y negro, según BrandBook 05.
   Sustituir el archivo en assets/img/equipo/ manteniendo el nombre. */
.person-photo {
  aspect-ratio: 4 / 5; background: #e8eaed; position: relative; overflow: hidden;
  border-right: 1px solid var(--border);
}
.person-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
}
.person-body { padding: 34px 38px; display: flex; flex-direction: column; justify-content: center; }
.person-name {
  font-family: 'Fraunces', Georgia, serif; font-weight: 300; font-size: 1.4rem;
  color: var(--graphite); letter-spacing: -0.01em; margin-bottom: 6px;
}
.person-role {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--red); margin-bottom: 18px;
}
.person-body p { font-size: 14px; line-height: 1.8; max-width: 62ch; }

/* ------------------------------------------------------------
   14. FORMULARIO
   ------------------------------------------------------------ */
.form { max-width: 620px; }
.form-row { margin-bottom: 20px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form label { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.form input:not([type="checkbox"]), .form textarea {
  width: 100%; background: var(--white); border: 1px solid var(--border);
  padding: 13px 16px; font-size: 14px; color: var(--graphite);
  transition: border-color .2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--red); }
.form textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 12px; color: var(--muted); margin-top: 16px; }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-consent { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.form-consent input[type="checkbox"] { width: 16px; height: 16px; margin-top: 3px; padding: 0; accent-color: var(--red); flex-shrink: 0; }
.form-consent label { display: inline; text-transform: none; letter-spacing: normal; font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 0; }
.form-consent label a { color: var(--red); }

/* ------------------------------------------------------------
   15. PROCESO / ONBOARDING
   ------------------------------------------------------------ */
.metric {
  font-family: 'Fraunces', Georgia, serif; font-weight: 200;
  font-size: 4rem; line-height: 1; color: var(--graphite);
}
.metric span { font-size: 1.4rem; color: var(--red); }

/* ------------------------------------------------------------
   16. FOOTER
   ------------------------------------------------------------ */
.footer { background: var(--graphite); padding: 4rem 0 2.5rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 3rem; }
.footer-top { display: flex; justify-content: space-between; gap: 3rem; flex-wrap: wrap; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-logo svg { height: 34px; width: auto; }
.footer-tag { color: rgba(255,255,255,0.45); font-size: 13px; margin-top: 16px; max-width: 320px; line-height: 1.7; }
.footer-nav { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col .label { display: block; color: rgba(255,255,255,0.3); margin-bottom: 14px; }
.footer-col a { display: block; color: rgba(255,255,255,0.55); font-size: 13px; line-height: 2; transition: color .2s; }
.footer-col a:hover { color: var(--red); }
.footer-bottom { padding-top: 2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom p, .footer-bottom a { color: rgba(255,255,255,0.3); font-size: 11px; letter-spacing: 0.1em; }

/* ------------------------------------------------------------
   17. HUECOS DE ILUSTRACIÓN
   ------------------------------------------------------------
   Las ilustraciones de marca (estética Akira / Mecha) van aquí.
   BrandBook 05: monocromo alto contraste + un único destello
   Bermellón. Nunca protagonista — textura de fondo al 10%.

   CÓMO FUNCIONA (revisado):
   Cada ilustración existe en dos archivos ya coloreados —no se
   usan filtros CSS de color sobre ellos—:
     mecha-<pagina>.webp     tinta oscura + rojo de marca, para fondos claros
     mecha-<pagina>-w.webp   tinta blanca + el mismo rojo,  para fondos oscuros
   El CSS elige el archivo correcto según el fondo. No hay
   'invert()' en ningún punto: invertir colorea el rojo hacia
   cian, porque es su complementario. Por eso antes el destello
   Bermellón se veía mal (o, con grayscale por delante, no se
   veía nunca: grayscale(100%) borra el color antes de que
   invert() tenga nada que invertir).

   PARA ACTIVAR UNA PÁGINA NUEVA:
   1. Genera los dos archivos (claro/oscuro) con el mismo proceso.
   2. Añade su bloque .illustration-<pagina> siguiendo el patrón de abajo.
   El <div class="illustration-bg illustration-<pagina">"></div>
   ya está en el HTML de cada página; no hace falta tocarlo.
   ------------------------------------------------------------ */

.has-illustration { position: relative; overflow: hidden; }
.has-illustration > * { position: relative; z-index: 2; }

.illustration-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
  opacity: 0.09;               /* subir con cautela: máximo ~0.14 */
  pointer-events: none;
}

/* url() directo, sin custom properties: un url() dentro de una variable CSS
   (--ilus, var(--ilus)) se resuelve mal en varios navegadores, contando la
   ruta relativa desde el documento en vez de desde esta hoja de estilos.
   Con la ruta escrita aquí mismo no hay ambigüedad posible. */
.illustration-home    { background-image: url('../img/ilustraciones/mecha-hero.webp'); }
.illustration-sistema  { background-image: url('../img/ilustraciones/mecha-sistema.webp'); }
.illustration-pricing  { background-image: url('../img/ilustraciones/mecha-pricing.webp'); }
.illustration-equipo   { background-image: url('../img/ilustraciones/mecha-equipo.webp'); }

.section-dark .illustration-home   { background-image: url('../img/ilustraciones/mecha-hero-w.webp'); opacity: 0.10; }
.section-dark .illustration-sistema { background-image: url('../img/ilustraciones/mecha-sistema-w.webp'); opacity: 0.10; }
.section-dark .illustration-pricing { background-image: url('../img/ilustraciones/mecha-pricing-w.webp'); opacity: 0.10; }
.section-dark .illustration-equipo  { background-image: url('../img/ilustraciones/mecha-equipo-w.webp'); opacity: 0.10; }

/* ── Extra 1: acento en la sección oscura de la home ("Cómo funciona") ──
   Esa sección estaba vacía; ahora lleva la pieza hexagonal centrada,
   grande y con el haz rojo intacto —el único punto de la home donde
   se permite subir la opacidad, porque es un momento, no una textura. */
.section-dark .ilus-hub {
  position: absolute; z-index: 1; pointer-events: none;
  top: 50%; left: 50%;
  width: 760px; height: 760px;
  margin-top: -380px; margin-left: -380px;   /* centrado clásico: nada de aspect-ratio ni transform */
  background-image: url('../img/ilustraciones/mecha-hub-w.webp');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.16;
}
@media (max-width: 860px) {
  .section-dark .ilus-hub { width: 88vw; height: 88vw; margin-top: -44vw; margin-left: -44vw; }
}

/* ── Extra 2: marca de agua discreta en el footer, en todas las páginas ── */
.footer { position: relative; overflow: hidden; }
.footer::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  top: -35%; right: -4%; width: 420px; height: 420px;   /* el archivo es 1:1 real */
  background-image: url('../img/ilustraciones/mecha-firma-w.webp');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.10;
}
@media (max-width: 640px) {
  .footer::before { width: 260px; height: 260px; }
}
.footer-inner { position: relative; z-index: 1; }

/* ------------------------------------------------------------
   18. ACCESIBILIDAD
   ------------------------------------------------------------ */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--graphite); color: var(--white); padding: 12px 20px; font-size: 12px;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------
   19. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .wrap, .wrap-narrow, .nav-inner, .footer-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .section { padding: 3.5rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
  .grid-2, .grid-4, .pain-grid, .form-row-2 { grid-template-columns: 1fr; }
  .hero .t-hero { max-width: none; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--off); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 1rem 1.5rem 1.5rem; display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links .nav-link { padding: 12px 0; width: 100%; }
  .nav-links .btn { margin-top: 12px; }

  .person { grid-template-columns: 1fr; }
  .person-photo { border-right: none; border-bottom: 1px solid var(--border); max-height: 420px; }
  .person-body { padding: 28px 24px; }

  .phase { flex-direction: column; gap: 14px; }
  .phase-index { width: auto; padding-top: 0; }
  .footer-top { flex-direction: column; }
  .footer-nav { gap: 2rem; }
}

@media (max-width: 420px) {
  .tier-price { font-size: 2.4rem; }
  .metric { font-size: 3rem; }
}

/* ------------------------------------------------------------
   20. IMPRESIÓN
   ------------------------------------------------------------ */
@media print {
  body { background: var(--white); background-image: none; }
  .nav, .footer, .btn { display: none; }
}
