/* ==========================================================
   PROYECTOS · Bóveda holográfica (informe de misión + carrusel 3D)
   ========================================================== */
.vault {
    --code: #2bf5b0; --code-rgb: 43, 245, 176;
    --ai: #a970ff; --ai-rgb: 169, 112, 255;
    --design: #ff5bd8; --design-rgb: 255, 91, 216;
    --mkt: #3ddcff; --mkt-rgb: 61, 220, 255;
    padding: 0 clamp(16px, 4vw, 48px);
}
.vault > * { width: min(1180px, 100%); margin-left: auto; margin-right: auto; }

/* ---------- Encabezado y frecuencias ---------- */
.vault-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px 32px;
    padding: clamp(22px, 4vh, 44px) 0 18px;
}
.vault-overline { margin: 0 0 8px; font-family: var(--a-font-mono); font-size: 0.74rem; letter-spacing: 0.34em; color: var(--a-emerald); }
.vault-title {
    margin: 0;
    font-family: var(--a-font-display);
    font-weight: 800;
    font-size: clamp(1.9rem, 4.4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(100deg, #eafff7 10%, var(--code) 45%, #b79cff 75%, var(--design));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.vault-lead { margin: 10px 0 0; max-width: 56ch; color: #c8ddd6; line-height: 1.55; }

.vault-freq { display: flex; flex-wrap: wrap; gap: 8px; }
.freq {
    --t: #e7fff6; --t-rgb: 231, 255, 246;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(var(--t-rgb), 0.22);
    border-radius: 999px;
    background: rgba(4, 12, 14, 0.7);
    color: var(--a-text);
    font-family: var(--a-font-body);
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
/* ícono de "onda" de frecuencia */
.freq i {
    width: 16px;
    height: 12px;
    background:
        linear-gradient(var(--t), var(--t)) 0 60% / 2px 40% no-repeat,
        linear-gradient(var(--t), var(--t)) 4px 20% / 2px 80% no-repeat,
        linear-gradient(var(--t), var(--t)) 8px 0 / 2px 100% no-repeat,
        linear-gradient(var(--t), var(--t)) 12px 40% / 2px 60% no-repeat;
    opacity: 0.7;
}
.freq.is-active i { animation: freq-wave 0.9s ease-in-out infinite alternate; opacity: 1; }
@keyframes freq-wave { to { transform: scaleY(0.55); } }
.freq b { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 0.72rem; text-align: center; }
.freq:hover, .freq:focus-visible { border-color: rgba(var(--t-rgb), 0.7); outline: none; }
.freq.is-active { border-color: var(--t); background: rgba(var(--t-rgb), 0.14); box-shadow: 0 0 18px rgba(var(--t-rgb), 0.28); }
.freq--web { --t: #ffb547; --t-rgb: 255, 181, 71; }
.freq--code { --t: var(--code); --t-rgb: var(--code-rgb); }
.freq--ai { --t: var(--ai); --t-rgb: var(--ai-rgb); }
.freq--design { --t: var(--design); --t-rgb: var(--design-rgb); }
.freq--marketing { --t: var(--mkt); --t-rgb: var(--mkt-rgb); }

/* ---------- Informe de misión ---------- */
.report {
    --c: #2bf5b0; --c-rgb: 43, 245, 176;
    position: relative;
    padding: 16px 18px 20px;
    border: 1px solid rgba(var(--c-rgb), 0.45);
    border-radius: 6px;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(var(--c-rgb), 0.12), transparent 60%),
        linear-gradient(160deg, rgba(4, 14, 16, 0.92), rgba(10, 8, 24, 0.9));
    box-shadow: 0 0 50px rgba(var(--c-rgb), 0.16), inset 0 0 40px rgba(var(--c-rgb), 0.05);
    backdrop-filter: blur(12px);
    transition: border-color 0.5s, box-shadow 0.5s;
    scroll-margin-top: 96px; /* deja ver el informe completo bajo la barra fija */
}
.report__corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--c); filter: drop-shadow(0 0 6px var(--c)); transition: border-color 0.5s; }
.report__corner--tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.report__corner--tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.report__corner--bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }
.report__corner--br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.report__bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px dashed rgba(var(--c-rgb), 0.3);
    font-family: var(--a-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    color: rgba(var(--c-rgb), 0.95);
}
.report__status { display: inline-flex; align-items: center; gap: 8px; color: #2bf5b0; }
.report__status i { width: 8px; height: 8px; border-radius: 50%; background: #2bf5b0; box-shadow: 0 0 8px #2bf5b0; animation: aura-blink 1.6s steps(2) infinite; }
.report__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); align-items: center; }

.report__screen {
    position: relative;
    height: clamp(180px, 32vh, 380px);
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(var(--c-rgb), 0.35);
    background: #03080a;
}
.report__screen img, .report__screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* líneas de pantalla + barrido */
.report__screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
    pointer-events: none;
}
.report__scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 30%;
    background: linear-gradient(180deg, transparent, rgba(var(--c-rgb), 0.28), transparent);
    mix-blend-mode: screen;
    transform: translateY(-110%);
    pointer-events: none;
}
.report.is-switching .report__scan { animation: report-scan 0.9s ease-out 1; }
.report.is-switching .report__screen > :first-child { animation: report-glitch 0.45s steps(3) 1; }
.report.is-switching .report__info > * { animation: report-in 0.5s ease-out both; }
.report.is-switching .report__info > :nth-child(2) { animation-delay: 0.05s; }
.report.is-switching .report__info > :nth-child(3) { animation-delay: 0.1s; }
.report.is-switching .report__info > :nth-child(4) { animation-delay: 0.15s; }
.report.is-switching .report__info > :nth-child(5) { animation-delay: 0.2s; }
.report.is-switching .report__info > :nth-child(6) { animation-delay: 0.25s; }
@keyframes report-scan { to { transform: translateY(360%); } }
@keyframes report-glitch {
    0% { clip-path: inset(10% 0 60% 0); transform: translateX(-6px); filter: hue-rotate(40deg); }
    50% { clip-path: inset(50% 0 20% 0); transform: translateX(6px); }
    100% { clip-path: inset(0 0 0 0); transform: none; filter: none; }
}
@keyframes report-in { from { opacity: 0; transform: translateX(12px); } }

/* gráfico para proyectos sin imagen */
.art {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(var(--c-rgb, 43, 245, 176), 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--c-rgb, 43, 245, 176), 0.08) 1px, transparent 1px),
        radial-gradient(circle at 50% 45%, rgba(var(--c-rgb, 43, 245, 176), 0.28), transparent 62%),
        #040a0c;
    background-size: 20px 20px, 20px 20px, auto, auto;
}
.art b { font-family: var(--a-font-display); font-size: 1.6rem; color: var(--c, #2bf5b0); text-shadow: 0 0 16px var(--c, #2bf5b0); }
.art .mini-orb { position: relative; display: block; width: 40px; height: 40px; }
.art--big b { font-size: 3.4rem; }
.art--big .mini-orb { width: 86px; height: 86px; }
.art small { font-family: var(--a-font-mono); font-size: 0.74rem; letter-spacing: 0.12em; color: rgba(var(--c-rgb, 43, 245, 176), 0.85); }

.report__kind { margin: 0; font-family: var(--a-font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9fb8b0; }
.report__title {
    margin: 8px 0 0;
    font-family: var(--a-font-display);
    font-weight: 800;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    line-height: 1.1;
    letter-spacing: 0.03em;
    color: var(--c);
    text-shadow: 0 0 24px rgba(var(--c-rgb), 0.5);
    transition: color 0.4s;
}
.report__pillars { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.report__pillar { display: inline-flex; align-items: center; gap: 6px; font-family: var(--a-font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--p); }
.report__pillar::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--p); box-shadow: 0 0 6px var(--p); }
.report__text { margin: 14px 0 0; font-size: 1.02rem; line-height: 1.6; color: #d6ece5; }
.report__tech { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.report__tech li { padding: 4px 10px; border: 1px solid rgba(var(--c-rgb), 0.35); border-radius: 999px; background: rgba(var(--c-rgb), 0.07); font-size: 0.8rem; color: #e7fff6; }
.report__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.report__enter { background: var(--c); color: #071012; box-shadow: 0 0 22px rgba(var(--c-rgb), 0.45); }
.report__enter:hover, .report__enter:focus-visible { background: var(--c); filter: brightness(1.1); box-shadow: 0 0 30px rgba(var(--c-rgb), 0.7); }
.report__ask { cursor: pointer; }

/* ---------- Carrusel 3D ---------- */
.carousel {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}
.carousel__stage {
    position: relative;
    height: 214px;
    perspective: 1100px;
    transform-style: preserve-3d;
    touch-action: pan-y;
    outline: none;
    overflow: hidden;
    overflow: clip;
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.carousel__stage:focus-visible { box-shadow: 0 0 0 2px rgba(43, 245, 176, 0.5); border-radius: 12px; }
.cart {
    --c: #2bf5b0; --c-rgb: 43, 245, 176;
    position: absolute;
    left: calc(50% - 70px);
    top: 12px;
    width: 140px;
    height: 186px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border: 1px solid rgba(var(--c-rgb), 0.35);
    border-radius: 12px;
    background: linear-gradient(170deg, rgba(10, 22, 24, 0.96), rgba(12, 10, 26, 0.96));
    color: var(--a-text);
    text-align: left;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(.2, .8, .2, 1), opacity 0.5s, border-color 0.3s, box-shadow 0.3s;
    -webkit-tap-highlight-color: transparent;
}
.cart[hidden] { display: none; }
.cart::before {
    /* lomo del cartucho */
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--c);
    box-shadow: 0 0 10px var(--c);
}
.cart.is-active { border-color: var(--c); box-shadow: 0 0 30px rgba(var(--c-rgb), 0.45); }
.cart:hover { border-color: rgba(var(--c-rgb), 0.8); }
.cart:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.cart__thumb { display: block; height: 92px; overflow: hidden; border-radius: 8px; background: #040a0c; }
.cart__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart__code { margin-top: 10px; font-family: var(--a-font-mono); font-size: 0.6rem; letter-spacing: 0.2em; color: rgba(var(--c-rgb), 0.9); }
.cart__name { margin-top: 3px; font-weight: 700; font-size: 0.9rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart__bars { display: flex; gap: 4px; margin-top: auto; }
.cart__bars i { width: 16px; height: 3px; border-radius: 2px; }

.carousel__nav {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(43, 245, 176, 0.35);
    border-radius: 50%;
    background: rgba(4, 12, 14, 0.8);
    color: var(--a-emerald);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.carousel__nav:hover, .carousel__nav:focus-visible { background: rgba(43, 245, 176, 0.14); box-shadow: var(--a-glow); transform: scale(1.06); outline: none; }
.carousel__hint { margin: 6px auto 0; text-align: center; font-family: var(--a-font-mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--a-dim); }

/* ---------- Selector de vista ---------- */
.view-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 22px;
}
.view-bar__label { margin: 0; font-family: var(--a-font-mono); font-size: 0.72rem; letter-spacing: 0.24em; color: var(--a-muted); }
.view-bar__label b { color: var(--a-emerald); font-weight: 500; }
.view-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    background: rgba(4, 12, 14, 0.75);
}
.view-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--a-muted);
    font-family: var(--a-font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.view-toggle__btn svg { width: 17px; height: 17px; }
.view-toggle__btn:hover, .view-toggle__btn:focus-visible { color: var(--a-text); outline: none; }
.view-toggle__btn.is-active { background: linear-gradient(135deg, var(--a-emerald), #7cf5d0); color: #031012; box-shadow: 0 0 14px rgba(43, 245, 176, 0.4); }

/* ---------- Vista "Ver todos": cuadrícula de archivos ---------- */
.carousel.is-grid { grid-template-columns: 1fr; margin-top: 14px; }
.carousel.is-grid .carousel__nav { display: none; }
.carousel.is-grid .carousel__stage {
    height: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    padding: 4px;
    perspective: none;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
}
.carousel.is-grid .cart {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: 196px;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    animation: cart-in 0.4s ease-out both;
}
.carousel.is-grid .cart:hover { transform: translateY(-4px); }
.carousel.is-grid .cart.is-active { transform: none; }
.carousel.is-grid .cart__thumb { height: 96px; }
@keyframes cart-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }

/* ---------- Cierre ---------- */
.vault-cta { padding: clamp(48px, 8vh, 80px) 0 clamp(64px, 10vh, 100px); text-align: center; }
.vault-cta__title { margin: 0; font-family: var(--a-font-display); font-weight: 700; font-size: clamp(1.2rem, 2.6vw, 1.8rem); }
.vault-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-height: 960px) and (min-width: 701px) {
    .vault-lead { display: none; }
    .vault-title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
    .report { padding: 12px 16px 16px; }
    .report__bar { padding-bottom: 8px; margin-bottom: 12px; }
    .report__text { margin-top: 10px; }
    .report__actions { margin-top: 14px; }
}
@media (max-height: 820px) and (min-width: 701px) {
    .vault-head { padding: 14px 0 12px; }
    .vault-overline { display: none; }
    .report__screen { height: clamp(170px, 30vh, 300px); }
    .carousel { margin-top: 12px; }
    .carousel__stage { height: 178px; }
    .cart { width: 118px; height: 156px; left: calc(50% - 59px); top: 8px; }
    .cart__thumb { height: 72px; }
    .carousel__hint { display: none; }
}
@media (max-width: 900px) {
    .report__body { grid-template-columns: 1fr; }
    .report__screen { height: auto; aspect-ratio: 16 / 10; }
}
@media (max-width: 700px) {
    .carousel.is-grid .carousel__stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .carousel.is-grid .cart { width: 100%; left: auto; height: 172px; }
    .carousel.is-grid .cart__thumb { height: 80px; }
    .vault-freq { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
    .vault-freq::-webkit-scrollbar { display: none; }
    .freq { flex: none; }
    .carousel { grid-template-columns: 1fr; }
    .carousel__nav { display: none; }
    .carousel__stage { height: 200px; }
    .cart { width: 104px; height: 156px; left: calc(50% - 52px); padding: 6px; }
    .cart__thumb { height: 70px; }
    .cart__name { font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cart { transition: none; }
    .report.is-switching * { animation: none !important; }
}
