/* ============================================
   LANDING PAGE STYLESHEET
*/

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1100px;
    width: 100%;
}

.profile-img {
    width: 240px;
    height: 320px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.rule {
    width: 420px;
    height: 3px;
    background: linear-gradient(90deg, #ffffff 0%, #666666 100%);
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.hero-text .subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-text .focus {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-text);
}

/* ============================================
   PORTFOLIO CONTAINER
   ============================================ */
.portfolio-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding-top: 80px;
}

/* ============================================
   CATEGORY CARDS
   ============================================ */
.category-card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: 24px;
    padding: 24px;
    position: relative;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    overflow: visible;
    animation: slideIn 0.6s ease forwards;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: inherit;
    opacity: 0.1;
    z-index: -1;
}

.category-title {
    color: var(--color-text);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 20;
}

/* Card Positioning */
.category-card[data-position="left"] {
    background: var(--color-card-left);
    margin-right: calc(var(--overlap-amount) * -1);
    z-index: 1;
}

.category-card[data-position="center"] {
    background: var(--color-card-center);
    z-index: 10;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: calc(var(--card-width) + 60px);
    height: calc(var(--card-height) + 60px);
    transform: translateY(-20px);
}

.category-card[data-position="right"] {
    background: var(--color-card-left);
    margin-left: calc(var(--overlap-amount) * -1);
    z-index: 1;
}

/* Hover Effects */
.category-card[data-position="center"]:hover {
    transform: scale(1.05) translateY(-15px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.category-card[data-position="left"]:hover,
.category-card[data-position="right"]:hover {
    transform: translateY(-5px);
}

/* Animation stagger */
.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }

/* Active state for touch */
.category-card:active {
    transform: scale(0.98);
}

.category-card[data-position="center"]:active {
    transform: scale(1.03) translateY(-8px);
}

/* ============================================
   PROJECTS CONTAINER
   ============================================ */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100% - 80px);
    overflow-y: visible;
    padding-bottom: 10px;
}

.projects-container::-webkit-scrollbar {
    width: 6px;
}

.projects-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.projects-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.project-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 5;
}

.project-card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.project-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.1);
}

.project-name {
    color: var(--color-text);
    font-weight: 600;
    font-size: 15px;
}

.project-preview {
    border-radius: 10px;
    height: 120px;
    width: 100%;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
}

/* ============================================
   ASYMMETRIC CONTENT FLOW
   ============================================ */
.category-card[data-position="left"] .project-preview {
    margin-right: var(--overlap-amount);
    width: calc(100% - var(--overlap-amount));
}

.category-card[data-position="right"] .project-header {
    margin-left: var(--overlap-amount);
}

.category-card[data-position="right"] .project-preview {
    margin-left: var(--overlap-amount);
    width: calc(100% - var(--overlap-amount));
}

.category-card[data-position="center"] .project-header,
.category-card[data-position="center"] .project-preview {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.main-project .project-preview {
    height: 200px;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.projects-grid .project-card .project-preview {
    height: 100px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-card-center);
    border-radius: 24px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
    border-radius: 10px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-logo {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
}

.modal-title {
    color: var(--color-text);
    font-size: 32px;
    font-weight: 700;
}

.modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
}

.modal-preview {
    border-radius: 16px;
    height: 250px;
    width: 100%;
    background-size: cover;
    background-position: center;
    grid-column: 1 / -1;
}

.modal-description h3 {
    color: var(--color-text);
    font-size: 20px;
    margin-bottom: 12px;
    margin-top: 20px;
}

.modal-description p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 16px;
}

.modal-description {
    min-width: 0;
}

.modal-section + .modal-section {
    margin-top: 18px;
}

.modal-section:first-child h3 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-self: end;
    align-self: end;
    margin-left: 12px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
}

.modal-action-btn {
    width: 110px;
    min-height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.1;
    padding: 8px 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    user-select: none;
}

.modal-action-btn:hover {
    transform: translateY(-1px);
}

.modal-action-btn:active {
    transform: translateY(0);
    opacity: 0.95;
}

.modal-action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.modal-action-demo {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.72) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32);
}

.modal-action-demo:hover {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38);
}

.modal-action-read {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.86) 100%);
    color: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.20);
}

.modal-action-read:hover {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --card-width: 340px;
        --card-height: 520px;
        --overlap-amount: 60px;
    }

    .category-title {
        font-size: 24px;
        top: -50px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .hero {
        min-height: auto;
        padding: 2.25rem 1rem 1.5rem;
    }

    .portfolio-container {
        width: 100%;
        max-width: none;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 12px 15px 0;
    }

    .category-card[data-position] {
        width: 100%;
        max-width: 430px;
        height: auto;
        min-height: 0;
        margin: 0 !important;
        transform: none !important;
        padding: 16px;
        border-radius: 20px;
        overflow: hidden;
    }

    .category-card[data-position="center"] {
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .category-title {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin-bottom: 14px;
        font-size: 1.35rem;
    }

    .projects-container {
        height: auto;
        gap: 12px;
        padding-bottom: 0;
    }

    .project-card {
        padding: 12px;
    }

    .project-header {
        margin-bottom: 10px;
    }

    .project-name {
        font-size: 0.95rem;
    }

    .project-preview,
    .category-card[data-position="left"] .project-preview,
    .category-card[data-position="right"] .project-preview {
        height: 112px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .category-card[data-position="right"] .project-header {
        margin-left: 0;
    }

    .main-project .project-preview {
        height: 145px;
    }

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

    .projects-grid .project-card .project-preview {
        height: 92px;
    }

    .modal-body {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .modal-preview {
        height: 180px;
    }

    .modal-actions {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
        align-self: stretch;
        justify-self: stretch;
        margin-left: 0;
        padding: 0;
    }

    .modal-action-btn {
        width: auto;
        min-width: 116px;
        min-height: 40px;
    }

    .modal-action-read br {
        display: none;
    }

    .profile-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-img {
        width: 180px;
        height: 250px;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .rule {
        width: min(300px, 80vw);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 28px 18px 20px;
        width: 94%;
    }

    .modal-title {
        font-size: 24px;
        padding-right: 18px;
    }

    .modal-logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .hero-text .subtitle {
        font-size: 1.1rem;
    }

    .hero-text .focus {
        font-size: 1.2rem;
    }

    .category-card[data-position] {
        padding: 14px;
        border-radius: 18px;
    }

    .project-preview,
    .category-card[data-position="left"] .project-preview,
    .category-card[data-position="right"] .project-preview {
        height: 100px;
    }

    .main-project .project-preview {
        height: 132px;
    }
}