/* Apple-inspired minimal design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-white: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent-gray: #f5f5f7;
    --border-gray: #d2d2d7;
    --hover-bg: #fafafa;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--primary-white);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.subtitle {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.description {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
    margin-bottom: 60px;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.photo-container {
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: var(--accent-gray);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fade-in Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeIn 1s ease-in 0.3s forwards;
}

.fade-in-delay-2 {
    opacity: 0;
    animation: fadeIn 1s ease-in 0.6s forwards;
}

.fade-in-delay-3 {
    opacity: 0;
    animation: fadeIn 1s ease-in 0.9s forwards;
}

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

/* Projects Section */
.projects {
    padding: 120px 20px;
    background-color: var(--accent-gray);
}

.projects h2 {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 60px;
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    background: var(--primary-white);
    border-radius: 18px;
    padding: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-gray);
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--accent-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 40px;
}

.project-content h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.project-content p {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 17px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.project-link:hover {
    transform: translateX(4px);
}

/* Links Section */
.links {
    padding: 120px 20px;
    background-color: var(--primary-white);
}

.link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.link-card {
    background: var(--accent-gray);
    border-radius: 18px;
    padding: 50px 40px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    background-color: var(--hover-bg);
    transform: translateY(-4px);
    border-color: var(--border-gray);
}

.link-content h3 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.link-content p {
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 20px;
}

.arrow {
    font-size: 28px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    display: inline-block;
}

.link-card:hover .arrow {
    transform: translateX(8px);
}

/* Project Detail Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    max-width: 1400px;
    margin: 40px auto;
    background: var(--primary-white);
    border-radius: 24px;
    padding: 60px;
    animation: slideUpModal 0.4s ease;
    z-index: 1001;
}

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

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: var(--accent-gray);
    border: 1px solid var(--border-gray);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-primary);
    z-index: 1002;
}

.modal-close:hover {
    background: var(--border-gray);
    transform: rotate(90deg);
}

.modal-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Modal Images - Left Side */
.modal-images {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-image-main {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    background: var(--accent-gray);
    border: 1px solid var(--border-gray);
}

.modal-image-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.modal-image-small {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: var(--accent-gray);
    border: 1px solid var(--border-gray);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal-image-small:hover {
    transform: scale(1.05);
}

.modal-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal Text - Right Side */
.modal-text {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.modal-text h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
}

.modal-text p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.modal-features,
.modal-tech {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-features h3,
.modal-tech h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.modal-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-features li {
    font-size: 17px;
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
}

.modal-features li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-tag {
    background: var(--accent-gray);
    border: 1px solid var(--border-gray);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: var(--primary-white);
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    padding: 60px 20px;
    background-color: var(--accent-gray);
    text-align: center;
    border-top: 1px solid var(--border-gray);
}

footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        min-height: 80vh;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
    }

    .projects {
        padding: 80px 20px;
    }

    .links {
        padding: 80px 20px;
    }

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

    .link-cards {
        grid-template-columns: 1fr;
    }

    .project-card,
    .link-card {
        padding: 30px;
    }

    /* Modal Responsive */
    .modal-content {
        margin: 20px;
        padding: 40px 30px;
    }

    .modal-close {
        top: 20px;
        right: 20px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .modal-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .modal-image-grid {
        grid-template-columns: 1fr;
    }

    .modal-text h2 {
        font-size: 28px;
    }

    .modal-button {
        width: 100%;
    }
}

/* Smooth transitions for dynamic content */
.project-card,
.link-card {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }

.link-card:nth-child(1) { animation-delay: 0.1s; }
.link-card:nth-child(2) { animation-delay: 0.2s; }

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