/* =========================================================================
   projects.css — Portafolio: escenario (vista previa + información),
   selector escalable, galería y ventana de detalles.
   ========================================================================= */

/* Las ventanas entran desde un lateral (translateX); el recorte horizontal de la
   sección evita que esa animación ensanche el documento en móviles. */
.projects { overflow-x: clip; }

.projects-head {
    display: grid;
    gap: 22px;
    margin-bottom: clamp(32px, 4vw, 52px);
}

@media (min-width: 1024px) {
    .projects-head {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }
}

.projects-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.projects-filters[hidden] { display: none; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--fast) ease, border-color var(--fast) ease, background-color var(--fast) ease;
}

.filter-btn small { color: var(--blue-pale); font-family: var(--mono); font-size: 0.7rem; }
.filter-btn:hover { color: var(--text); border-color: var(--line-blue); }
.filter-btn[aria-pressed="true"] { border-color: var(--blue); background: rgba(37, 99, 235, 0.16); color: var(--text); }

/* -------------------------------- Escenario -------------------------------- */
.stage { position: relative; }

.stage-loading {
    padding: 60px 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.85rem;
    text-align: center;
}

.stage-card {
    display: grid;
    gap: clamp(26px, 4vw, 56px);
    align-items: center;
}

@media (min-width: 900px) {
    .stage-card { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

.stage-card > * { min-width: 0; }

.stage-preview {
    position: relative;
    min-width: 0;
    perspective: 1200px;
}

/* Marco de navegador para capturas (y para la portada provisional) */
.browser {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(147, 197, 253, 0.24);
    border-radius: 18px;
    background: #081022;
    box-shadow:
        0 50px 100px -50px rgba(37, 99, 235, 0.85),
        0 0 0 6px color-mix(in srgb, var(--ink) 50%, transparent),
        inset 0 1px rgba(255, 255, 255, 0.06);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transform-style: preserve-3d;
    transition: transform 600ms var(--ease);
}

.browser::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--gx, 50%) var(--gy, 0%), rgba(147, 197, 253, 0.1), transparent 45%);
    pointer-events: none;
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 38px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #0e1730, #0a1226);
}

.browser-dots { display: inline-flex; gap: 6px; flex: none; }
.browser-dots i { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.browser-dots i:nth-child(1) { background: #f87171; }
.browser-dots i:nth-child(2) { background: #fbbf24; }
.browser-dots i:nth-child(3) { background: #34d399; }

.browser-url {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    max-width: 420px;
    margin-inline: auto;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
}

.browser-url span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.browser-url .i { flex: none; color: var(--blue-pale); }

.browser-view {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

/* Capturas con transición cruzada */
.slides, .slide { position: absolute; inset: 0; margin: 0; }

.slide {
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 600ms ease, transform 900ms var(--ease);
}

.slide.is-current { opacity: 1; transform: none; }

.slide img,
.browser-view > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.slide-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 75%, transparent);
    color: var(--text);
    opacity: 0.85;
    transition: opacity var(--fast) ease, background-color var(--fast) ease;
}

.slide-arrow:hover { opacity: 1; background: rgba(37, 99, 235, 0.45); }
.slide-arrow--prev { left: 12px; }
.slide-arrow--next { right: 12px; }

.slide-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--ink) 70%, transparent);
    transform: translateX(-50%);
}

.slide-dots button {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.5);
    transition: width var(--mid) var(--ease), background-color var(--fast) ease;
}

.slide-dots button[aria-current="true"] { width: 22px; background: var(--cyan); }

/* Portada gráfica provisional (sin captura) */
.cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(420px 280px at 50% 55%, rgba(37, 99, 235, 0.38), transparent 70%),
        radial-gradient(300px 200px at 85% 10%, rgba(99, 102, 241, 0.25), transparent 70%),
        linear-gradient(160deg, #0b1630, #060b18);
}

.cover-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
    mask-image: radial-gradient(closest-side, #000, transparent);
}

.cover-rings {
    position: absolute;
    width: 58%;
    aspect-ratio: 1;
    border: 1px dashed rgba(147, 197, 253, 0.2);
    border-radius: 50%;
}

.cover-rings::before,
.cover-rings::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(147, 197, 253, 0.14);
    border-radius: 50%;
}

.cover-rings::before { inset: 20%; }
.cover-rings::after { inset: -22%; border-color: rgba(147, 197, 253, 0.07); }

.cover-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(72px, 16%, 112px);
    aspect-ratio: 1;
    border: 1px solid rgba(147, 197, 253, 0.4);
    border-radius: 28%;
    background: linear-gradient(150deg, rgba(59, 130, 246, 0.5), rgba(29, 78, 216, 0.25));
    box-shadow: 0 20px 60px -10px rgba(37, 99, 235, 0.9), inset 0 1px rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.preview-float {
    position: absolute;
    display: grid;
    place-items: center;
    width: clamp(40px, 8%, 54px);
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
    border-radius: 30%;
    background: color-mix(in srgb, var(--ink-2) 92%, transparent);
    box-shadow: 0 0 28px -8px var(--c);
    color: var(--c);
    font-size: 1.2rem;
    animation: float 7s ease-in-out infinite;
}

.preview-float--1 { top: 18%; left: 16%; }
.preview-float--2 { top: 22%; right: 15%; animation-delay: -2.3s; }
.preview-float--3 { bottom: 18%; left: 25%; animation-delay: -4.6s; }

.cover-tag {
    position: absolute;
    right: 16px;
    bottom: 14px;
    padding: 4px 10px;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    background: color-mix(in srgb, var(--ink) 70%, transparent);
    color: var(--blue-pale);
    font-family: var(--mono);
    font-size: 0.66rem;
}

.cover--mini .cover-rings { width: 80%; }
.cover--mini .cover-icon { width: 46%; font-size: 1.15rem; border-radius: 30%; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.is-paused .preview-float { animation-play-state: paused; }

.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid rgba(252, 211, 77, 0.3);
    border-radius: 99px;
    color: #fde68a;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stage-badge .i { color: #fcd34d; }

/* -------------------------------- Información -------------------------------- */
.stage-info { min-width: 0; }

.stage-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.stage-count {
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.stage-count i { color: var(--muted); font-style: normal; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 11px;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    color: var(--text-soft);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue-pale);
}

.status.is-live { border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.status.is-live::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status.is-dev { border-color: rgba(251, 191, 36, 0.35); color: #fcd34d; }
.status.is-dev::before { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }

.stage-category {
    margin-top: 18px;
    color: var(--blue-pale);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stage-info h3 {
    margin-top: 10px;
    font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stage-summary {
    margin-top: 14px;
    color: var(--text-soft);
}

.stage-features {
    display: grid;
    gap: 8px 18px;
    margin-top: 20px;
}

@media (min-width: 560px) {
    .stage-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stage-features li {
    display: flex;
    gap: 9px;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

.stage-features .i { margin-top: 0.28em; color: var(--cyan); font-size: 0.78rem; }
.stage-features .more { color: var(--muted); font-family: var(--mono); font-size: 0.76rem; }

.tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 20px;
}

.tech-chips li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 9px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-soft);
    font-size: 0.8rem;
    transition: border-color var(--fast) ease;
}

.tech-chips li:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.tech-chips .i { color: var(--c); font-size: 0.95rem; }

.stage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

/* Transiciones entre proyectos */
.stage-card.is-leaving { animation: stage-out 240ms ease both; }
.stage-card.is-entering .browser { animation: preview-in 800ms var(--ease) both; }
.stage-card.is-entering .stage-info > * { animation: info-in 700ms var(--ease) both; }
.stage-card.is-entering .stage-info > *:nth-child(2) { animation-delay: 60ms; }
.stage-card.is-entering .stage-info > *:nth-child(3) { animation-delay: 110ms; }
.stage-card.is-entering .stage-info > *:nth-child(4) { animation-delay: 160ms; }
.stage-card.is-entering .stage-info > *:nth-child(5) { animation-delay: 210ms; }
.stage-card.is-entering .stage-info > *:nth-child(n+6) { animation-delay: 260ms; }

@keyframes stage-out { to { opacity: 0; transform: translateX(calc(var(--dir, 1) * -24px)); } }

@keyframes preview-in {
    from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 40px)) scale(0.97); clip-path: inset(0 0 0 0 round 18px); }
    to { opacity: 1; transform: none; }
}

@keyframes info-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* -------------------------------- Selector -------------------------------- */
.selector {
    margin-top: clamp(36px, 5vw, 60px);
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.selector[hidden] { display: none; }

.selector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.selector-label {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.selector-step { display: flex; gap: 8px; }

.selector-step button,
.pick-pager button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    color: var(--text);
    transition: border-color var(--fast) ease, background-color var(--fast) ease, transform var(--mid) var(--ease);
}

.selector-step button:hover,
.pick-pager button:hover:not(:disabled) { border-color: var(--line-blue); background: rgba(59, 130, 246, 0.14); }

.selector-step button:active,
.pick-pager button:active:not(:disabled) { transform: scale(0.94); }

.pick-pager button:disabled { opacity: 0.35; cursor: default; }

/* Con pocos proyectos las tarjetas reparten todo el ancho (--cols = cantidad visible). */
.picks {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
    gap: 12px;
}

.pick {
    position: relative;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 8px;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--ink-3) 70%, transparent), color-mix(in srgb, var(--ink-2) 40%, transparent));
    text-align: left;
    transition: border-color var(--mid) ease, background-color var(--mid) ease, transform var(--mid) var(--ease);
}

.pick:hover { border-color: var(--line-2); transform: translateY(-2px); }

.pick.is-active {
    border-color: rgba(96, 165, 250, 0.55);
    background:
        radial-gradient(300px 140px at 0% 0%, rgba(37, 99, 235, 0.2), transparent 70%),
        linear-gradient(160deg, color-mix(in srgb, var(--ink-3) 90%, transparent), color-mix(in srgb, var(--ink-2) 50%, transparent));
}

.pick-thumb {
    position: relative;
    grid-row: 1 / span 2;
    display: block;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: #081022;
}

.pick-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.pick-text { display: grid; gap: 2px; min-width: 0; }

.pick-num { color: var(--blue-pale); font-family: var(--mono); font-size: 0.66rem; }

.pick-text b {
    overflow: hidden;
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pick-text small { color: var(--muted); font-size: 0.78rem; }

.pick-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.66rem;
}

.pick-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-pale); }
.pick-status.is-live i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pick-status.is-dev i { background: #fbbf24; }

/* Indicador de selección */
.pick-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 12px var(--cyan);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 600ms var(--ease);
}

.pick.is-active .pick-bar { transform: none; }

.pick-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.76rem;
}

.pick-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed var(--line-2);
    border-radius: 14px;
    color: var(--blue-pale);
    font-size: 0.86rem;
    font-weight: 500;
}

.pick-more[aria-expanded="true"] .i { transform: rotate(180deg); }

@media (max-width: 899px) {
    .picks { grid-template-columns: 1fr; gap: 8px; }
    .pick { grid-template-columns: 72px minmax(0, 1fr); padding: 10px; border-radius: 14px; }
}

@media (max-width: 420px) {
    .pick { grid-template-columns: 60px minmax(0, 1fr); column-gap: 12px; }
    .browser-bar { height: 32px; padding: 0 10px; }
    .browser-dots i { width: 7px; height: 7px; }
    .stage-badge { top: 42px; }
    .stage-actions .btn { flex: 1 1 100%; }
}

/* ------------------------------ Ventana de detalle ------------------------------ */
/* Dos columnas en escritorio: vista previa, tecnologías y enlace a la izquierda;
   título, descripción y funcionalidades a la derecha. Cabe sin desplazamiento. */
.project-dialog {
    width: min(1100px, calc(100% - 40px));
    max-height: min(88vh, 760px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: var(--r-xl);
    background:
        radial-gradient(700px 400px at 0% 0%, rgba(37, 99, 235, 0.14), transparent 60%),
        var(--panel-solid);
    color: var(--text-soft);
    box-shadow: 0 40px 140px -20px var(--shadow), 0 0 80px -30px var(--glow);
}

.project-dialog::backdrop {
    background: rgba(2, 5, 12, 0.76);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.project-dialog[open] { animation: dialog-in 520ms var(--ease) both; }
.project-dialog[open]::backdrop { animation: fade-in 320ms ease both; }
.project-dialog.is-closing { animation: dialog-out 240ms ease both; }
.project-dialog.is-closing::backdrop { animation: fade-out 240ms ease both; }

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes dialog-out { to { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.dialog-inner {
    max-height: min(88vh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dialog-grid {
    display: grid;
    min-height: 0;
}

@media (min-width: 900px) {
    .dialog-inner { overflow: hidden; }
    .dialog-grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); max-height: min(88vh, 760px); }
    .dialog-side, .dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
    .dialog-side { border-right: 1px solid var(--line); background: rgba(127, 148, 190, 0.03); }
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: var(--glass);
    color: var(--text);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background-color var(--fast) ease, transform var(--mid) var(--ease);
}

.dialog-close:hover { background: rgba(37, 99, 235, 0.35); transform: rotate(90deg); }

.dialog-side {
    display: grid;
    align-content: start;
    gap: 18px;
    padding: 22px;
}

.dialog-media .browser { box-shadow: 0 30px 70px -40px var(--glow); }
.dialog-media .browser-view { aspect-ratio: 16 / 10; }
.dialog-media .browser-view > img.is-swapping { animation: info-in 500ms var(--ease) both; }

.dialog-thumbs {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    overflow-x: auto;
}

.dialog-thumb {
    flex: none;
    width: 76px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    opacity: 0.55;
    transition: opacity var(--fast) ease, border-color var(--fast) ease;
}

.dialog-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dialog-thumb[aria-current="true"], .dialog-thumb:hover { opacity: 1; border-color: var(--blue); }

.dialog-body { padding: 26px 30px 28px; }
.dialog-body .stage-category { margin-top: 0; }

.dialog-body h3 {
    margin-top: 12px;
    padding-right: 44px;
    font-family: var(--display);
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.dialog-desc { margin-top: 12px; font-size: 0.94rem; line-height: 1.65; }

.dialog-block h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dialog-block h4 .i { color: var(--accent-text); font-size: 0.8rem; }
.dialog-block h4 span { padding: 0 6px; border-radius: 5px; background: var(--chip); color: var(--text-soft); letter-spacing: 0; }
.dialog-tech .tech-chips { margin-top: 0; }

.dialog-feats {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.dialog-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}

.dialog-features li {
    display: flex;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--chip);
    font-size: 0.86rem;
    line-height: 1.4;
    transition: border-color var(--fast) ease, background-color var(--fast) ease;
}

.dialog-features li:hover { border-color: var(--line-blue); background: var(--chip-hover); }
.project-dialog[open] .dialog-features li { animation: info-in 520ms var(--ease) both calc(120ms + var(--i) * 35ms); }
.dialog-features .i { flex: none; margin-top: 0.25em; color: var(--cyan); font-size: 0.78rem; }

.dialog-note {
    display: flex;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.dialog-note .i { flex: none; margin-top: 0.2em; color: var(--accent-text); }
.dialog-note--soon .i { color: var(--warn); }

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dialog-actions .btn { flex: 1 1 auto; }

@media (max-width: 899px) {
    .dialog-side { display: contents; }
    .dialog-grid { padding-bottom: 0; }
    .dialog-media { order: 1; padding: 16px 16px 0; }
    .dialog-body { order: 2; padding: 20px 20px 6px; }
    .dialog-tech { order: 3; padding: 14px 20px 0; }
    .dialog-note { order: 4; margin: 12px 20px 0; }
    .dialog-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        order: 5;
        margin-top: 16px;
        padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: var(--glass);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
    .dialog-media .browser-view { aspect-ratio: 16 / 9; }
    .dialog-features { grid-template-columns: 1fr; gap: 6px; }
    .dialog-features li { padding: 7px 10px; }
}

@media (max-width: 640px) {
    .project-dialog {
        width: 100%;
        max-width: 100%;
        max-height: 92svh;
        margin: auto auto 0;
        border-radius: 24px 24px 0 0;
    }

    .project-dialog[open] { animation: sheet-in 460ms var(--ease) both; }
    .dialog-inner { max-height: 92svh; }
    .dialog-close { top: 22px; right: 22px; }
}

@keyframes sheet-in { from { transform: translateY(40%); opacity: 0; } }

@media (max-width: 560px) {
    .preview-float--1 { top: auto; bottom: 22%; left: auto; right: 12%; }
    .preview-float--2 { top: 16%; right: 10%; }
}

/* =====================================================================
   Product showcase: ventana principal + ventanas secundarias
   ===================================================================== */
.stage-visual {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.stage-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding-inline: 4%;
}

.win {
    position: relative;
    min-width: 0;
    padding: 0 0 14px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--ink-3) 92%, transparent), color-mix(in srgb, var(--ink-2) 92%, transparent));
    box-shadow: 0 24px 50px -30px rgba(37, 99, 235, 0.8);
}

.win:only-child { grid-column: 1 / -1; }

.win-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.win-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.win-rotator {
    position: relative;
    min-height: 2.9em;
    margin: 0 12px;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.4;
}

.win-rotator li {
    position: absolute;
    inset: 0 0 auto;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 500ms ease, transform 600ms var(--ease);
}

.win-rotator li.is-current { opacity: 1; transform: none; }

.win-layers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 0 12px;
    font-family: var(--mono);
    font-size: 0.64rem;
}

.win-layers span {
    padding: 3px 7px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--blue-pale);
    white-space: nowrap;
}

.win-layers i { width: 8px; height: 1px; background: var(--cyan); }

.stage-card.is-entering .win { animation: info-in 700ms var(--ease) both; }
.stage-card.is-entering .win + .win { animation-delay: 90ms; }

.win-zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: color-mix(in srgb, var(--ink) 78%, transparent);
    color: var(--text);
}

.win-zoom:hover { background: rgba(37, 99, 235, 0.5); }

.stage-note {
    display: flex;
    gap: 9px;
    margin-top: 18px;
    padding: 10px 12px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.05);
    color: var(--text-soft);
    font-size: 0.84rem;
}

.stage-note .i { margin-top: 0.25em; flex: none; color: #fcd34d; }

/* --------------------------- Representaciones conceptuales --------------------------- */
.concept {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 3.5%;
    padding: 4.5%;
    background:
        radial-gradient(420px 260px at 70% 20%, rgba(37, 99, 235, 0.22), transparent 70%),
        linear-gradient(160deg, #0b1530, #060b18);
}

.concept i, .concept span, .concept b { display: block; }

.concept-tag {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: calc(100% - 24px);
    padding: 5px 10px;
    border: 1px solid rgba(147, 197, 253, 0.35);
    border-radius: 99px;
    background: color-mix(in srgb, var(--ink) 86%, transparent);
    color: var(--blue-ice);
    font-family: var(--mono);
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Generador: menú, formulario con validaciones y salida estructurada */
.concept--generator { grid-template-columns: 12% 1fr 1fr; padding-bottom: 12%; }

.cg-side {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 12px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.cg-side i { height: 8px; border-radius: 4px; background: rgba(148, 163, 184, 0.18); }
.cg-side i.on { background: var(--blue); box-shadow: 0 0 10px rgba(59, 130, 246, 0.7); }

.cg-main { display: grid; align-content: start; gap: 12px; }
.cg-title { width: 58%; height: 12px; border-radius: 6px; background: rgba(226, 232, 240, 0.5); }
.cg-form { display: grid; gap: 8px; }

.cg-form span {
    height: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
}

.cg-form .short { width: 60%; }
.cg-checks { display: flex; gap: 6px; }

.concept .cg-checks b {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-style: normal;
}

.cg-checks .ok { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.cg-checks .warn { background: rgba(251, 191, 36, 0.16); color: #fcd34d; }

.cg-btn {
    width: 46%;
    height: 24px;
    border-radius: 7px;
    background: linear-gradient(90deg, var(--blue-strong), var(--blue));
    box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.9);
}

.cg-code {
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 14px 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(2, 6, 16, 0.75);
}

.cg-code i {
    width: var(--w);
    height: 7px;
    margin-left: var(--x, 0);
    border-radius: 4px;
    background: linear-gradient(90deg, #60a5fa 0 22%, #86efac 22% 60%, rgba(148, 163, 184, 0.35) 60%);
    opacity: 0.75;
}

/* Observatorio: filtros, indicadores, cartografía abstracta y gráfica */
.concept--dashboard {
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: auto auto 1fr;
    padding-bottom: 12%;
}

.cd-filters { grid-column: 1 / -1; display: flex; gap: 8px; }
.cd-filters span { width: 18%; height: 18px; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 6px; }
.cd-filters b { width: 12%; height: 18px; margin-left: auto; border-radius: 6px; background: rgba(52, 211, 153, 0.4); }

.cd-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.cd-kpis span {
    display: grid;
    gap: 6px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
}

.cd-kpis b { width: 50%; height: 10px; border-radius: 4px; background: rgba(226, 232, 240, 0.55); }
.cd-kpis i { width: 80%; height: 5px; border-radius: 3px; background: rgba(148, 163, 184, 0.25); }

.cd-map {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
    padding: 6px;
    border-radius: 10px;
    background: rgba(2, 6, 16, 0.6);
}

.cd-map i {
    grid-row: calc(var(--r) + 1);
    grid-column: calc(var(--c) + 1);
    border-radius: 4px;
    background: rgba(56, 189, 248, var(--v));
}

.cd-chart {
    display: flex;
    align-items: flex-end;
    gap: 7%;
    padding: 10px 8px 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.cd-chart i {
    flex: 1;
    height: var(--h);
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #ff6384, rgba(255, 99, 132, 0.25));
    transform-origin: bottom;
}

.stage-card.is-entering .cd-chart i,
.stage-card.is-entering .cg-code i { animation: grow-in 900ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 200ms); }

@keyframes grow-in { from { transform: scaleY(0.1); opacity: 0; } }

/* -------------------------------------- Lightbox -------------------------------------- */
.lightbox {
    width: min(1280px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 18px;
    background: #050914;
}

.lightbox::backdrop { background: rgba(2, 5, 12, 0.88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox[open] { animation: dialog-in 420ms var(--ease) both; }
.lightbox img { display: block; width: 100%; max-height: calc(100vh - 26px); object-fit: contain; cursor: zoom-out; }

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 85%, transparent);
    color: var(--text);
}

@media (max-width: 520px) {
    .stage-secondary { grid-template-columns: 1fr; padding-inline: 0; }
    .concept { padding: 4%; gap: 3%; }
    .concept--generator { grid-template-columns: 14% 1fr; }
    .cg-code { display: none; }
    .concept-tag { font-size: 0.56rem; }
}

/* ------------------------------- Tema claro ------------------------------- */
[data-theme="light"] .status.is-live { color: #15803d; border-color: rgba(21, 128, 61, 0.35); }
[data-theme="light"] .status.is-dev { color: #b45309; border-color: rgba(180, 83, 9, 0.35); }
[data-theme="light"] .stage-badge { color: #92400e; }
[data-theme="light"] .stage-badge .i, [data-theme="light"] .stage-note .i { color: #b45309; }
[data-theme="light"] .project-dialog::backdrop { background: rgba(30, 41, 59, 0.45); }
