/* ============================================================
   Fonts
   ============================================================ */
@font-face {
    font-family: "InterVariable";
    src: url("assets/fonts/InterVariable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    --color-bg: #ffffff;
    --color-text: #000000cc;
    --color-secondary: #00000070;
    --color-link: #000000a3;
    --color-link-bg: #0000000a;
    --color-btn-bg: #0000000a;
    --color-btn-bg-hover: #00000014;
    --color-btn-primary-bg: #000000cc;
    --color-btn-primary-bg-hover: #000000b8;
    --font: "InterVariable", "Inter", sans-serif;
    --side-spacing: 16px;
    --grid-gap: 16px;
    --card-radius: 12px;
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   Focus
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    font-feature-settings: "cv10" on;
    padding-bottom: 64px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    padding: 92px;
}

.hero-text {
    animation: fade-up 0.4s var(--ease-spring) 0.05s both;
}

.hero-name {
    font-size: 32px;
    line-height: 40px;
    font-weight: 550;
    letter-spacing: -0.32px;
    margin-bottom: 8px;
    text-wrap: balance;
}

.hero-bio {
    font-size: 20px;
    line-height: 28px;
    font-weight: 500;
    letter-spacing: -0.4px;
    color: var(--color-secondary);
    max-width: 560px;
    text-wrap: pretty;
}

.hero-link {
    color: var(--color-link);
    border-radius: 4px;
    transition:
        box-shadow 0.15s,
        background 0.15s;
}

@media (hover: hover) {
    .hero-link:hover {
        box-shadow:
            4px 0 0 var(--color-link-bg),
            -4px 0 0 var(--color-link-bg);
        background: var(--color-link-bg);
    }
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    animation: fade-up 0.4s var(--ease-spring) 0.12s both;
}

/* ============================================================
   Button
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 500;
    font-family: var(--font);
    font-feature-settings: "cv10" on;
    -webkit-font-smoothing: antialiased;
    transition: transform 0.1s ease;
}

@media (hover: hover) {
    .btn:hover {
        opacity: 0.85;
    }
}

.btn.pressing {
    transform: scale(0.97);
    transition: transform 0.08s ease;
}

.btn.releasing {
    transform: scale(1);
    transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary {
    background: var(--color-btn-bg);
    color: var(--color-text);
    transition:
        background 0.15s,
        opacity 0.15s,
        transform 0.1s ease;
}

@media (hover: hover) {
    .btn-secondary:hover {
        background: var(--color-btn-bg-hover);
        opacity: 1;
    }
}

.btn-primary {
    background: var(--color-btn-primary-bg);
    color: var(--color-bg);
    white-space: nowrap;
    transition:
        background 0.15s,
        opacity 0.15s,
        transform 0.15s ease;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: var(--color-btn-primary-bg-hover);
        opacity: 1;
    }
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

.btn-label {
    display: inline-block;
    transition: opacity 0.15s ease;
}

.btn-label.exit {
    opacity: 0;
}

.btn-label .scrambling {
    opacity: 0.3;
}

.btn-label .locking {
    opacity: 0.3;
    animation: char-lock 0.25s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.btn-label .locked {
    opacity: 1;
}

@keyframes char-lock {
    to {
        opacity: 1;
    }
}

/* ============================================================
   Projects Section
   ============================================================ */
.projects-section {
    padding: 16px;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 64px;
    column-gap: 16px;
}

/* ============================================================
   Project Card
   ============================================================ */

.project-card:nth-child(1) {
    animation: fade-up 0.4s var(--ease-spring) 0.3s both;
}
.project-card:nth-child(2) {
    animation: fade-up 0.4s var(--ease-spring) 0.37s both;
}
.project-card:nth-child(3) {
    animation: fade-up 0.4s var(--ease-spring) 0.44s both;
}
.project-card:nth-child(4) {
    animation: fade-up 0.4s var(--ease-spring) 0.51s both;
}
.project-card:nth-child(5) {
    animation: fade-up 0.4s var(--ease-spring) 0.58s both;
}

.project-card {
    display: block;
    position: relative;
    transition: scale 0.1s ease;
}

.card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 1px solid #0000000a;
    pointer-events: none;
    z-index: 1;
}

.project-card.pressing {
    scale: 0.992;
    transition: scale 0.4s ease;
}

.project-card.releasing {
    scale: 1;
    transition: scale 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
}

.card-image img,
.card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) {
    .project-card:hover .card-image img,
    .project-card:hover .card-image video {
        transform: scale(1.04);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

.card-body {
    margin-top: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    text-wrap: balance;
}

.card-desc {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-secondary);
    line-height: 1.5;
    text-wrap: pretty;
}

/* ============================================================
   Gallery (Project Detail Images)
   ============================================================ */
.gallery-section {
    padding: 16px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
    position: relative;
    animation: fade-up 0.4s var(--ease-spring) both;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.33s;
}
.gallery-item:nth-child(2) {
    animation-delay: 0.4s;
}
.gallery-item:nth-child(3) {
    animation-delay: 0.47s;
}
.gallery-item:nth-child(4) {
    animation-delay: 0.54s;
}
.gallery-item:nth-child(5) {
    animation-delay: 0.61s;
}
.gallery-item:nth-child(6) {
    animation-delay: 0.68s;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 1px solid #0000000a;
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000000cc;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: zoom-out;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1),
        visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox img,
.lightbox video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.98);
    opacity: 0;
    transition:
        transform 0.25s var(--ease-spring),
        opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox.active img,
.lightbox.active video {
    transform: scale(1);
    opacity: 1;
}

/* ============================================================
   Project Page
   ============================================================ */
@keyframes page-in {
    from {
        opacity: 0;
        translate: 0 16px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        translate: 0 20px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

.page-wrap {
    animation: page-in 0.35s var(--ease-spring) both;
}

.project-title {
    animation: fade-up 0.4s var(--ease-spring) 0.05s both;
}
.project-desc {
    animation: fade-up 0.4s var(--ease-spring) 0.12s both;
}

.project-nav-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

.project-nav {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 16px;
    background: #ffffffd9;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.project-nav-arrows {
    display: flex;
    flex-shrink: 0;
    gap: 4px;
}

.btn-prev {
    border-radius: 100px 24px 24px 100px;
}

.btn-next {
    border-radius: 24px 100px 100px 24px;
}

.btn-prev svg {
    transform: translateX(1px);
}

.btn-next svg {
    transform: translateX(-1px);
}

.project-content {
    padding: 48px 92px 92px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
}

.project-title {
    font-size: 32px;
    font-weight: 550;
    line-height: 40px;
    letter-spacing: -0.32px;
    margin-bottom: 8px;
    text-wrap: balance;
}

.project-desc {
    font-size: 20px;
    font-weight: 500;
    color: var(--color-secondary);
    line-height: 28px;
    letter-spacing: -0.4px;
    max-width: 560px;
    text-wrap: pretty;
}

.project-actions {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
    animation: fade-up 0.4s var(--ease-spring) 0.19s both;
}

.project-link {
    font-size: 16px;
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .page-wrap,
    .hero-text,
    .hero-actions,
    .project-card:nth-child(1),
    .project-card:nth-child(2),
    .project-card:nth-child(3),
    .project-card:nth-child(4),
    .project-card:nth-child(5),
    .project-title,
    .project-desc,
    .project-link,
    .gallery-item {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }

    .card-image img,
    .card-image video {
        transition: none;
    }

    .lightbox,
    .lightbox img,
    .lightbox video {
        transition: none;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .projects-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .hero-name {
        font-size: 32px;
        line-height: 40px;
    }
}

@media (max-width: 600px) {
    .hero {
        flex-direction: column;
        gap: 40px;
        padding: 64px 32px;
    }

    .project-content {
        flex-direction: column;
        gap: 40px;
        padding: 64px 32px;
    }

    .projects-section,
    .gallery-section {
        padding-left: 32px;
        padding-right: 32px;
    }

    .projects-section,
    .gallery-section {
        padding: 16px;
    }

    .hero-name,
    .project-title {
        font-size: 28px;
        line-height: 36px;
    }

    .hero-bio,
    .project-desc {
        font-size: 18px;
    }
}
