@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}

:root {
  --paper: #f2f3f5;
  --surface: #ffffff;
  --ink: #0f1729;
  --muted: #4b5563;
  --line: #d8dce2;
  --accent: #2e4bf0;
  --accent-hover: #1f35c7;
  --accent-soft: #e4e9ff;
  --ok: #1f8a4c;
  --dark: #0f1729;
  --dark-2: #182238;
  --dark-line: #5a6684;
  --dark-muted: #aab3c5;
  --error: #b42318;
  --error-dark: #ff9b8f;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(88px, 11vw, 152px);
  --header-h: 68px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 300; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 24px;
  border: 1px solid transparent; border-radius: 999px; background: transparent; font-weight: 600; font-size: 16px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-sm { min-height: 42px; padding: 9px 18px; font-size: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border-color: #b9c0cb; color: var(--ink); }
.btn-quiet { min-height: 42px; padding: 9px 18px; font-size: 15px; border-color: var(--line); background: var(--surface); }
.btn-light { background: #fff; color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost:hover, .btn-quiet:hover { border-color: var(--ink); }
  .btn-light:hover { background: var(--accent-soft); }
}

/* ---------- Cabecera ---------- */
.header { position: fixed; inset: 0 0 auto; z-index: 100; background: rgba(242, 243, 245, 0.82); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color 200ms ease; }
.header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.nav { display: none; gap: 30px; margin-left: auto; }
.nav a { position: relative; color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; transition: color 160ms ease; }
.nav a[aria-current="true"] { color: var(--ink); }
.nav a[aria-current="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--accent); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--ink); } }
.header-cta { display: none; }
.menu-btn { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: transform 160ms var(--ease-out); }
.menu-btn:active { transform: scale(0.95); }
.menu-icon { position: relative; width: 18px; height: 10px; }
.menu-icon i { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 200ms var(--ease-out); }
.menu-icon i:first-child { top: 0; }
.menu-icon i:last-child { bottom: 0; }
.menu-btn[aria-expanded="true"] .menu-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.menu { position: absolute; top: calc(100% + 8px); right: var(--gutter); width: min(300px, calc(100% - 2 * var(--gutter))); padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 50px -18px rgba(15, 23, 41, 0.35); transform-origin: top right; }
.menu nav { display: grid; gap: 2px; }
.menu a:not(.btn) { padding: 12px 14px; border-radius: 10px; font-weight: 500; text-decoration: none; }
.menu a:not(.btn):active { background: var(--paper); }
.menu .btn { margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .menu.is-open { animation: menu-in 180ms var(--ease-out); }
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.97) translateY(-4px); } }
@media (min-width: 900px) {
  .nav { display: flex; }
  .header-cta { display: inline-flex; }
  .menu-btn, .menu { display: none !important; }
}

/* ---------- Portada ---------- */
.hero { padding-top: calc(var(--header-h) + clamp(40px, 6vw, 72px)); padding-bottom: clamp(64px, 9vw, 120px); overflow: clip; }
.hero-grid { display: grid; gap: clamp(48px, 6vw, 72px); align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); } }
.status { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(31, 138, 76, 0.14); }
.hero-title { max-width: 17ch; font-size: clamp(36px, 4.6vw, 64px); font-weight: 700; line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.hero-text { max-width: 52ch; margin-top: 26px; color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
@media (max-width: 479px) { .hero-actions .btn { flex: 1 1 100%; } }

/* Entrada de la portada: un solo momento orquestado */
@media (prefers-reduced-motion: no-preference) {
  .js .load-in { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  .js.is-loaded .load-in { opacity: 1; transform: none; filter: none; transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out), filter 600ms var(--ease-out); }
  .js.is-loaded .load-in:nth-child(2) { transition-delay: 60ms; }
  .js.is-loaded .load-in:nth-child(3) { transition-delay: 120ms; }
  .js.is-loaded .load-in:nth-child(4) { transition-delay: 180ms; }
}

/* Abanico de proyectos */
.deck { position: relative; aspect-ratio: 1.12; width: 100%; max-width: 640px; margin-inline: auto; }
.deck-slot { position: absolute; left: 4%; top: 18%; width: 74%; }
.deck-slot-0 { z-index: 1; }
.deck-slot-1 { z-index: 3; }
.deck-slot-2 { z-index: 2; }
.deck-card { position: relative; display: block; border-radius: var(--radius); text-decoration: none; transform: var(--to); will-change: transform; }
.deck-0 { --to: translate(-6%, 12%) rotate(-7deg); }
.deck-1 { --to: translate(10%, -10%) rotate(2deg); }
.deck-2 { --to: translate(30%, 22%) rotate(8deg); }
@media (prefers-reduced-motion: no-preference) {
  .js .deck-card { opacity: 0; transform: translate(14%, 6%) rotate(0deg) scale(0.96); }
  .js.is-loaded .deck-card { opacity: 1; transform: var(--to); transition: transform 900ms var(--ease-out), opacity 500ms var(--ease-out); }
  .js.is-loaded .deck-0 { transition-delay: 220ms; }
  .js.is-loaded .deck-1 { transition-delay: 300ms; }
  .js.is-loaded .deck-2 { transition-delay: 380ms; }
}
@media (hover: hover) and (pointer: fine) {
  .deck-card .frame { transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out); }
  .deck-card:hover .frame { transform: translateY(-8px); box-shadow: 0 2px 4px rgba(15, 23, 41, 0.06), 0 34px 70px -28px rgba(15, 23, 41, 0.5); }
}

/* Marco de navegador */
.frame { overflow: hidden; border: 1px solid #cfd4dc; border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 41, 0.06), 0 24px 50px -30px rgba(15, 23, 41, 0.45); }
.frame-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding-inline: 12px; border-bottom: 1px solid #e3e6eb; background: #f7f8fa; }
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: #d3d7de; }
.frame-bar span { overflow: hidden; margin-left: 10px; color: #6b7280; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.frame img { width: 100%; aspect-ratio: 752 / 470; object-fit: cover; object-position: top; }
/* Parallax interior: la capa es algo más alta que el hueco y GSAP la desplaza */
.frame-media { position: relative; aspect-ratio: 752 / 470; overflow: hidden; background: #e5e8ed center top / cover no-repeat; }
.frame-par { position: absolute; inset: -5% 0; }
.frame-par img { height: 100%; aspect-ratio: auto; object-position: center top; }

/* ---------- Secciones ---------- */
.section { padding-block: var(--section); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.sec-head { display: grid; gap: 16px; margin-bottom: clamp(44px, 6vw, 72px); }
@media (min-width: 900px) { .sec-head { grid-template-columns: 1fr 1fr; align-items: end; gap: 64px; } }
.h2 { max-width: 18ch; font-size: clamp(32px, 4.2vw, 54px); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.sec-text { max-width: 48ch; color: var(--muted); font-size: 18px; }

/* Proyectos */
.projects { display: grid; gap: clamp(48px, 6vw, 72px) 40px; }
@media (min-width: 900px) { .projects { grid-template-columns: 1fr 1fr; } }
.project { display: grid; gap: 22px; align-content: start; min-width: 0; }
@media (min-width: 900px) {
  .project.is-featured { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 56px; }
  .project.is-featured .project-name { font-size: clamp(30px, 3vw, 40px); }
}
.project-media { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); background: none; text-align: left; cursor: pointer; }
.project-media .frame img { transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .project-media:hover .frame img { transform: scale(1.025); } }
.project-kind { color: var(--accent); font-size: 15px; font-weight: 600; }
.project-name { margin-top: 4px; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.project-summary { max-width: 52ch; margin-top: 10px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: #374151; font-size: 13px; font-weight: 500; }
.section-alt .chips li { background: var(--paper); }
.chips-lg li { padding: 7px 14px; font-size: 15px; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 22px; }
.link-ext { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; text-decoration: underline; text-decoration-color: #b9c0cb; text-underline-offset: 5px; transition: text-decoration-color 160ms ease; }
.link-ext svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .link-ext:hover { text-decoration-color: currentColor; } }

/* Capturas: miniatura borrosa al instante y fundido corto al cargar la nítida */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal-img img { opacity: 0; filter: blur(6px); }
  .js .reveal-img.is-in img { opacity: 1; filter: none; transition: opacity 380ms var(--ease-out), filter 380ms var(--ease-out), transform 600ms var(--ease-out); }
}

/* Servicios */
.services-grid { display: grid; gap: 40px; }
@media (min-width: 1000px) { .services-grid { grid-template-columns: 1fr 360px; gap: 64px; align-items: start; } }
.services { display: grid; }
.service { display: grid; gap: 8px; padding-block: 28px; border-top: 1px solid var(--line); }
.service:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .service { grid-template-columns: 260px 1fr; gap: 32px; } }
.service h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.service p { color: var(--muted); }
.included { padding: 28px; border-radius: 20px; background: var(--ink); color: #fff; }
.included h3 { font-size: 19px; font-weight: 700; }
.ticks { display: grid; gap: 12px; margin-top: 18px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.included .ticks li { color: #dfe4ee; }

/* Proceso */
.steps { display: grid; gap: 32px; counter-reset: s; }
@media (min-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
  .steps::before { content: ""; position: absolute; left: 22px; right: calc((100% - 84px) / 4 - 22px); top: 22px; height: 1px; background: var(--line); }
}
.step { position: relative; }
/* Progreso del proceso: la línea se dibuja con el scroll (GSAP anima --p) */
@media (min-width: 1000px) {
  .steps::after { content: ""; position: absolute; left: 22px; right: calc((100% - 84px) / 4 - 22px); top: 22px; height: 1px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
  .js-gsap .step-n { transition: background-color 300ms ease, border-color 300ms ease, color 300ms ease; z-index: 1; }
  .js-gsap .step.is-on .step-n { border-color: var(--accent); background: var(--accent); color: #fff; }
}
.step-n { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-weight: 700; }
.step:first-child .step-n { border-color: var(--accent); background: var(--accent); color: #fff; }
.step h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.step p { margin-top: 8px; color: var(--muted); }

/* Sobre mí */
.about { display: grid; gap: 28px; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1fr; gap: 64px; } }
.about-copy > p { color: var(--muted); font-size: 18px; }
.about-copy > p + p { margin-top: 18px; }

/* ---------- Contacto ---------- */
.contact { padding-block: var(--section); background: var(--dark); color: #fff; overflow: clip; }
/* Franja de texto gigante que se desplaza con el scroll (decorativa) */
.contact-band { margin-top: calc(var(--section) * -0.35); margin-bottom: clamp(40px, 6vw, 80px); pointer-events: none; user-select: none; }
.contact-band-text { white-space: nowrap; font-size: clamp(64px, 12vw, 190px); font-weight: 700; line-height: 0.95; letter-spacing: -0.045em; color: #1d2842; display: inline-block; will-change: transform; }
.contact-grid { display: grid; gap: 56px; }
@media (min-width: 1000px) { .contact-grid { grid-template-columns: 1fr 1.1fr; gap: 80px; align-items: start; } }
.contact .sec-text { margin-top: 18px; color: var(--dark-muted); }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 34px; }
.mail-link { font-size: clamp(18px, 2vw, 22px); font-weight: 600; text-decoration: underline; text-decoration-color: var(--dark-line); text-underline-offset: 6px; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .mail-link:hover { text-decoration-color: #fff; } }
.copy-btn { min-width: 132px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--dark-line); border-radius: 999px; background: transparent; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease-out), border-color 200ms ease; }
.copy-btn:active { transform: scale(0.97); }
.copy-label { display: inline-block; transition: filter 160ms ease, opacity 160ms ease; }
.copy-label.is-swapping { filter: blur(2px); opacity: 0; }
@media (hover: hover) and (pointer: fine) { .copy-btn:hover { border-color: #fff; } }
.contact :focus-visible { outline-color: #fff; }

.form { display: grid; gap: 18px; padding: clamp(24px, 3vw, 36px); border: 1px solid #2a3550; border-radius: 22px; background: var(--dark-2); }
@media (min-width: 600px) { .form { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; margin: 0; padding: 0; border: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .field legend { padding: 0; font-size: 14px; font-weight: 600; color: #e6e9f0; }
.field input, .field textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--dark-line); border-radius: 12px; background: var(--dark); color: #fff; font-size: 16px; transition: border-color 160ms ease; }
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: #8892a6; }
.field input:focus, .field textarea:focus { outline: none; border-color: #fff; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span { display: inline-block; padding: 9px 15px; border: 1px solid var(--dark-line); border-radius: 999px; color: #dfe4ee; font-size: 15px; font-weight: 500; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out); }
.option:active span { transform: scale(0.97); }
.option input:checked + span { border-color: #fff; background: #fff; color: var(--ink); }
.option input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.err { color: var(--error-dark); font-size: 14px; }
.err:empty { display: none; }
.has-error input, .has-error textarea { border-color: var(--error-dark); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 4px; }
.form-status { font-size: 15px; }
.form-status:empty { display: none; }
.form-status a { color: #fff; font-weight: 600; text-underline-offset: 4px; }
.form-status.is-ok { color: #9be2b4; }
.form-status.is-error { color: var(--error-dark); }

/* ---------- Pie ---------- */
.footer { padding-block: 28px; background: var(--dark); color: var(--dark-muted); border-top: 1px solid #222d45; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer a { color: #fff; text-underline-offset: 4px; }

/* ---------- Ficha de proyecto (diálogo) ---------- */
.detail { width: min(900px, calc(100% - 24px)); max-height: min(90dvh, 900px); margin: auto; padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 90px -20px rgba(15, 23, 41, 0.55); overflow: hidden; }
.detail::backdrop { background: rgba(15, 23, 41, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.detail-inner { max-height: min(90dvh, 900px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(16px, 2.5vw, 28px); }
.detail-inner .frame { box-shadow: none; }
.detail-body { padding: 26px clamp(4px, 1.5vw, 12px) 8px; }
.detail-title { margin-top: 4px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
.detail-body > p:not(.project-kind) { max-width: 62ch; margin-top: 14px; color: var(--muted); }
.detail-h { margin-top: 26px; font-size: 17px; font-weight: 700; }
.detail-body .ticks { margin-top: 14px; }
.detail-body .ticks li { color: #374151; }
.detail-body .btn { margin-top: 26px; }
.detail-close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.92); cursor: pointer; transition: transform 160ms var(--ease-out); }
.detail-close:active { transform: scale(0.94); }
.detail-close svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .detail.is-animated[open] { animation: pop 240ms var(--ease-out); }
  .detail.is-animated[open]::backdrop { animation: fade 240ms ease; }
  .detail.is-closing { animation: pop-out 150ms ease forwards; }
  .detail.is-closing::backdrop { animation: fade-out 150ms ease forwards; }
}
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
@keyframes pop-out { to { opacity: 0; transform: scale(0.98); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
body.is-locked { overflow: hidden; }

/* ---------- Stack de cada proyecto ---------- */
.stack { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; }
.stack-label { padding-right: 14px; border-right: 1px solid var(--line); color: #6b7280; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { --c: var(--accent); display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: #1f2937; font-size: 13px; font-weight: 600; letter-spacing: -0.005em; transition: border-color 200ms ease; }
.tag::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 2px; background: var(--c); transition: transform 300ms var(--ease-out); }
.tag[data-kind="lang"] { --c: #e8890c; }
.tag[data-kind="host"] { --c: #0f9f75; }
.section-alt .tag, .detail .tag { background: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .project:hover .tag { border-color: #c3c9d3; }
  .project:hover .tag::before { transform: rotate(45deg); }
  .project:hover .tag:nth-child(2)::before { transition-delay: 40ms; }
  .project:hover .tag:nth-child(3)::before { transition-delay: 80ms; }
  .project:hover .tag:nth-child(4)::before { transition-delay: 120ms; }
  .project:hover .tag:nth-child(5)::before { transition-delay: 160ms; }
}

/* ---------- Herramientas (Sobre mí) ---------- */
.skills-title { margin-top: 34px; color: #6b7280; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.skills { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 600px) { .skills { grid-template-columns: 1fr 1fr; } }
.skill { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; transition: border-color 220ms ease, translate 220ms var(--ease-out); }
.skill::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 420ms var(--ease-out); }
.skill-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); transition: background-color 220ms ease, color 220ms ease; }
.skill-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skill-name { padding-right: 26px; font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.skill-desc { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.skill-n { position: absolute; top: 16px; right: 16px; color: #9aa3b2; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .skill:hover { border-color: #c3c9d3; translate: 0 -2px; }
  .skill:hover::after { transform: scaleX(1); }
  .skill:hover .skill-ico { background: var(--accent); color: #fff; }
}
