:root {
  --bg: #e3dfd7;
  --ink: #1b1a17;
  --muted: #6d6a62;
  --line: #c9c4b9;
  --panel: rgba(236, 233, 226, 0.72);
  --accent: #5a48f2;
  --serif: "Instrument Serif", Georgia, serif;
  --text: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
body.noche {
  --bg: #0b0d18;
  --ink: #ecebf5;
  --muted: #9a98ad;
  --line: #2c2f45;
  --panel: rgba(20, 22, 38, 0.72);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  transition: background-color .8s ease, color .8s ease;
}

#escena { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
#escena:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }

/* Cabecera */
.cabecera { position: fixed; top: 32px; left: 36px; pointer-events: none; max-width: 420px; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 132px; line-height: .9; margin: 0; letter-spacing: -.02em; }
.punto-final { color: var(--accent); transition: color .6s; }
.sub { font-size: 16px; line-height: 1.5; margin: 30px 0 0; color: var(--ink); opacity: .82; }

.vivo { position: fixed; top: 34px; right: 36px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--line); padding: 6px 10px; display: flex; align-items: center; gap: 8px; }
.led { width: 6px; height: 6px; border-radius: 50%; background: #2e9b62; box-shadow: 0 0 0 0 rgba(46,155,98,.6); animation: latido 2s infinite; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(46,155,98,.6);} 70% { box-shadow: 0 0 0 7px rgba(46,155,98,0);} 100% { box-shadow: 0 0 0 0 rgba(46,155,98,0);} }

/* Panel */
.panel { position: fixed; top: 82px; right: 36px; width: 252px; padding: 18px 18px 16px; background: var(--panel);
  border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--mono); font-size: 11px; transition: background-color .8s, border-color .8s; }
.panel-cab { display: flex; justify-content: space-between; align-items: baseline; letter-spacing: .14em; text-transform: uppercase; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-cab em { font-family: var(--text); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.bloque { border: 0; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
legend, .control label { letter-spacing: .14em; text-transform: uppercase; padding: 0; }
legend { margin-bottom: 10px; float: left; width: 100%; }
.muestras { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.muestras button { background: none; border: 1px solid transparent; padding: 6px 4px 4px; cursor: pointer; color: var(--ink); display: grid; justify-items: center; gap: 5px; }
.muestras button i { width: 52px; height: 26px; display: block; background: linear-gradient(var(--a) 0 70%, var(--b) 70% 100%); border-radius: 2px; }
.muestras button em { font-family: var(--text); font-size: 13px; color: var(--muted); }
.muestras button[aria-pressed="true"] { border-color: var(--ink); }
.muestras button[aria-pressed="true"] em { color: var(--ink); }

.fila { display: flex; justify-content: space-between; margin-bottom: 8px; }
output { font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; appearance: none; -webkit-appearance: none; background: transparent; height: 18px; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
input[type=range]::-moz-range-track { height: 1px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--ink); background: var(--bg); margin-top: -6px; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink); background: var(--bg); }
.extremos { display: flex; justify-content: space-between; font-family: var(--text); font-size: 12px; color: var(--muted); margin-top: 4px; }

.botones { display: grid; gap: 8px; }
.botones.tres { grid-template-columns: repeat(3, 1fr); }
.botones.dos { grid-template-columns: repeat(2, 1fr); margin-top: 10px; }
.botones button { font-family: system-ui, sans-serif; font-size: 13px; padding: 10px 4px; background: transparent; color: var(--ink); border: 1px solid var(--line); cursor: pointer; transition: background-color .15s, border-color .15s; }
.botones button:hover { border-color: var(--ink); }
.botones button:active { background: var(--ink); color: var(--bg); }
.botones button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks { display: flex; gap: 16px; padding: 12px 0 2px; font-family: system-ui, sans-serif; font-size: 12.5px; }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checks input { accent-color: var(--ink); margin: 0; }

/* Manual inferior */
.manual { position: fixed; left: 36px; bottom: 26px; width: 410px; pointer-events: none; }
.instr { font-size: 14.5px; line-height: 1.45; margin: 0 0 16px; }
.eti { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; margin-right: 6px; }
.datos { display: grid; grid-template-columns: repeat(4, auto); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.datos div { padding: 9px 14px 9px 0; }
.datos div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.datos dt { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.datos dd { margin: 0; font-family: var(--mono); font-size: 16px; white-space: nowrap; }
.datos dd b { font-weight: 500; font-variant-numeric: tabular-nums; }
.datos small { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.nota { font-family: system-ui, sans-serif; font-size: 10.5px; line-height: 1.4; color: var(--muted); margin: 10px 0 0; }

/* Dentro del experimento */
.dentro { position: fixed; right: 36px; bottom: 26px; width: 300px; border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background-color .8s; }
.dentro summary { list-style: none; cursor: pointer; padding: 10px 14px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; display: flex; justify-content: space-between; }
.dentro summary::-webkit-details-marker { display: none; }
.dentro summary::after { content: "+"; }
.dentro[open] summary::after { content: "–"; }
.dentro-cuerpo { padding: 0 14px 12px; font-size: 13.5px; line-height: 1.5; }
.dentro-cuerpo p { margin: 0 0 8px; }

.sin-js { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; }
body.agarrando, body.agarrando #escena { cursor: grabbing; }
body.sobre #escena { cursor: grab; }
