/* ============================================================
   bryancc.dev — Bryan Choque Canaza
   Una persona, tres facetas. Tres fotos sobre la mesa:
   la de arriba es la faceta que estás viendo.
   Papel tibio · tinta azul noche · un color por faceta ·
   esquinas suaves · las cosas se mueven como objetos.
   ============================================================ */

/* Tipografía alojada en el propio sitio: Asap, de Omnibus-Type (Argentina),
   licencia OFL (assets/fonts/OFL.txt). Un solo archivo variable (peso y ancho). */
@font-face {
  font-family: "Asap";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("../assets/fonts/asap-latin.woff2") format("woff2");
}

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

:root {
  /* los tres colores de faceta */
  --c-e: #F4B400;
  --c-d: #6CC04A;
  --c-p: #E5533D;

  --paper: #F6F4EF;
  --panel: #ECE8DF;
  --card: #FFFDF8;
  --line: #DCD7CC;
  --ink: #151A26;
  --ink-2: #454B59;
  --ink-3: #5C6270;

  /* color de la faceta en uso (por defecto, Emprendedor) */
  --acc: var(--c-e);
  --mark: #FFDD66;
  --acc-ink: #7A5A00;

  --f: "Asap", "Helvetica Neue", Arial, sans-serif;
  --r-s: 13px;
  --r-m: 16px;
  --r-l: 28px;
  --bar: 68px;
  --wrap: 1160px;
  --gutter: clamp(20px, 5vw, 56px);
  /* una sola línea de columna para toda la página: portada, secciones y cierre */
  --cols: minmax(0, 1.2fr) minmax(0, .8fr);
  --col-gap: clamp(32px, 6vw, 92px);

  --out: cubic-bezier(.22, 1, .36, 1);
  /* asentamiento: llega, se pasa apenas y vuelve */
  --settle: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
}

body[data-mode="dev"] {
  --paper: #F3F5EF; --panel: #E6EADE; --line: #D5DACB;
  --acc: var(--c-d); --mark: #C3EBA3; --acc-ink: #2E7318;
}
body[data-mode="persona"] {
  --paper: #F7F3EF; --panel: #EEE6DE; --line: #E0D5CA;
  --acc: var(--c-p); --mark: #FFC4B4; --acc-ink: #B03925;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 18px);
  background: #F6F4EF;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--mark); color: var(--ink); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip {
  position: fixed; left: 16px; top: 12px; z-index: 100; padding: 12px 16px; border-radius: var(--r-s);
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; transform: translateY(-220%);
}
.skip:focus { transform: none; }
.noscript { max-width: 640px; margin: 15vh auto; padding: 0 24px; }
.noscript h1 { font-size: 2.25rem; line-height: 1.05; margin: 0 0 12px; }

.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--out); }

/* ---------- cabecera ---------- */
.bar {
  position: sticky; top: 0; z-index: 40; height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding-inline: var(--gutter);
  background: var(--paper);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow .3s ease;
}
html.scrolled .bar { box-shadow: 0 1px 0 var(--line); }
.brand { justify-self: start; font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand span { color: var(--acc-ink); }
.bar-right { justify-self: end; display: flex; align-items: center; gap: 12px; }

/* selector de pastilla: el botón elegido lleva una ficha clara que se desliza */
.seg { position: relative; display: inline-flex; padding: 4px; background: var(--panel); border-radius: 999px; }
.seg button {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-weight: 600; font-size: .9375rem; line-height: 1.15; color: var(--ink-2); white-space: nowrap;
  transition: color .2s ease;
}
.seg button:hover, .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { color: var(--ink); }
.seg-thumb {
  position: absolute; inset: 0; border-radius: 999px; background: var(--card);
  box-shadow: 0 1px 2px rgba(21, 26, 38, .16), 0 0 0 1px rgba(21, 26, 38, .04);
}
.seg-l { position: relative; display: inline-flex; align-items: center; gap: 8px; transition: transform .18s var(--out); }
.seg button:active .seg-l { transform: scale(.96); }
.seg-dot { width: 8px; height: 8px; border-radius: 50%; }
.seg-dot[data-m="emprendedor"] { background: var(--c-e); }
.seg-dot[data-m="dev"] { background: var(--c-d); }
.seg-dot[data-m="persona"] { background: var(--c-p); }
.seg-n { font-weight: 500; font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.lang { display: inline-flex; gap: 2px; }
.lang button {
  padding: 8px 9px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-weight: 600; font-size: .875rem; line-height: 1; color: var(--ink-3);
  transition: color .2s ease, background-color .2s ease;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); background: var(--panel); }

/* ---------- botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 1rem; line-height: 1.15; text-decoration: none;
  transition: transform .18s var(--out), background-color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #262E42; }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn-sm { padding: 11px 18px; font-size: .9375rem; }
.btn:hover .ico { transform: translate(2px, -2px); }
.link-go {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 1px;
  font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
}
.link-go:hover .ico { transform: translateY(3px); }

/* ---------- palabras y resaltador ---------- */
.w { position: relative; display: inline-block; isolation: isolate; }
.w.m::before {
  content: ""; position: absolute; z-index: -1;
  left: -.07em; right: -.3em; top: 54%; bottom: 3%;
  background: var(--mark); border-radius: .14em .3em .2em .34em;
  transform: rotate(-.7deg); transform-origin: 0 50%;
}
.w.m.m1::before { right: -.07em; }

/* ---------- portada ---------- */
.hero { padding-block: clamp(22px, 3.6vw, 52px) clamp(48px, 6vw, 84px); }
.hero-grid {
  display: grid;
  grid-template-columns: var(--cols);
  grid-template-areas: "st fig" "rest fig";
  column-gap: var(--col-gap);
  align-items: center;
}
.statement {
  grid-area: st; align-self: end; margin: 0;
  font-weight: 700; font-stretch: 92%;
  font-size: clamp(2.6rem, 1.15rem + 4.9vw, 5rem); line-height: 1; letter-spacing: -.03em;
  text-wrap: balance;
}
.hero-rest { grid-area: rest; align-self: start; }
.statement-note {
  margin: clamp(18px, 2vw, 26px) 0 0;
  font-weight: 600; font-size: clamp(1.125rem, .95rem + .7vw, 1.4rem); line-height: 1.3;
  color: var(--acc-ink); text-wrap: balance;
}
.hero-value { margin: 16px 0 0; max-width: 52ch; font-size: 1.125rem; color: var(--ink-2); text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: clamp(24px, 3vw, 36px); }

/* las tres fotos: la de arriba se arrastra y las de atrás se tocan */
.stack { grid-area: fig; justify-self: center; margin: 0; width: min(100%, 440px); }
/* --px y --py: dónde está el cursor respecto de la pila (de -1 a 1). --sc: cuánto de la pila
   ya pasó hacia arriba con el scroll (de 0 a 1). Los pone js/app.js; sin él valen 0. */
.stack-deck { position: relative; aspect-ratio: 4 / 5; margin: 4% 8% 9%; --px: 0; --py: 0; --sc: 0; }
.card {
  --tx: 0%; --ty: 0%; --r: 0deg; --s: 1;
  position: absolute; inset: 0; padding: 0; border: 0; border-radius: var(--r-l); overflow: hidden;
  background: var(--panel); cursor: pointer;
  transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(var(--s));
  transition: transform .5s var(--out), box-shadow .3s ease;
  box-shadow: 0 1px 2px rgba(21, 26, 38, .1), 0 18px 36px -20px rgba(21, 26, 38, .4);
  -webkit-user-select: none; user-select: none; touch-action: pan-y;
}
.card:focus-visible { border-radius: var(--r-l); }
.card img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); pointer-events: none; -webkit-user-drag: none; transition: filter .3s ease; }
/* la de arriba se arrima al cursor y gira apenas cuando la página se va con el scroll */
.card[data-slot="front"] {
  z-index: 3; cursor: grab;
  transform:
    translate(calc(var(--px) * 8px), calc(var(--py) * 5px))
    rotate(calc(var(--px) * 1.5deg - var(--sc) * 1.6deg))
    scale(var(--s));
}
/* al tocarla se levanta de la mesa */
.card[data-slot="front"].is-press {
  --s: 1.025;
  box-shadow: 0 2px 4px rgba(21, 26, 38, .1), 0 26px 44px -20px rgba(21, 26, 38, .46);
  transition: transform .22s var(--out), box-shadow .22s ease;
}
/* las de atrás: --open las abre en abanico, la del lado al que te acercas y las dos con el scroll */
.card[data-slot="mid"] { z-index: 2; --tx: 15%; --ty: 2.5%; --r: 7.5deg; --s: .95; --dir: 1; --open: calc(max(0, var(--px)) * .9 + var(--sc)); }
.card[data-slot="back"] { z-index: 1; --tx: -15%; --ty: 4.5%; --r: -8.5deg; --s: .92; --dir: -1; --open: calc(max(0, var(--px) * -1) * .9 + var(--sc)); }
/* la foto que va a pasar al frente se acomoda a medida que la de arriba se aleja (--peek va de 0 a 1) */
.card:not([data-slot="front"]) {
  --k: calc(1 - var(--peek, 0));
  transform:
    translate(calc((var(--tx) + var(--open) * var(--dir) * 5.5%) * var(--k)), calc(var(--ty) * var(--k)))
    rotate(calc((var(--r) + var(--open) * var(--dir) * 4deg) * var(--k)))
    scale(calc(var(--s) + (1 - var(--s)) * var(--peek, 0)));
}
.card:not([data-slot="front"]) img { filter: saturate(.78); }
@media (hover: hover) {
  .card:not([data-slot="front"]):hover img { filter: none; }
}
.card.is-drag { transition: none; cursor: grabbing; box-shadow: 0 2px 4px rgba(21, 26, 38, .1), 0 30px 50px -22px rgba(21, 26, 38, .5); }
.card.is-back { transition: transform .6s var(--settle); }
.stack-deck.is-dragging .card:not([data-slot="front"]) { transition: none; }
html.dragging, html.dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }

.stack-cap { text-align: center; }
.stack-name { display: block; font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; }
.stack-roles { display: block; margin-top: 2px; font-size: .9375rem; color: var(--ink-2); text-wrap: balance; }
/* cada rol va entero y el punto queda al final de la línea, nunca al principio */
.stack-roles span { white-space: nowrap; }
.stack-hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .875rem; color: var(--ink-3); }

/* datos sueltos, sin tabla */
.facts {
  display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 18px 32px;
  margin: clamp(34px, 4.4vw, 60px) 0 0; padding-top: 22px; border-top: 1px solid var(--line);
}
.facts div { min-width: 0; }
.facts dt { font-size: .875rem; color: var(--ink-3); }
.facts dd { margin: 3px 0 0; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.facts .sub { display: block; font-weight: 400; font-size: .875rem; color: var(--ink-3); }

/* ---------- secciones ---------- */
.sec { padding-block: clamp(60px, 8vw, 116px); }
.sec-head {
  display: grid; grid-template-columns: var(--cols);
  column-gap: var(--col-gap); align-items: start;
  margin-bottom: clamp(28px, 3.8vw, 50px);
}
.sec-head h2, .notes-title, .vision-grid h2, .contact h2 {
  margin: 0; font-weight: 700; font-stretch: 94%;
  font-size: clamp(1.95rem, 1.1rem + 2.7vw, 3.3rem); line-height: 1.04; letter-spacing: -.026em;
  text-wrap: balance;
}
.sec-head p { margin: 0; max-width: 56ch; color: var(--ink-2); text-wrap: pretty; }

/* proyectos */
.scope { margin-bottom: clamp(16px, 2.2vw, 28px); }
.proj-list { position: relative; list-style: none; margin: 0; padding: 0; }
/* una sola mancha clara que acompaña al cursor de fila en fila */
.proj-list::before {
  content: ""; position: absolute; z-index: 0; inset: 0 -20px;
  background: var(--panel); opacity: var(--hl-o, 0);
  /* se recorta a la fila en vez de cambiar de tamaño: no mueve el layout */
  clip-path: inset(var(--hl-y, 0px) 0 calc(100% - var(--hl-y, 0px) - var(--hl-h, 0px)) 0 round 24px);
  transition: clip-path .4s var(--out), opacity .25s ease;
  pointer-events: none;
}
/* con el dedo no viaja de fila en fila: aparece de una bajo la fila que tocas */
.proj-list.is-touch::before { transition: opacity .18s ease; }
.proj {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1.7fr) minmax(0, .86fr) auto;
  column-gap: clamp(18px, 2.6vw, 40px); align-items: start;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.proj:last-child { border-bottom: 1px solid var(--line); }
.proj-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.proj-logo { flex: none; width: 56px; height: 56px; border-radius: 15px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.proj-logo.contain { object-fit: contain; padding: 6px; }
.proj-mono { display: grid; place-items: center; background: var(--panel); font-weight: 700; font-size: .9375rem; letter-spacing: .02em; color: var(--ink-2); }
.proj-name { margin: 0; font-weight: 700; font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); line-height: 1.1; letter-spacing: -.018em; text-wrap: balance; }
.proj-co { display: inline-block; margin-top: 4px; font-size: .9375rem; color: var(--ink-3); text-decoration: none; }
a.proj-co { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color .2s ease; }
a.proj-co:hover { color: var(--ink); }
.proj-desc { margin: 0; max-width: 56ch; font-size: 1rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.proj-note { margin: 10px 0 0; max-width: 56ch; font-size: .9375rem; line-height: 1.5; color: var(--ink-3); }
.proj-facts { list-style: none; margin: 0; padding: 2px 0 0; display: grid; gap: 4px; font-size: .9375rem; line-height: 1.4; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.proj-go { display: grid; justify-items: end; gap: 10px; text-align: right; }
.proj-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line);
  font-weight: 600; font-size: .9375rem; line-height: 1.15; text-decoration: none; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, transform .18s var(--out);
}
.proj-link:hover { background: var(--ink); color: var(--paper); box-shadow: none; }
.proj-link:hover .ico { transform: translate(2px, -2px); }
.proj-link:active { transform: scale(.97); }
.proj-priv { padding: 9px 0; font-size: .875rem; color: var(--ink-3); white-space: nowrap; }
.proj-tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--panel); font-weight: 600; font-size: .875rem; color: var(--ink-2); white-space: nowrap; }
.proj-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.proj.is-off .proj-logo { filter: grayscale(1); opacity: .85; }
.proj.is-off .proj-name { color: var(--ink-2); }

/* manifiesto */
.notes-grid { display: grid; grid-template-columns: var(--cols); column-gap: var(--col-gap); align-items: start; }
.notes-body { margin: 0; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); line-height: 1.55; text-wrap: pretty; }
.dots { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
.dots li { position: relative; padding-left: 26px; font-weight: 600; }
.dots li::before { content: ""; position: absolute; left: 2px; top: .56em; width: 10px; height: 10px; border-radius: 50%; background: var(--acc); }

/* visión: la frase a la izquierda y sus tres propósitos como lista, sin numerar */
.vision-grid { display: grid; grid-template-columns: var(--cols); column-gap: var(--col-gap); align-items: start; }
.vision-statement { margin: clamp(16px, 1.8vw, 24px) 0 0; font-weight: 600; font-size: clamp(1.3rem, 1.05rem + .9vw, 1.75rem); line-height: 1.25; letter-spacing: -.012em; max-width: 26ch; text-wrap: balance; }
.aims { list-style: none; margin: 10px 0 0; padding: 0; }
.aims li { padding: 18px 2px; border-top: 1px solid var(--line); line-height: 1.5; text-wrap: pretty; }
.aims li:last-child { border-bottom: 1px solid var(--line); }

/* stack y habilidades */
.legend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 52px) clamp(22px, 3vw, 44px); }
.legend-grid[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.legend-item { padding-top: 18px; border-top: 1px solid var(--line); }
.legend-item h3 { margin: 0 0 12px; font-weight: 700; font-size: 1.0625rem; line-height: 1.25; }
.legend-item ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--ink-2); }
.legend-item li span { font-size: .9375rem; color: var(--ink-3); }

/* ---------- cierre: una isla oscura ---------- */
.contact {
  margin: clamp(20px, 3vw, 44px) clamp(10px, 1.6vw, 24px) 0;
  padding-block: clamp(58px, 8vw, 112px);
  border-radius: clamp(26px, 3.4vw, 44px);
  background: var(--ink); color: var(--paper);
  --mark: var(--acc);
  /* sube a la mesa a medida que llegas con el scroll: --rise va de 0 a 1 y sin js/app.js vale 1 */
  transform: translateY(calc((1 - var(--rise, 1)) * 56px)) scale(calc(.95 + var(--rise, 1) * .05));
  transform-origin: 50% 100%;
}
/* sobre la isla oscura el resaltador pasa a ser un trazo por debajo, con el color entero de la faceta */
.contact .w.m::before { top: auto; bottom: -.05em; height: .13em; left: 0; right: -.26em; border-radius: 999px; }
.contact .w.m.m1::before { right: 0; }
.contact-grid { display: grid; grid-template-columns: var(--cols); column-gap: var(--col-gap); align-items: start; }
.contact-lead { margin: 20px 0 30px; max-width: 46ch; font-size: 1.125rem; color: #CBCED8; text-wrap: pretty; }
.contact-list { list-style: none; margin: 10px 0 0; padding: 0; }
.contact-list li { border-top: 1px solid rgba(246, 244, 239, .16); }
.contact-list li:last-child { border-bottom: 1px solid rgba(246, 244, 239, .16); }
.contact-list a, .contact-list .row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; column-gap: 14px; align-items: baseline;
  padding: 17px 2px; text-decoration: none;
}
.contact-list .k { font-size: .875rem; color: #ABB0BD; }
.contact-list .v { font-weight: 600; overflow-wrap: anywhere; }
.contact-list .x { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; color: #ABB0BD; transition: color .2s ease; }
.contact-list a:hover .x { color: var(--paper); }
.contact-list a:hover .ico { transform: translate(2px, -2px); }
.contact :focus-visible { outline-color: var(--paper); }

.foot { padding-block: 26px 34px; font-size: .875rem; color: var(--ink-3); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 28px; }
.foot .brand { font-size: .9375rem; }

/* ============================================================
   MOVIMIENTO
   Los textos nunca se esconden: lo que se mueve son los objetos.
   La pila de fotos se arrima al cursor, se abre con el scroll, se
   levanta al tocarla y sigue al dedo; los logos caen en su fila,
   los puntos se apoyan y el cierre sube a la mesa. Solo el titular
   de la portada entra palabra por palabra. Apagado con "reducir
   movimiento" o con ?still.
   ============================================================ */
@keyframes word-in { from { opacity: 0; transform: translateY(.42em); } }
@keyframes mark-in { from { transform: rotate(-.7deg) scaleX(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(26px) rotate(0deg) scale(.9); } }
/* la foto de arriba se corre apenas y vuelve: al llegar y cuando la tocas sin arrastrarla */
@keyframes card-nudge { 36% { transform: translate(-18px, 2px) rotate(-2.6deg); animation-timing-function: var(--settle); } }
/* cada logo cae en su lugar y cada punto de lista se apoya cuando su fila aparece */
@keyframes logo-in { from { opacity: 0; transform: translateY(-12px) rotate(-8deg) scale(.8); } }
@keyframes dot-in { from { transform: scale(0); } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

html.hold *, html.hold *::before, html.hold *::after { animation-play-state: paused !important; }

html.motion [data-rv="words"] .w { opacity: 0; }
html.motion [data-rv="words"].is-in .w { opacity: 1; animation: word-in .7s var(--out) calc(var(--i) * 34ms + var(--d, 0ms)) both; }
html.motion [data-rv="words"].is-in .w.m::before { animation: mark-in .6s var(--out) calc(var(--i) * 34ms + var(--d, 0ms) + 420ms) both; }
html.motion [data-rv="fade"] { opacity: 0; }
html.motion [data-rv="fade"].is-in { opacity: 1; animation: fade-up .65s var(--out) var(--d, 0ms) both; }
/* en el cierre las palabras no entran: solo se pasa el trazo cuando llegas */
html.motion [data-rv="mark"]:not(.is-in) .w.m::before { transform: rotate(-.7deg) scaleX(0); }
html.motion [data-rv="mark"].is-in .w.m::before { animation: mark-in .7s var(--out) calc(var(--i) * 34ms + 120ms) both; }
html.motion [data-rv="pop"]:not(.is-in) { opacity: 0; }
html.motion [data-rv="pop"].is-in { animation: logo-in .75s var(--settle) var(--d, 0ms) both; }
html.motion [data-rv="dot"]:not(.is-in)::before { transform: scale(0); }
html.motion [data-rv="dot"].is-in::before { animation: dot-in .55s var(--settle) var(--d, 0ms) both; }
html.motion [data-rv].is-still, html.motion [data-rv].is-still::before, html.motion [data-rv].is-still .w, html.motion [data-rv].is-still .w.m::before { animation: none; }

html.motion body.first .card[data-slot="front"] { animation: card-in .9s var(--settle) .12s both, card-nudge 1.1s var(--out) 1.55s; }
html.motion .card.is-nudge { animation: card-nudge .9s var(--out); }
html.motion body.first .card[data-slot="mid"] { animation: card-in .9s var(--settle) .26s both; }
html.motion body.first .card[data-slot="back"] { animation: card-in .9s var(--settle) .36s both; }
html.motion body.first .stack-cap { animation: fade-up .65s var(--out) .7s both; }

/* cambio de faceta, idioma y pestaña: cada pieza viaja a su nuevo lugar */
html.motion .bar { view-transition-name: bar; }
html.motion .seg-thumb.t-mode { view-transition-name: thumb-mode; }
html.motion .seg-thumb.t-scope { view-transition-name: thumb-scope; }
html.motion .card[data-mode="emprendedor"] { view-transition-name: card-e; }
html.motion .card[data-mode="dev"] { view-transition-name: card-d; }
html.motion .card[data-mode="persona"] { view-transition-name: card-p; }

::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .34s ease .06s both; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--out); }
::view-transition-group(card-e), ::view-transition-group(card-d), ::view-transition-group(card-p) { z-index: 1; animation-duration: .78s; animation-timing-function: var(--settle); }
::view-transition-old(card-e), ::view-transition-new(card-e),
::view-transition-old(card-d), ::view-transition-new(card-d),
::view-transition-old(card-p), ::view-transition-new(card-p) { width: 100%; height: 100%; object-fit: cover; }
/* la foto que pasa al frente viaja por encima de las otras */
html[data-mid="emprendedor"]::view-transition-group(card-e), html[data-mid="dev"]::view-transition-group(card-d), html[data-mid="persona"]::view-transition-group(card-p) { z-index: 2; }
html[data-front="emprendedor"]::view-transition-group(card-e), html[data-front="dev"]::view-transition-group(card-d), html[data-front="persona"]::view-transition-group(card-p) { z-index: 3; }
::view-transition-group(thumb-scope) { z-index: 4; animation-timing-function: var(--settle); }
::view-transition-group(sl-partner), ::view-transition-group(sl-all) { z-index: 5; }
::view-transition-group(bar) { z-index: 10; animation: none; }
::view-transition-old(bar) { animation: none; opacity: 0; }
::view-transition-new(bar) { animation: none; }
::view-transition-group(thumb-mode) { z-index: 11; animation-timing-function: var(--settle); }
::view-transition-group(sl-emprendedor), ::view-transition-group(sl-dev), ::view-transition-group(sl-persona) { z-index: 12; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* ============================================================
   PANTALLAS CHICAS
   ============================================================ */
@media (max-width: 1080px) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; }
  .proj { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id go" "body body" "facts facts"; row-gap: 14px; }
  .proj-id { grid-area: id; }
  .proj-body { grid-area: body; }
  .proj-facts { grid-area: facts; display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 0; }
  .proj-go { grid-area: go; }
  .legend-grid, .legend-grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --bar: 58px; }
  html { scroll-padding-top: 78px; }
  .bar {
    height: auto; grid-template-columns: 1fr auto; grid-template-rows: var(--bar) auto; row-gap: 0; padding-bottom: 10px;
    /* solo la fila de facetas queda fija: la marca se va con el scroll */
    top: calc(var(--bar) * -1);
  }
  .seg-mode { grid-column: 1 / -1; grid-row: 2; display: flex; }
  .seg-mode button { flex: 1; padding-inline: 8px; }
  /* en pantallas táctiles, todo lo que se toca mide al menos 44 px */
  .seg button { padding-block: 13px; }
  .lang button { padding: 14px 11px; }
  .btn-sm { padding-block: 14px; }
  .proj-link { padding-block: 13px; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "st" "fig" "rest"; row-gap: 20px; }
  .stack { width: min(84%, 344px); }
  .sec-head, .notes-grid, .vision-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); row-gap: 18px; align-items: start; }
  .contact-list { margin-top: 26px; }
  .aims { margin-top: 8px; }
}

@media (max-width: 620px) {
  body { font-size: 1rem; }
  .statement { letter-spacing: -.026em; }
  .hero-value { font-size: 1.0625rem; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > :last-child { grid-column: 1 / -1; }
  .scope { display: flex; }
  .scope button { flex: 1; padding-inline: 8px; font-size: .875rem; }
  .proj { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "body" "facts" "go"; padding: 24px 0; }
  .proj-go { justify-items: start; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
  .proj-list::before { inset: 0 -12px; }
  .legend-grid, .legend-grid[data-n="4"] { grid-template-columns: minmax(0, 1fr); }
  .contact-list a, .contact-list .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k x" "v v"; row-gap: 2px; }
  .contact-list .k { grid-area: k; }
  .contact-list .v { grid-area: v; }
  .contact-list .x { grid-area: x; }
}
