/* ============================================================
   EcoUtmach · Tacho Inteligente
   Landing + monitor en vivo · tema azul/negro con rayas blancas
   ============================================================ */

:root {
  --bg: #04070f;
  --bg-soft: #060b18;
  --bg-elevated: #0b1628;
  --surface: rgba(12, 22, 44, 0.55);
  --surface-strong: rgba(16, 28, 54, 0.8);
  --border: rgba(185, 210, 255, 0.12);
  --border-strong: rgba(185, 210, 255, 0.24);
  --text: #edf3ff;
  --text-soft: #c7d3e6;
  --muted: #8b9bb6;
  --blue: #4da3ff;
  --blue-deep: #2468d8;
  --sky: #7dd3fc;
  --white: #ffffff;
  --amber: #fbbf54;
  --red: #ff6b6b;
  --violet: #a78bfa;
  --font-sans: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.35);
  --container: 1180px;
  --header-h: 74px;
  --bar-h: 52px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::selection,
body ::selection {
  background: rgba(77, 163, 255, 0.28);
  color: #fff;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.08);
  border: 1px solid rgba(77, 163, 255, 0.14);
  padding: 1px 6px;
  border-radius: 6px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + var(--bar-h) + 18px);
}

/* ---------- Fondo ambiental ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.ambient-glow-a {
  width: 760px;
  height: 760px;
  top: -280px;
  right: -180px;
  background: radial-gradient(circle, rgba(77, 163, 255, 0.16), transparent 66%);
}

.ambient-glow-b {
  width: 640px;
  height: 640px;
  bottom: -260px;
  left: -220px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.1), transparent 66%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 78%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0 128px,
    rgba(255, 255, 255, 0.045) 128px 132px,
    transparent 132px 252px
  );
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 72%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 72%);
}

/* ---------- Cabecera ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(4, 8, 18, 0.82);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0 30px, transparent 30px 64px);
  opacity: 0.12;
  pointer-events: none;
}

.site-header.scrolled::after {
  opacity: 0.26;
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #04101f;
  background: linear-gradient(135deg, #8ec5ff, #2f7bf0);
  box-shadow: 0 6px 18px rgba(77, 163, 255, 0.28);
}

.brand-mark .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.brand-name span {
  color: var(--blue);
}

.nav-cta {
  margin-left: auto;
}

/* ---------- Barra de apartados ---------- */

.section-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: calc(var(--bar-h) - 8px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.section-bar-inner::-webkit-scrollbar {
  display: none;
}

.section-scroll-wrap {
  height: 8px;
  display: flex;
  align-items: center;
}

.section-scroll {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  touch-action: none;
}

.section-scroll[hidden] {
  display: none;
}

.section-scroll::before,
.section-scroll-thumb::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  bottom: -6px;
}

.section-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-width: 36px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.5);
  cursor: grab;
  touch-action: none;
  transition: background 0.2s ease;
}

.section-scroll-thumb:hover {
  background: rgba(125, 211, 252, 0.72);
}

.section-scroll-thumb:active {
  cursor: grabbing;
  background: rgba(125, 211, 252, 0.85);
}

.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12.4px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.section-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--sky);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.section-chip:hover {
  color: var(--text);
  background: rgba(77, 163, 255, 0.08);
}

.section-chip.active {
  color: var(--text);
  border-color: rgba(77, 163, 255, 0.45);
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.24), rgba(125, 211, 252, 0.08));
}

.section-chip.active .icon {
  opacity: 1;
  color: #bfe1ff;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
  transition: transform 0.2s ease;
}

.btn:hover .icon {
  transform: translateX(2px);
}

.btn-primary {
  color: #04101f;
  background: linear-gradient(135deg, #8ec5ff, #2f7bf0);
  box-shadow: 0 12px 32px rgba(77, 163, 255, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(77, 163, 255, 0.32);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(77, 163, 255, 0.08);
  border-color: rgba(77, 163, 255, 0.32);
}

.btn-tiny {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}

.btn-tiny:hover {
  border-color: rgba(77, 163, 255, 0.35);
  color: var(--blue);
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--header-h) + var(--bar-h) + 62px) 0 72px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: calc(var(--header-h) + var(--bar-h) + 16px) 0 44px;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0 92px,
    rgba(255, 255, 255, 0.07) 92px 98px,
    transparent 98px 196px
  );
  -webkit-mask-image: radial-gradient(ellipse 62% 68% at 74% 44%, #000 0%, transparent 74%);
  mask-image: radial-gradient(ellipse 62% 68% at 74% 44%, #000 0%, transparent 74%);
  pointer-events: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
}

.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(77, 163, 255, 0.55);
  animation: livePulse 2s ease-out infinite;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.15rem);
  line-height: 1.03;
  margin-bottom: 22px;
}

.grad {
  background: linear-gradient(115deg, #9fc9ff 0%, #4da3ff 42%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 54ch;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-points .icon {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.hero-visual {
  position: relative;
  min-height: 500px;
  display: grid;
  place-items: center;
}

.visual-orbit {
  position: absolute;
  width: min(92%, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed rgba(77, 163, 255, 0.15);
  animation: spin 70s linear infinite;
}

.visual-orbit::before,
.visual-orbit::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 16px rgba(77, 163, 255, 0.9);
}

.visual-orbit::before {
  top: 11%;
  right: 17%;
}

.visual-orbit::after {
  bottom: 8%;
  left: 22%;
  background: var(--sky);
  box-shadow: 0 0 16px rgba(125, 211, 252, 0.9);
}

.bin-art {
  width: min(100%, 470px);
  height: auto;
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.45));
}

.bin-lid {
  transform-box: view-box;
  transform-origin: 166px 168px;
  animation: lidSwing 9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes lidSwing {
  0%, 12% { transform: rotate(0deg); }
  40%, 52% { transform: rotate(-24deg); }
  80%, 100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bin-lid { animation: none; transform: rotate(-10deg); }
}

.orbit-ring {
  fill: none;
  stroke: rgba(77, 163, 255, 0.09);
  stroke-width: 1;
}

.orbit-ring-2 {
  stroke-dasharray: 3 9;
  stroke: rgba(125, 211, 252, 0.13);
}

.svg-screen-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: #9cc3ff;
  letter-spacing: 0.06em;
}

.svg-screen-big {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  fill: #d3e5ff;
}

.svg-live-dot {
  animation: blink 1.8s ease-in-out infinite;
}

.svg-fill {
  animation: fillBreath 4s ease-in-out infinite;
}

.sonar-waves path {
  animation: sonarWave 3s ease-out infinite;
  transform-origin: 276px 197px;
}

.sonar-waves path:nth-child(2) {
  animation-delay: 0.45s;
}

.sonar-waves path:nth-child(3) {
  animation-delay: 0.9s;
}

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 15px;
  background: rgba(8, 16, 34, 0.86);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: float 7s ease-in-out infinite;
}

.float-chip strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
}

.float-chip small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.35;
}

.chip-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.1);
  border: 1px solid rgba(77, 163, 255, 0.18);
}

.chip-icon .icon {
  width: 17px;
  height: 17px;
}

.chip-icon.cyan {
  color: var(--sky);
  background: rgba(125, 211, 252, 0.09);
  border-color: rgba(125, 211, 252, 0.2);
}

.chip-icon.amber {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.09);
  border-color: rgba(251, 191, 84, 0.2);
}

.chip-a {
  top: 11%;
  left: 0;
}

.chip-b {
  top: 42%;
  right: -1%;
  animation-delay: -2.3s;
}

.chip-c {
  bottom: 9%;
  left: 3%;
  animation-delay: -4.6s;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 74px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(115deg, transparent 0 58px, rgba(255, 255, 255, 0.05) 58px 61px),
    linear-gradient(180deg, rgba(16, 28, 54, 0.7), rgba(7, 13, 28, 0.55));
  overflow: hidden;
}

.stat {
  padding: 22px 24px;
  position: relative;
}

.stat + .stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: var(--border);
}

.stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

.stat span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Secciones genéricas ---------- */

.section {
  padding: 100px 0;
  position: relative;
}

main > section[hidden] {
  display: none;
}

main > section:not(.hero):not([hidden]) {
  padding-top: calc(var(--header-h) + var(--bar-h) + 52px);
}

.section-alt {
  background:
    radial-gradient(ellipse 60% 60% at 15% 0%, rgba(77, 163, 255, 0.06), transparent 70%),
    linear-gradient(180deg, rgba(6, 12, 28, 0.65), rgba(4, 8, 18, 0));
  border-top: 1px solid rgba(185, 210, 255, 0.06);
  border-bottom: 1px solid rgba(185, 210, 255, 0.06);
}

.section-head {
  max-width: 760px;
  margin-bottom: 46px;
}

.section-head h2,
.split-head h2 {
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  margin-bottom: 16px;
}

.section-sub {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 64ch;
}

.split-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 46px;
}

.split-head .section-sub {
  max-width: 44ch;
  padding-bottom: 4px;
}

/* ---------- Beneficios ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(77, 163, 255, 0.07), transparent 55%),
    linear-gradient(160deg, rgba(14, 25, 48, 0.7), rgba(7, 13, 27, 0.8));
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(77, 163, 255, 0.28);
  transform: translateY(-3px);
}

.feature-index {
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: rgba(191, 219, 254, 0.07);
  letter-spacing: -0.05em;
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.1);
  border: 1px solid rgba(77, 163, 255, 0.2);
  margin-bottom: 22px;
  flex-shrink: 0;
}

.feature-icon .icon {
  width: 22px;
  height: 22px;
}

.feature-icon.cyan {
  color: var(--sky);
  background: rgba(125, 211, 252, 0.09);
  border-color: rgba(125, 211, 252, 0.2);
}

.feature-icon.amber {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.09);
  border-color: rgba(251, 191, 84, 0.2);
}

.feature-icon.mint {
  color: var(--blue);
}

.feature-card h3 {
  font-size: 19px;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 13.8px;
  color: var(--muted);
  line-height: 1.65;
}

.check-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
}

.check-list .icon {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

/* ---------- Pasos ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.step {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(13, 23, 45, 0.55), rgba(5, 10, 21, 0.6));
  transition: border-color 0.3s ease, background 0.3s ease;
}

.step:hover {
  border-color: rgba(77, 163, 255, 0.24);
  background: linear-gradient(170deg, rgba(17, 29, 55, 0.7), rgba(5, 10, 21, 0.7));
}

.step-num {
  position: absolute;
  top: 20px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.08);
  border: 1px solid rgba(77, 163, 255, 0.17);
  margin-bottom: 30px;
}

.step-icon .icon {
  width: 19px;
  height: 19px;
}

.step-icon.cyan {
  color: var(--sky);
  background: rgba(125, 211, 252, 0.08);
  border-color: rgba(125, 211, 252, 0.18);
}

.step-icon.amber {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.08);
  border-color: rgba(251, 191, 84, 0.18);
}

.step h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.step p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Monitor en vivo ---------- */

.monitor-section {
  padding: 96px 0 106px;
  background:
    radial-gradient(ellipse 55% 40% at 50% 0%, rgba(125, 211, 252, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(3, 6, 14, 0.5), rgba(3, 6, 14, 0.92));
  border-top: 1px solid rgba(185, 210, 255, 0.09);
  border-bottom: 1px solid rgba(185, 210, 255, 0.09);
}

.monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.monitor-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  margin-bottom: 12px;
}

.monitor-head .section-sub {
  max-width: 62ch;
}

.monitor-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-pill.online {
  color: var(--blue);
  border-color: rgba(77, 163, 255, 0.35);
  background: rgba(77, 163, 255, 0.08);
}

.status-pill.online .status-dot {
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(77, 163, 255, 0.5);
  animation: livePulse 2s ease-out infinite;
}

.status-pill.offline {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.07);
}

.status-pill.offline .status-dot {
  background: var(--red);
}

.status-pill.waiting {
  color: var(--amber);
  border-color: rgba(251, 191, 84, 0.28);
  background: rgba(251, 191, 84, 0.06);
}

.status-pill.waiting .status-dot {
  background: var(--amber);
  animation: blink 1.6s ease-in-out infinite;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.meta-chip .icon {
  width: 13px;
  height: 13px;
  color: var(--blue);
}

.meta-chip.sim-chip {
  color: var(--amber);
  border-color: rgba(251, 191, 84, 0.25);
  background: rgba(251, 191, 84, 0.06);
}

.meta-chip.sim-chip .icon {
  color: var(--amber);
}

.monitor-updated {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 20px;
  font-size: 12px;
  color: var(--muted);
}

.monitor-updated > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.monitor-updated .icon {
  width: 14px;
  height: 14px;
}

.updated-sep {
  opacity: 0.5;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

#proximityCard,
#fillCard,
#odorCard,
#buzzerCard {
  grid-column: span 3;
}

.chart-card {
  grid-column: span 7;
}

.alerts-card {
  grid-column: span 5;
}

.oled-card {
  grid-column: span 4;
}

.sim-card {
  grid-column: span 8;
}

/* ---------- Tarjetas de sensores / paneles ---------- */

.sensor-card,
.panel-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(77, 163, 255, 0.07), transparent 55%),
    repeating-linear-gradient(115deg, transparent 0 64px, rgba(255, 255, 255, 0.028) 64px 67px),
    linear-gradient(165deg, rgba(14, 25, 48, 0.68), rgba(6, 12, 24, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sensor-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.sensor-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.35s ease;
}

.sensor-card.is-warning {
  border-color: rgba(251, 191, 84, 0.28);
}

.sensor-card.is-alert {
  border-color: rgba(255, 107, 107, 0.32);
}

.panel-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.sensor-head,
.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.sensor-head > div,
.panel-head > div {
  min-width: 0;
}

.sensor-head h3,
.panel-head h3 {
  font-size: 14.5px;
  letter-spacing: -0.02em;
}

.sensor-head p,
.panel-head p {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.sensor-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.09);
  border: 1px solid rgba(77, 163, 255, 0.18);
  flex-shrink: 0;
}

.sensor-icon .icon {
  width: 18px;
  height: 18px;
}

.sensor-icon.cyan {
  color: var(--sky);
  background: rgba(125, 211, 252, 0.08);
  border-color: rgba(125, 211, 252, 0.18);
}

.sensor-icon.amber {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.08);
  border-color: rgba(251, 191, 84, 0.18);
}

.state-tag {
  margin-left: auto;
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.state-tag.ok {
  color: var(--blue);
  border-color: rgba(77, 163, 255, 0.3);
  background: rgba(77, 163, 255, 0.08);
}

.state-tag.warn {
  color: var(--amber);
  border-color: rgba(251, 191, 84, 0.3);
  background: rgba(251, 191, 84, 0.08);
}

.state-tag.danger {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.09);
}

.sensor-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 20px;
}

.sensor-value .big {
  font-family: var(--font-mono);
  font-size: clamp(34px, 3vw, 42px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sensor-value .unit {
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.sensor-hint {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.sensor-card.is-alert .sensor-value .big {
  color: var(--red);
}

.sensor-card.is-warning .sensor-value .big {
  color: var(--amber);
}

/* Proximidad */

.proximity-visual {
  position: relative;
  margin-top: auto;
  padding-top: 16px;
  height: 74px;
  display: flex;
  align-items: center;
  border-top: 1px dashed var(--border);
}

.sonar-core {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.08);
  border: 1px solid rgba(77, 163, 255, 0.2);
  flex-shrink: 0;
}

.sonar-core .icon {
  width: 18px;
  height: 18px;
}

.sonar-ring {
  position: absolute;
  left: 19px;
  top: 50%;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border-radius: 50%;
  border: 1px solid rgba(77, 163, 255, 0.4);
  opacity: 0;
  pointer-events: none;
}

.proximity-line {
  flex: 1;
  height: 2px;
  margin-left: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(77, 163, 255, 0.45), rgba(77, 163, 255, 0));
}

#proximityCard.active .sonar-ring {
  animation: sonar 2.8s ease-out infinite;
}

#proximityCard.active .sonar-ring.r2 {
  animation-delay: 0.55s;
}

#proximityCard.active .sonar-ring.r3 {
  animation-delay: 1.1s;
}

#proximityCard.active .sonar-core {
  background: rgba(77, 163, 255, 0.16);
  box-shadow: 0 0 22px rgba(77, 163, 255, 0.2);
}

/* Tapa automática (servomotor) */

.lid-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 20px 30px;
  padding: 22px 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 150% at 86% 6%, rgba(77, 163, 255, 0.13), transparent 55%),
    rgba(10, 21, 37, 0.78);
}

.lid-copy {
  min-width: 0;
}

.lid-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.lid-readout div {
  flex: 1 1 108px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.lid-readout span {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.lid-readout strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.3s ease;
}

.lid-card.open .lid-readout strong {
  color: var(--sky);
}

.lid-hint {
  margin-top: 14px;
  max-width: 48ch;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.lid-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.lid-demo {
  width: 260px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.lid-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.lid-group {
  transform-box: view-box;
  transform-origin: 96px 104px;
  transition: transform 0.9s cubic-bezier(0.34, 1.3, 0.5, 1);
}

.lid-demo.open .lid-group {
  transform: rotate(-104deg);
}

.lid-mouth {
  opacity: 0;
  transition: opacity 0.45s ease 0.2s;
}

.lid-demo.open .lid-mouth {
  opacity: 1;
}

.lid-wave {
  fill: none;
  stroke: rgba(77, 163, 255, 0.5);
  stroke-width: 1.2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.lid-demo.open .lid-wave {
  animation: lid-wave 2.2s ease-out infinite;
}

.lid-demo.open .lid-wave.wave-b {
  animation-delay: 0.65s;
}

.lid-demo.open .lid-wave.wave-c {
  animation-delay: 1.3s;
}

@keyframes lid-wave {
  0% {
    opacity: 0.6;
    transform: scale(0.72);
  }
  70% {
    opacity: 0;
    transform: scale(1.18);
  }
  100% {
    opacity: 0;
  }
}

.lid-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.lid-state {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.lid-demo.open .lid-state {
  color: var(--blue);
  border-color: rgba(77, 163, 255, 0.35);
  background: rgba(77, 163, 255, 0.08);
}

.lid-angle {
  min-width: 24px;
  text-align: right;
  font-size: 9px;
  color: var(--muted);
}

/* Medidores */

.meter {
  position: relative;
  height: 10px;
  margin: 22px 0 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3478e8, #9fc9ff);
  box-shadow: 0 0 18px rgba(77, 163, 255, 0.35);
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease, box-shadow 0.4s ease;
}

.meter.warn .meter-fill {
  background: linear-gradient(90deg, #f7a928, #ffd98a);
  box-shadow: 0 0 18px rgba(251, 191, 84, 0.35);
}

.meter.danger .meter-fill {
  background: linear-gradient(90deg, #ff4d4d, #ff9d8a);
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

.meter-tick {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.meter-tick b {
  position: absolute;
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.tick-medium {
  left: 60%;
}

.tick-full {
  left: 90%;
}

#odorTickModerate {
  left: 29.3%;
}

#odorTickAlert {
  left: 58.7%;
}

/* Zumbador */

.buzzer-state {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.buzzer-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.buzzer-orb .icon {
  width: 25px;
  height: 25px;
}

.buzzer-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.buzzer-reason {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

#buzzerCard.active .buzzer-orb {
  color: #1b1303;
  background: linear-gradient(135deg, #ffd166, #fbbf54);
  border-color: rgba(251, 191, 84, 0.7);
  box-shadow: 0 0 0 5px rgba(251, 191, 84, 0.09), 0 0 28px rgba(251, 191, 84, 0.35);
  animation: buzzerPulse 1.15s ease-in-out infinite;
}

#buzzerCard.active .buzzer-label {
  color: var(--amber);
}

#buzzerCard.active .buzzer-reason {
  color: #e8c37c;
}

#buzzerCard .sensor-hint {
  margin-top: auto;
  padding-top: 12px;
}

/* ---------- Gráfica ---------- */

.chart-card .panel-head,
.alerts-card .panel-head {
  margin-bottom: 16px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.legend-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot.mint {
  background: var(--blue);
  box-shadow: 0 0 8px rgba(77, 163, 255, 0.6);
}

.dot.amber {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(251, 191, 84, 0.5);
}

.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 220px;
}

#chartCanvas {
  width: 100%;
  height: 220px;
  display: block;
}

/* ---------- Alertas ---------- */

.alerts-count {
  margin-left: auto;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(77, 163, 255, 0.1);
  border: 1px solid rgba(77, 163, 255, 0.25);
  flex-shrink: 0;
}

.alerts-count.has-warning {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.1);
  border-color: rgba(251, 191, 84, 0.3);
}

.alerts-count.has-critical {
  color: var(--red);
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.32);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 268px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(77, 163, 255, 0.25) transparent;
}

.alerts-list::-webkit-scrollbar {
  width: 5px;
}

.alerts-list::-webkit-scrollbar-thumb {
  background: rgba(77, 163, 255, 0.22);
  border-radius: 99px;
}

.alert-item,
.alert-empty {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}

.alert-empty {
  color: var(--muted);
  align-items: center;
}

.alert-icon {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-icon .icon {
  width: 14px;
  height: 14px;
}

.alert-icon.critical {
  color: var(--red);
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.22);
}

.alert-icon.warning {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.09);
  border: 1px solid rgba(251, 191, 84, 0.2);
}

.alert-icon.info {
  color: var(--sky);
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.18);
}

.alert-icon.ok {
  color: var(--blue);
  background: rgba(77, 163, 255, 0.09);
  border: 1px solid rgba(77, 163, 255, 0.2);
}

.alert-item.critical {
  border-color: rgba(255, 107, 107, 0.24);
  background: rgba(255, 107, 107, 0.055);
}

.alert-item.warning {
  border-color: rgba(251, 191, 84, 0.2);
  background: rgba(251, 191, 84, 0.045);
}

.alert-item .alert-text {
  min-width: 0;
}

.alert-item .alert-level {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2px;
}

.alerts-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 10.5px;
  color: var(--muted);
}

.alerts-footer strong {
  color: var(--text-soft);
  font-weight: 600;
}

.alerts-rule {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: -0.02em;
}

/* ---------- OLED ---------- */

.oled-card .panel-head {
  margin-bottom: 18px;
}

.oled-tag {
  align-self: center;
}

.oled-device {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-block: auto;
}

.oled-screen {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 2 / 1;
  min-height: 172px;
  padding: 14px 16px;
  border-radius: 15px;
  border: 5px solid #131d2e;
  background: #02060d;
  box-shadow:
    inset 0 0 40px rgba(125, 211, 252, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.5);
  color: #cfe8ff;
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  overflow: hidden;
}

.oled-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(147, 197, 253, 0.06), transparent 60%);
  pointer-events: none;
}

.oled-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  pointer-events: none;
  opacity: 0.5;
}

.oled-top,
.oled-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.oled-brand {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #dbe7ff;
}

.oled-id {
  color: #93c5fd;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oled-msg {
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f2f7ff;
  line-height: 1.2;
  text-shadow: 0 0 12px rgba(147, 197, 253, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.oled-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-top: 1px dotted rgba(125, 211, 252, 0.16);
  padding-top: 3px;
  color: #7692b5;
  font-size: 9px;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.oled-row strong {
  color: #cfe8ff;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oled-wifi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #5f7d9c;
}

.oled-wifi .icon {
  width: 11px;
  height: 11px;
}

.oled-wifi.connected {
  color: var(--blue);
}

.oled-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #5f7d9c;
}

.oled-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5f7d9c;
}

.oled-live i.on {
  background: var(--blue);
  box-shadow: 0 0 8px rgba(77, 163, 255, 0.8);
  animation: blink 1.8s ease-in-out infinite;
}

.oled-caption {
  width: 76px;
  flex-shrink: 0;
}

.oled-size {
  display: block;
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.oled-caption p {
  margin-top: 6px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--muted);
}

.oled-caption p span {
  color: var(--text-soft);
}

/* ---------- Simulador ---------- */

.sim-card .panel-head {
  margin-bottom: 22px;
}

.sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 26px;
}

.sim-field {
  margin-bottom: 17px;
}

.sim-field:last-child {
  margin-bottom: 0;
}

.sim-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.sim-label .sim-sub {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

.sim-label output {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}

.sim-status {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
}

.sim-status.warn {
  color: var(--amber);
}

.sim-status.danger {
  color: var(--red);
}

.sim-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #091427;
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.55), 0 0 16px rgba(77, 163, 255, 0.35);
  transition: transform 0.15s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #091427;
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.55);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.35), 0 0 16px rgba(77, 163, 255, 0.4);
}

.sim-toggle-field {
  padding-top: 4px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 4px;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  padding: 3px;
  display: block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.25s ease;
}

.switch-thumb {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8c9cb5;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease;
}

.switch input:checked + .switch-track {
  background: rgba(77, 163, 255, 0.85);
  border-color: rgba(77, 163, 255, 0.6);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
  background: #04101f;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.switch-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  font-size: 12px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]::placeholder {
  color: #65758f;
}

input[type="text"]:focus {
  outline: none;
  border-color: rgba(77, 163, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.08);
}

.sim-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

.sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.sim-actions .btn {
  flex: 1;
  min-width: 140px;
}

.auto-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s ease;
}

#btnAutoSim[aria-pressed="true"] {
  border-color: rgba(251, 191, 84, 0.4);
  color: var(--amber);
  background: rgba(251, 191, 84, 0.08);
}

#btnAutoSim[aria-pressed="true"] .auto-dot {
  background: var(--amber);
  animation: blink 1.2s ease-in-out infinite;
}

.sim-note {
  margin-top: 14px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Especificaciones ---------- */

.spec-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 24px;
  align-items: start;
}

.spec-table {
  border-top: 1px solid var(--border);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 14px 4px;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}

.spec-row span {
  color: var(--muted);
  flex-shrink: 0;
}

.spec-row strong {
  font-weight: 500;
  color: var(--text-soft);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.spec-aside {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(125, 211, 252, 0.07), transparent 60%),
    linear-gradient(160deg, rgba(14, 25, 48, 0.6), rgba(6, 12, 24, 0.8));
}

.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(77, 163, 255, 0.22);
  background: rgba(77, 163, 255, 0.07);
  color: var(--blue);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.spec-badge .icon {
  width: 13px;
  height: 13px;
}

.spec-aside h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.code-block {
  margin: 0 0 14px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(185, 210, 255, 0.1);
  background: rgba(0, 0, 0, 0.32);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: #a9c7ff;
  scrollbar-width: thin;
}

.code-block code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.spec-aside > p {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 14px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
}

.text-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.text-link:hover .icon {
  transform: translateX(3px);
}

/* ---------- Conexión ESP32 ---------- */

.connect-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 24px;
  align-items: start;
  margin-top: 36px;
}

.connect-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connect-step {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(14, 25, 48, 0.55), rgba(6, 12, 24, 0.75));
}

.connect-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid rgba(77, 163, 255, 0.25);
  background: rgba(77, 163, 255, 0.08);
}

.connect-step h3 {
  font-size: 14.5px;
  margin-bottom: 5px;
}

.connect-step p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.connect-aside {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(77, 163, 255, 0.07), transparent 60%),
    linear-gradient(160deg, rgba(14, 25, 48, 0.6), rgba(6, 12, 24, 0.8));
}

.connect-aside h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.connect-aside > p {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 14px;
}

.code-block-sm {
  font-size: 10px;
  line-height: 1.6;
}

.connect-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 0 !important;
}

/* ---------- Contacto ---------- */

.section-contact {
  background:
    radial-gradient(ellipse 50% 60% at 85% 40%, rgba(77, 163, 255, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(6, 12, 28, 0.5), rgba(4, 8, 18, 0));
  border-top: 1px solid rgba(185, 210, 255, 0.06);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 56px;
  align-items: center;
}

.contact-copy h2 {
  font-size: clamp(2rem, 3.3vw, 2.7rem);
  margin-bottom: 16px;
}

.contact-points {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 32px 0 28px;
}

.contact-points li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-points .feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  margin-bottom: 0;
}

.contact-points .feature-icon .icon {
  width: 19px;
  height: 19px;
}

.contact-points strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.contact-points div span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.contact-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-meta .icon {
  width: 13px;
  height: 13px;
  color: var(--blue);
}

.contact-form {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(125, 211, 252, 0.05), transparent 55%),
    linear-gradient(160deg, rgba(15, 26, 50, 0.75), rgba(6, 12, 24, 0.9));
  box-shadow: var(--shadow-soft);
}

.form-head {
  margin-bottom: 22px;
}

.form-head h3 {
  font-size: 21px;
  margin-bottom: 5px;
}

.form-head p {
  font-size: 11.5px;
  color: var(--muted);
}

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #65758f;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(77, 163, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.08);
}

.field input.invalid,
.field textarea.invalid {
  border-color: rgba(255, 107, 107, 0.55);
}

.contact-form .btn-block {
  margin-top: 4px;
}

.form-success {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(77, 163, 255, 0.28);
  background: rgba(77, 163, 255, 0.07);
  color: var(--blue);
  font-size: 12px;
}

.form-success .icon {
  width: 15px;
  height: 15px;
}

.form-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
}

.form-foot a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Pie ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 36px;
  background: rgba(3, 5, 12, 0.65);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  gap: 48px;
  align-items: start;
}

.site-footer .brand {
  font-size: 18px;
  margin-bottom: 12px;
}

.footer-grid > div > p {
  max-width: 38ch;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.footer-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-status .icon {
  width: 12px;
  height: 12px;
  color: var(--blue);
}

.footer-copy {
  margin-top: 6px;
  color: #65758f;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(9, 16, 34, 0.96);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  text-align: center;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ffc9c9;
}

/* ---------- Animaciones ---------- */

.js-ready .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-ready .reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(77, 163, 255, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(77, 163, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(77, 163, 255, 0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes sonar {
  0% { opacity: 0.7; transform: scale(1); }
  80% { opacity: 0; transform: scale(3.1); }
  100% { opacity: 0; transform: scale(3.1); }
}

@keyframes sonarWave {
  0% { opacity: 0; transform: translateX(0); }
  30% { opacity: 0.8; }
  100% { opacity: 0; transform: translateX(10px); }
}

@keyframes buzzerPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(251, 191, 84, 0.09), 0 0 26px rgba(251, 191, 84, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(251, 191, 84, 0.04), 0 0 34px rgba(251, 191, 84, 0.5); }
}

@keyframes fillBreath {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.7; }
}

/* ---------- Proyecto: portada académica ---------- */

.hero-subtitle {
  max-width: 56ch;
  margin: 0 0 16px;
  font-size: clamp(1.02rem, 1.5vw, 1.25rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--text-soft);
}

.hero-motto {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 9px 15px;
  border-left: 2px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: rgba(77, 163, 255, 0.07);
  color: var(--sky);
  font-size: 13.5px;
  font-style: italic;
}

.hero-motto .icon {
  width: 15px;
  height: 15px;
  font-style: normal;
}

.hero-uni {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}

.hero-uni strong {
  font-weight: 600;
  color: var(--text-soft);
}

.hero-uni .uni-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.7;
}

/* ---------- Bloques de contenido del proyecto ---------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 24px;
  align-items: start;
}

.prose h3 {
  font-size: 17px;
  margin: 22px 0 10px;
}

.prose h3:first-child {
  margin-top: 0;
}

.code-title {
  font-size: 16px;
  margin-bottom: 10px;
}

.prose p {
  color: var(--text-soft);
  font-size: 14.8px;
  line-height: 1.85;
}

.prose p + p {
  margin-top: 16px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose .prose-lead {
  font-size: 16.5px;
  color: var(--text);
}

.info-panel {
  padding: 26px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(77, 163, 255, 0.08), transparent 60%),
    linear-gradient(160deg, rgba(14, 25, 48, 0.62), rgba(6, 12, 24, 0.8));
}

.info-panel h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: var(--muted);
  flex-shrink: 0;
}

.info-row strong {
  font-weight: 500;
  color: var(--text-soft);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.info-panel .text-link {
  margin-top: 14px;
}

.callout {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 15px 17px;
  border-radius: 13px;
  border: 1px solid rgba(77, 163, 255, 0.22);
  background: rgba(77, 163, 255, 0.055);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-soft);
}

.callout .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
  margin-top: 2px;
}

.callout.warn {
  border-color: rgba(251, 191, 84, 0.28);
  background: rgba(251, 191, 84, 0.055);
}

.callout.warn .icon {
  color: var(--amber);
}

.callout strong {
  color: var(--text);
}

.problem-grid,
.solution-grid,
.impact-grid,
.objective-grid,
.conclusion-list {
  display: grid;
  gap: 16px;
}

.problem-grid,
.solution-grid,
.impact-grid {
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.problem-card {
  border-left: 2px solid rgba(251, 191, 84, 0.45);
}

.problem-card .feature-icon {
  color: var(--amber);
  background: rgba(251, 191, 84, 0.08);
  border-color: rgba(251, 191, 84, 0.2);
}

.solution-card .feature-icon {
  color: var(--sky);
  background: rgba(125, 211, 252, 0.08);
  border-color: rgba(125, 211, 252, 0.2);
}

.solution-grid .feature-card p {
  font-size: 13.2px;
}

.objective-hero {
  position: relative;
  padding: 28px 30px 28px 34px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(77, 163, 255, 0.26);
  background:
    radial-gradient(110% 150% at 0% 0%, rgba(77, 163, 255, 0.11), transparent 55%),
    linear-gradient(160deg, rgba(15, 27, 52, 0.72), rgba(6, 12, 24, 0.82));
}

.objective-hero::before {
  content: "“";
  position: absolute;
  top: 6px;
  left: 14px;
  font-size: 54px;
  line-height: 1;
  color: rgba(125, 211, 252, 0.35);
  font-family: Georgia, serif;
}

.objective-hero .eyebrow {
  margin-bottom: 10px;
}

.objective-hero p {
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  line-height: 1.75;
  color: var(--text);
}

.objective-grid {
  grid-template-columns: repeat(3, 1fr);
}

.objective-card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(13, 23, 45, 0.55), rgba(5, 10, 21, 0.62));
}

.objective-card .obj-num {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--blue);
}

.objective-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.objective-card p {
  font-size: 12.8px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- Diagramas ---------- */

.diagram-panel {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(110% 100% at 50% 0%, rgba(77, 163, 255, 0.06), transparent 65%),
    rgba(4, 9, 19, 0.55);
  overflow-x: auto;
  scrollbar-width: thin;
}

.diagram-panel svg {
  min-width: 760px;
  width: 100%;
  height: auto;
}

.circuit-panel svg {
  min-width: 880px;
}

.diagram-caption {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Componentes ---------- */

.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
}

.component-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(77, 163, 255, 0.055), transparent 55%),
    linear-gradient(165deg, rgba(13, 23, 45, 0.58), rgba(5, 10, 21, 0.66));
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.component-card:hover {
  border-color: rgba(77, 163, 255, 0.28);
  transform: translateY(-3px);
}

.component-figure {
  height: 118px;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 13px;
  border: 1px solid rgba(185, 210, 255, 0.1);
  background:
    radial-gradient(90% 90% at 50% 0%, rgba(77, 163, 255, 0.09), transparent 65%),
    rgba(2, 6, 14, 0.6);
  display: grid;
  place-items: center;
}

.component-svg {
  width: 100%;
  height: 100%;
}

.component-figure--photo {
  height: auto;
  aspect-ratio: 4 / 3;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: #eef4fb;
  border-color: rgba(185, 210, 255, 0.22);
}

.component-figure--photo img {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
  object-position: center;
}

.component-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 7px;
}

.component-card h3 {
  font-size: 15.5px;
  margin-bottom: 7px;
}

.component-fn {
  font-size: 12.3px;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 7px;
}

.component-card p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- Tablas de datos ---------- */

.table-scroll {
  margin-top: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(4, 9, 19, 0.5);
  overflow-x: auto;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 9.8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px dashed var(--border);
  color: var(--text-soft);
  line-height: 1.55;
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  color: var(--text);
  font-weight: 600;
}

.data-table .num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

.data-table code {
  font-size: 10.5px;
  white-space: nowrap;
}

.data-table code.pin-pending {
  color: #ffcf70;
  border-color: rgba(255, 207, 112, 0.4);
}

.budget-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 13px;
  border: 1px solid rgba(77, 163, 255, 0.26);
  background: rgba(77, 163, 255, 0.06);
}

.budget-total span {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.budget-total strong {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--text);
}

.budget-total small {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  margin-top: 2px;
}

/* ---------- Programas ---------- */

.program-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.code-snippet {
  max-height: 330px;
  overflow: auto;
  font-size: 10.5px;
}

/* ---------- Metodología ---------- */

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}

.method-card {
  position: relative;
  padding: 22px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(13, 23, 45, 0.58), rgba(5, 10, 21, 0.64));
  overflow: hidden;
}

.method-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), transparent 85%);
  opacity: 0.55;
}

.method-num {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.method-card h3 {
  font-size: 15.5px;
  margin-bottom: 8px;
}

.method-card p {
  font-size: 12.3px;
  line-height: 1.68;
  color: var(--muted);
}

/* ---------- Equipo ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 13px;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(13, 23, 45, 0.55), rgba(5, 10, 21, 0.62));
}

.team-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #04101f;
  background: linear-gradient(135deg, #9fc9ff, #2f7bf0);
  box-shadow: 0 6px 16px rgba(77, 163, 255, 0.22);
}

.team-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.team-card span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}

.academic-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(77, 163, 255, 0.2);
  background: rgba(77, 163, 255, 0.05);
}

.academic-item span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.academic-item strong {
  font-size: 12.8px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.45;
}

/* ---------- Conclusiones ---------- */

.conclusion-list {
  grid-template-columns: 1fr;
}

.conclusion-item {
  display: flex;
  gap: 15px;
  padding: 17px 19px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(13, 23, 45, 0.5), rgba(5, 10, 21, 0.58));
}

.conclusion-item .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--blue);
  padding-top: 2px;
}

.conclusion-item p {
  font-size: 13.2px;
  line-height: 1.7;
  color: var(--text-soft);
}

.conclusion-item strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Accesibilidad ---------- */

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--sky);
  color: #04101f;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transform: translate(-50%, -180%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

/* ---------- Menú lateral de secciones ---------- */

.index-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.index-toggle:hover,
.index-toggle[aria-expanded="true"] {
  border-color: rgba(77, 163, 255, 0.5);
  background: rgba(77, 163, 255, 0.12);
  color: var(--text);
}

.index-toggle .icon {
  width: 18px;
  height: 18px;
  color: var(--sky);
}

.index-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 72;
  display: flex;
  flex-direction: column;
  width: min(320px, 86vw);
  padding: 18px 14px 16px;
  border-right: 1px solid rgba(77, 163, 255, 0.28);
  border-radius: 0 20px 20px 0;
  background: linear-gradient(180deg, rgba(9, 18, 34, 0.99), rgba(4, 9, 19, 0.99));
  box-shadow: 26px 0 60px rgba(0, 0, 0, 0.6);
  visibility: hidden;
  opacity: 0;
  transform: translateX(-102%);
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.22, 0.8, 0.3, 1), visibility 0s linear 0.28s;
}

.index-panel.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.22, 0.8, 0.3, 1), visibility 0s;
}

.index-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 14px;
  border-bottom: 1px solid var(--border);
}

.index-brand-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(140deg, #4da3ff, #1f5fc4);
  box-shadow: 0 6px 18px rgba(31, 95, 196, 0.35);
}

.index-brand-badge .icon {
  width: 17px;
  height: 17px;
  color: #f4f9ff;
}

.index-brand-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.index-label {
  margin: 16px 4px 6px;
  padding-left: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.index-foot {
  margin-top: 10px;
  padding: 12px 8px 2px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.index-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(10, 19, 36, 0.7);
  color: var(--muted);
  cursor: pointer;
}

.index-close:hover {
  color: var(--text);
  border-color: rgba(77, 163, 255, 0.45);
}

.index-close .icon {
  width: 14px;
  height: 14px;
}

.index-links {
  display: grid;
  gap: 2px;
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(77, 163, 255, 0.3) transparent;
}

.index-links::-webkit-scrollbar {
  width: 8px;
}

.index-links::-webkit-scrollbar-track {
  background: transparent;
}

.index-links::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.28);
}

.index-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.index-link:focus-visible {
  outline: 2px solid rgba(159, 201, 255, 0.65);
  outline-offset: -2px;
}

.index-link .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.2s ease;
}

.index-link:hover {
  color: var(--text);
  background: rgba(77, 163, 255, 0.08);
}

.index-link:hover .icon {
  color: var(--sky);
}

.index-link.active {
  color: #04101f;
  background: linear-gradient(135deg, #9fc9ff, #2f7bf0);
}

.index-link.active .icon {
  color: #04101f;
}

.index-backdrop {
  position: fixed;
  inset: 0;
  z-index: 68;
  background: rgba(2, 6, 14, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.index-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0s;
}

body.index-open {
  overflow: hidden;
}

/* ---------- Fichas de componentes (desplegables) ---------- */

.component-card details {
  width: 100%;
}

.component-card summary {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  list-style: none;
}

.component-card summary::-webkit-details-marker {
  display: none;
}

.component-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.component-more {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.component-more::after {
  content: " +";
}

.component-card details[open] .component-more::after {
  content: " −";
}

.component-card details[open] {
  padding-bottom: 2px;
}

.component-card details[open] p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.component-card details[open] .component-figure {
  border-color: rgba(77, 163, 255, 0.3);
}

/* ---------- Equipo con fotografías ---------- */

.team-photo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(77, 163, 255, 0.35);
  background: rgba(4, 9, 19, 0.6);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

.team-info {
  min-width: 0;
}

.teachers-block {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}

.teachers-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.teachers-head h3 {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.teachers-note {
  font-size: 11.5px;
  color: var(--muted);
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 13px;
}

.teacher-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(77, 163, 255, 0.22);
  background: linear-gradient(165deg, rgba(13, 23, 45, 0.72), rgba(5, 10, 21, 0.78));
}

.teacher-photo {
  width: 82px;
  flex: 0 0 82px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #eef3f9;
  border: 1px solid rgba(185, 210, 255, 0.32);
}

.teacher-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.teacher-info strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.teacher-info span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.team-card > .team-avatar.team-avatar-lg {
  display: grid;
  width: 52px;
  height: 52px;
  font-size: 14px;
  color: #04101f;
  background: linear-gradient(135deg, #9fc9ff, #2f7bf0);
}

@media (max-width: 980px) {
  .content-grid,
  .program-grid {
    grid-template-columns: 1fr;
  }

  .objective-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hero-grid {
    gap: 28px;
  }

  .float-chip {
    padding: 8px 11px;
  }

  .chip-b {
    right: -3%;
  }

  #proximityCard,
  #fillCard,
  #odorCard,
  #buzzerCard {
    grid-column: span 6;
  }

  .chart-card,
  .alerts-card {
    grid-column: span 12;
  }

  .oled-card {
    grid-column: span 5;
  }

  .sim-card {
    grid-column: span 7;
  }

  .lid-card {
    grid-template-columns: minmax(0, 1fr) 250px;
    padding: 20px 22px;
  }
}

@media (max-width: 980px) {
  .hero {
    padding-top: calc(var(--header-h) + var(--bar-h) + 44px);
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 640px;
  }

  .hero-visual {
    min-height: 460px;
    margin-top: 10px;
  }

  .bin-art {
    max-width: 470px;
  }

  .visual-orbit {
    max-width: 480px;
  }

  .stats-strip {
    margin-top: 50px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .monitor-head {
    flex-direction: column;
    gap: 18px;
  }

  .monitor-toolbar {
    justify-content: flex-start;
    padding-top: 0;
  }

  .spec-layout,
  .contact-grid,
  .connect-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .connect-aside {
    position: static;
  }

  .contact-copy {
    max-width: 640px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 920px) {
  .monitor-grid {
    gap: 14px;
  }

  .oled-card,
  .sim-card {
    grid-column: span 12;
  }

  .sim-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sim-side {
    margin-top: 8px;
  }

  .oled-screen {
    max-width: 440px;
  }

  .lid-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .lid-stage {
    justify-content: flex-start;
    padding-left: 4px;
  }

  .lid-demo {
    width: 240px;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 0 20px;
  }

  .section {
    padding: 76px 0;
  }

  .monitor-section {
    padding: 76px 0 84px;
  }

  .hero {
    padding-bottom: 54px;
  }

  .lead {
    font-size: 15.5px;
  }

  .hero-points {
    gap: 8px 16px;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .stat:nth-child(3)::before {
    display: none;
  }

  .stat:nth-child(1),
  .stat:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .split-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .split-head .section-sub {
    max-width: 100%;
  }

  .chart-legend {
    display: none;
  }

  .monitor-toolbar {
    gap: 6px;
  }

  .status-pill {
    font-size: 11.5px;
    padding: 7px 12px;
  }

  .meta-chip {
    font-size: 10px;
    padding: 6px 9px;
  }

  .spec-row {
    flex-direction: column;
    gap: 4px;
  }

  .spec-row strong {
    text-align: left;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .contact-form {
    padding: 22px;
  }
}

@media (max-width: 620px) {
  .nav {
    gap: 14px;
  }

  .nav-cta {
    display: none;
  }

  .section-bar-inner {
    gap: 4px;
  }

  .section-chip {
    gap: 6px;
    padding: 6px 10px;
    font-size: 11.8px;
  }

  #proximityCard,
  #fillCard,
  #odorCard,
  #buzzerCard {
    grid-column: span 12;
  }

  .lid-card {
    padding: 18px;
  }

  .lid-readout div {
    flex: 1 1 100%;
  }

  .lid-demo {
    width: 210px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step-icon {
    margin-bottom: 18px;
  }

  .hero-visual {
    min-height: 380px;
  }

  .float-chip {
    transform: scale(0.92);
  }

  .chip-a {
    top: 7%;
    left: -2%;
  }

  .chip-b {
    top: 46%;
    right: -4%;
  }

  .chip-c {
    left: -1%;
    bottom: 5%;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .monitor-head h2 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .oled-device {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .oled-caption {
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 12px;
  }

  .oled-caption p {
    margin-top: 0;
  }

  .sim-actions .btn {
    flex: 1 1 100%;
  }

  .chart-wrap {
    min-height: 190px;
  }

  #chartCanvas {
    height: 190px;
  }

  .alerts-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 430px) {
  .float-chip {
    display: none;
  }

  .hero-visual {
    min-height: 340px;
  }

  .stats-strip {
    grid-template-columns: 1fr;
  }

  .stat + .stat::before {
    display: none;
  }

  .stat {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .monitor-updated {
    font-size: 11px;
  }

  .oled-screen {
    min-height: 158px;
    padding: 11px 12px;
  }
}

@media (max-width: 620px) {
  .index-panel {
    width: min(300px, calc(100vw - 40px));
  }
}

/* ---------- Accesibilidad / movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js-ready .reveal {
    opacity: 1;
    transform: none;
  }
}
