/* FamilyPin — sitio web. Sin dependencias externas. */
@font-face { font-family: "Baloo 2"; src: url("../fonts/baloo2-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #eef4fa;
  --paper-2: #e3ecf6;
  --surface: #ffffff;
  --text: #1e2b4d;
  --soft: #4a5675;
  --outline: #2a3858;
  --shadow: #2a3858;
  --line: #ccd7e4;
  --tint: #dcebfb;
  --mustard: #ffc93c;
  --mustard-hi: #ffe08a;
  --sky: #5aa9f2;
  --mint: #37c99b;
  --chili: #f2545b;
  --lilac: #a58bf2;
  --orange: #ff9a4d;
  --link: #1f63b5;
  --on-accent: #1e2b4d;
  /* mapa */
  --land: #e3ecf3;
  --block: #d6e0ea;
  --road: #ffffff;
  --road-edge: #cfdae6;
  --avenue: #fff6da;
  --park: #cdebd8;
  --water: #aed6f5;
  --map-base: .025;
  --map-hero: .01;
  --radius: 22px;
  --wrap: 1180px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1729;
    --paper-2: #131d33;
    --surface: #1a2540;
    --text: #eaf1fa;
    --soft: #b0bdd3;
    --outline: #44557d;
    --shadow: #050a16;
    --line: #2c3a58;
    --tint: #1d2f50;
    --link: #8cc4fa;
    --land: #1c2842;
    --block: #22304e;
    --road: #33446a;
    --road-edge: #2a3a5c;
    --avenue: #4a4630;
    --park: #1f3d3b;
    --water: #1b3c60;
    --map-base: .035;
    --map-hero: .015;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.6 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  position: relative;
}
/* Fondo de mapa: una capa suave en toda la página y otra, más visible, tras la cabecera. Las dos parten
   del mismo punto, así que el dibujo coincide. El mosaico sale de tools/site/mkmap.cjs. */
body::before, body::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: -1; pointer-events: none;
  background: url("../img/map-tile.svg") 50% 0 / 800px 800px;
}
body::before { bottom: 0; opacity: var(--map-base); }
body::after {
  height: min(1100px, 100%); opacity: var(--map-hero);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
@media (prefers-color-scheme: dark) { body::before, body::after { background-image: url("../img/map-tile-dark.svg"); } }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, .display { font-family: "Baloo 2", "Atkinson Hyperlegible", system-ui, sans-serif; font-weight: 800; line-height: 1.08; letter-spacing: -.01em; margin: 0; }
h2 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h3 { font-size: 1.35rem; line-height: 1.2; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--mustard); color: var(--on-accent); padding: 8px 14px; border-radius: 12px; border: 2px solid var(--outline); font-weight: 700; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- cabecera ---------- */
:root { --header-h: 68px; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1.5px solid transparent;
  transition: border-color .2s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .site-header { background: var(--paper); } }
/* Sin JS no sabemos si hay scroll: el borde se queda siempre. */
html:not(.js) .site-header, .site-header.scrolled, .site-header.nav-open { border-bottom-color: var(--line); }
.site-header .wrap { position: relative; display: flex; align-items: center; gap: 8px; height: var(--header-h); }
.brand { display: inline-flex; flex: none; border-radius: 10px; }
.site-header .brand { margin-right: auto; }
.site-header .brand img { height: 44px; width: auto; }
@media (max-width: 399px) { .site-header .brand img { height: 36px; } }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }

/* Enlaces de sección: en línea desde 1024 px; por debajo, dentro del botón «Menú» (necesita JS). */
.nav { display: none; gap: 2px; }
.nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.5; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--tint); }
.menu-toggle {
  display: none; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 14px 0 12px; margin: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1; color: var(--text); background: var(--surface);
  border: 2px solid var(--outline); border-radius: 999px; box-shadow: 2px 2px 0 var(--shadow);
  transition: transform .12s, box-shadow .12s; -webkit-tap-highlight-color: transparent;
}
.menu-toggle svg { flex: none; display: block; }
.menu-toggle:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.menu-toggle[aria-expanded="true"] { background: var(--tint); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }
.menu-toggle:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 999px; }
@media (max-width: 1023px) {
  .js .menu-toggle { display: inline-flex; }
  .site-header.nav-open .nav {
    display: flex; flex-direction: column; position: absolute; top: calc(100% + 8px); left: 16px; right: 16px;
    padding: 8px; background: var(--surface); border: 2px solid var(--outline); border-radius: 18px; box-shadow: 4px 4px 0 var(--shadow);
  }
  .site-header.nav-open .nav a { padding: 11px 14px; font-size: 1.06rem; border-radius: 12px; }
}
@media (min-width: 720px) and (max-width: 1023px) { .site-header.nav-open .nav { left: auto; right: 32px; width: 320px; } }
@media (max-width: 399px) { .menu-toggle { width: 40px; padding: 0; justify-content: center; } .menu-toggle .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (min-width: 1024px) {
  .nav { display: flex; margin-right: 8px; }
}
@media (min-width: 1024px) and (max-width: 1179px) { .nav { gap: 0; } .nav a { padding: 8px 10px; } }

.lang-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 14px; font-weight: 700; }
.lang-row a { text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.lang-row a:hover { text-decoration: underline; }
.lang-row a[aria-current="page"] { color: var(--text); background: var(--tint); }
.lang-row span { color: var(--soft); }

/* ---------- botones e insignias ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  color: var(--on-accent); background: var(--mustard);
  border: 2.5px solid var(--outline); border-radius: 16px; padding: 13px 22px;
  box-shadow: 4px 4px 0 var(--shadow); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.btn.ghost { background: var(--surface); color: var(--text); }
.play {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%; text-decoration: none;
  background: #1e2b4d; color: #fff; border: 2.5px solid var(--outline); border-radius: 16px;
  padding: 9px 18px 9px 14px; box-shadow: 4px 4px 0 var(--shadow); text-align: left; line-height: 1.15;
  transition: transform .12s, box-shadow .12s;
}
.play:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.play:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
@media (prefers-color-scheme: dark) { .play { background: #eaf1fa; color: #1e2b4d; border-color: #eaf1fa; } }
.play:focus-visible, .btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 16px; }
.play svg { flex: none; }
.play small { display: block; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; font-weight: 700; }
.play strong { display: block; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.3rem; line-height: 1.05; }
.beta-note { font-size: .95rem; color: var(--soft); max-width: 36em; margin: -12px 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .95rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 13px 5px 9px; }
.chips li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--mint)); border: 1.5px solid var(--outline); }

/* ---------- héroe ---------- */
.hero { position: relative; padding: 28px 0 64px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 56px 0 96px; } .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem; background: var(--tint); color: var(--text); border: 1.5px solid var(--outline); border-radius: 999px; padding: 4px 14px 4px 6px; margin-bottom: 18px; }
.eyebrow b { background: var(--mustard); color: var(--on-accent); border: 1.5px solid var(--outline); border-radius: 999px; padding: 0 9px; font-size: .82rem; letter-spacing: .03em; }
.hero h1 { font-size: clamp(2.55rem, 1.5rem + 5vw, 4.6rem); line-height: 1; margin-bottom: 20px; }
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after { content: ""; position: absolute; left: -4px; right: -6px; bottom: .08em; height: .36em; background: var(--mustard); border-radius: 6px; z-index: -1; transform: rotate(-1.2deg); }
@media (prefers-color-scheme: dark) { .hl { color: var(--mustard); } .hl::after { height: .09em; bottom: .02em; opacity: .9; } }
.lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); color: var(--soft); max-width: 36em; }
.hero .lead { margin-bottom: 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 28px; }

/* ---------- demo del mapa ---------- */
.demo { position: relative; display: grid; justify-items: center; gap: 18px; }
.demo .blob { position: absolute; z-index: -1; width: min(520px, 108%); aspect-ratio: 1; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -48%); background: radial-gradient(circle, color-mix(in srgb, var(--sky) 30%, transparent) 0 55%, transparent 70%); }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 2px solid var(--outline); border-radius: 999px; box-shadow: 3px 3px 0 var(--shadow); max-width: 100%; }
.seg button { font: 700 .95rem/1.2 inherit; font-family: inherit; color: var(--text); background: transparent; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--mustard); color: var(--on-accent); box-shadow: inset 0 0 0 1.5px var(--outline); }
.seg button[data-view="server"][aria-pressed="true"] { background: #1e2b4d; color: #fff; }
@media (max-width: 380px) { .seg button { padding: 8px 10px; font-size: .88rem; } }
.demo-note { min-height: 3.2em; max-width: 340px; text-align: center; font-size: .95rem; color: var(--soft); margin: 0; }

.phone {
  width: min(320px, 100%); aspect-ratio: 9 / 18.4; position: relative;
  background: var(--outline); border-radius: 44px; padding: 10px;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--shadow) 30%, transparent);
}
@media (prefers-color-scheme: dark) { .phone { background: #050a16; box-shadow: 10px 10px 0 rgba(0, 0, 0, .45); outline: 2px solid var(--outline); } }
.screen { position: relative; height: 100%; border-radius: 35px; overflow: hidden; background: var(--paper); display: flex; flex-direction: column; isolation: isolate; }
.status { height: 26px; flex: none; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-size: .74rem; font-weight: 700; position: absolute; inset: 0 0 auto 0; z-index: 3; }
.map { position: relative; flex: 1 1 auto; min-height: 0; background: var(--land); }
.map > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.m-land { fill: var(--land); } .m-block { fill: var(--block); } .m-park { fill: var(--park); } .m-water { fill: var(--water); }
.m-road { stroke: var(--road); fill: none; stroke-linecap: round; } .m-edge { stroke: var(--road-edge); fill: none; stroke-linecap: round; }
.m-ave { stroke: var(--avenue); fill: none; }
.m-fence { fill: color-mix(in srgb, var(--sky) 16%, transparent); stroke: var(--sky); stroke-width: 1.6; stroke-dasharray: 4 3; }
.m-place { font: 700 10.5px "Atkinson Hyperlegible", sans-serif; fill: var(--text); }
.m-tag rect { fill: var(--surface); stroke: var(--outline); stroke-width: 1.3; }
.pin circle.b { stroke: #2a3858; stroke-width: 2.2; }
.pin circle.s { fill: #2a3858; }
.pin text { font: 800 14px "Baloo 2", sans-serif; fill: #1e2b4d; text-anchor: middle; dominant-baseline: central; }
.pin .halo { fill: none; stroke-width: 2; opacity: 0; }
.pin.ping .halo { animation: ping 1.4s ease-out; }
@keyframes ping { from { opacity: .9; r: 13; } to { opacity: 0; r: 30; } }

.toast {
  position: absolute; left: 12px; right: 12px; top: 32px; z-index: 4;
  display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1.5px solid var(--outline); border-radius: 16px; box-shadow: 3px 3px 0 var(--shadow);
  padding: 8px 12px; font-size: .82rem; line-height: 1.25;
  transform: translateY(-130%); opacity: 0; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .25s;
}
.toast.show { transform: none; opacity: 1; }
.toast b { display: block; font-size: .72rem; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.toast .bell { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--mustard); border: 1.5px solid #2a3858; }

.sheet { flex: none; background: var(--surface); border-top: 1.5px solid var(--outline); border-radius: 22px 22px 0 0; margin-top: -18px; position: relative; z-index: 2; padding: 6px 14px 12px; }
.sheet::before { content: ""; display: block; width: 34px; height: 4px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; }
.sheet h3 { font-size: 1.02rem; margin: 0 0 2px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet h3 .k { font: 700 .66rem/1 "Atkinson Hyperlegible", sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1.5px solid var(--line); min-height: 46px; }
.av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c); border: 1.5px solid #2a3858; font: 800 .95rem/1 "Baloo 2", sans-serif; color: #1e2b4d; transition: background .3s; }
.who { flex: 1; min-width: 0; line-height: 1.2; }
.who strong { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; font-size: .74rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bat { flex: none; font-size: .72rem; font-weight: 700; border: 1.5px solid var(--outline); border-radius: 999px; padding: 1px 7px; display: inline-flex; align-items: center; gap: 4px; }
.bat i { display: inline-block; width: 14px; height: 8px; border: 1.3px solid currentColor; border-radius: 2px; position: relative; }
.bat i::after { content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: calc(var(--p) * 10px); background: var(--mint); border-radius: 1px; }
.bat.low { background: color-mix(in srgb, var(--chili) 18%, transparent); }
.bat.low i::after { background: var(--chili); }

/* vista del servidor */
.cipher-layer { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; transition: opacity .4s; background: #121b30; color: #6f86b4; overflow: hidden; }
.cipher-layer pre { margin: 0; padding: 30px 10px 30px; font: 11px/1.45 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; opacity: .8; }
.cipher-layer .lock { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 8px; text-align: center; color: #eaf1fa; font-weight: 700; font-size: .88rem; width: 80%; background: rgba(18, 27, 48, .88); border: 1.5px solid #44557d; border-radius: 16px; padding: 12px 10px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; letter-spacing: -.02em; }
.demo[data-view="server"] .cipher-layer { opacity: 1; }
.demo[data-view="server"] .status { color: #eaf1fa; }
.status { transition: color .4s; }
.demo[data-view="server"] .toast { opacity: 0 !important; }
.demo[data-view="server"] .av { background: var(--line); color: var(--soft); }
.role { display: none; flex: none; font-size: .68rem; font-weight: 700; border: 1.5px solid var(--outline); border-radius: 999px; padding: 1px 7px; }
.demo[data-view="server"] .role { display: inline-block; }
.demo[data-view="server"] .bat { display: none; }

/* ---------- secciones ---------- */
section { padding: 72px 0; }
@media (min-width: 960px) { section { padding: 104px 0; } }
.sec-head { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.sec-head .lead { margin: 14px auto 0; }
.kicker { display: inline-block; font-weight: 700; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text); background: var(--surface); border: 1.5px solid var(--outline); border-radius: 999px; padding: 3px 14px; margin-bottom: 14px; box-shadow: 2px 2px 0 var(--shadow); }
.alt { background: color-mix(in srgb, var(--paper-2) 72%, transparent); border-block: 1.5px solid var(--line); }

.card { background: var(--surface); border: 2px solid var(--outline); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--shadow); }
@media (prefers-color-scheme: dark) { .card { border-color: var(--outline); } }

/* pasos */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: s; }
@media (min-width: 840px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.step { position: relative; padding: 26px 24px 24px; }
.step .num { position: absolute; top: -18px; left: 22px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--mustard); color: var(--on-accent); border: 2px solid #2a3858; font: 800 1.3rem/1 "Baloo 2", sans-serif; box-shadow: 2px 2px 0 var(--shadow); }
.step .art { height: 150px; display: grid; place-items: center; margin: 8px 0 14px; border-radius: 16px; background: var(--tint); border: 1.5px solid var(--line); overflow: hidden; }
.step .art svg { width: auto; height: 124px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--soft); margin: 0; }

/* funciones */
.features { display: grid; gap: 22px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 24px; transition: transform .18s, box-shadow .18s; }
.feature:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--shadow); }
.ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--c); border: 2px solid #2a3858; box-shadow: 3px 3px 0 #2a3858; margin-bottom: 16px; }
@media (prefers-color-scheme: dark) { .ico { box-shadow: 3px 3px 0 var(--shadow); } }
.ico svg { width: 28px; height: 28px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--soft); margin: 0; }

/* privacidad */
.flow { padding: 28px 18px; margin-bottom: 36px; }
.flow-track { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; position: relative; }
@media (min-width: 840px) { .flow-track { grid-template-columns: 1fr 1.1fr 1fr; gap: 24px; } .flow { padding: 36px 32px; } }
.node { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 10px; }
.node .disc { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--c); border: 2px solid #2a3858; box-shadow: 4px 4px 0 var(--shadow); }
.node .disc svg { width: 44px; height: 44px; }
.node h3 { font-size: 1.2rem; }
.node p { margin: 0; color: var(--soft); font-size: .95rem; max-width: 22em; }
.packet { justify-self: center; font-size: .82rem; font-weight: 700; padding: 6px 12px; border-radius: 12px; border: 1.5px solid var(--outline); background: var(--surface); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.packet.enc { background: #1e2b4d; color: #9fb6e4; border-color: #1e2b4d; }
@media (prefers-color-scheme: dark) { .packet.enc { background: #050a16; border-color: var(--outline); } }
.wire { display: flex; justify-content: center; position: relative; padding: 6px 0; }
.wire::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2.5px dashed var(--outline); opacity: .45; z-index: 0; }
.wire .packet { position: relative; z-index: 1; }
@media (min-width: 840px) {
  .flow-track { grid-template-columns: 1fr 1.25fr 1fr; }
  .wire { display: none; }
  .node { position: relative; z-index: 1; }
  .lane { position: absolute; left: 0; right: 0; top: 52px; height: 0; z-index: 0; }
  .lane::before { content: ""; position: absolute; left: 16%; right: 16%; top: 0; border-top: 2.5px dashed var(--outline); opacity: .45; }
  .lane .packet { position: absolute; top: 0; transform: translate(-50%, -50%); left: 30%; }
  .lane .lp.plain { left: 26%; opacity: 0; }
}
@media (max-width: 839px) { .lane { display: none; } }

.compare { display: grid; gap: 22px; margin-bottom: 36px; }
@media (min-width: 840px) { .compare { grid-template-columns: 1fr 1fr; } }
.col { padding: 24px; }
.col h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.col h3 .ico { margin: 0; width: 44px; height: 44px; border-radius: 14px; }
.col h3 .ico svg { width: 24px; height: 24px; }
.col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.col li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.col li svg { width: 22px; height: 22px; margin-top: 2px; }
.col.server { background: #1e2b4d; color: #eaf1fa; }
.col.server li { color: #c9d5ea; }
@media (prefers-color-scheme: dark) { .col.server { background: #070d1c; } }
.col .foot { margin: 16px 0 0; padding-top: 14px; border-top: 1.5px dashed currentColor; font-size: .95rem; opacity: .9; }
.col code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: rgba(255, 255, 255, .1); padding: 1px 5px; border-radius: 5px; }

.promises { display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
@media (min-width: 640px) { .promises { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .promises { grid-template-columns: repeat(4, 1fr); } }
.promises li { padding: 20px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); }
.promises strong { display: block; font-family: "Baloo 2", sans-serif; font-size: 1.2rem; line-height: 1.15; margin-bottom: 4px; }
.promises span { color: var(--soft); font-size: .97rem; }
.promises .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #2a3858; background: var(--c); margin-bottom: 10px; }

/* capturas */
.gallery { position: relative; }
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(250px, 72vw); gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
  padding: 10px 16px 26px; margin: 0 -16px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .track { grid-auto-columns: 250px; margin: 0 -32px; padding-inline: 32px; scroll-padding-inline: 32px; } }
@media (min-width: 1180px) { .track { justify-content: center; } }
.shot { margin: 0; scroll-snap-align: start; }
.shot .frame { background: var(--outline); padding: 8px; border-radius: 36px; box-shadow: 7px 7px 0 color-mix(in srgb, var(--shadow) 30%, transparent); transition: transform .25s; }
@media (prefers-color-scheme: dark) { .shot .frame { background: #050a16; outline: 2px solid var(--outline); box-shadow: 7px 7px 0 rgba(0, 0, 0, .45); } }
.shot:hover .frame { transform: translateY(-6px) rotate(-.6deg); }
.shot img { border-radius: 29px; width: 100%; aspect-ratio: 1 / 2; object-fit: cover; background: var(--land); }
.shot figcaption { margin-top: 16px; text-align: center; }
.shot figcaption strong { display: block; font-family: "Baloo 2", sans-serif; font-size: 1.2rem; line-height: 1.15; }
.shot figcaption span { color: var(--soft); font-size: .95rem; }
.g-ctrl { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 8px; }
.g-ctrl[hidden] { display: none; }
.g-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); border: 2px solid var(--outline); box-shadow: 3px 3px 0 var(--shadow); cursor: pointer; }
.g-btn:disabled { opacity: .4; cursor: default; }
.g-btn:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.dots { display: flex; gap: 8px; }
.dots button { width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid var(--outline); background: transparent; padding: 0; cursor: pointer; transition: width .25s, background .25s; }
.dots button[aria-current="true"] { width: 30px; background: var(--mustard); }

/* faq */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
.faq details { background: var(--surface); border: 2px solid var(--outline); border-radius: 18px; box-shadow: 4px 4px 0 var(--shadow); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 700; font-size: 1.08rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline-offset: -4px; border-radius: 16px; }
.faq summary .pm { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--outline); display: grid; place-items: center; background: var(--tint); transition: transform .25s, background .25s; }
.faq details[open] summary .pm { transform: rotate(45deg); background: var(--mustard); }
.faq .answer { padding: 0 20px 18px; color: var(--soft); overflow: hidden; }
.faq .answer p:last-child { margin: 0; }

/* llamada final */
.final { text-align: center; }
.final .card { padding: 44px 22px; display: grid; justify-items: center; gap: 18px; background: var(--sky); color: #1e2b4d; position: relative; overflow: hidden; }
.final .card::before { content: ""; position: absolute; inset: 0; background: url("../img/map-bg.svg") center / 1100px auto no-repeat; opacity: .55; }
.final .card > * { position: relative; }
.final h2 { max-width: 16ch; }
.final p { max-width: 34em; margin: 0; font-size: 1.1rem; }
.final img.sym { width: 120px; height: 120px; }
.final a { color: #1e2b4d; font-weight: 700; }
.final .play { background: #1e2b4d; color: #fff; border-color: #2a3858; box-shadow: 4px 4px 0 #2a3858; }
.final .play:hover { box-shadow: 6px 6px 0 #2a3858; }
.final .play:active { box-shadow: 2px 2px 0 #2a3858; }
/* El anillo celeste no se ve sobre la tarjeta celeste. */
.final :focus-visible, .final .play:focus-visible { outline-color: #1e2b4d; }
.final p.beta-note { margin: -4px 0 0; font-size: .95rem; color: #1e2b4d; }

/* pie */
.site-footer { padding: 48px 0 40px; border-top: 1.5px solid var(--line); font-size: .97rem; }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 840px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-size: 1.1rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .brand img { height: 34px; }
.site-footer p { color: var(--soft); }
.fine { margin-top: 32px; padding-top: 20px; border-top: 1.5px solid var(--line); color: var(--soft); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.email { word-break: break-all; }

/* aparición al hacer scroll */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* animación del paquete: sale en claro del móvil, viaja cifrado y se descifra al llegar */
@media (min-width: 840px) and (prefers-reduced-motion: no-preference) {
  .lane .lp { animation: travel 8s cubic-bezier(.45, 0, .55, 1) infinite, show-plain 8s linear infinite; }
  .lane .lp.enc { animation-name: travel, show-enc; }
}
@keyframes travel { 0%, 10% { left: 27%; } 42%, 58% { left: 50%; } 90%, 100% { left: 73%; } }
@keyframes show-plain { 0%, 8% { opacity: 1; } 13%, 87% { opacity: 0; } 92%, 100% { opacity: 1; } }
@keyframes show-enc { 0%, 8% { opacity: 0; } 13%, 87% { opacity: 1; } 92%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Clases que sustituyen a los style="" en línea ----------
   La web se sirve con una CSP sin 'unsafe-inline' (firebase.json), así que el HTML no lleva atributos style.
   build-site.cjs comprueba que cada clase c-*, d-* y p-* que usa existe aquí. */
.c-mint { --c: var(--mint); } .c-sky { --c: var(--sky); } .c-mustard { --c: var(--mustard); } .c-lilac { --c: var(--lilac); }
.c-chili { --c: var(--chili); } .c-orange { --c: var(--orange); } .c-navy { --c: #1e2b4d; }
.d-05 { --d: .05s; } .d-07 { --d: .07s; } .d-08 { --d: .08s; } .d-10 { --d: .1s; } .d-14 { --d: .14s; } .d-15 { --d: .15s; }
.d-16 { --d: .16s; } .d-17 { --d: .17s; } .d-20 { --d: .2s; } .d-21 { --d: .21s; }
.p-15 { --p: .15; } .p-47 { --p: .47; } .p-64 { --p: .64; } .p-82 { --p: .82; }
.cipher-layer .lock .lock-sub { font-weight: 400; font-size: .78rem; opacity: .85; }
.col .foot .foot-x { vertical-align: -3px; margin-right: 6px; }
p.priv-more { text-align: center; margin: 28px 0 0; }
.site-footer p.tagline { margin-top: 12px; }

/* ---------- Selector de idioma ----------
   <details class="lang-picker"> con enlaces reales: funciona sin JS, los enlaces llevan hreflang
   y site.js añade Escape, clic fuera y flechas. El mismo bloque está en site.css y en style.css. */
.lang-picker { position: relative; flex: none; }
.lang-picker > summary { display: block; list-style: none; cursor: pointer; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
.lang-picker > summary::-webkit-details-marker { display: none; }
.lang-picker > summary::marker { content: ""; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 11px; white-space: nowrap; user-select: none;
  font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1; color: var(--text);
  background: var(--surface); border: 2px solid var(--outline); border-radius: 999px; box-shadow: 2px 2px 0 var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.lang-btn svg { flex: none; display: block; }
.lang-btn .chev { margin-left: 2px; transition: transform .15s; }
.lang-picker > summary:hover .lang-btn { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.lang-picker[open] .lang-btn { background: var(--tint); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }
.lang-picker[open] .chev { transform: rotate(180deg); }
.lang-picker > summary:focus-visible { outline: none; }
.lang-picker > summary:focus-visible .lang-btn { outline: 3px solid var(--sky); outline-offset: 2px; }
.lang-code { display: none; }
@media (max-width: 479px) {
  .lang-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lang-code { display: inline; letter-spacing: .03em; }
}
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 2px solid var(--outline); border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow);
}
.lang-list li { margin: 0; }
.lang-list a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.2;
}
.lang-list a:hover { background: var(--tint); }
.lang-list a:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px; border-radius: 10px; }
.lang-list a[aria-current="page"] { background: var(--mustard); color: #1e2b4d; }
.lang-badge { display: inline-grid; place-items: center; flex: none; width: 30px; height: 22px; border-radius: 6px; border: 1.5px solid currentColor; font-size: .75rem; letter-spacing: .03em; }
.lang-list .check { margin-left: auto; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .lang-picker[open] .lang-list { animation: lang-pop .14s ease-out; }
  @keyframes lang-pop { from { opacity: 0; transform: translateY(-4px); } }
}
