/* ─── TOKENS ─── */
:root {
  --bg:        #0a0a0b;
  --surface:   #111114;
  --border:    #1e1e24;
  --border-hi: #2e2e38;
  --text:      #c8c8d4;
  --text-dim:  #8989a3;
  --text-hi:   #eeeef4;
  --fuchsia:   #d946a8;
  --fuchsia-li:#e175bd;
  --fuchsia-lo:#d946a820;
  --cyan:      #22d3ee;
  --cyan-lo:   #22d3ee18;
  --amber:     #f59e0b;
  --amber-lo:  #f59e0b18;
  --green:     #4ade80;
  --green-lo:  #4ade8018;
  --mono:      'JetBrains Mono', monospace;
  --serif:     'Fraunces', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
  --radius:    6px;
  --max-w:     1100px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,11,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  overflow-x: auto;
}
nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.7rem;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
nav a:hover { 
  color: var(--text-hi); 
  background: var(--border); 
}
nav .sep { 
  color: var(--border-hi); 
  font-size: 0.8rem; 
  user-select: none; }

nav .back {
  color: var(--fuchsia);
  margin-right: auto;
}
nav .back:hover { 
  color: var(--fuchsia); 
  opacity: 0.8; 
  background: var(--fuchsia-lo); 
}

/* ─── LAYOUT ─── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: none; }

/* ─── TYPOGRAPHY ─── */
.label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:var(--text-dim);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--text-dim)
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 300;
  color: var(--text-hi);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 em {
  font-style: italic;
  color: var(--fuchsia);
}
h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  color: var(--text-hi);
  line-height: 1.25;
  margin-bottom: 2rem;
}
h3 {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-hi);
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}
p { color: var(--text); 
  margin-bottom: 1rem; 
}
p:last-child { 
  margin-bottom: 0; 
}
strong { 
  color: var(--text-hi); 
  font-weight: 500; }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  border: 1px solid;
}
.badge-done   { 
  color: var(--green);  
  background: var(--green-lo);  
  border-color: #4ade8040; 
}
.badge-active { 
  color: var(--amber);  
  background: var(--amber-lo);  
  border-color: #f59e0b40; 
}
.badge-pending{ 
  color: var(--text-dim); 
  background: var(--border);  
  border-color: var(--border-hi); 
}
.badge::before {
  content: ''; display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-active::before {
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { 
    opacity: 1; 
  }
  50%       { 
    opacity: 0.3; 
  }
}

/* ─── HERO y DATASET ─── */
#hero {
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--border);
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.hero-project-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fuchsia);
}

.hero-project-tag em {
   color: var(--amber);
}

.hero-title { 
  margin-bottom: 1.5rem; 

}

.hero-sub {
  font-size: 1rem;
  color: var(--text);
  max-width: 620px;
  margin-bottom: 2rem;
  line-height: 1.75;
}
.hero-context {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  border-left: 2px solid var(--fuchsia);
  padding-left: 1rem;
  max-width: 580px;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  margin-bottom: 4rem;


}
.stat-item { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-val {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-hi);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ─── METHODOLOGY ─── */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}
.method-cell {
  background: var(--surface);
  padding: 1.8rem;
}
.method-cell .tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fuchsia);
  margin-bottom: 0.8rem;
}
.method-cell h3 { 
  font-size: 0.9rem; 
  margin-bottom: 0.7rem; }

.method-cell p { 
  font-size: 0.85rem; 
  color: var(--text); 
  line-height: 1.65; 
  text-align: justify;
  margin: 0; 
}

.insight-box {
  background: var(--fuchsia-lo);
  border: 1px solid #d946a830;
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}
.insight-box strong { color: var(--fuchsia); }

/* ─── APLICABILIDAD ─── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.2s;
}
.app-card:hover { border-color: var(--border-hi); }
.app-icon { font-size: 1.4rem; margin-bottom: 0.8rem; }
.app-card h3 { font-size: 0.88rem; margin-bottom: 0.5rem; }
.app-card p { font-size: 0.82rem; color: var(--text-dim); line-height: 1.6; margin: 0; }

.transfer-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.transfer-note strong { 
  color: var(--cyan); 
}

/* ─── KANBAN / ESTADO ─── */
.phase-list { 
  display: flex; 
  flex-direction: 
  column; gap: 1px; 
  background: var(--border); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  overflow: hidden; 
}
.phase-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.phase-row.header-row {
  background: var(--surface);
}
.phase-col {
  display:flex;
  flex-direction:column;
  gap:0.5rem;
  padding-top:1.2rem;
  background: var(--surface);
  padding: 1rem 1.2rem;
  font-size: 0.82rem;
}
.phase-row.header-row .phase-col {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.8rem 1.2rem;
}
.phase-name {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
}
.phase-name .phase-num {
  display: block;
  font-size: 0.65rem;
  color: var(--text-hi);
  margin-bottom: 0.2rem;
}
.phase-name.active-phase .phase-num { 
  color: var(--amber); 
}
.phase-name.active-phase { 
  color: var(--amber); 
}
.phase-name.done-phase { 
  color: var(--green); 
}
.block-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-hi);
  margin-bottom: 0.3rem;
}
.block-desc { 
  font-size: 0.82rem; 
  color:var(--text-dim);
}

/* ─── ALINEACIÓN BLOQUE ↔ ESTADO EN FASES MULTI-BLOQUE ─── */
/* Convierte la 2ª y 3ª columna de cada phase-row en sub-grids
   con el mismo número de filas, para que cada bloque quede
   alineado verticalmente con su badge correspondiente. */

.phase-row > .phase-col:nth-child(2),
.phase-row > .phase-col:nth-child(3) {
  display: grid;
  grid-auto-rows: 1fr;     /* todas las filas iguales */
  align-items: center;     /* centra contenido verticalmente */
  gap: 0.6rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Cada item-bloque y cada badge ocupan exactamente 1 fila */
.phase-row > .phase-col:nth-child(2) > div,
.phase-row > .phase-col:nth-child(3) > .badge {
  margin: 0;               /* anula el margin-bottom inline de los <div> */
  align-self: center;
}

/* La columna de estados centra los badges horizontalmente
   a la izquierda como ya estaba, pero con altura de fila uniforme */
.phase-row > .phase-col:nth-child(3) {
  align-content: start;
}

/* La cabecera de la tabla NO debe heredar este sub-grid */
.phase-row.header-row > .phase-col:nth-child(2),
.phase-row.header-row > .phase-col:nth-child(3) {
  display: flex;
  flex-direction: column;
}

/* ─── TIMELINE ─── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--fuchsia), var(--border) 60%);
}
.tl-item {
  position: relative;
  padding-bottom: 2.5rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -2.3rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-hi);
  border: 2px solid var(--border);
}
.tl-dot.done   { background: var(--green);  border-color: var(--green); }
.tl-dot.active { background: var(--amber);  border-color: var(--amber); box-shadow: 0 0 8px #f59e0b60; }

.tl-date {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--fuchsia-li);
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.tl-title { 
  font-size: 0.9rem; 
  color: var(--text-hi); 
  margin-bottom: 0.3rem; 
  font-weight: 500; 
}
.tl-desc  { 
  font-size: 0.82rem; 
  color: var(--text-dim); 
  line-height: 1.6; }

/* ─── MILESTONES ─── */
.milestone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.milestone-card:last-child { margin-bottom: 0; }
.ms-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.ms-header:hover { background: rgba(255,255,255,0.02); }
.ms-header-left { display: flex; flex-direction: column; gap: 0.5rem; }
.ms-block-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fuchsia);
}
.ms-title { 
  font-size: 1rem; 
  color: var(--text-hi); 
  font-weight: 500; 
}

.ms-body { padding: 1.4rem 1.6rem; }

.four-q {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.q-card {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.q-card.decision { 
  border-left-color: var(--fuchsia-li);
  border-left-width: 2px; 
}
.q-card.renuncia  { 
  border-left-color: var(--amber);   
  border-left-width: 2px; 
}
.q-card.uso-real  { 
  border-left-color: var(--cyan);
  border-left-width: 2px; 
}
.q-card.tradeoff  { 
  border-left-color: var(--green);   
  border-left-width: 2px; 
}
.q-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.q-card.decision .q-label { 
  color:var(--fuchsia-li);
}
.q-card.renuncia  .q-label { 
  color: var(--amber); 
}
.q-card.uso-real  .q-label { 
  color: var(--cyan);
}
.q-card.tradeoff  .q-label { 
  color: var(--green); 
}
.q-text { 
  font-size: 0.8rem; 
  text-align: justify;
  color: var(--text); 
  line-height: 1.6; 
}

/* bloque en curso: partial */
.ms-partial {
  background: var(--amber-lo);
  border: 1px solid #f59e0b30;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: 0.8lrem;
  color: var(--text-dim);
  line-height: 1.65;
}
.ms-partial strong { color: var(--amber); }

/* bloque pendiente: key question */
.ms-pending-q {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 0.8rem 1.2rem;
  border-left: 2px solid var(--border-hi);
}

/* ─── DECISIONES ─── */
.decision-list { display: flex; flex-direction: column; gap: 0.75rem; }
.decision-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.decision-item:hover { border-color: var(--border-hi); }
.decision-num {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--border-hi);
  padding-top: 0.1rem;
}
.decision-content h3 { font-size: 0.88rem; color: var(--fuchsia); margin-bottom: 0.3rem; }
.decision-content p { font-size: 0.83rem; color: var(--text-dim); margin: 0; line-height: 1.6; }

/* ─── RENUNCIAS ─── */
.renuncia-list { display: flex; flex-direction: column; gap: 0.75rem; }
.renuncia-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--amber);
  border-radius: var(--radius);
}
.renuncia-x {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--amber);
  padding-top: 0.15rem;
}
.renuncia-content h3 { font-size: 0.88rem; margin-bottom: 0.3rem; }
.renuncia-content p { font-size: 0.82rem; color: var(--text-dim); margin: 0; line-height: 1.6; }

/* ─── BIBLIOGRAFÍA ─── */
.bib-section { margin-bottom: 2rem; }
.bib-section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:rgb(157, 192, 239);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.bib-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}
.bib-item:last-child { border-bottom: none; }
.bib-ref {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-hi);
  margin-bottom: 0.35rem;
  line-height: 1.5;
}
.bib-why {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.bib-why strong { color: var(--text); }
.bib-tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  background: var(--border);
  color: var(--text-dim);
  white-space: nowrap;
  align-self: start;
}

/* ─── GLOSARIO ─── */
#glosario { padding: 4rem 0; }

.glossary-search {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 0.7rem 1rem;
  color: #d4d4d0;
  font-size: 0.9rem;
  font-family: 'Fraunces', serif;
  margin: 1.5rem 0 2rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.glossary-search:focus { border-color: #c084fc; }

.glossary-count {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  font-family: var(--mono);
}

.glossary-list { display: flex; flex-direction: column; }

.glossary-item {
  border-bottom: 1px solid #222;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.glossary-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.glossary-item:first-child { 
  border-top: 1px solid #222; 
}

.glossary-acronym {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #f5f5f0;
  letter-spacing: 0.05em;
}

.glossary-sep { color: #444; font-size: 0.8rem; }

.glossary-full {
  font-size: 0.78rem;
  color: #a0a09a;
  font-style: italic;
  font-family: 'Fraunces', serif;
}

.glossary-def {
  font-size: 0.95rem;
  color: #c5c5be;
  font-family: 'Fraunces', serif;
  line-height: 1.55;
}

.glossary-empty {
  color: #444;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 3rem;
}

/* ─── CTA NOTEBOOK ─── */
#notebook {
  padding: 5rem 0;
}
.cta-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--fuchsia), transparent);
}
.cta-block h2 { margin-bottom: 0.8rem; }
.cta-block p { color: var(--text-dim); font-size: 0.9rem; max-width: 480px; margin: 0 auto 2rem; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--fuchsia);
  color: #fff;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  transition: opacity 0.2s, transform 0.2s;
}
.cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.cta-note {
  display: block;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
}



/* ─── FOOTER ─── */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
footer p { font-size: 0.78rem; color: var(--text-dim); margin: 0; }
footer a { color: var(--fuchsia); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ─── UTILS ─── */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.ms-readings {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 680px) {
  nav { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  section { padding: 3.5rem 0; }
  .method-grid { grid-template-columns: 1fr; }
  .four-q { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .phase-row { grid-template-columns: 1fr; }
  .phase-row.header-row { display: none; }
  .cta-block { padding: 2rem 1.2rem; }
}
