/* Fuentes alojadas en la propia web (Geist, licencia OFL: assets/fonts/OFL.txt) */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("assets/fonts/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("assets/fonts/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("assets/fonts/geist-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("assets/fonts/geist-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Portfolio de Alejandro Corral
   Idea: un expediente técnico. Tipografía grande, datos reales y código que funciona. */

:root {
  color-scheme: light;
  --paper: #FAFAF9;
  --raised: #FFFFFF;
  --ink: #0B0B0C;
  --ink-2: #57585E;
  --ink-3: #6B6C72;
  --line: #E3E3E1;
  --accent: #FF4D00;
  --accent-ink: #C43D00;
  --on-accent: #FFFFFF;
  --ok: #087A3C;
  --bad: #B42318;
  --ok-bg: #E8F6EE;
  --bad-bg: #FDECEA;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: max(20px, env(safe-area-inset-left));
  --max: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0B0B0C; --raised: #141416; --ink: #F2F2F0; --ink-2: #A2A3A9; --ink-3: #8D8E94; --line: #232327;
    --accent: #FF6A2B; --accent-ink: #FF6A2B; --on-accent: #0B0B0C; --ok: #3DD68C; --bad: #FF6B5E; --ok-bg: #0E2A1C; --bad-bg: #2E1412;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0B0B0C; --raised: #141416; --ink: #F2F2F0; --ink-2: #A2A3A9; --ink-3: #8D8E94; --line: #232327;
  --accent: #FF6A2B; --accent-ink: #FF6A2B; --on-accent: #0B0B0C; --ok: #3DD68C; --bad: #FF6B5E; --ok-bg: #0E2A1C; --bad-bg: #2E1412;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 17px; line-height: 1.55; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.muted { color: var(--ink-2); }
.rule { border: 0; border-top: 1px solid var(--line); }

/* Enlaces y botones */
.link { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .22em; text-decoration-thickness: 1px; transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 15px; text-decoration: none;
  border: 1px solid var(--ink); transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn.line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.line:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn .ext { font-family: var(--mono); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 60px; }
.top .me { font-weight: 600; text-decoration: none; margin-right: auto; letter-spacing: -.02em; }
.top nav { display: none; gap: 22px; font-size: 14px; }
.top nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.top nav a:hover { color: var(--ink); }
.top .cv { font-size: 14px; font-weight: 500; text-decoration: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; }
.top .cv:hover { border-color: var(--ink); }
.top .lang { font-family: var(--mono); font-size: 13px; text-decoration: none; padding: 7px 9px; border-radius: 8px; color: var(--ink-2); }
.top .lang:hover { color: var(--ink); background: var(--raised); }
.top .lang + .cv { margin-left: -14px; }
.theme { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); }
.theme:hover { border-color: var(--ink); }
.theme svg { width: 16px; height: 16px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

/* Portada */
.hero { padding-top: 32px; padding-bottom: 56px; overflow-x: clip; }
.status { display: inline-flex; align-items: flex-start; gap: 10px; color: var(--ink-2); }
.dot { flex: none; margin-top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--accent); opacity: .6; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(2); opacity: 0; } }
.masthead {
  margin: 22px 0 0; font-size: min(20.4vw, 292px); line-height: .84; letter-spacing: -.062em; font-weight: 600;
  margin-left: -.04em;
}
.masthead span { display: block; }
.js .masthead .ln { overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.masthead .ln > span { animation: rise 1.1s var(--ease) both; }
.masthead .ln:nth-child(2) > span { animation-delay: .08s; }
@keyframes rise { from { transform: translateY(105%); } }
.hero-grid { display: grid; gap: 36px; margin-top: 52px; }
.claim { font-size: clamp(24px, 3.2vw, 38px); line-height: 1.15; letter-spacing: -.03em; font-weight: 500; max-width: 22ch; }
.claim em { font-style: normal; color: var(--ink-2); }
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts dt { color: var(--ink-3); font-family: var(--mono); font-size: 12.5px; padding-top: 2px; }
.hero .row { margin-top: 28px; }

/* Secciones */
section { padding: 64px 0; }
.sec-head { display: grid; gap: 10px; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(34px, 5vw, 60px); line-height: 1; letter-spacing: -.045em; }
.sec-head p { color: var(--ink-2); max-width: 60ch; }

/* Casos */
.case { padding: 40px 0 72px; border-top: 1px solid var(--ink); }
.case + .case { margin-top: 24px; }
.case-top { display: grid; gap: 14px; }
.case-num { font-family: var(--mono); font-size: 13px; color: var(--accent-ink); }
.case h3 { font-size: clamp(40px, 7vw, 88px); line-height: .95; letter-spacing: -.055em; }
.case .what { font-size: clamp(19px, 2vw, 23px); letter-spacing: -.02em; line-height: 1.3; color: var(--ink-2); max-width: 34ch; }
.case .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); }
.case .row { margin-top: 6px; }
.case-body { display: grid; gap: 36px; margin-top: 44px; }
.block-title { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); margin-bottom: 12px; }
.prose p + p { margin-top: 12px; }
.prose p { color: var(--ink); }
.decisions { display: grid; gap: 0; border-top: 1px solid var(--line); }
.decisions li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.decisions b { font-weight: 600; }
.decisions span { display: block; color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.feature-list { display: flex; flex-wrap: wrap; gap: 8px; }
.feature-list li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.note { margin-top: 16px; padding: 14px 16px; border-left: 2px solid var(--accent); background: var(--raised); font-size: 15px; color: var(--ink-2); }
.note b { color: var(--ink); font-weight: 600; }

/* Historial de commits (datos reales del repo) */
.log { font-family: var(--mono); font-size: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); overflow: hidden; }
.log li { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--ink-3); }
.log .gap { color: var(--ink-3); grid-template-columns: 1fr; text-align: center; padding: 6px; }

/* Tira de capturas */
.strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 14px; margin: 44px calc(var(--gutter) * -1) 0; padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding-left: var(--gutter); }
.strip figure { flex: 0 0 auto; scroll-snap-align: start; }
.strip.web figure { width: min(86vw, 760px); }
.strip.phone figure { width: min(46vw, 230px); }
.strip img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); }
.strip.phone img { border-radius: 18px; }
.strip figcaption { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.strip button { display: block; width: 100%; cursor: zoom-in; border-radius: 10px; }

/* Motor VeriFactu en vivo */
.lab { margin-top: 44px; border: 1px solid var(--ink); border-radius: 14px; background: var(--raised); overflow: hidden; }
.lab-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lab-head p { font-size: 15px; font-weight: 500; }
.lab-state { font-family: var(--mono); font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.lab-state.bad { background: var(--bad-bg); color: var(--bad); }
.regs { display: grid; }
.reg { padding: 18px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; position: relative; transition: background .3s; }
.reg:last-child { border-bottom: 0; }
.reg.bad { background: color-mix(in srgb, var(--bad-bg) 70%, transparent); }
.reg-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.reg-top b { font-weight: 600; }
.reg .kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-family: var(--mono); font-size: 12.5px; }
.reg .kv dt { color: var(--ink-3); }
.reg .kv dd { word-break: break-all; }
.hash { color: var(--ink); }
.hash.changing { color: var(--accent-ink); }
.amount { display: inline-flex; align-items: center; gap: 6px; }
.amount input {
  width: 9ch; font-family: var(--mono); font-size: 13px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--paper); color: var(--ink);
}
.check { font-family: var(--mono); font-size: 12.5px; color: var(--ok); }
.check.bad { color: var(--bad); }
.lab-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.lab-foot .muted { font-size: 14px; flex: 1 1 260px; }
.lab-foot button { font-size: 14px; min-height: 38px; padding: 0 14px; }
.lab noscript p { padding: 18px; }

/* Cómo trabajo */
.steps { display: grid; gap: 0; border-top: 1px solid var(--ink); counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 6px 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--accent-ink); padding-top: 5px; }
.steps h3 { font-size: 22px; letter-spacing: -.025em; }
.steps p { grid-column: 2; color: var(--ink-2); }
.proof { display: grid; gap: 14px; margin-top: 36px; }
.proof div { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--raised); }
.proof b { display: block; font-size: 30px; letter-spacing: -.04em; font-weight: 600; line-height: 1.1; }
.proof div > span { color: var(--ink-2); font-size: 15px; }
.quote { margin-top: 36px; font-size: clamp(22px, 2.8vw, 32px); line-height: 1.2; letter-spacing: -.03em; font-weight: 500; max-width: 30ch; }

/* Experiencia */
.jobs { border-top: 1px solid var(--ink); }
.job { display: grid; gap: 6px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.job time { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.job h3 { font-size: 23px; letter-spacing: -.025em; line-height: 1.2; }
.job .org { color: var(--ink-2); }
.job ul { margin-top: 10px; display: grid; gap: 6px; }
.job li { padding-left: 16px; position: relative; }
.job li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 1px; background: var(--ink-3); }

/* Formación, stack, idiomas */
.facts-grid { display: grid; gap: 28px; margin-top: 56px; }
.facts-grid h3 { font-family: var(--mono); font-size: 12.5px; font-weight: 400; color: var(--ink-3); margin-bottom: 10px; }
.facts-grid li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts-grid li span { color: var(--ink-2); }
.facts-grid .about { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: start; }
.facts-grid .about img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }

/* Contacto */
.contact { padding: 100px 0 64px; border-top: 1px solid var(--ink); }
.contact p { color: var(--ink-2); max-width: 46ch; }
.mail { display: block; margin: 18px 0 28px; font-size: clamp(30px, 5.6vw, 96px); line-height: 1; letter-spacing: -.05em; font-weight: 600; text-decoration: none; transition: color .2s; }
.mail:hover { color: var(--accent-ink); }
.copied { font-family: var(--mono); font-size: 12.5px; color: var(--ok); min-height: 1.4em; margin-top: 10px; }
footer { border-top: 1px solid var(--line); padding: 22px 0 max(32px, env(safe-area-inset-bottom)); color: var(--ink-3); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* Visor */
dialog { border: 0; padding: 0; background: transparent; margin: auto; max-width: min(1100px, 94vw); max-height: 92vh; color: #fff; }
dialog::backdrop { background: rgba(8, 8, 9, .9); }
dialog img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 10px; }
dialog p { text-align: center; margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: #B9B9BD; }
dialog .close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border-radius: 8px; background: #222; color: #fff; display: grid; place-items: center; }

/* Aparición al hacer scroll */
.js [data-in] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-in].in { opacity: 1; transform: none; }

/* Pantallas más grandes */
@media (min-width: 720px) {
  .hero { padding-top: 56px; padding-bottom: 88px; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: end; }
  section { padding: 120px 0; }
  .sec-head { grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; }
  .case-top { grid-template-columns: 1fr auto; align-items: end; }
  .case-top .side { text-align: right; justify-items: end; display: grid; gap: 12px; }
  .case .meta { justify-content: flex-end; }
  .case-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; }
  .proof { grid-template-columns: repeat(3, 1fr); }
  .job { grid-template-columns: 200px 1fr; gap: 6px 40px; }
  .job time { grid-row: span 4; padding-top: 6px; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 56px; }
  .reg { grid-template-columns: 1fr; padding: 20px 22px; }
  .strip { margin: 44px 0 0; padding-left: 0; padding-right: 0; scroll-padding-left: 0; }
}
@media (min-width: 960px) {
  .top nav { display: flex; }
  .case-body.three { grid-template-columns: 1.1fr 1fr 1fr; }
  .facts-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .steps li { grid-template-columns: 64px 1fr 1.3fr; align-items: baseline; }
  .steps p { grid-column: 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot::after { animation: none; }
}

/* ===================== Movimiento y 3D ===================== */

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

/* Barra de progreso de lectura */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* Nombre: cada letra se levanta en 3D al acercar el puntero y se separa al hacer scroll */
.masthead { perspective: 900px; }
.masthead .ch {
  display: inline-block; transform-style: preserve-3d; will-change: transform;
  transform: translate3d(0, var(--ty, 0px), var(--tz, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease), color .3s;
}
.masthead .ch.hot { color: var(--accent); }

/* Cinta de commits */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--raised); cursor: pointer; }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker-track, .ticker.paused .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; flex: none; }
.ticker-list li { white-space: nowrap; padding: 13px 28px; border-right: 1px solid var(--line); color: var(--ink-2); }
.ticker-list b { color: var(--accent-ink); font-weight: 500; margin-right: 8px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Títulos que suben al aparecer */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 45ms); }
.split.in .w > span { transform: none; }
.js .split[data-in] { opacity: 1; transform: none; }

/* Tiras de capturas: giran en 3D al deslizar y entran en cascada */
.js .strip[data-in] { opacity: 1; transform: none; }
.js .strip[data-in] figure { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .strip[data-in].in figure { opacity: 1; transform: none; }

/* Vídeos de los proyectos */
.strip video { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; }
.strip.phone video { border-radius: 18px; }
.strip .vid figcaption { color: var(--ink-2); }
.strip .vid figcaption::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.strip .vid.paused figcaption::before { background: var(--ink-3); }

/* QR a pantalla completa (fondo blanco siempre, para que se escanee bien) */
.qr-dialog { margin: auto; padding: 28px 28px 24px; border: 0; border-radius: 20px; background: #FFFFFF; color: #0B0B0C; text-align: center; max-width: min(380px, 92vw); }
.qr-dialog::backdrop { background: rgba(8, 8, 9, .82); }
.qr-dialog img { width: min(300px, 76vw); height: auto; margin: 0 auto; image-rendering: pixelated; }
.qr-dialog p { margin: 8px 0 18px; font-size: 15px; }
.qr-dialog .btn { background: #0B0B0C; color: #FAFAF9; border-color: #0B0B0C; }
.ibtn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); }
.ibtn:hover { border-color: var(--ink); }
.ibtn svg { width: 16px; height: 16px; }
.top .ibtn + .theme { margin-left: -12px; }

/* Caso de prácticas: diagrama animado del recorrido de un contacto */
.private { font-size: 12px; color: var(--ink-3); }
.flow { position: relative; margin-top: 44px; padding: 22px; border: 1px solid var(--ink); border-radius: 14px; background: var(--raised); display: grid; gap: 26px; }
.flow-col { position: relative; display: grid; gap: 10px; align-content: center; }
.flow-col:not(.flow-out)::after {
  content: ""; position: absolute; left: 50%; bottom: -22px; width: 2px; height: 18px; transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, var(--accent) 0 5px, transparent 5px 9px); background-size: 2px 18px;
  animation: dash-v .8s linear infinite;
}
@keyframes dash-v { to { background-position: 0 18px; } }
.flow-src, .flow-dest {
  display: grid; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 500;
  transition: border-color .3s, background .3s, transform .3s var(--ease);
}
.flow-dest small { font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.flow-src.on { border-color: var(--accent); transform: translateX(4px); }
.flow-dest.ok.on { border-color: var(--ok); background: var(--ok-bg); transform: scale(1.03); }
.flow-dest.unk.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); transform: scale(1.03); }
.flow-title { font-size: 12.5px; color: var(--ink-3); }
.rules { display: grid; gap: 8px; }
.rules li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; transition: border-color .25s, background .25s, opacity .25s; }
.rules b { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-family: var(--mono); font-size: 12px; font-weight: 500; background: var(--paper); border: 1px solid var(--line); }
.rules li.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.rules li.on b { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.rules li.miss { opacity: .45; }
.flow-lead { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); padding-top: 14px; border-top: 1px solid var(--line); }
.flow-lead::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.flow-note { margin-top: -18px; font-size: 11.5px; color: var(--ink-3); }
@media (min-width: 720px) {
  .flow { grid-template-columns: 1fr 1.35fr 1fr; gap: 20px 44px; padding: 28px; }
  .flow-col:not(.flow-out)::after {
    left: auto; right: -34px; bottom: auto; top: 50%; width: 24px; height: 2px; transform: none;
    background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 9px); background-size: 18px 2px;
    animation: dash-h .8s linear infinite;
  }
  .flow-lead, .flow-note { grid-column: 1 / -1; }
  .flow-note { position: absolute; bottom: 28px; right: 28px; margin: 0; }
}
@keyframes dash-h { to { background-position: 18px 0; } }
@media (prefers-reduced-motion: reduce) { .flow-col::after { animation: none !important; } }

/* Laboratorio VeriFactu: carril que une los registros */
.reg { padding-left: 46px; }
.reg::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px; background: var(--ok); opacity: .45; transition: background .3s; }
.reg:first-child::before { top: 26px; }
.reg:last-child::before { bottom: calc(100% - 26px); }
.reg::after { content: ""; position: absolute; left: 16px; top: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--raised); border: 2px solid var(--ok); transition: border-color .3s, background .3s; }
.reg.bad::before { background: var(--bad); opacity: .8; }
.reg.bad::after { border-color: var(--bad); background: var(--bad); }
.reg.shake { animation: shake .45s var(--ease); }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-.4deg); } 40% { transform: translateX(5px) rotate(.3deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

@media (min-width: 720px) {
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation-duration: 180s; }
}

/* Decisiones técnicas plegables (abiertas en escritorio, cerradas en móvil) */
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; font-family: var(--mono); font-size: 16px; color: var(--ink-2); transition: transform .3s var(--ease); }
details.more[open] > summary::after { transform: rotate(45deg); }

/* Móvil: página más corta y compacta */
@media (max-width: 719px) {
  .case-body .commits { display: none; }
  .case { padding: 32px 0 48px; }
  .case-body { margin-top: 32px; gap: 28px; }
  details.more:not([open]) > summary { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; margin: 0; }
  .flow { padding: 16px; gap: 22px; }
  .flow-in, .flow-out { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .flow-src, .flow-dest { font-size: 14px; padding: 10px 12px; }
  .flow-dest small { font-size: 11.5px; }
  .rules li { padding: 9px 10px; font-size: 14px; }
  .steps li { padding: 18px 0; }
  .proof { margin-top: 28px; }
  .quote { margin-top: 28px; }
  .facts-grid { margin-top: 40px; }
  .contact { padding: 72px 0 48px; }
}
