/* ============================================
   PEPPE LAB PORTFOLIO - APPLE-STYLE CSS
   WCAG 2.2 AA Compliant | Performance Optimized
   ============================================ */

/* === VISION SECTION === */
.vision-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px;
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: relative;
    z-index: 10;
    margin-top: 100vh;
}

/* Vision section before footer (last instance only) */
.vision-section:last-of-type {
    min-height: auto;
    padding: 80px 24px 100px 24px;
    margin-top: 0;
    z-index: 150;
    background: rgba(29, 29, 31, 0.98);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.vision-section:last-of-type .vision-title {
    color: #f5f5f7;
}

.vision-section:last-of-type .vision-subtitle {
    color: rgba(245, 245, 247, 0.8);
}

.vision-section:last-of-type .vision-tagline {
    color: #f5f5f7;
}

.vision-cta {
    margin-top: 40px;
    text-align: center;
}

.vision-contact-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #ffffff;
    color: #1d1d1f;
    border: 1px solid #ffffff;
}

.vision-contact-btn:hover {
    background-color: #f5f5f7;
    border-color: #f5f5f7;
    transform: scale(1.02);
}

.vision-container {
    max-width: 980px;
    text-align: center;
    margin: 0 auto;
}

.vision-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 600;
    color: var(--dark-text);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin-bottom: 48px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.vision-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 400;
    color: var(--gray-text);
    line-height: 1.5;
    letter-spacing: 0.007em;
    margin-bottom: 32px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.vision-tagline {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 500;
    color: var(--dark-text);
    line-height: 1.4;
    letter-spacing: 0.011em;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* === SECTIONS === */
.section {
    padding: 80px 24px;
    position: relative;
    background: var(--light-bg);
    z-index: 100;
}

/* First section needs margin-top to account for fixed hero */
#about {
    margin-top: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    margin-bottom: 48px;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--dark-text);
}

/* === ABOUT SECTION === */
.about-section {
    background: #ffffff !important;
}

/* Centered content container */
.about-content-centered {
    max-width: 800px;
    margin: 0 auto 48px;
    text-align: center;
}

/* About Text Styles */
.about-text-main {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--dark-text);
    margin-bottom: 16px;
}

.about-text-philosophy {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--gray-text);
    margin-bottom: 0;
    font-style: italic;
}

@media (min-width: 768px) {
    .about-text-main {
        font-size: 1.75rem;
    }

    .about-text-philosophy {
        font-size: 1.25rem;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--dark-text);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === TECH STACK SECTION === */
.stack-section {
    background: var(--light-bg);
    overflow: hidden;
    padding: 80px 0;
}

.stack-carousel-wrapper {
    position: relative;
    padding: 0;
    overflow: visible;
}

.stack-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 24px;
    touch-action: pan-x;
}

.stack-grid::-webkit-scrollbar {
    display: none;
}

.stack-badge {
    flex: 0 0 280px;
    padding: 40px 32px;
    min-height: 280px;
    background: var(--light-bg-secondary);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-snap-align: start;
    cursor: pointer;
    user-select: none;
    touch-action: pan-x;
}

.stack-badge:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stack-badge:active {
    transform: scale(0.98);
}

.stack-icon {
    font-size: 4rem;
    width: 80px;
    height: 80px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stack-icon-dark {
    background: #1c1c1e;
    border-radius: 50%;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-icon-python {
    filter: brightness(0);
}

.stack-badge:hover .stack-icon {
    transform: scale(1.1);
}

.stack-icon svg {
    width: 100%;
    height: 100%;
}

.stack-name {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--dark-text);
    text-align: center;
    line-height: 1.3;
}

/* Navigation arrows at bottom center */
.stack-arrows {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 12px 0;
}

.stack-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.stack-arrow:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1.1);
}

.stack-arrow:active {
    transform: scale(0.95);
}

.stack-arrow svg {
    width: 20px;
    height: 20px;
    fill: var(--dark-text);
}

.stack-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stack-arrow:disabled:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .stack-badge {
        flex: 0 0 240px;
        min-height: 280px;
        padding: 32px 24px;
    }

    .stack-icon {
        width: 72px;
        height: 72px;
    }

    .stack-name {
        font-size: 1rem;
    }

    .stack-arrows {
        margin-top: 16px;
    }

    .stack-arrow {
        width: 32px;
        height: 32px;
    }

    .stack-arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* Show More Button Container */
.show-more-container {
    display: block;
    text-align: center;
    margin-top: 48px;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

.show-more-container.hidden {
    display: none !important;
}

/* Show More Button - System Design Principles */
.show-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--light-bg-secondary);
    color: var(--dark-text);
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: inherit;
}

.show-more-btn:hover {
    background: var(--dark-text);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.show-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Projects Counter Badge */
.projects-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    margin-left: 4px;
}

.show-more-btn:hover .projects-counter {
    background: white;
    color: var(--dark-text);
}

/* Project Card Visibility */
.project-card {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.mobile-hidden {
    display: none;
}

.project-card.revealing {
    animation: revealCard 0.5s ease-out forwards;
}

@keyframes revealCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* === PROJECTS SECTION === */
.projects-section {
    background: var(--light-bg);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.filter-btn {
    padding: 12px 24px;
    min-width: 100px;
    min-height: 44px; /* WCAG 2.2: 44x44px minimum */
    background: var(--light-bg-secondary);
    color: var(--dark-text);
    border: 1px solid var(--border-color);
    border-radius: 980px;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s var(--transition);
}

.filter-btn:hover {
    background: var(--light-bg-tertiary);
    border-color: rgba(0, 0, 0, 0.16);
}

.filter-btn:focus {
    outline: 4px solid rgba(0, 113, 227, 0.3);
    outline-offset: 2px;
}

.filter-btn.active {
    background: var(--dark-text);
    color: var(--light-bg);
    border-color: var(--dark-text);
}

/* 4-column grid layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Flip card container */
.project-card {
    perspective: 1000px;
    height: 280px;
    cursor: pointer;
    position: relative;
}

.project-card.hidden {
    display: none;
}

/* Inner card that flips */
.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Flip state */
.project-card.flipped .project-card-inner {
    transform: rotateY(180deg);
}

/* Card faces */
.project-card-front,
.project-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    background: var(--light-bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: box-shadow 0.3s var(--transition), border-color 0.3s var(--transition);
}

.project-card-front {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.project-card-back {
    transform: rotateY(180deg);
    overflow-y: auto;
    text-align: left;
}

/* Hover effect */
.project-card:hover .project-card-front,
.project-card:hover .project-card-back {
    box-shadow: 0 8px 32px var(--shadow);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Front face - Title only */
.project-card-front .project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0;
    line-height: 1.3;
}

.project-card-front .project-category {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 4px 12px;
    background: var(--light-bg);
    border-radius: 980px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-text);
    border: 1px solid var(--border-color);
}

.project-card-front .flip-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--gray-text);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.project-card:hover .flip-hint {
    opacity: 1;
}

/* Back face - Full details */
.project-card-back .project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark-text);
}

.project-card-back .project-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-text);
    margin-bottom: 16px;
    flex-grow: 1;
}

.project-card-back .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.project-card-back .tech-tag {
    padding: 3px 8px;
    background: var(--light-bg);
    border-radius: 980px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-text);
    border: 1px solid var(--border-color);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        height: 320px;
    }
}

/* === EXPERIENCE SECTION === */
.experience-section {
    background: var(--light-bg-secondary);
}

.experience-timeline {
    max-width: 900px;
    margin: 0 auto 64px;
}

.experience-item {
    background: var(--light-bg);
    border-radius: 16px;
    padding: 40px;
    border-left: 4px solid var(--accent);
}

.experience-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .experience-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.experience-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
}

.experience-period {
    color: var(--gray-text);
    font-size: 1rem;
    font-weight: 400;
}

.experience-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--gray-text);
    margin-bottom: 24px;
}

.experience-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.highlight-item {
    padding: 12px 16px;
    background: var(--light-bg-secondary);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--dark-text);
    border-left: 3px solid var(--accent);
}

/* === TESTIMONIALS === */
.testimonials {
    max-width: 900px;
    margin: 0 auto;
}

.testimonials-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center;
    color: var(--dark-text);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.testimonial-card {
    background: var(--light-bg);
    border-radius: 16px;
    padding: 32px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 2px 8px var(--shadow);
}

.testimonial-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--gray-text);
    font-style: italic;
    margin-bottom: 16px;
}

.testimonial-author {
    display: block;
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
    font-style: normal;
}

/* === FOOTER === */
.footer {
    background: var(--dark-text);
    color: #ffffff;
    padding: 60px 24px 24px;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 200;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-logo-link {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-logo-link:hover {
    transform: translateY(-4px);
}

.footer-logo {
    width: 48px;
    height: 48px;
    display: block;
}

.footer-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-links-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    color: #ffffff;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-list a,
.footer-link-btn {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.footer-links-list a:hover,
.footer-link-btn:hover {
    color: #ffffff;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-copyright {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.footer-subtext {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer {
        padding: 40px 24px 24px;
    }
}

/* === REVEAL ANIMATIONS === */
.reveal-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition);
}

.reveal-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === ACCESSIBILITY: REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal-fade {
        opacity: 1;
        transform: none;
    }
}

/* === ACCESSIBILITY: FOCUS VISIBLE === */
*:focus-visible {
    outline: 4px solid rgba(0, 113, 227, 0.3);
    outline-offset: 2px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .vision-section {
        margin-top: 100vh;
        min-height: auto;
        padding: 80px 24px;
    }

    .vision-title {
        margin-bottom: 32px;
    }

    .vision-subtitle {
        margin-bottom: 24px;
    }

    .section {
        padding: 60px 16px;
    }

    .section:first-of-type {
        margin-top: 0;
    }

    .section-title {
        margin-bottom: 40px;
    }

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

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 0.75rem;
    }

    .experience-item {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .contact-cta {
        width: 100%;
        max-width: 300px;
    }

    .stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */
.project-card,
.stack-badge {
    will-change: transform;
}

@media (prefers-color-scheme: light) {
    /* Optional: add light theme support in future */
}
