/* ═══════════════════════════════════════════════
   PROJECTS SLIDER — prefijo: ps-
   Estilo cinematográfico con mockups CSS
═══════════════════════════════════════════════ */

#projects {
    padding: 100px 0;
    background: var(--c-bg);
    position: relative;
    overflow: hidden;
}

#projects::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 40% at 15% 50%, rgba(249,115,22,.05) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 85% 20%, rgba(59,130,246,.05) 0%, transparent 55%);
    pointer-events: none;
}

/* ── HEADER ── */
.ps-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.ps-header-left { max-width: 560px; }

.ps-github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 10px;
    border: 1px solid var(--c-border2);
    color: var(--c-muted);
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    flex-shrink: 0;
}

.ps-github-link:hover {
    color: var(--c-text);
    border-color: var(--c-cyan);
    background: rgba(249,115,22,.05);
}

/* ── SLIDER WRAPPER ── */
.ps-slider-wrap {
    position: relative;
    z-index: 1;
}

/* track visible */
.ps-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    cursor: grab;
}

.ps-track:active { cursor: grabbing; }
.ps-track::-webkit-scrollbar { display: none; }

/* fades laterales */
.ps-slider-wrap::before,
.ps-slider-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 4px;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.ps-slider-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--c-bg), transparent);
}

.ps-slider-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--c-bg), transparent);
}

/* ── CARD ── */
.ps-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 420px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    transition:
        border-color .3s ease,
        box-shadow .3s ease,
        transform .35s cubic-bezier(.34,1.1,.64,1);
    position: relative;
}

.ps-card:hover {
    border-color: var(--c-border2);
    transform: translateY(-8px);
    box-shadow:
        0 24px 60px rgba(0,0,0,.45),
        0 0 0 1px rgba(249,115,22,.12);
}

/* card destacada más grande */
.ps-card.ps-featured {
    width: 560px;
}

/* ── MOCKUP AREA ── */
.ps-mockup {
    height: 260px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.ps-card.ps-featured .ps-mockup {
    height: 320px;
}

/* fondo del mockup */
.ps-mockup-bg {
    position: absolute;
    inset: 0;
    transition: transform .6s ease;
}

.ps-card:hover .ps-mockup-bg {
    transform: scale(1.04);
}

/* ── MOCKUPS CSS POR PROYECTO ── */

/* Bagrie Shop — E-commerce dashboard */
.ps-mock-bagrie {
    background: linear-gradient(160deg, #0a1628 0%, #0f2040 50%, #081428 100%);
}

.ps-mock-bagrie::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 60% 40%, rgba(0,180,255,.08) 0%, transparent 65%),
        radial-gradient(ellipse 40% 40% at 20% 70%, rgba(0,120,255,.06) 0%, transparent 55%);
}

/* ventana de app */
.ps-app-window {
    position: absolute;
    background: #0d1f3a;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    overflow: hidden;
}

.ps-app-titlebar {
    height: 28px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 5px;
}

.ps-titlebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ps-app-content {
    padding: 10px;
}

/* mini stats */
.ps-mini-stats {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.ps-mini-stat {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255,255,255,.04);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.06);
}

.ps-mini-stat-val {
    font-size: 10px;
    font-weight: 800;
    color: #4fc3f7;
    line-height: 1;
    margin-bottom: 2px;
    font-family: 'JetBrains Mono', monospace;
}

.ps-mini-stat-label {
    font-size: 8px;
    color: rgba(255,255,255,.3);
}

/* mini chart line */
.ps-mini-chart {
    height: 32px;
    background: rgba(255,255,255,.02);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ps-chart-line {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
}

/* mini table */
.ps-mini-table { margin-top: 6px; }

.ps-mini-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 7px;
    color: rgba(255,255,255,.4);
}

.ps-mini-row-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ps-mini-badge {
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 6px;
    font-weight: 700;
    margin-left: auto;
}

/* Cotizaciones — Fintech */
.ps-mock-cotiz {
    background: linear-gradient(160deg, #041018 0%, #071c1c 50%, #041018 100%);
}

.ps-mock-cotiz::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 50% at 50% 40%, rgba(0,230,180,.07) 0%, transparent 60%);
}

/* Candlestick chart SVG decoration */
.ps-candle-wrap {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 140px;
    background: rgba(0,0,0,.3);
    border-radius: 8px;
    border: 1px solid rgba(0,230,180,.12);
    overflow: hidden;
    padding: 10px;
}

.ps-candle-header {
    font-size: 8px;
    color: rgba(0,230,180,.6);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.ps-candle-price {
    font-size: 18px;
    font-weight: 800;
    color: #00e6b4;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin-bottom: 8px;
}

.ps-candle-change {
    font-size: 9px;
    color: #00e6b4;
    margin-left: 8px;
}

/* OESTECH — Corporativo */
.ps-mock-oestech {
    background: linear-gradient(160deg, #0a0a14 0%, #12101e 50%, #0a0a14 100%);
}

.ps-mock-oestech::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 50% at 60% 30%, rgba(108,71,255,.1) 0%, transparent 60%);
}

/* E-Commerce Esol — Backend */
.ps-mock-esol {
    background: linear-gradient(160deg, #0a1418 0%, #0f2028 50%, #0a1418 100%);
}

.ps-mock-esol::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 50% at 40% 40%, rgba(79,158,255,.08) 0%, transparent 60%);
}

/* Back-End Node.js */
.ps-mock-nodejs {
    background: linear-gradient(160deg, #081408 0%, #0f200f 50%, #081408 100%);
}

.ps-mock-nodejs::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 50% at 50% 40%, rgba(68,222,128,.07) 0%, transparent 60%);
}

/* Portfolio EquiCode */
.ps-mock-portfolio {
    background: linear-gradient(160deg, #140a08 0%, #201208 50%, #140a08 100%);
}

.ps-mock-portfolio::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 50% at 50% 40%, rgba(249,115,22,.1) 0%, transparent 60%);
}

/* ── FLOATING UI ELEMENTS (genéricos) ── */
.ps-float-card {
    position: absolute;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 8px 12px;
    backdrop-filter: blur(8px);
}

.ps-float-label {
    font-size: 7px;
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 3px;
}

.ps-float-val {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.ps-float-sub {
    font-size: 8px;
    margin-top: 2px;
}

/* terminal mockup */
.ps-terminal {
    position: absolute;
    background: #0d1117;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    padding: 10px 12px;
    line-height: 1.8;
}

.ps-terminal-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.ps-t-line { display: block; }
.ps-t-green  { color: #4ade80; }
.ps-t-blue   { color: #60a5fa; }
.ps-t-orange { color: #fb923c; }
.ps-t-muted  { color: rgba(255,255,255,.25); }
.ps-t-cursor {
    display: inline-block;
    width: 6px;
    height: 11px;
    background: #60a5fa;
    vertical-align: middle;
    animation: psCursor .8s steps(1) infinite;
}

@keyframes psCursor { 0%,100%{opacity:1} 50%{opacity:0} }

/* browser mockup */
.ps-browser {
    position: absolute;
    background: #111827;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    overflow: hidden;
}

.ps-browser-bar {
    height: 26px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 5px;
}

.ps-url-bar {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,.06);
    border-radius: 4px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    padding: 0 6px;
}

.ps-url-text {
    font-size: 7px;
    color: rgba(255,255,255,.25);
    font-family: 'JetBrains Mono', monospace;
}

.ps-browser-body {
    padding: 10px;
}

/* grid de componentes UI */
.ps-ui-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.ps-ui-block {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 5px;
    padding: 6px 8px;
}

.ps-ui-block-title {
    font-size: 7px;
    color: rgba(255,255,255,.3);
    margin-bottom: 4px;
}

.ps-ui-block-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.06);
    margin-bottom: 3px;
    overflow: hidden;
}

.ps-ui-block-fill {
    height: 100%;
    border-radius: 2px;
}

/* ── OVERLAY CINEMATOGRÁFICO ── */
.ps-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5,5,10,.92) 0%,
        rgba(5,5,10,.4)  45%,
        rgba(5,5,10,.1)  70%,
        transparent      100%
    );
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    gap: 8px;
}

.ps-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    font-size: .68rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    letter-spacing: .08em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    width: fit-content;
}

.ps-card-title-overlay {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.03em;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0,0,0,.5);
}

.ps-card.ps-featured .ps-card-title-overlay {
    font-size: 1.9rem;
}

/* ── CARD BODY ── */
.ps-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.ps-card-desc {
    font-size: .84rem;
    color: var(--c-muted);
    line-height: 1.7;
    margin: 0;
}

/* problema resuelto */
.ps-problem {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(249,115,22,.06);
    border: 1px solid rgba(249,115,22,.18);
    font-size: .78rem;
    color: var(--c-muted);
    line-height: 1.5;
}

.ps-problem strong {
    color: var(--c-cyan);
    font-weight: 600;
}

/* stack pills */
.ps-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ps-stack-pill {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 600;
    background: rgba(59,130,246,.08);
    border: 1px solid rgba(59,130,246,.2);
    color: var(--c-violet);
    font-family: 'JetBrains Mono', monospace;
}

/* card footer */
.ps-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
    margin-top: auto;
}

.ps-year {
    font-size: .7rem;
    color: var(--c-hint);
    font-family: 'JetBrains Mono', monospace;
}

.ps-btns {
    display: flex;
    gap: 7px;
}

.ps-btn-demo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--c-cyan2), var(--c-violet2));
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(249,115,22,.3);
}

.ps-btn-demo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249,115,22,.45);
}

.ps-btn-gh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--c-border2);
    color: var(--c-muted);
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    transition: color .2s, border-color .2s, background .2s;
}

.ps-btn-gh:hover {
    color: var(--c-text);
    border-color: var(--c-hint);
    background: rgba(255,255,255,.04);
}

/* ── NAVEGACIÓN DEL SLIDER ── */
.ps-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    position: relative;
    z-index: 1;
}

/* dots */
.ps-dots {
    display: flex;
    gap: 6px;
}

.ps-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-border2);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .25s, transform .25s, width .3s;
}

.ps-dot.active {
    background: var(--c-cyan);
    width: 20px;
    border-radius: 3px;
}

/* flechas */
.ps-arrows {
    display: flex;
    gap: 8px;
}

.ps-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    color: var(--c-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all .22s;
}

.ps-arrow:hover {
    background: rgba(249,115,22,.1);
    border-color: var(--c-cyan);
    color: var(--c-cyan);
    transform: scale(1.08);
}

.ps-arrow:disabled {
    opacity: .3;
    cursor: default;
    transform: none;
}

/* ── LIGHT MODE ── */
[data-theme="light"] .ps-card { background: #fff; }
[data-theme="light"] #projects { background: var(--c-bg); }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
    #projects { padding: 70px 0; }
    .ps-header { flex-direction: column; align-items: flex-start; }
    .ps-card { width: 320px; }
    .ps-card.ps-featured { width: 340px; }
    .ps-mockup { height: 200px; }
    .ps-card.ps-featured .ps-mockup { height: 220px; }
    .ps-card-title-overlay { font-size: 1.2rem; }
    .ps-card.ps-featured .ps-card-title-overlay { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .ps-card, .ps-card.ps-featured { width: 280px; }
    .ps-btns { flex-direction: column; }
    .ps-btn-demo, .ps-btn-gh { justify-content: center; }
}