/* =========================================================
   La ruta del fotón — hoja de estilos
   Diseño híbrido: portada oscura + contenido tipo cuaderno
   ========================================================= */

:root {
  --bg: #f7f5ef;
  --surface: #fffdf8;
  --surface-2: #efece3;
  --ink: #101a2b;
  --ink-soft: #334155;
  --muted: #5b6577;
  --line: #d9d4c7;
  --navy: #0a1224;
  --navy-soft: #111d35;
  --laser: #e63946;
  --laser-deep: #b91c2a;
  --cyan: #0e7490;
  --cyan-bright: #22d3ee;
  --amber: #b45309;
  --amber-bright: #f59e0b;
  --green: #15803d;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 5px 18px rgba(16, 26, 43, 0.06);
  --shadow-soft: 0 2px 8px rgba(16, 26, 43, 0.04);
  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "SFMono-Regular", Menlo, monospace;
  --max: 1180px;
  --header-h: 70px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.08rem);
  line-height: 1.65;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--laser-deep);
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--cyan-bright);
  outline-offset: 3px;
}

::selection {
  background: var(--laser);
  color: var(--white);
}

[hidden] {
  display: none !important;
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.container--narrow {
  width: min(860px, calc(100% - 2rem));
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 999;
  background: var(--white);
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Barra de progreso ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 400;
  background: transparent;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--laser), var(--amber-bright), var(--cyan-bright));
}

/* ---------- Encabezado ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 18, 36, 0.94);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--white);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--white);
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(230, 57, 70, 0.12);
  border: 1px solid rgba(230, 57, 70, 0.38);
  color: #ff7b85;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.brand-text {
  display: grid;
  line-height: 1.12;
}

.brand-text strong {
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: #9fb0c9;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin-top: 0.2rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.12rem;
  margin-inline: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  color: #c8d3e5;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.site-nav a[aria-current="true"] {
  background: rgba(230, 57, 70, 0.16);
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(230, 57, 70, 0.34);
}

.header-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1.15rem;
  font-weight: 750;
  font-size: 0.88rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: #cf2332;
  color: var(--white);
  box-shadow: 0 7px 18px rgba(207, 35, 50, 0.22);
}

.btn--primary:hover {
  background: var(--laser-deep);
  color: var(--white);
}

.btn--secondary {
  background: var(--navy);
  color: var(--white);
}

.btn--secondary:hover {
  background: #16223c;
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--white);
  border-color: #bfc7d4;
  color: var(--ink);
}

.btn--presenter {
  background: #cf2332;
  color: var(--white);
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  box-shadow: 0 4px 12px rgba(207, 35, 50, 0.18);
}

.btn--presenter:hover {
  background: var(--laser-deep);
  color: var(--white);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.hero .btn--ghost {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--white);
}

.hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--white);
}

/* ---------- Portada ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 14% 18%, rgba(34, 211, 238, 0.08), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(230, 57, 70, 0.12), transparent 32%),
    linear-gradient(180deg, #0a1224 0%, #0c162b 74%, #0a1224 100%);
  padding-block: clamp(4rem, 8vw, 7rem) clamp(4rem, 7vw, 6rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  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: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 88%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  color: var(--cyan);
}

.hero .eyebrow {
  color: #ff8a94;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.1rem, 6.2vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.text-laser {
  color: #ff6b78;
  text-shadow: 0 0 22px rgba(230, 57, 70, 0.34);
}

.hero-subtitle {
  margin: 1rem 0 0;
  color: #d7e0ee;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 650;
  letter-spacing: 0.01em;
}

.hero-lead {
  max-width: 60ch;
  margin: 1.2rem 0 0;
  color: #aebdd2;
  font-size: 1rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.hero-visual {
  position: relative;
  min-width: 0;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 12% 4% 8%;
  background: radial-gradient(circle at 50% 50%, rgba(230, 57, 70, 0.15), transparent 64%);
  filter: blur(18px);
  pointer-events: none;
}

.hero-svg {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
}

.hero-beam-line {
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: heroBeam 1.8s ease-out 0.25s forwards;
}

.hero-output-line {
  opacity: 0;
  animation: heroOutput 1.1s ease-out 1.35s forwards;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge--info {
  background: #e0f2fe;
  color: #075985;
}

.badge--warning {
  background: #fef3c7;
  color: #92400e;
}

.badge--success {
  background: #dcfce7;
  color: #166534;
}

.badge--danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ---------- Secciones ---------- */

.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.section--tint {
  background: var(--surface-2);
}

.section-head {
  max-width: 78ch;
  margin-bottom: 2.1rem;
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.section-lead {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.split {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.prose p {
  max-width: 70ch;
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.sources {
  max-width: 84ch;
  margin: 2rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.sources a {
  color: var(--muted);
}

/* ---------- Llamados ---------- */

.callout {
  margin: 1.3rem 0;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.callout-title {
  margin: 0 0 0.35rem;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout ul {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}

.callout li + li {
  margin-top: 0.35rem;
}

.callout--key {
  border-left-color: var(--cyan);
  background: #ecfeff;
}

.callout--key .callout-title {
  color: #0e7490;
}

.callout--myth {
  border-left-color: var(--laser);
  background: #fff1f2;
}

.callout--myth .callout-title {
  color: var(--laser-deep);
}

.callout--warning {
  border-left-color: var(--amber-bright);
  background: #fffbeb;
}

.callout--warning .callout-title {
  color: var(--amber);
}

.callout--formula {
  border-left-color: var(--laser);
  background: #fef2f2;
}

.callout--formula .callout-title {
  color: var(--laser-deep);
}

.callout--info {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.callout--info .callout-title {
  color: #1d4ed8;
}

.formula {
  display: inline-block;
  padding: 0.08rem 0.38rem;
  border-radius: 6px;
  background: rgba(230, 57, 70, 0.08);
  font-family: var(--font-mono);
  font-size: 0.92em;
  white-space: nowrap;
}

/* ---------- Figuras ---------- */

.figure {
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.compare-card {
  padding: 0.9rem;
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}

.compare-card--laser {
  background: #f8fafc;
  border-color: rgba(230, 57, 70, 0.22);
}

.compare-card svg {
  width: 100%;
  height: auto;
  display: block;
}

.compare-card h3 {
  margin: 0.7rem 0 0.4rem;
  font-size: 0.98rem;
}

.compare-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  color: var(--muted);
  font-size: 0.8rem;
}

.compare-card li {
  position: relative;
  padding-left: 1rem;
}

.compare-card li + li {
  margin-top: 0.28rem;
}

.compare-card li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--cyan);
}

.compare-card--laser li::before {
  color: var(--laser);
}

/* ---------- Pestañas de procesos ---------- */

.process-tabs {
  margin-top: 2rem;
}

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  padding: 0.52rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 750;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.tab:hover {
  border-color: #94a3b8;
}

.tab[aria-selected="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(10, 18, 36, 0.14);
}

.tab-panels {
  margin-top: 1.4rem;
}

.process-panel {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: center;
  padding: clamp(1rem, 2.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.process-visual {
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.process-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.process-copy h3 {
  margin: 0 0 0.45rem;
  font-size: 1.45rem;
}

.process-copy p {
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.key-line {
  margin: 0;
  padding: 0.7rem 0.9rem;
  background: #f1f5f9;
  border-left: 3px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  font-size: 0.87rem;
}

.atom,
.photon,
.absorb-arrow,
.spont-arrow,
.stim-arrow {
  transform-box: fill-box;
  transform-origin: center;
}

.process-panel.is-active .photon--in {
  animation: photonIn 1.25s ease-out both;
}

.process-panel.is-active .atom:not(.atom--spont):not(.atom--stim) {
  animation: atomUp 1.25s ease-out both;
}

.process-panel.is-active .atom--spont,
.process-panel.is-active .atom--stim {
  animation: atomDown 1.25s ease-out both;
}

.process-panel.is-active .photon--out {
  animation: photonOut 1.35s ease-out both;
}

.process-panel.is-active .photon--out-a {
  animation: photonOut 1.35s ease-out 0.15s both;
}

.process-panel.is-active .photon--out-b {
  animation: photonOut 1.35s ease-out 0.3s both;
}

.process-panel.is-active .absorb-arrow,
.process-panel.is-active .spont-arrow,
.process-panel.is-active .stim-arrow {
  animation: arrowFade 0.8s ease-out 0.2s both;
}

/* ---------- Ingredientes ---------- */

.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.ingredient-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.ingredient-num {
  font-family: var(--font-mono);
  color: var(--laser-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ingredient-card h3 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1rem;
}

.ingredient-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}

/* ---------- Laboratorio ---------- */

.lab {
  margin-top: 2.2rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lab-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.lab-head h3 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
}

.lab-intro {
  max-width: 78ch;
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.lab-note {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.lab-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.lab-controls {
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.control label,
.calc-controls > label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 750;
}

.control output,
.calc-controls output {
  font-family: var(--font-mono);
  color: var(--laser-deep);
  font-size: 0.82rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--laser);
  cursor: pointer;
}

.control-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.control-buttons .btn {
  flex: 1 1 100%;
  padding: 0.58rem 0.8rem;
  font-size: 0.8rem;
}

.lab-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e2e8f0;
  color: var(--muted);
  font-size: 0.72rem;
}

.lab-legend p {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.legend-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

.legend-dot--pump {
  background: var(--amber-bright);
}

.legend-dot--photon {
  background: var(--laser);
}

.legend-dot--beam {
  background: var(--laser);
  box-shadow: 0 0 7px rgba(230, 57, 70, 0.75);
}

.lab-stage {
  min-width: 0;
}

.lab-visual {
  --pump: 0;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lab-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.medium {
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.lab-visual.has-inversion .medium {
  fill: #fecaca;
  stroke: var(--laser);
}

.pump-arrows {
  opacity: calc(0.15 + var(--pump) * 0.85);
  transition: opacity 0.2s ease;
}

.mirror--right {
  transition: transform 0.25s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.lab-visual.is-misaligned .mirror--right {
  transform: translate(18px, 14px) rotate(9deg);
}

.beam {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.beam-inside {
  opacity: 0.12;
  transition: opacity 0.25s ease;
}

.lab-visual.is-lasing .beam {
  opacity: 1;
  animation: beamGlow 1.6s ease-in-out infinite;
}

.beam-label {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lab-visual.is-lasing .beam-label {
  opacity: 1;
}

.lab-visual.is-lasing .beam-inside {
  opacity: 0.92;
}

.lab-photon {
  opacity: 0;
}

.lab-visual.is-lasing .lab-photon {
  opacity: 1;
  animation: photonTravel 1.25s linear infinite;
}

.lab-visual.is-lasing .lab-photon:nth-child(2) {
  animation-delay: 0.25s;
}

.lab-visual.is-lasing .lab-photon:nth-child(3) {
  animation-delay: 0.5s;
}

.lab-visual.is-lasing .lab-photon:nth-child(4) {
  animation-delay: 0.75s;
}

.lab-visual.is-lasing .lab-photon:nth-child(5) {
  animation-delay: 1s;
}

.lab-readouts {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.readout {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 1.6fr auto;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.readout-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.bar {
  height: 0.52rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--laser);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.bar--lower span {
  background: var(--cyan);
}

.readout output {
  min-width: 2.4rem;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 750;
  text-align: right;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.status-pill {
  padding: 0.24rem 0.52rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
}

.status-pill.is-good {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.status-pill.is-bad {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.status-pill.is-warn {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.lab-footer {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.4rem;
  align-items: start;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.missions-title {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.missions {
  display: grid;
  gap: 0.38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.missions li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.mission-dot {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
}

.missions li.is-done {
  color: #166534;
  font-weight: 700;
}

.missions li.is-done .mission-dot {
  background: #22c55e;
  border-color: #22c55e;
}

.missions li.is-done .mission-dot::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 800;
}

.lab-feedback {
  margin: 0;
  padding: 0.8rem 1rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.lab-feedback.is-good {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.lab-feedback.is-warn {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

/* ---------- Propiedades ---------- */

.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.property-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.property-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  min-height: 112px;
  padding: 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.property-card h3 {
  margin: 0.85rem 0 0.4rem;
  font-size: 1.18rem;
}

.property-card p {
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.property-card p:last-child {
  margin-bottom: 0;
}

.spectrum {
  height: 0.7rem;
  border-radius: 999px;
}

.spectrum--broad {
  background: linear-gradient(90deg, #7c3aed, #2563eb, #16a34a, #facc15, #f97316, #dc2626);
  opacity: 0.82;
}

.spectrum--narrow {
  position: relative;
  background: #0f172a;
}

.spectrum--narrow span {
  position: absolute;
  top: 50%;
  left: 58%;
  width: 4px;
  height: 1.1rem;
  background: #ef4444;
  border-radius: 2px;
  box-shadow: 0 0 8px #ef4444;
  transform: translate(-50%, -50%);
}

.mini-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
  line-height: 1.4;
}

.wave-svg,
.beam-svg {
  display: block;
  width: 100%;
  height: auto;
}

.table-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table caption {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 750;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: #f8fafc;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.data-table tbody tr:hover {
  background: #fbfdff;
}

/* ---------- He-Ne y cálculos ---------- */

.hene-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 3vw, 2.4rem);
  align-items: start;
}

.hene-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.hene-photon {
  animation: henePulse 2.2s ease-in-out infinite;
}

.steps {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.step-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--navy);
  border-radius: 50%;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.steps h3 {
  margin: 0 0 0.18rem;
  font-size: 0.98rem;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-top: 2rem;
}

.worked-example,
.calculator-card {
  padding: clamp(1rem, 2.5vw, 1.6rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.worked-example h3,
.calculator-card h3 {
  margin: 0.2rem 0 0.8rem;
  font-size: 1.28rem;
}

.formula-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.formula-box span {
  padding: 0.32rem 0.55rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.calc-steps {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calc-steps li {
  display: flex;
  gap: 0.65rem;
}

.calc-steps p {
  margin: 0 0 0.25rem;
  font-size: 0.87rem;
}

.math {
  margin: 0;
  padding: 0.45rem 0.6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 1rem;
}

.result-grid div {
  padding: 0.6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-grid strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.calc-card-head p {
  margin: 0.2rem 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.calc-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.8rem 0;
}

.calc-number label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.calc-number input {
  width: 8.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.62rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.chip.is-correct {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.chip.is-wrong {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.chip.is-selected {
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.2);
}

.chip:disabled {
  cursor: default;
}

.calc-result {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.swatch {
  height: 4.4rem;
  background-color: #dc2626;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.18);
  transition: background-color 0.2s ease;
}

.swatch[data-region="ir"] {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 16px);
}

.swatch[data-region="uv"] {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 16px);
}

.calc-region {
  margin: 0.5rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 750;
}

.result-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed #e2e8f0;
}

.result-list dt {
  color: var(--muted);
  font-size: 0.79rem;
}

.result-list dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 750;
  text-align: right;
}

.calc-details {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.calc-details summary {
  color: var(--cyan);
  font-weight: 750;
  cursor: pointer;
}

.calc-details p {
  margin: 0.5rem 0 0;
  padding: 0.6rem;
  background: #f8fafc;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
}

/* ---------- Aplicaciones ---------- */

.detector-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.detector-bar h3 {
  margin: 0.2rem 0 0;
  font-size: 1.18rem;
}

.detector-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.detector-score {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  padding: 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.app-card.is-correct {
  border-color: #86efac;
}

.app-card.is-wrong {
  border-color: #fca5a5;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.7rem;
  background: #f1f5f9;
  border-radius: 12px;
  color: var(--cyan);
}

.app-icon svg {
  width: 1.7rem;
  height: 1.7rem;
}

.app-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1.08rem;
}

.app-where {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.app-question {
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-bottom: 0.6rem;
}

.app-feedback {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.app-feedback:empty {
  display: none;
}

.app-note {
  margin: 0.8rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid #eef2f7;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

/* ---------- Seguridad ---------- */

.safety-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.4rem;
  align-items: start;
}

.safety-table {
  min-width: 620px;
}

.safety-copy h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.02rem;
}

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

.risk-list,
.checklist {
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.risk-list li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.risk-list li::before {
  content: "!";
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  background: #fef3c7;
  border-radius: 50%;
  color: #92400e;
  font-size: 0.62rem;
  font-weight: 800;
}

.checklist li {
  position: relative;
  padding-left: 1.65rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  top: 0.08rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  background: #dcfce7;
  border-radius: 50%;
  color: #166534;
  font-size: 0.66rem;
  font-weight: 800;
}

/* ---------- Quiz ---------- */

.quiz-list {
  display: grid;
  gap: 0.9rem;
}

.quiz-question {
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.quiz-question.is-correct {
  border-color: #86efac;
}

.quiz-question.is-wrong {
  border-color: #fca5a5;
}

.quiz-question legend {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 750;
}

.quiz-num {
  color: var(--laser-deep);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.quiz-options {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.8rem;
}

.quiz-options label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.58rem 0.68rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quiz-options label:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.quiz-options input {
  margin-top: 0.22rem;
  accent-color: var(--laser);
}

.quiz-feedback {
  display: none;
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.7rem;
  background: #f8fafc;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.quiz-feedback.is-visible {
  display: block;
}

.quiz-question.is-correct .quiz-feedback {
  background: #f0fdf4;
  color: #166534;
}

.quiz-question.is-wrong .quiz-feedback {
  background: #fef2f2;
  color: #991b1b;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.quiz-summary {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
}

.quiz-summary:empty {
  display: none;
}

/* ---------- Aporte y equipo ---------- */

.aporte-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

.aporte-copy p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.aporte-cards {
  display: grid;
  gap: 0.75rem;
}

.aporte-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.aporte-card h3 {
  margin: 0.2rem 0 0.3rem;
  font-size: 1rem;
}

.aporte-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

.aporte-icon {
  color: var(--laser-deep);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.team-names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-names li {
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Referencias ---------- */

.references {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding-left: 1.35rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.references li {
  padding-left: 0.15rem;
}

.references li::marker {
  color: var(--laser);
  font-weight: 800;
}

.references a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

.references a:hover {
  text-decoration-thickness: 2px;
}

.references cite {
  font-style: italic;
}

.ref-note {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- Pie de página ---------- */

.site-footer {
  padding: 3rem 0 2rem;
  background: var(--navy);
  color: #c8d3e5;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 8vw, 7rem);
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.footer-brand .brand-mark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ff7b85;
}

.footer-title {
  margin: 0;
  color: var(--white);
  font-weight: 800;
}

.footer-subtitle {
  margin: 0.2rem 0;
  color: #9fb0c9;
  font-size: 0.84rem;
}

.footer-meta {
  margin: 0.4rem 0 0;
  color: #7f91ab;
  font-size: 0.72rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(9rem, 1fr));
  gap: 0.5rem 2rem;
}

.footer-links a {
  color: #c8d3e5;
  font-size: 0.84rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* ---------- Modo exposición ---------- */

.presenter {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 500;
  width: min(780px, calc(100% - 2rem));
  max-height: 72vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(10, 18, 36, 0.3);
  transform: translateX(-50%) translateY(130%);
  transition: transform 0.24s ease;
}

.presenter.is-open {
  transform: translateX(-50%) translateY(0);
}

.presenter-inner {
  padding: 1rem 1.2rem 1.1rem;
}

.presenter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.presenter-progress {
  margin: 0.2rem 0 0;
  color: var(--laser-deep);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.presenter h2 {
  margin: 0.5rem 0 0.3rem;
  font-size: 1.28rem;
}

.presenter-note {
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.presenter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.presenter-actions .btn {
  padding: 0.5rem 0.78rem;
  font-size: 0.78rem;
}

.presenter-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.presenter-hint {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.icon-btn:hover {
  background: #e2e8f0;
}

.link-btn {
  padding: 0;
  background: none;
  border: 0;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.is-presenting .to-top {
  display: none;
}

/* ---------- Volver arriba ---------- */

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 300;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  background: var(--navy);
  border-radius: 50%;
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(10, 18, 36, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--white);
  background: var(--navy-soft);
}

/* =========================================================
   Animaciones
   ========================================================= */

@keyframes heroBeam {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes heroOutput {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes photonIn {
  0% {
    opacity: 0;
    transform: translateX(-16px);
  }
  22% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(10px);
  }
}

@keyframes atomUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-110px);
  }
}

@keyframes atomDown {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(110px);
  }
}

@keyframes photonOut {
  0% {
    opacity: 0;
    transform: translate(-8px, 8px) scale(0.82);
  }
  32% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes arrowFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.9;
  }
}

@keyframes photonTravel {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(390px);
  }
}

@keyframes beamGlow {
  0%,
  100% {
    opacity: 0.86;
  }
  50% {
    opacity: 1;
  }
}

@keyframes henePulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .header-inner {
    gap: 0.6rem;
  }

  .site-nav a {
    padding-inline: 0.42rem;
    font-size: 0.72rem;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 6vw, 4.8rem);
  }
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
    padding-block: 0.6rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 0.2rem;
  }

  .header-actions {
    margin-left: auto;
  }

  .section {
    scroll-margin-top: 8.5rem;
  }

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

  .hero-visual {
    max-width: 560px;
    margin-inline: auto;
  }

  .split,
  .hene-grid,
  .calc-layout,
  .aporte-grid,
  .safety-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .lab-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .lab-controls .control {
    grid-column: 1 / -1;
  }

  .control-buttons {
    margin-top: 0;
  }

  .lab-legend {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

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

@media (max-width: 760px) {
  .site-nav {
    flex-wrap: wrap;
    overflow: visible;
    row-gap: 0.2rem;
  }

  .site-nav a {
    padding: 0.32rem 0.45rem;
    font-size: 0.76rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 12vw, 4rem);
  }

  .hero-lead {
    font-size: 0.95rem;
  }

  .ingredient-grid,
  .property-grid,
  .app-grid,
  .team-names {
    grid-template-columns: 1fr;
  }

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

  .process-panel {
    grid-template-columns: 1fr;
  }

  .lab-footer {
    grid-template-columns: 1fr;
  }

  .lab-controls {
    grid-template-columns: 1fr;
  }

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

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

  .presenter {
    bottom: 0.5rem;
    width: calc(100% - 1rem);
    max-height: 78vh;
  }

  .presenter-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .presenter-hint {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .container,
  .container--narrow {
    width: calc(100% - 1.25rem);
  }

  .brand-text strong {
    font-size: 0.82rem;
  }

  .brand-text small {
    font-size: 0.6rem;
  }

  .brand-mark {
    width: 2.1rem;
    height: 2.1rem;
  }

  .btn--presenter {
    padding-inline: 0.7rem;
  }

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

  .section-head h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .lab {
    padding: 0.85rem;
  }

  .lab-head .badge {
    white-space: normal;
    line-height: 1.4;
  }

  .readout {
    grid-template-columns: 1fr auto;
  }

  .readout .bar {
    grid-column: 1 / -1;
    order: 3;
  }

  .calc-number {
    align-items: flex-start;
    flex-direction: column;
  }

  .calc-number input {
    width: 100%;
  }

  .detector-bar {
    align-items: flex-start;
  }

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

  .footer-links {
    grid-template-columns: 1fr;
  }

  .to-top {
    right: 0.6rem;
    bottom: 0.6rem;
  }
}

/* =========================================================
   Movimiento reducido
   ========================================================= */

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

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

  .hero-beam-line {
    stroke-dashoffset: 0;
  }

  .hero-output-line {
    opacity: 1;
  }
}

/* =========================================================
   Impresión / PDF de respaldo
   ========================================================= */

@media print {
  @page {
    margin: 16mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
    overflow: visible;
  }

  .site-header,
  .progress,
  .presenter,
  .to-top,
  .skip-link,
  .lab-controls,
  .lab-footer .missions-wrap,
  .quiz-actions,
  .detector-actions,
  .app-options,
  .tablist,
  .hero-actions,
  .footer-links {
    display: none !important;
  }

  .hero {
    color: #000;
    background: #fff;
    padding: 0 0 10mm;
    border-bottom: 1px solid #999;
  }

  .hero::before {
    display: none;
  }

  .hero h1,
  .text-laser,
  .hero-subtitle,
  .hero-lead,
  .eyebrow,
  .section-kicker {
    color: #000 !important;
    text-shadow: none;
  }

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

  .hero-visual {
    display: none;
  }

  .section {
    break-before: page;
    padding-block: 8mm;
    border-top: 0;
  }

  .section:first-of-type {
    break-before: auto;
  }

  .section--tint {
    background: #fff;
  }

  .ingredient-grid,
  .property-grid,
  .app-grid,
  .team-names {
    grid-template-columns: repeat(2, 1fr);
  }

  .ingredient-card,
  .property-card,
  .app-card,
  .figure,
  .lab,
  .worked-example,
  .calculator-card,
  .quiz-question,
  .callout {
    box-shadow: none;
    break-inside: avoid;
  }

  .process-panel[hidden] {
    display: grid !important;
  }

  .process-panel {
    break-inside: avoid;
  }

  .lab-grid,
  .lab-footer {
    grid-template-columns: 1fr;
  }

  .lab-visual,
  .process-visual,
  .property-visual {
    border-color: #bbb;
  }

  .lab-feedback {
    border-style: solid;
  }

  .app-feedback {
    display: none !important;
  }

  .site-footer {
    background: #fff;
    color: #000;
    border-top: 1px solid #999;
  }

  .footer-title,
  .footer-subtitle,
  .footer-meta {
    color: #000;
  }
}
