/* Japanese Zen Minimal — Mobile First */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafafa;
    --text: #2a2a2a;
    --muted: rgba(42, 42, 42, 0.55);
    --rule: rgba(0, 0, 0, 0.06);
    --sp: 1.25rem;
    --max-w: 960px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.45;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ─── Typography ─── */

h1, h2, h3 {
    font-weight: 300;
}

h1 {
    font-size: 1.125rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h2 {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ─── Layout ─── */

header {
    padding: calc(var(--sp) * 2.5) var(--sp);
    text-align: center;
}

main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: calc(var(--sp) * 2) var(--sp);
    min-height: 60vh;
}

footer {
    padding: calc(var(--sp) * 2.5) var(--sp);
    text-align: center;
    border-top: 1px solid var(--rule);
    margin-top: calc(var(--sp) * 4);
}

/* ─── Homepage — centered menu ─── */

.home-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: var(--sp);
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: calc(var(--sp) * 2);
    align-items: center;
}

.main-nav li {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.main-nav li:nth-child(1) { animation-delay: 0.05s; }
.main-nav li:nth-child(2) { animation-delay: 0.15s; }
.main-nav li:nth-child(3) { animation-delay: 0.25s; }

.main-nav a {
    font-size: 1.125rem;
    letter-spacing: 0.06em;
    padding: 0.35rem 0;
}

/* ─── Social ─── */

.social-links {
    display: flex;
    gap: calc(var(--sp) * 1.5);
    justify-content: center;
}

.social-links a {
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* ─── Page Header ─── */

.page-header {
    text-align: center;
    margin-bottom: calc(var(--sp) * 2.5);
}

.intro-text {
    max-width: 540px;
    margin: 0 auto calc(var(--sp) * 3);
    text-align: center;
    font-size: 0.9375rem;
    line-height: 2;
    color: var(--muted);
}

/* ─── Project Grid (with thumbnails) ─── */

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--sp) * 2.5);
}

.project-item a {
    display: block;
}

.project-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.project-item:nth-child(1) .project-thumb { animation-delay: 0.05s; }
.project-item:nth-child(2) .project-thumb { animation-delay: 0.1s; }
.project-item:nth-child(3) .project-thumb { animation-delay: 0.15s; }
.project-item:nth-child(4) .project-thumb { animation-delay: 0.2s; }
.project-item:nth-child(5) .project-thumb { animation-delay: 0.25s; }
.project-item:nth-child(6) .project-thumb { animation-delay: 0.3s; }

.project-title {
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    margin-top: calc(var(--sp) * 0.6);
    color: var(--muted);
}

/* ─── Photo Grid ─── */

.photo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--sp) * 1.5);
}

.photo-item img {
    width: 100%;
    height: auto;
}

/* ─── Project Detail ─── */

.project-detail {
    max-width: 720px;
    margin: 0 auto;
}

.project-detail:has(.photo-grid) {
    max-width: 960px;
}

.project-description {
    margin: calc(var(--sp) * 2) 0;
    text-align: center;
    line-height: 2;
    color: var(--muted);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: calc(var(--sp) * 2) 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ─── About ─── */

.about-content {
    max-width: 540px;
    margin: 0 auto;
    text-align: center;
}

.bio {
    line-height: 2;
    margin-bottom: calc(var(--sp) * 2);
    color: rgba(42, 42, 42, 0.75);
}

.bio p + p {
    margin-top: var(--sp);
}

/* ─── Back Link ─── */

.back-link {
    text-align: center;
    margin-top: calc(var(--sp) * 3);
}

.back-link a {
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* ─── Lightbox ─── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(250, 250, 250, 0.96);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.75rem;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 1rem;
    right: 1.25rem;
    font-size: 1.75rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ─── Animation ─── */

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

/* ─── Tablet (≥600px) ─── */

@media (min-width: 600px) {
    :root { --sp: 1.5rem; }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--sp) * 2);
    }

    .main-nav ul {
        flex-direction: row;
        gap: calc(var(--sp) * 3);
    }

    .main-nav a {
        font-size: 1.25rem;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Desktop (≥900px) ─── */

@media (min-width: 900px) {
    :root { --sp: 2rem; }

    header {
        padding: calc(var(--sp) * 3) var(--sp);
    }

    main {
        padding: calc(var(--sp) * 3) var(--sp);
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--sp) * 2.5);
    }
}
