/* =========================================================
   PROYECTOS - estilos solo para proyectos.html
   ========================================================= */

/* ---------- HERO INTERACTIVO ---------- */
.ph-hero {
    position: relative;
    overflow: hidden;
    padding: 150px 0 90px;
    background: linear-gradient(135deg, #f5f9ff 0%, #e3f0fd 100%);
}
.ph-hero::before {
    content: "";
    position: absolute;
    right: -180px;
    top: -120px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,165,233,.18), rgba(37,99,235,0) 70%);
    pointer-events: none;
}
.ph-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 48px;
}
.ph-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: .9rem;
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(37,99,235,.12);
    margin-bottom: 22px;
}
.ph-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,.6);
    animation: ph-pulse 1.8s infinite;
}
.ph-title {
    font-size: clamp(2.3rem, 5.5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.08;
    color: #0f172a;
    margin: 0 0 18px;
}
.ph-title .ph-gradient {
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ph-rotator {
    display: inline-block;
    min-width: 6ch;
    border-right: 3px solid #2563eb;
    padding-right: 4px;
    animation: ph-caret .8s step-end infinite;
}
.ph-text {
    font-size: 1.15rem;
    color: #475569;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 0 30px;
}
.ph-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 40px;
}
.ph-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.ph-btn-primary {
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37,99,235,.3);
}
.ph-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37,99,235,.38); }
.ph-btn-ghost {
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
}
.ph-btn-ghost:hover { background: #2563eb; color: #fff; }

/* Contadores */
.ph-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
}
.ph-stat strong {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}
.ph-stat span {
    font-size: .9rem;
    color: #64748b;
}

/* Ilustración con parallax */
.ph-visual {
    position: relative;
    perspective: 900px;
}
.ph-visual img {
    display: block;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    transition: transform .15s ease-out;
    animation: ph-float 6s ease-in-out infinite;
}
.ph-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 10px 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: .9rem;
    color: #0f172a;
    box-shadow: 0 12px 28px rgba(15,23,42,.12);
    transition: transform .15s ease-out;
}
.ph-chip i { color: #2563eb; }
.ph-chip-1 { top: 6%; left: -2%; }
.ph-chip-2 { bottom: 8%; right: -2%; }

/* ---------- SECCIÓN PROYECTOS ---------- */
.ph-section { padding: 80px 0 100px; background: #fff; }
.ph-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 36px;
}
.ph-head h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 10px;
}
.ph-head p { color: #64748b; font-size: 1.05rem; margin: 0; }

.ph-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 44px;
}
.ph-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #dbeafe;
    background: #f8fbff;
    color: #1e3a8a;
    padding: 10px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: all .2s ease;
}
.ph-filter .count {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
}
.ph-filter:hover { border-color: #2563eb; }
.ph-filter.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.ph-filter.active .count { background: rgba(255,255,255,.25); color: #fff; }

.ph-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}
.ph-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #eef2f7;
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
    opacity: 0;
    transform: translateY(24px);
}
.ph-card.visible { opacity: 1; transform: translateY(0); }
.ph-card.visible:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 44px rgba(37,99,235,.16);
}
.ph-card.hidden { display: none; }

.ph-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e2e8f0;
}
.ph-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}
.ph-card:hover .ph-media img { transform: scale(1.06); }
.ph-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,.55);
    opacity: 0;
    transition: opacity .3s ease;
}
.ph-card:hover .ph-overlay { opacity: 1; }
.ph-overlay a {
    background: #fff;
    color: #2563eb;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 999px;
    text-decoration: none;
}

/* Logos: se ven completos */
.ph-card[data-category="logos"] .ph-media { background: #f8fafc; }
.ph-card[data-category="logos"] .ph-media img { object-fit: contain; padding: 24px; }

.ph-body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.ph-tag {
    align-self: flex-start;
    background: #e0ecff;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
}
.ph-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.ph-card p {
    color: #475569;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}
.ph-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ph-tech span {
    font-size: .75rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ---------- PROCESO ---------- */
.ph-process { padding: 80px 0; background: #f8fbff; }
.ph-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.ph-step {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 8px 24px rgba(15,23,42,.05);
    position: relative;
}
.ph-step .num {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 2.4rem;
    font-weight: 900;
    color: #e0ecff;
}
.ph-step i {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    margin-bottom: 16px;
}
.ph-step h3 { font-size: 1.1rem; font-weight: 800; color: #0f172a; margin: 0 0 8px; }
.ph-step p { color: #64748b; line-height: 1.6; margin: 0; }

/* ---------- ANIMACIONES ---------- */
@keyframes ph-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes ph-caret { 50% { border-color: transparent; } }
@keyframes ph-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
    70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@media (prefers-reduced-motion: reduce) {
    .ph-visual img, .ph-badge .dot, .ph-rotator { animation: none; }
    .ph-card { opacity: 1; transform: none; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .ph-grid { grid-template-columns: 1fr; text-align: center; }
    .ph-text { margin-left: auto; margin-right: auto; }
    .ph-actions, .ph-stats { justify-content: center; }
    .ph-visual { max-width: 480px; margin: 0 auto; }
    .ph-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .ph-hero { padding: 120px 0 60px; }
    .ph-chip { display: none; }
    .ph-grid-cards { grid-template-columns: 1fr; }
    .ph-steps { grid-template-columns: 1fr; }
    .ph-stats { gap: 20px; }
}

/* ---------- RETO / SOLUCIÓN / IMPACTO (vista en la tarjeta) ---------- */
.ph-case h4 {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #2563eb;
    margin: 0 0 4px;
}
.ph-card .ph-case p { flex: none; }
.ph-reto p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* En la tarjeta solo se ven las tecnologías de la solución */
.ph-card .ph-solucion h4,
.ph-card .ph-solucion p { display: none; }
/* En la tarjeta solo se ve el primer resultado */
.ph-card .ph-impacto { margin-top: auto; }
.ph-card .ph-impacto h4 { display: none; }
.ph-card .ph-impacto ul { list-style: none; margin: 0; padding: 0; }
.ph-card .ph-impacto li:not(:first-child) { display: none; }
.ph-card .ph-impacto li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 700;
    font-size: .9rem;
    padding: 10px 12px;
    border-radius: 10px;
}
.ph-card .ph-impacto li::before {
    content: "▲";
    font-size: .7rem;
}

/* ---------- Distintivo para proyectos reales en línea (data-url) ---------- */
.ph-card[data-url] .ph-media::after {
    content: "● Sitio en línea";
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #fff;
    color: #059669;
    font-size: .75rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* =========================================================
   CATEGORÍAS DE PROYECTOS
   ========================================================= */
.ph-cats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
.ph-cats[hidden], .ph-panel[hidden], .ph-empty[hidden], .ph-grid-cards[hidden] { display: none !important; }
.ph-cat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    padding: 28px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ph-cat:hover, .ph-cat:focus-visible {
    transform: translateY(-6px);
    border-color: #93c5fd;
    box-shadow: 0 18px 40px rgba(37, 99, 235, .15);
    outline: none;
}
.ph-cat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    margin-bottom: 6px;
}
.ph-cat[data-cat="movil"] .ph-cat-icon { background: linear-gradient(135deg, #0891b2, #14b8a6); }
.ph-cat[data-cat="robotica"] .ph-cat-icon { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.ph-cat[data-cat="talleres"] .ph-cat-icon { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.ph-cat-title { font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.ph-cat-desc { color: #64748b; line-height: 1.55; font-size: .95rem; flex: 1; }
.ph-cat-count {
    margin-top: 6px;
    font-size: .8rem;
    font-weight: 800;
    color: #1d4ed8;
    background: #e0ecff;
    padding: 5px 12px;
    border-radius: 999px;
}
.ph-cat-count.pronto { color: #92400e; background: #fef3c7; }
.ph-cat-count::after { content: "  →"; }

.ph-panel-head {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.ph-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #dbeafe;
    background: #f8fbff;
    color: #1e3a8a;
    padding: 10px 18px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ph-back:hover { border-color: #2563eb; }
.ph-panel-title { font-size: 1.6rem; font-weight: 900; color: #0f172a; margin: 0; }

.ph-empty {
    text-align: center;
    max-width: 520px;
    margin: 10px auto 0;
    padding: 46px 30px;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    background: #f8fafc;
}
.ph-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #b45309;
    background: #fef3c7;
}
.ph-empty h4 { font-size: 1.3rem; font-weight: 800; color: #0f172a; margin: 0 0 8px; }
.ph-empty p { color: #64748b; line-height: 1.6; margin: 0 0 22px; }

@media (max-width: 1024px) { .ph-cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
    .ph-cats { grid-template-columns: 1fr; gap: 14px; }
    .ph-cat { padding: 20px; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .ph-cat-icon { width: 48px; height: 48px; font-size: 1.2rem; margin: 0; }
    .ph-cat-title { flex: 1; }
    .ph-cat-desc { flex-basis: 100%; }
    .ph-panel-title { font-size: 1.3rem; }
}
