/* ==========================================================================
   Page Section Styles - Introduction, Blog, YouTube, Footer
   ========================================================================== */

/* --- Introduction Section --- */

#intro.section {
    height: 100vh;
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 80vh;
}

.intro-description {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 300;
    min-height: 2em;
    height: 2em;
    display: flex;
    align-items: center;
    line-height: 1.3;
    overflow: hidden;
}

.intro-details p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-lighter);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-color);
    color: var(--bg-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Avatar */
.avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-frame {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--bg-lighter);
    border: 3px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--text-light);
}

.avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

/* --- Promo Popup --- */

.promo-popup {
    position: absolute;
    top: calc(var(--nav-height) + 30px);
    right: 40px;
    min-width: 320px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: var(--shadow-subtle);
    color: inherit;
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: promoSlideIn 0.6s ease 1s both;
}

.promo-popup[hidden] {
    display: none;
}

.promo-popup.is-hidden {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    pointer-events: none;
}

.promo-popup:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.promo-popup-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.9rem 1.2rem 0.9rem 1.2rem;
    color: inherit;
    text-decoration: none;
}

.promo-popup-link:focus-visible,
.promo-close:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.promo-icon {
    font-size: 1.5rem;
    color: var(--text-primary);
    flex-shrink: 0;
    margin-right: 0.85rem;
}

.promo-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 270px;
    flex: 1;
}

.promo-text strong {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.promo-text small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.promo-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.promo-popup:hover .promo-arrow {
    transform: translateX(4px);
    color: var(--accent-color);
}

.promo-popup:hover .promo-text small {
    color: var(--accent-color);
}

.promo-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: #333;
    color: var(--bg-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    font-size: 0.65rem;
}

.promo-close:hover {
    background: var(--accent-color);
    color: var(--bg-light);
    transform: rotate(90deg);
}

@keyframes promoSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Blog Section --- */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 255, 159, 0.1);
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.blog-date {
    color: var(--text-secondary);
}

.blog-category {
    background: var(--accent-color);
    color: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.8rem;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.blog-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 1rem;
}

/* --- Projects Section --- */

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-card {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.project-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* .chrome-icon {
    font-size: 60px;
    display: inline-block;
    background:
        radial-gradient(circle at center,
            #4285f4 0 18%,
            transparent 18% 24%,
            transparent 24%
        ),
        conic-gradient(
            from -30deg,
            #ea4335 0deg 120deg, 
            #fbbc05 120deg 240deg, 
            #34a853 240deg 360deg  
        );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
} */

/* .project-icon {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(
        from -30deg,
        #ea4335 0deg 120deg,
        #fbbc05 120deg 240deg,
        #34a853 240deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    overflow: hidden;
} */

/* .project-icon::after {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #7cb7ff, #1a73e8 70%, #185abc 100%);
    border: 5px solid #f1f3f4;
} */

.project-card:hover .project-icon {
    background: var(--accent-color);
    color: var(--bg-light);
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-badge {
    display: inline-block;
    background: var(--accent-color);
    color: var(--bg-light);
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.project-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-link {
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.project-card:hover .project-link {
    gap: 0.8rem;
}

/* --- YouTube Section --- */

.youtube-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.youtube-card {
    overflow: hidden;
    transition: transform 0.3s ease;
}

.youtube-card:hover {
    transform: translateY(-10px);
}

.youtube-thumbnail {
    position: relative;
    width: 100%;
    height: 225px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.youtube-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.youtube-card:hover .youtube-thumbnail img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.youtube-card:hover .play-overlay {
    opacity: 1;
}

.youtube-info {
    padding: 1.5rem;
}

.youtube-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.youtube-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.youtube-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.youtube-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Footer --- */

.cyber-footer {
    background: var(--bg-lighter);
    border-top: 1px solid var(--border-light);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* --- Responsive --- */

/* Half-page browser / small laptop (≤1024px) */
@media (max-width: 1024px) {
    .promo-popup {
        right: 20px;
    }

    .intro-content {
        gap: 2.5rem;
    }

    .avatar-frame {
        width: 250px;
        height: 250px;
    }

    .intro-description {
        font-size: 1.3rem;
    }
}

/* Tablet / half-page window (≤768px) — stack to single column */
@media (max-width: 768px) {
    #intro.section {
        height: auto;
        min-height: 100vh;
    }

    .intro-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        min-height: auto;
        padding: 0 20px;
    }

    /* Move avatar above the text block */
    .intro-visual {
        order: -1;
    }

    .intro-description {
        font-size: 1.2rem;
        height: auto;
        min-height: 1.6em;
        justify-content: center;
    }

    .intro-details p {
        font-size: 1rem;
    }

    .social-links {
        justify-content: center;
    }

    .avatar-frame {
        width: 200px;
        height: 200px;
    }

    .avatar-image {
        font-size: 2.5rem;
    }

    .promo-popup {
        position: relative;
        top: auto;
        right: auto;
        margin: 0 auto 1rem;
        width: min(100%, 420px);
        min-width: 0;
    }

    .projects-grid,
    .blog-grid,
    .youtube-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Phone portrait (≤480px) */
@media (max-width: 480px) {
    #intro.section {
        height: auto;
        min-height: 100vh;
    }

    .intro-content {
        gap: 1.5rem;
        padding: 0 15px;
    }

    .intro-description {
        font-size: 0.95rem;
        height: auto;
        min-height: 1.3em;
    }

    .intro-details p {
        font-size: 0.9rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }

    .avatar-frame {
        width: 160px;
        height: 160px;
    }

    .avatar-image {
        font-size: 2rem;
    }

    .promo-popup {
        width: 100%;
    }

    .promo-text {
        max-width: 220px;
    }

    .promo-popup-link {
        gap: 0;
        padding: 0.8rem 2.9rem 0.8rem 1rem;
    }

    .promo-icon {
        font-size: 1.25rem;
        margin-right: 0.85rem;
    }

    .promo-text strong {
        font-size: 0.78rem;
    }

    .promo-text small {
        font-size: 0.7rem;
    }

    .social-link {
        width: 44px;
        height: 44px;
    }

    .blog-card {
        padding: 1.25rem;
    }

    .project-card {
        gap: 1rem;
        padding: 1.25rem;
    }

    .project-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        border-radius: 12px;
    }

    .project-info h3 {
        font-size: 1.1rem;
    }

    .project-info p {
        font-size: 0.88rem;
    }

    .youtube-thumbnail {
        height: 180px;
    }
}
