/* Alquimia Sistemas — portfolio */
:root {
  --papel: #f5f1e8;
  --papel-2: #ece6d8;
  --tarjeta: #fffdf8;
  --tinta: #1c2220;
  --tinta-2: #4b5450;
  --tinta-3: #77807b;
  --borde: #ddd5c4;
  --verde: #1f5c55;
  --verde-2: #2b7a70;
  --verde-suave: #dcebe6;
  --cobre: #b5602e;
  --cobre-suave: #f4e2d4;
  --oro: #c9a14a;
  --noche: #141a19;
  --sombra: 0 1px 2px rgb(28 34 32 / .06), 0 8px 24px rgb(28 34 32 / .08);
  --radio: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ancho: 1180px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papel: #121716;
    --papel-2: #182020;
    --tarjeta: #1a2221;
    --tinta: #ece7dc;
    --tinta-2: #b9bfb9;
    --tinta-3: #8a938e;
    --borde: #2c3735;
    --verde: #6cc0b3;
    --verde-2: #8fd3c8;
    --verde-suave: #1d3532;
    --cobre: #e3955f;
    --cobre-suave: #3a271c;
    --sombra: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--verde); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 4.6vw, 46px); }
h3 { font-size: clamp(24px, 3vw, 31px); }
p { margin: 0 0 1em; }
.envoltura { max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }
.saltar { position: absolute; left: -999px; top: 8px; background: var(--tinta); color: var(--papel); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.saltar:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--cobre); outline-offset: 2px; border-radius: 6px; }
[id] { scroll-margin-top: 78px; }

/* ---------- barra ---------- */
.barra {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--papel) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--borde);
}
.barra .envoltura { display: flex; align-items: center; gap: 20px; height: 62px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); font-family: var(--serif); font-size: 20px; font-weight: 600; white-space: nowrap; }
.marca svg { width: 30px; height: 30px; flex: none; }
.marca span em { font-style: italic; font-weight: 400; color: var(--verde); }
.barra nav { margin-left: auto; display: flex; gap: 22px; }
.barra nav a { color: var(--tinta-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.barra nav a:hover { color: var(--tinta); }
.barra .boton { margin-left: 4px; }
@media (max-width: 899px) { .barra nav { display: none; } .barra .boton { margin-left: auto; } }
@media (max-width: 420px) { .marca { font-size: 18px; } .barra .boton { padding: 8px 12px; font-size: 14px; } }

/* ---------- botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font: 600 15px/1.2 var(--sans);
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.boton:active { transform: translateY(1px); }
.boton svg { width: 18px; height: 18px; flex: none; }
.boton-wa { background: #1f8f4e; color: #fff; }
.boton-wa:hover { background: #187a41; }
.boton-lleno { background: var(--verde); color: #fff; }
@media (prefers-color-scheme: dark) { .boton-lleno { color: #0f1514; } }
.boton-lleno:hover { background: var(--verde-2); }
.boton-borde { border-color: var(--borde); color: var(--tinta); background: var(--tarjeta); }
.boton-borde:hover { border-color: var(--tinta-3); }
.boton-chico { padding: 8px 14px; font-size: 14px; }

/* ---------- portada ---------- */
.portada { padding: 56px 0 40px; position: relative; }
.portada .envoltura { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .portada .envoltura { grid-template-columns: 1.05fr .95fr; } .portada { padding: 80px 0 64px; } }
.antetitulo { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cobre); font-weight: 700; margin-bottom: 14px; }
.portada h1 { font-size: clamp(40px, 7.2vw, 74px); }
.portada h1 em { font-style: italic; font-weight: 400; color: var(--verde); }
.portada .bajada { font-size: clamp(17px, 2vw, 20px); color: var(--tinta-2); max-width: 34em; margin: 22px 0 28px; }
.portada .acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.collage { position: relative; height: 430px; max-width: 520px; width: 100%; margin: 0 auto; }
.collage .navegador { position: absolute; left: 0; top: 30px; width: 86%; }
.collage .celu { position: absolute; width: 33%; }
.collage .celu:nth-of-type(2) { right: 0; top: 0; transform: rotate(4deg); }
.collage .celu:nth-of-type(3) { right: 26%; bottom: 0; transform: rotate(-5deg); }
@media (max-width: 560px) { .collage { height: 330px; } }

.cinta { border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); background: var(--papel-2); }
.cinta ul { list-style: none; margin: 0; padding: 14px var(--gutter); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-size: 14px; color: var(--tinta-2); font-weight: 500; }
.cinta li::before { content: "✦"; color: var(--oro); margin-right: 8px; font-size: 11px; }

/* ---------- marcos de pantalla ---------- */
.navegador { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; box-shadow: var(--sombra); }
.navegador::before { content: ""; display: block; height: 22px; border-bottom: 1px solid var(--borde); background:
  radial-gradient(circle at 12px 11px, #e0796b 4px, transparent 4.5px),
  radial-gradient(circle at 26px 11px, #e3b85a 4px, transparent 4.5px),
  radial-gradient(circle at 40px 11px, #7cbf73 4px, transparent 4.5px), var(--papel-2); }
.celu { background: #0e1110; padding: 6px; border-radius: 22px; box-shadow: var(--sombra); }
.celu img { border-radius: 16px; }

/* ---------- secciones ---------- */
.seccion { padding: 72px 0; }
.seccion-cabeza { max-width: 720px; margin-bottom: 40px; }
.seccion-cabeza p { color: var(--tinta-2); font-size: 18px; margin-top: 14px; }

.servicios { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.servicio { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 24px; }
.servicio .icono { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--verde-suave); color: var(--verde); margin-bottom: 16px; }
.servicio .icono svg { width: 24px; height: 24px; }
.servicio h3 { font-size: 21px; margin-bottom: 8px; }
.servicio p { color: var(--tinta-2); font-size: 15.5px; margin: 0; }

/* ---------- proyectos ---------- */
.proyectos { display: grid; gap: 28px; }
.proy {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 20px;
  display: grid; overflow: hidden; box-shadow: var(--sombra);
}
@media (min-width: 1000px) {
  .proy { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .proy:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .proy:nth-child(even) .proy-texto { order: 2; }
}
.proy-texto { padding: 28px 24px; }
@media (min-width: 720px) { .proy-texto { padding: 36px 36px; } }
.proy-cat { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--cobre); margin-bottom: 10px; }
.estado { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; margin: 14px 0 18px; background: var(--verde-suave); color: var(--verde); }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.estado.ambar { background: var(--cobre-suave); color: var(--cobre); }
.proy-problema { color: var(--tinta-2); }
.proy-problema strong { color: var(--tinta); }
.lista { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 7px; font-size: 15.5px; }
.lista li { padding-left: 24px; position: relative; }
.lista li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 10px; height: 10px; border-radius: 3px; background: var(--verde); transform: rotate(45deg) scale(.7); }
.chips { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--borde); color: var(--tinta-2); }
.proy-botones { display: flex; flex-wrap: wrap; gap: 10px; }
.nota { font-size: 14px; color: var(--tinta-3); margin: 0; }

/* galería tipo tira */
.galeria { position: relative; background: var(--papel-2); min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.tira {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding: 24px; scrollbar-width: thin; align-items: center; height: 100%;
}
.tira figure { margin: 0; flex: none; scroll-snap-align: center; height: 380px; width: min-content; display: flex; flex-direction: column; }
.tira button.ampliar { all: unset; cursor: zoom-in; display: block; height: calc(100% - 30px); }
.tira .navegador, .tira .celu { display: block; height: 100%; }
.tira .navegador img { height: calc(100% - 23px); width: auto; max-width: none; }
.tira .celu img { height: 100%; width: auto; max-width: none; }
.tira figure.ancha { width: 100%; height: auto; }
.tira figure.ancha button.ampliar { height: auto; }
.tira figure.ancha .navegador img { width: 100%; height: auto; }
.tira figcaption { font-size: 13px; color: var(--tinta-3); margin-top: 8px; text-align: center; }
.tira button.ampliar:focus-visible { outline: 3px solid var(--cobre); outline-offset: 3px; border-radius: 12px; }
@media (min-width: 1000px) { .tira figure { height: 460px; } }
@media (max-width: 560px) { .tira { padding: 18px 16px; gap: 14px; } .tira figure { height: 330px; } }
.flechas { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px; }
.flechas button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--borde); background: var(--tarjeta); color: var(--tinta); cursor: pointer; display: grid; place-items: center; font-size: 16px; box-shadow: var(--sombra); }
.flechas button:disabled { opacity: .35; cursor: default; }
@media (hover: none) { .flechas { display: none; } }

/* ---------- integraciones ---------- */
.ingenieria { background: var(--noche); color: #ece7dc; }
.ingenieria .seccion-cabeza p { color: #b9bfb9; }
.ingenieria .antetitulo { color: var(--oro); }
.ingenios { display: grid; gap: 18px; }
@media (min-width: 1000px) { .ingenios { grid-template-columns: repeat(3, 1fr); } }
.ingenio { border: 1px solid #2c3735; border-radius: var(--radio); padding: 26px 24px; background: #182120; display: flex; flex-direction: column; }
.ingenio h3 { font-size: 23px; color: #f3eee4; }
.ingenio p { color: #b9bfb9; font-size: 15.5px; }
.ingenio .estado { background: #1d3532; color: #8fd3c8; margin-top: 10px; }
.flujo { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 0; counter-reset: paso; }
.flujo li { position: relative; padding: 10px 12px 10px 44px; border: 1px solid #2c3735; border-radius: 10px; background: #121a19; font-size: 14.5px; color: #dcd7cc; }
.flujo li + li { margin-top: 22px; }
.flujo li + li::after { content: "↓"; position: absolute; left: 50%; top: -21px; transform: translateX(-50%); color: var(--oro); font-size: 15px; line-height: 20px; }
.flujo li::before { counter-increment: paso; content: counter(paso); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--oro); color: #141a19; font-weight: 700; font-size: 12.5px; display: grid; place-items: center; }
.flujo strong { color: #fff; font-weight: 600; }
.ingenio .chips li { border-color: #2c3735; color: #b9bfb9; }
.ingenio .chips { margin-top: auto; margin-bottom: 0; }

/* ---------- otros proyectos ---------- */
.otros { display: grid; gap: 22px; }
@media (min-width: 900px) { .otros { grid-template-columns: repeat(2, minmax(0, 1fr)); } .otro.ancho { grid-column: 1 / -1; } }
.otro { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.otro .proy-texto { flex: 1; }
.otro-media { background: var(--papel-2); }
.otro-media img { width: 100%; height: auto; }
.mosaico { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #000; }
.mosaico img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.reels { display: flex; gap: 12px; overflow-x: auto; padding: 22px; scroll-snap-type: x mandatory; align-items: center; background: var(--papel-2); }
.reels video, .reels img { flex: none; width: 168px; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: #000; scroll-snap-align: start; }
@media (min-width: 900px) { .otro.reel-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .reels video, .reels img { width: 190px; } }
.otro-media { aspect-ratio: 16 / 9; overflow: hidden; }
.otro-media > img { width: 100%; height: 100%; object-fit: cover; }
.duo { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1px; background: var(--borde); }
.duo img { width: 100%; height: 100%; object-fit: contain; background: #f7f7f7; min-height: 0; }
.duo img + img { background: #fff; padding: 10px; }
.ragnarok { background: radial-gradient(120% 120% at 0% 0%, #1f2b2e 0%, #0d1112 60%); color: #e9e2d0; border-color: #3a3324; }
.ragnarok .proy-cat { color: var(--oro); }
.ragnarok h3 { color: #f4ecd8; }
.ragnarok .proy-problema, .ragnarok p { color: #c7c0ae; }
.ragnarok .proy-problema strong { color: #f4ecd8; }
.ragnarok .lista li::before { background: var(--oro); }
.ragnarok .chips li { border-color: #3a3324; color: #c7c0ae; }
.ragnarok .estado { background: #3a3324; color: #e8c779; }
@media (min-width: 900px) { .ragnarok { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.piezas { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 1px; background: #3a3324; }
.piezas figure { margin: 0; background: #000; position: relative; min-height: 0; }
.piezas img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.piezas figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; color: #e8c779; text-align: center; background: linear-gradient(transparent, rgb(0 0 0 / .85)); }
.rag-video { grid-column: 1 / -1; background: #000; border-top: 1px solid #3a3324; }
.rag-video video { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; background: #000; }
.rag-video p { margin: 0; padding: 10px 18px 14px; font-size: 13.5px; color: #a89f86; font-style: italic; }

/* ---------- cómo trabajamos ---------- */
.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: p; }
@media (min-width: 900px) { .pasos { grid-template-columns: repeat(4, 1fr); } }
.pasos li { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 24px; }
.pasos li::before { counter-increment: p; content: "0" counter(p); display: block; font-family: var(--serif); font-size: 34px; color: var(--cobre); line-height: 1; margin-bottom: 14px; }
.pasos h3 { font-size: 21px; margin-bottom: 8px; }
.pasos p { color: var(--tinta-2); font-size: 15.5px; margin: 0; }

/* ---------- contacto ---------- */
.contacto { padding: 0 0 80px; }
.contacto-caja { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 24px; padding: 40px 24px; text-align: center; }
@media (min-width: 720px) { .contacto-caja { padding: 52px 48px; } }
.contacto-caja h2 { font-size: clamp(26px, 3.6vw, 36px); }
.contacto-caja p { max-width: 34em; margin: 12px auto 24px; color: var(--tinta-2); }
.contacto-caja .numero { display: block; margin-top: 12px; font-size: 15px; color: var(--tinta-3); }

footer { border-top: 1px solid var(--borde); padding: 28px 0 40px; font-size: 14px; color: var(--tinta-3); }
footer .envoltura { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- visor ---------- */
dialog.visor { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
dialog.visor::backdrop { background: rgb(10 14 13 / .88); }
dialog.visor img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; border-radius: 10px; margin: 0 auto; }
dialog.visor p { color: #e9e5dc; text-align: center; margin: 10px 0 0; font-size: 15px; }
dialog.visor .cerrar { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: #111; font-size: 22px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .boton { transition: none; } }
