/* Charla «Software factory»: estilos compartidos por los tres idiomas, con la
   identidad de maximofn.com (fondo azul noche, rejilla, Cascadia Code, cian). */
@font-face {
  font-family: "Cascadia Code";
  src: url("/fonts/CascadiaCode-2404.23/woff2/CascadiaCode.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
:root {
  --bg: #040813;
  --surface: #07111f;
  --text: #fafafa;
  --muted: #989898;
  --soft: #cbd5e1;
  --blue: #839dd1;
  --cyan: #67e8f9;
  --amber: #ff9a3d;
  --red: #ff6b6f;
  --glass: rgba(7, 17, 31, 0.66);
  --edge: rgba(131, 157, 209, 0.24);
  --font: "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; font-family: var(--font); -webkit-font-smoothing: antialiased; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; transition: filter 1.2s ease; }
#scene.blurred { filter: blur(7px) brightness(0.5); }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* Etiquetas ancladas a la escena. main.js las mueve y las funde. */
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 21px; line-height: 1.25; color: var(--text); visibility: hidden; opacity: 0; will-change: transform, opacity, filter; }
.lbl.tag { background: var(--glass); border: 1px solid var(--edge); padding: 8px 16px; border-radius: 999px; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.lbl.mini { font-size: 16px; padding: 5px 12px; color: var(--soft); }
.lbl.year { font-size: 24px; font-weight: 700; padding: 6px 14px; }
.lbl.big { font-size: clamp(40px, 4.4vw, 70px); font-weight: 700; letter-spacing: -0.03em; text-shadow: 0 8px 40px rgba(0, 0, 0, 0.9); white-space: normal; width: 22ch; text-align: center; text-wrap: balance; }
.lbl.q { font-size: clamp(28px, 3vw, 46px); font-weight: 600; letter-spacing: -0.025em; color: rgba(250, 250, 250, 0.9); text-shadow: 0 6px 30px rgba(0, 0, 0, 0.85); white-space: normal; width: 30ch; text-align: center; text-wrap: balance; }
.lbl.q.wide { width: 46ch; }
.lbl.ok { color: var(--cyan); border-color: rgba(103, 232, 249, 0.42); }
.lbl.tag.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); margin-right: 10px; vertical-align: 2px; }
.lbl.big.ok, .lbl.q.ok { text-shadow: 0 0 40px rgba(103, 232, 249, 0.35), 0 8px 40px rgba(0, 0, 0, 0.8); }
.lbl.bad { color: var(--red); border-color: rgba(255, 107, 111, 0.45); }
.lbl.amber { color: var(--amber); border-color: rgba(255, 154, 61, 0.45); }
.lbl.opt { color: var(--blue); border-style: dashed; }
.lbl.count { font-variant-numeric: tabular-nums; }

.lbl.desc { white-space: normal; width: 300px; text-align: center; font-size: 18px; line-height: 1.4; color: var(--soft); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95); text-wrap: balance; }
.lbl.desc.wide { width: 470px; }
.lbl.desc.left { text-align: left; width: 420px; transform-origin: left; }
.lbl.desc small { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.lbl.desc em, .lbl.desc i { font-style: normal; font-weight: 700; }
.lbl.desc em { color: var(--cyan); }
.lbl.desc i { color: var(--red); }

.card { background: var(--glass); border: 1px solid var(--edge); border-radius: 18px; padding: 18px 22px; backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05); white-space: normal; }
.c-title { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.lbl.rule-card { width: 860px; font-size: 22px; line-height: 1.4; border-color: rgba(103, 232, 249, 0.42); box-shadow: 0 0 60px rgba(103, 232, 249, 0.12), 0 18px 50px rgba(0, 0, 0, 0.5); }

.lbl.rule { display: grid; grid-template-columns: 210px 30px 230px; align-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--edge); border-radius: 14px; padding: 10px 16px; font-size: 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .4s, border-color .4s, box-shadow .4s; }
.lbl.rule i { font-style: normal; color: var(--cyan); text-align: center; }
.lbl.rule span { color: var(--soft); }
.lbl.rule.hot { border-color: rgba(103, 232, 249, 0.75); background: rgba(10, 48, 66, 0.8); box-shadow: 0 0 40px rgba(103, 232, 249, 0.25); }

.lbl.stepcard { white-space: normal; width: 210px; display: grid; gap: 6px; background: var(--glass); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.35; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lbl.stepcard b { color: var(--cyan); font-size: 26px; line-height: 1; }
.lbl.stepcard strong { font-size: 19px; }
.lbl.stepcard span { color: var(--soft); }
.lbl.stepcard.tall { width: 190px; }

.lbl.kinds { width: 1180px; }
.kinds-row { flex-wrap: nowrap; white-space: nowrap; }
.kinds-row { display: flex; align-items: center; gap: 10px; font-size: 17px; flex-wrap: wrap; }
.kinds-row span { color: var(--muted); }
.kinds-row b { font-weight: 500; border: 1px solid rgba(103, 232, 249, 0.45); color: var(--cyan); border-radius: 999px; padding: 4px 12px; }
.kinds-row b.hot { border-color: rgba(255, 154, 61, 0.55); color: var(--amber); }
.kinds-row i { flex: 1; min-width: 60px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), var(--amber)); }

.lbl.num { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; text-shadow: 0 0 40px rgba(103, 232, 249, 0.25), 0 8px 30px rgba(0, 0, 0, 0.8); }
.lbl.num.huge { font-size: clamp(110px, 13vw, 200px); line-height: 0.9; }
.lbl.num.bad { color: var(--red); text-shadow: 0 0 60px rgba(255, 107, 111, 0.35), 0 8px 30px rgba(0, 0, 0, 0.8); }
.lbl.measure { width: 1060px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips span { border: 1px solid var(--edge); border-radius: 999px; padding: 5px 13px; font-size: 17px; }
.warn { color: var(--amber); font-size: 18px; font-weight: 600; }

.lbl.risk { white-space: normal; width: 330px; display: grid; gap: 4px; background: var(--glass); border: 1px solid rgba(255, 107, 111, 0.32); border-radius: 14px; padding: 12px 15px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lbl.risk b { font-size: 18px; color: var(--text); }
.lbl.risk span { font-size: 15px; color: var(--soft); line-height: 1.38; }

.lbl.case { width: 430px; }
.case .talk { font-size: 17px; font-weight: 600; margin: -4px 0 12px; }
.case .kpi { font-size: 52px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--cyan); margin-bottom: 14px; }
.case .kpi small { display: block; font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--soft); margin-top: 6px; }
.case ul { margin: 0 0 14px; padding-left: 1.1em; display: grid; gap: 6px; font-size: 16px; line-height: 1.38; }
.case .ex { font-size: 14px; color: var(--muted); border-top: 1px solid var(--edge); padding-top: 10px; }

/* Capas fijas */
#chip { position: fixed; left: 32px; top: 26px; display: flex; align-items: center; gap: 12px; font-size: 18px; color: var(--soft); opacity: 0; transform: translateY(-6px); transition: opacity .6s, transform .6s; }
#chip.on { opacity: 1; transform: none; }
#chip b { color: var(--bg); background: var(--cyan); font-size: 14px; padding: 4px 9px; border-radius: 7px; }
#progress { position: fixed; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, rgba(103, 232, 249, 0.15), var(--cyan)); box-shadow: 0 0 14px rgba(103, 232, 249, 0.6); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
#home { position: fixed; right: 28px; top: 22px; font-size: 15px; color: var(--muted); text-decoration: none; padding: 6px 13px; border: 1px solid var(--edge); border-radius: 999px; background: var(--glass); transition: color .2s, border-color .2s; }
#home:hover, #home:focus-visible { color: var(--text); border-color: rgba(103, 232, 249, 0.5); outline: none; }

#title { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: 18px; pointer-events: none; opacity: 0; transition: opacity 1.2s; padding: 0 24px; }
#title.on { opacity: 1; }
#title .eyebrow { font-size: clamp(14px, 1.3vw, 19px); letter-spacing: 0.24em; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 30px rgba(103, 232, 249, 0.5); }
#title h1 { margin: 0; font-size: clamp(56px, 9vw, 150px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.95; }
#title h1 span { color: var(--cyan); text-shadow: 0 0 60px rgba(103, 232, 249, 0.45); }
#title .sub { font-size: clamp(18px, 1.9vw, 28px); color: var(--soft); max-width: 34ch; margin-inline: auto; text-wrap: balance; line-height: 1.35; }
#title .who { margin-top: 18px; font-size: clamp(15px, 1.4vw, 21px); color: var(--muted); }
#title > * { transform: translateY(14px); transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
#title.on > * { transform: none; }

#moral { position: fixed; left: 0; right: 0; top: 11vh; display: grid; justify-items: center; gap: 0.3em; text-align: center; pointer-events: none; font-size: clamp(30px, 4vw, 66px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; padding: 0 24px; }
#moral p { margin: 0; opacity: 0; transform: translateY(16px); transition: opacity 1s, transform 1.2s cubic-bezier(.2, .8, .2, 1); text-wrap: balance; text-shadow: 0 8px 40px rgba(0, 0, 0, 0.9); }
#moral .m2 { color: var(--cyan); text-shadow: 0 0 50px rgba(103, 232, 249, 0.4), 0 8px 40px rgba(0, 0, 0, 0.9); }
#moral.on p { opacity: 1; transform: none; }
#moral.on .m2 { transition-delay: .7s; }

/* Final en dos pantallas: primero las fuentes, después tus datos. */
#sources, #thanks { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 36px; background: radial-gradient(ellipse at center, rgba(4, 8, 19, 0.8), var(--bg) 70%); opacity: 0; transition: opacity 1.4s; pointer-events: none; padding: 0 24px; }
#sources.on, #thanks.on { opacity: 1; pointer-events: auto; }
#sources h2, #thanks h2 { margin: 0; font-size: clamp(52px, 6.5vw, 110px); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
#sources ul, #thanks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: clamp(16px, 1.45vw, 24px); }
#sources a, #thanks a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(103, 232, 249, 0.35); }
#sources a:hover, #sources a:focus-visible, #thanks a:hover, #thanks a:focus-visible { color: var(--cyan); outline: none; }
#sources small, #thanks small { display: block; color: var(--muted); font-size: 0.72em; margin-top: 2px; }
#thanks .me { margin: -18px 0 0; font-size: clamp(18px, 1.7vw, 28px); color: var(--cyan); }
#thanks ul { grid-template-columns: auto auto; gap: 14px 36px; align-items: baseline; }
#thanks li { display: contents; }
#thanks span { color: var(--muted); text-align: right; }
@media (max-width: 760px) { #thanks ul { grid-template-columns: 1fr; gap: 4px; } #thanks span { text-align: left; margin-top: 10px; } }

#fade { position: fixed; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; }
#fade.on { animation: fade 1.2s ease-out; }
@keyframes fade { 0% { opacity: 1; } 100% { opacity: 0; } }
#black { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .4s; }
#black.on { opacity: 1; }
#loading { position: fixed; inset: 0; display: grid; place-content: center; color: var(--muted); font-size: 16px; letter-spacing: 0.16em; text-transform: uppercase; transition: opacity .8s; background: var(--bg); }
#loading.done { opacity: 0; pointer-events: none; }
#hint { position: fixed; right: 24px; bottom: 20px; font-size: 14px; color: var(--muted); background: var(--glass); border: 1px solid var(--edge); padding: 8px 14px; border-radius: 10px; }
#hint kbd { font-family: var(--font); color: var(--text); }
@media (max-width: 760px) { #hint { display: none; } #chip { left: 16px; top: 16px; font-size: 14px; } #home { right: 16px; top: 14px; } }
@media (prefers-reduced-motion: reduce) { #scene, #title > *, #moral p { transition: none; } }
