/* =========================================================
   Bitácora Orbital — estilos
   Paleta: espacio profundo + pluma de cohete + cian de HUD
   ========================================================= */
:root {
  --bg: #05070f;
  --bg-2: #0a0f1f;
  --panel: rgba(14, 20, 40, 0.62);
  --line: rgba(120, 160, 255, 0.14);
  --line-strong: rgba(120, 160, 255, 0.3);
  --text: #d8e1f0;
  --dim: #8592ad;
  --white: #f4f7fc;
  --accent: #ff6b2c;      /* pluma */
  --accent-2: #ffb347;
  --cyan: #4cc9f0;        /* HUD */
  --violet: #8b5cf6;
  --go: #3ddc97;
  --radius: 18px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(76, 201, 240, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4 { color: var(--white); font-weight: 700; letter-spacing: -0.02em; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--white); }

.mono { font-family: var(--mono); }
.text-accent { color: var(--accent) !important; }
.text-dim { color: var(--dim) !important; }
.text-go { color: var(--go) !important; }

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------------- NAV ---------------- */
.nav-glass {
  padding: 0.9rem 0;
  transition: background 0.3s, padding 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav-glass.scrolled {
  background: rgba(5, 7, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.55rem 0;
  border-bottom-color: var(--line);
}
.brand {
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 0 20px rgba(255, 107, 44, 0.45);
}
.navbar .nav-link { color: var(--dim); font-weight: 500; position: relative; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--white); }
.navbar .nav-link::after {
  content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.2rem;
  height: 2px; background: var(--accent); transform: scaleX(0); transition: transform 0.25s;
}
.navbar .nav-link:hover::after { transform: scaleX(1); }
.navbar-toggler { color: var(--white); border-color: var(--line-strong); font-size: 1.4rem; }
.navbar-toggler:focus { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 991px) {
  .navbar-collapse { background: rgba(5, 7, 15, 0.95); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-top: 0.75rem; }
}

.utc-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--cyan);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.3rem 0.8rem;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--go);
  box-shadow: 0 0 8px var(--go); animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------------- BUTTONS ---------------- */
.btn-launch {
  background: linear-gradient(135deg, var(--accent), #ff3d6e);
  color: #fff; border: 0; font-weight: 600;
  padding: 0.8rem 1.4rem; border-radius: 12px;
  box-shadow: 0 10px 30px -10px rgba(255, 107, 44, 0.7);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-launch:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(255, 107, 44, 0.9); }
.btn-launch i { margin-right: 0.35rem; }
.btn-ghost {
  color: var(--white); border: 1px solid var(--line-strong);
  padding: 0.8rem 1.4rem; border-radius: 12px; font-weight: 500;
}
.btn-ghost:hover { color: var(--white); border-color: var(--cyan); background: rgba(76, 201, 240, 0.08); }

/* ---------------- HERO ---------------- */
.hero { padding: 9rem 0 4rem; min-height: 92vh; display: flex; align-items: center; }
.eyebrow { color: var(--cyan); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }
.blink { animation: pulse 1s steps(1) infinite; color: var(--accent); }
.hero-title { font-size: clamp(2.3rem, 6vw, 4.6rem); line-height: 1.04; margin: 0.8rem 0 1.2rem; min-height: 3.15em; /* reserva 3 líneas: evita saltos con el texto animado */ }
.gradient-text {
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 40%, #ff3d6e 70%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gradient-text::after { content: "_"; color: var(--accent); -webkit-text-fill-color: var(--accent); animation: pulse 1s steps(1) infinite; }
.hero-sub { font-size: 1.15rem; color: var(--dim); max-width: 560px; }

.telemetry-row { display: grid; grid-template-columns: repeat(4, auto); gap: 0; justify-content: start; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; width: fit-content; max-width: 100%; }
.telemetry { padding: 0.75rem 1.1rem; border-right: 1px solid var(--line); background: rgba(10, 15, 31, 0.6); }
.telemetry:last-child { border-right: 0; }
.t-label { display: block; font-size: 0.68rem; color: var(--dim); letter-spacing: 0.15em; text-transform: uppercase; }
.t-value { color: var(--white); font-size: 0.95rem; font-weight: 600; }
@media (max-width: 575px) {
  .telemetry-row { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .telemetry:nth-child(2) { border-right: 0; }
  .telemetry:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* Flight profile illustration (avión + cohete) */
@keyframes spin { to { transform: rotate(360deg); } }
.flight-stage { margin: 0 auto; max-width: 500px; overflow: hidden; padding: 0; }
.fs-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.7rem; letter-spacing: 0.14em; color: var(--cyan);
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
}
.fs-head .dot-live { display: inline-block; margin-right: 0.4rem; vertical-align: middle; }
.flight-svg { display: block; width: 100%; height: auto; }
.fs-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; fill: var(--dim); }
.fs-label.accent { fill: var(--accent); }
.fs-label.cyan { fill: var(--cyan); }
.fs-layer { stroke: rgba(120, 160, 255, 0.18); stroke-dasharray: 3 5; }
.fs-orbit { fill: none; stroke: rgba(139, 92, 246, 0.55); stroke-dasharray: 6 6; animation: dash 3s linear infinite; }
.fs-path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 7; animation: dash 1.6s linear infinite; }
.fs-path-plane { stroke: var(--cyan); }
.fs-path-rocket { stroke: url(#trailR); }
@keyframes dash { to { stroke-dashoffset: -36; } }
.fs-plane { filter: drop-shadow(0 0 6px var(--cyan)); }
.fs-rocket { filter: drop-shadow(0 0 8px var(--accent)); }
.fs-legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  font-size: 0.72rem; color: var(--dim);
  padding: 0.7rem 1rem; border-top: 1px solid var(--line); margin: 0;
}
.leg { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 0.35rem; }
.leg-plane { background: var(--cyan); }
.leg-rocket { background: linear-gradient(90deg, var(--accent-2), #ff3d6e); }

/* ---------------- TICKER ---------------- */
.ticker {
  border-block: 1px solid var(--line);
  background: rgba(10, 15, 31, 0.7);
  overflow: hidden; white-space: nowrap;
  font-size: 0.8rem; color: var(--dim);
  padding: 0.65rem 0;
}
.ticker-track { display: inline-block; animation: ticker 45s linear infinite; }
.ticker-track span { margin-right: 3rem; }
.ticker-track b { color: var(--cyan); font-weight: 600; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------------- SECTIONS ---------------- */
.section { padding: 5rem 0; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: 0; display: inline; }
.section-index {
  display: inline-block; color: var(--accent); font-size: 0.85rem;
  margin-right: 0.75rem; vertical-align: super;
}
.section-sub { color: var(--dim); margin: 0.5rem 0 0; }

/* Featured */
.featured {
  display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
  color: inherit;
}
.featured:hover { border-color: var(--line-strong); transform: translateY(-3px); color: inherit; }
.featured .cover { min-height: 340px; border-radius: 0; }
.featured-body { padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.featured-body h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
@media (max-width: 991px) { .featured { grid-template-columns: 1fr; } .featured .cover { min-height: 220px; } }

/* Covers (generados, sin imágenes externas) */
.cover {
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
  min-height: 190px;
  display: grid; place-items: center;
  background: var(--cover-bg, linear-gradient(135deg, #1e1b4b, #0f172a));
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%);
}
.cover::after {
  content: ""; position: absolute; width: 140%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  left: -20%; top: 55%;
}
.cover i { position: relative; z-index: 1; font-size: 3.6rem; color: rgba(255,255,255,0.92); filter: drop-shadow(0 0 24px var(--cover-glow, var(--accent))); transition: transform 0.5s; }
.featured .cover i { font-size: 6rem; }
.cover .cover-code {
  position: absolute; z-index: 1; left: 0.9rem; bottom: 0.7rem;
  font-family: var(--mono); font-size: 0.7rem; color: rgba(255,255,255,0.7); letter-spacing: 0.1em;
}
.cover[data-cat="aerodinamica"] { --cover-bg: linear-gradient(135deg, #082f49, #0284c7 55%, #7dd3fc); --cover-glow: #7dd3fc; }
.cover[data-cat="aeronaves"]    { --cover-bg: linear-gradient(135deg, #1e1b4b, #4338ca 55%, #22d3ee); --cover-glow: #22d3ee; }
.cover[data-cat="propulsion"]   { --cover-bg: linear-gradient(135deg, #7c2d12, #ea580c 55%, #fbbf24); --cover-glow: #fb923c; }
.cover[data-cat="coheteria"]    { --cover-bg: linear-gradient(135deg, #3b0764, #be123c 55%, #fb923c); --cover-glow: #fb7185; }
.cover[data-cat="avionica"]     { --cover-bg: linear-gradient(135deg, #052e16, #059669 55%, #a3e635); --cover-glow: #4ade80; }
.cover[data-cat="estructuras"]  { --cover-bg: linear-gradient(135deg, #1f2937, #475569 55%, #cbd5e1); --cover-glow: #e2e8f0; }

/* Post cards */
.post-card {
  display: flex; flex-direction: column; height: 100%;
  padding: 0.75rem; color: inherit;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  opacity: 0; transform: translateY(20px);
}
.post-card.in { opacity: 1; transform: none; }
.post-card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 20px 50px -25px rgba(76, 201, 240, 0.5); color: inherit; }
.post-card:hover .cover i { transform: scale(1.12) rotate(-6deg); }
.post-body { padding: 1.1rem 0.6rem 0.5rem; display: flex; flex-direction: column; flex: 1; }
.post-body h3 { font-size: 1.25rem; line-height: 1.3; margin: 0.6rem 0; }
.post-body p { color: var(--dim); font-size: 0.95rem; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.meta i { margin-right: 0.3rem; color: var(--cyan); }
.cat-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cyan); background: rgba(76, 201, 240, 0.08);
  border: 1px solid rgba(76, 201, 240, 0.25); padding: 0.2rem 0.6rem; border-radius: 6px;
  width: fit-content;
}
.dv-badge { font-family: var(--mono); font-size: 0.7rem; color: var(--accent-2); }
.read-more { font-weight: 600; color: var(--accent); margin-top: 0.75rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.read-more i { transition: transform 0.25s; }
.post-card:hover .read-more i, .featured:hover .read-more i { transform: translateX(5px); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 0.8rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-btn {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  padding: 0.45rem 0.9rem; border-radius: 10px; font-weight: 500; font-size: 0.9rem;
  transition: all 0.2s;
}
.filter-btn:hover { color: var(--white); border-color: var(--line-strong); }
.filter-btn.active { color: #fff; background: linear-gradient(135deg, rgba(255,107,44,0.9), rgba(255,61,110,0.9)); }
.filter-btn .count { font-family: var(--mono); font-size: 0.72rem; opacity: 0.7; margin-left: 0.3rem; }
.search-wrap { position: relative; flex: 0 1 300px; min-width: 220px; }
.search-wrap i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search-input {
  background: rgba(5, 7, 15, 0.6) !important; border: 1px solid var(--line) !important;
  color: var(--white) !important; padding: 0.6rem 0.9rem 0.6rem 2.4rem; border-radius: 10px;
}
.search-input::placeholder { color: var(--dim); }
.search-input:focus { border-color: var(--cyan) !important; box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.15) !important; }
.empty-state { padding: 4rem 0; color: var(--dim); }
.empty-state i { font-size: 2.5rem; color: var(--accent); }

/* ---------------- CV ---------------- */
.cv-top { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: space-between; align-items: flex-end; }
.cv-top .btn i { margin-right: 0.35rem; }
.panel-title { font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cyan); margin-bottom: 1.1rem; font-weight: 600; }
.xp-date { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--accent-2); white-space: nowrap; }

.cv-mission { display: grid; grid-template-columns: 96px 1fr; gap: 1.25rem; padding: 1.25rem; align-items: start; transition: border-color 0.3s, transform 0.3s; }
.cv-mission:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.cv-mission-icon.cover { min-height: 96px; height: 96px; border-radius: 14px; }
.cv-mission-icon.cover i { font-size: 2.4rem; }
.cv-mission h3 { font-size: 1.2rem; margin: 0.35rem 0 0.2rem; }
.cv-role { color: var(--accent); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.cv-mission p:last-child { color: var(--dim); font-size: 0.95rem; }

.cv-panel { padding: 1.5rem; }
.cv-tabs { gap: 0.4rem; border-bottom: 1px solid var(--line); padding-bottom: 0.9rem; margin-bottom: 1.5rem; }
.cv-tabs .nav-link {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  padding: 0.45rem 0.9rem; border-radius: 10px; font-weight: 500; font-size: 0.92rem;
}
.cv-tabs .nav-link:hover { color: var(--white); border-color: var(--line-strong); }
.cv-tabs .nav-link.active { color: #fff; background: linear-gradient(135deg, rgba(255,107,44,0.9), rgba(255,61,110,0.9)); }

.xp-list { list-style: none; padding: 0 0 0 1.5rem; margin: 0; position: relative; }
.xp-list::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--line-strong) 40%, var(--line)); }
.xp-item { position: relative; padding-bottom: 1.6rem; }
.xp-item:last-child { padding-bottom: 0; }
.xp-item::before {
  content: ""; position: absolute; left: calc(-1.5rem + 1px); top: 6px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan);
}
.xp-item.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.xp-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; align-items: baseline; }
.xp-head h4 { font-size: 1.05rem; margin: 0; }
.xp-org { color: var(--cyan); font-size: 0.9rem; margin: 0.15rem 0 0.5rem; }
.xp-item ul { padding-left: 1.1rem; margin: 0; color: #b9c4d9; font-size: 0.93rem; }
.xp-item ul li { margin-bottom: 0.3rem; }
.xp-item ul li::marker { color: var(--accent); }
.award { font-family: var(--mono); font-size: 0.78rem; color: var(--accent-2); margin-right: 0.3rem; white-space: nowrap; }

.edu + .edu { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.edu h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.edu p { font-size: 0.92rem; margin: 0; }
.honor { background: linear-gradient(135deg, rgba(255,179,71,0.1), rgba(14,20,40,0.62)); }
.honor p { font-size: 0.93rem; }
.skill-group { font-size: 0.8rem; color: var(--dim); margin: 1rem 0 0.5rem; }
.skill-group:first-of-type { margin-top: 0; }
.tool-chips span.lvl-adv { border-color: rgba(255,107,44,0.55); color: var(--white); background: rgba(255,107,44,0.1); }
.lvl-note { font-size: 0.72rem; color: var(--dim); margin: 1rem 0 0; }
.lvl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; border: 1px solid rgba(255,107,44,0.8); background: rgba(255,107,44,0.2); margin-right: 0.3rem; }

/* About */
.about-card { padding: 2rem; }
.avatar {
  position: relative; width: 128px; height: 128px; border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent), var(--violet));
  box-shadow: 0 0 30px -6px rgba(255, 107, 44, 0.6);
}
.avatar img {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--bg);
}
.avatar-status {
  position: absolute; right: 8px; bottom: 8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--go); border: 3px solid var(--bg); box-shadow: 0 0 10px var(--go);
}
.avatar-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 2px dashed rgba(76, 201, 240, 0.5);
  animation: spin 14s linear infinite;
}
.socials { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.socials a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line-strong); color: var(--text);
  transition: all 0.2s;
}
.socials a:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.gauges { display: grid; gap: 1rem; }
.about-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.78rem; color: var(--dim); margin-top: 1.25rem; }
.about-facts i { color: var(--cyan); margin-right: 0.35rem; }
.gauge { display: grid; grid-template-columns: 210px 1fr 92px; align-items: center; gap: 1rem; }
.gauge span { font-size: 0.95rem; }
.gauge .bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.gauge .bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--accent));
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
}
.gauge b { font-size: 0.8rem; color: var(--dim); text-align: right; }
@media (max-width: 575px) { .gauge { grid-template-columns: 1fr 92px; } .gauge .bar { grid-column: 1 / -1; grid-row: 2; } }
.tool-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tool-chips span {
  font-family: var(--mono); font-size: 0.78rem; color: var(--text);
  padding: 0.3rem 0.7rem; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

/* Newsletter */
.newsletter { padding: 2.5rem; position: relative; overflow: hidden; }
.newsletter::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,44,0.35), transparent 70%);
}
.nl-form { display: flex; gap: 0.6rem; position: relative; }
.nl-form .form-control {
  background: rgba(5,7,15,0.6); border: 1px solid var(--line-strong); color: var(--white);
  border-radius: 12px; padding: 0.8rem 1rem;
}
.nl-form .form-control::placeholder { color: var(--dim); }
.nl-form .form-control:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(76,201,240,0.15); background: rgba(5,7,15,0.8); color: var(--white); }
.nl-form .btn-launch { white-space: nowrap; }
.nl-msg { min-height: 1.4em; }
.nl-msg.ok { color: var(--go); }
.nl-msg.err { color: #ff6b8b; }
@media (max-width: 575px) { .nl-form { flex-direction: column; } }

/* Footer */
.footer { padding: 2.5rem 0; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.92rem; }

/* ---------------- LAUNCH OVERLAY ---------------- */
.launch-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: radial-gradient(circle at 50% 100%, rgba(255,107,44,0.25), rgba(5,7,15,0.92) 60%);
  display: none; place-items: center;
  overflow: hidden;
}
.launch-overlay.show { display: grid; }
.countdown { font-size: clamp(3rem, 12vw, 8rem); font-weight: 600; color: var(--white); text-shadow: 0 0 40px var(--accent); }
.rocket { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.rocket.shake { animation: shake 0.08s infinite; }
.rocket.liftoff { animation: liftoff 1.8s cubic-bezier(.55,0,.9,.4) forwards; }
.flame {
  width: 22px; height: 0; margin-top: -4px;
  background: linear-gradient(180deg, #fff 0%, var(--accent-2) 25%, var(--accent) 60%, transparent);
  border-radius: 0 0 50% 50%;
  filter: blur(1px);
  transition: height 0.4s;
}
.rocket.shake .flame, .rocket.liftoff .flame { height: 90px; animation: flicker 0.07s infinite alternate; }
@keyframes shake { 0% { transform: translateX(calc(-50% - 1px)); } 100% { transform: translateX(calc(-50% + 1px)); } }
@keyframes liftoff { to { transform: translate(-50%, -130vh); } }
@keyframes flicker { to { height: 110px; opacity: 0.85; } }

/* =========================================================
   ARTÍCULO (post.html)
   ========================================================= */
.altimeter {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1100;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--accent));
  box-shadow: 0 0 12px var(--accent);
}
.alt-readout {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1000;
  font-family: var(--mono); font-size: 0.75rem; color: var(--cyan);
  padding: 0.5rem 0.8rem; border-radius: 10px;
}
.article-hero { padding: 8.5rem 0 2rem; }
.article-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin: 1rem 0; }
.article-hero .lead { color: var(--dim); font-size: 1.2rem; max-width: 760px; }
.article-cover { min-height: 300px; margin-top: 2rem; }
.article-cover i { font-size: 7rem; }
.back-link { color: var(--dim); font-family: var(--mono); font-size: 0.85rem; }
.back-link:hover { color: var(--accent); }

.article-body { font-size: 1.1rem; color: #c9d3e6; }
.article-body h2 { font-size: 1.7rem; margin: 2.8rem 0 1rem; scroll-margin-top: 90px; }
.article-body h2::before { content: "// "; color: var(--accent); font-family: var(--mono); font-size: 1.1rem; }
.article-body p { margin-bottom: 1.3rem; }
.article-body strong { color: var(--white); }
.article-body ul { margin-bottom: 1.3rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body .equation {
  font-family: var(--mono); font-size: 1.2rem; color: var(--white); text-align: center;
  padding: 1.5rem; margin: 1.5rem 0; border-radius: 14px;
  background: linear-gradient(135deg, rgba(76,201,240,0.08), rgba(139,92,246,0.08));
  border: 1px solid var(--line-strong);
}
.article-body .equation small { display: block; font-size: 0.78rem; color: var(--dim); margin-top: 0.6rem; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 0.5rem 0 0.5rem 1.25rem; margin: 1.8rem 0;
  font-size: 1.25rem; color: var(--white); font-style: italic;
}
.article-body pre {
  background: #070b16; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.25rem; font-size: 0.88rem; color: #c3e8ff; overflow-x: auto;
  position: relative;
}
.article-body pre::before {
  content: attr(data-lang); position: absolute; top: 0.5rem; right: 0.8rem;
  font-size: 0.7rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em;
}
.article-body code { font-family: var(--mono); color: var(--accent-2); }
.article-body pre code { color: inherit; }
.article-body .callout {
  display: flex; gap: 1rem; padding: 1.1rem 1.25rem; border-radius: 14px; margin: 1.5rem 0;
  background: rgba(61, 220, 151, 0.07); border: 1px solid rgba(61, 220, 151, 0.3); font-size: 1rem;
}
.article-body .callout i { color: var(--go); font-size: 1.3rem; }
.article-body table { width: 100%; margin: 1.5rem 0; font-size: 0.95rem; border-collapse: collapse; }
.article-body th, .article-body td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.article-body th { color: var(--cyan); font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.toc { position: sticky; top: 100px; padding: 1.4rem; }
.toc h4 { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.15em; color: var(--dim); text-transform: uppercase; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block; padding: 0.45rem 0 0.45rem 0.9rem; color: var(--dim); font-size: 0.92rem;
  border-left: 2px solid var(--line); transition: all 0.2s;
}
.toc a::before { content: counter(toc, decimal-leading-zero) " "; font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.toc a:hover, .toc a.active { color: var(--white); border-left-color: var(--accent); }
.share-row { display: flex; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.share-row button {
  flex: 1; background: transparent; border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 10px; padding: 0.5rem; font-size: 0.85rem; transition: all 0.2s;
}
.share-row button:hover { border-color: var(--accent); color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.5rem; }
.tags span { font-family: var(--mono); font-size: 0.8rem; color: var(--cyan); padding: 0.25rem 0.7rem; border: 1px solid var(--line-strong); border-radius: 8px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.post-nav a { padding: 1.25rem; color: var(--text); transition: border-color 0.2s; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { font-family: var(--mono); color: var(--dim); font-size: 0.75rem; display: block; margin-bottom: 0.3rem; }
.post-nav .next { text-align: right; }
@media (max-width: 575px) { .post-nav { grid-template-columns: 1fr; } }

/* Artículo: tablas desplazables e índice móvil */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
.table-wrap table { margin: 0; }
.toc-mobile { padding: 0.9rem 1.1rem; }
.toc-mobile summary {
  cursor: pointer; list-style: none; font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cyan); display: flex; align-items: center; gap: 0.5rem;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "\F282"; font-family: "bootstrap-icons"; margin-left: auto; transition: transform 0.25s; }
.toc-mobile[open] summary::after { transform: rotate(180deg); }
.toc-mobile ol { list-style: none; padding: 0; margin: 0.9rem 0 0; counter-reset: toc; }
.toc-mobile li { counter-increment: toc; }
.toc-mobile a { display: block; padding: 0.55rem 0 0.55rem 0.9rem; color: var(--dim); border-left: 2px solid var(--line); font-size: 0.95rem; }
.toc-mobile a::before { content: counter(toc, decimal-leading-zero) " "; font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.toc-mobile a.active { color: var(--white); border-left-color: var(--accent); }

/* =========================================================
   RESPONSIVE · TABLETS Y MÓVILES
   ========================================================= */
@media (max-width: 991.98px) {
  .hero { min-height: auto; padding: 7.5rem 0 3.5rem; }
  .flight-stage { max-width: 560px; }
  .section { padding: 4rem 0; }
}

@media (max-width: 767.98px) {
  /* Herramientas: filtros en una sola fila deslizable */
  .toolbar { flex-direction: column; align-items: stretch; padding: 0.6rem; }
  .filters {
    width: 100%; max-width: 100%; min-width: 0;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; white-space: nowrap; }
  .search-wrap { flex: 0 0 auto; width: 100%; min-width: 0; }

  /* Pestañas del CV deslizables */
  .cv-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cv-tabs::-webkit-scrollbar { display: none; }
  .cv-tabs .nav-link { white-space: nowrap; }

  .featured-body { padding: 1.5rem; }
}

@media (max-width: 575.98px) {
  body { line-height: 1.6; }
  .container { padding-left: 1.1rem; padding-right: 1.1rem; }
  .navbar .container { padding-left: 1rem; padding-right: 1rem; }
  .brand { font-size: 1.1rem; }
  .brand-mark { width: 30px; height: 30px; }

  /* Héroe */
  .hero { padding: 6.5rem 0 2.5rem; }
  .eyebrow { font-size: 0.7rem; }
  .hero-title { font-size: 2.35rem; }
  .hero-sub { font-size: 1.02rem; }
  .hero-ctas .btn { width: 100%; }
  .telemetry-row { margin-top: 2rem !important; }
  .telemetry { padding: 0.65rem 0.8rem; }
  .t-value { font-size: 0.85rem; }
  .fs-label { font-size: 14px; }
  .fs-head, .fs-legend { font-size: 0.68rem; }
  .ticker { font-size: 0.72rem; }

  /* Secciones */
  .section { padding: 3.25rem 0; }
  .section-head { margin-bottom: 1.5rem; }
  .section-head h2 { font-size: 1.75rem; }
  .featured .cover { min-height: 180px; }
  .featured .cover i { font-size: 4.5rem; }
  .featured-body { padding: 1.25rem; }
  .featured-body h3 { font-size: 1.45rem; }
  .post-card { padding: 0.6rem; }
  .cover { min-height: 160px; }

  /* Sobre mí */
  .about-card { padding: 1.4rem; }
  .avatar { width: 112px; height: 112px; }
  .about-card h2 { font-size: 1.6rem; }
  .gauges { gap: 0.85rem; }
  .gauge { gap: 0.35rem 0.75rem; }
  .gauge span { font-size: 0.9rem; }
  .gauge b { font-size: 0.7rem; }

  /* CV */
  .cv-mission { grid-template-columns: 56px 1fr; gap: 0.9rem; padding: 1.1rem; }
  .cv-mission-icon.cover { min-height: 56px; height: 56px; border-radius: 12px; }
  .cv-mission-icon.cover i { font-size: 1.5rem; }
  .cv-mission h3 { font-size: 1.05rem; }
  .cv-mission p:last-child { font-size: 0.9rem; }
  .cv-panel { padding: 1.15rem; }
  .cv-tabs { margin-bottom: 1.2rem; }
  .cv-tabs .nav-link { font-size: 0.85rem; padding: 0.4rem 0.75rem; }
  .xp-list { padding-left: 1.2rem; }
  .xp-item::before { left: calc(-1.2rem + 1px); }
  .xp-head h4 { font-size: 1rem; }
  .xp-item ul { font-size: 0.9rem; }

  /* Newsletter y pie */
  .newsletter { padding: 1.5rem; }
  .footer { text-align: center; }

  /* Artículo */
  .article-hero { padding: 6.5rem 0 1rem; }
  .article-hero h1 { font-size: 1.9rem; }
  .article-hero .lead { font-size: 1.05rem; }
  .article-cover { min-height: 200px; }
  .article-cover i { font-size: 4.5rem; }
  .article-body { font-size: 1.02rem; }
  .article-body h2 { font-size: 1.4rem; margin-top: 2.2rem; }
  .article-body .equation { font-size: 1rem; padding: 1.1rem 0.9rem; overflow-x: auto; }
  .article-body blockquote { font-size: 1.1rem; }
  .article-body pre { font-size: 0.8rem; padding: 1rem; }
  .table-wrap table { min-width: 460px; font-size: 0.88rem; }
  .alt-readout { right: 0.75rem; bottom: 0.75rem; font-size: 0.68rem; padding: 0.35rem 0.6rem; pointer-events: none; }

  /* Superposición de lanzamiento */
  .flame { width: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .post-card { opacity: 1; transform: none; }
}
