@font-face {
    font-family: "Kaiso Next UP";
    src: local("廻想体 ネクスト ユーピー"),
         local("Kaisotai-Next-UP-B"),
         url("fonts/Kaisotai-Next-UP-B.otf") format("opentype"),
         url("fonts/Kaisotai-Next-UP-B.ttf") format("truetype");
    font-display: swap;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
    color: #c8c8c8;
    background: #0d0d0d;
}

#main,
nav {
    font-family: "Kaiso Next UP", sans-serif;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}
#main {
    opacity: 0;
    overflow-y: scroll;
    height: 100vh;
    scroll-snap-type: y mandatory;
    transition: opacity 0.8s ease;
}

#main.visible {
    opacity: 1;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #2a2a2a;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

nav.visible {
    opacity: 1;
    pointer-events: auto;
}

nav .nav-home {
    margin-right: auto;
    color: #64748b;
}

nav .nav-home:hover {
    color: #facc15;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: clamp(13px, 1.2vw, 15px);
    letter-spacing: 0.08em;
    transition: color 0.2s;
}

nav a:hover { color: #facc15; }

section {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 3vw 2rem;
    box-sizing: border-box;
    border-bottom: 1px solid #1e1e1e;
    overflow: hidden;
}

.section-inner {
    width: 100%;
    max-width: 760px;
}

.section-inner--wide {
    max-width: min(92vw, 1050px);
}

.section-label {
    font-size: clamp(1rem, 2.1vw, 1.7rem);
    letter-spacing: 0.2em;
    color: #4ade80;
    margin-bottom: clamp(0.75rem, 2.2vh, 1.85rem);
}

.section-label h1 {
    font-size: inherit;
    font-weight: normal;
    margin: 0;
}

/* ABOUT */
.profile {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 3.75vw, 3.75rem);
    flex-wrap: wrap;
    margin-bottom: clamp(1.5rem, 3.75vh, 3rem);
}

.susi {
    width: clamp(150px, 18vw, 270px);
    height: clamp(150px, 18vw, 270px);
    object-fit: cover;
    border: 2px solid #2a2a2a;
}

.info h1 {
    font-size: clamp(2rem, 6vw, 4.5rem);
    color: #f1f1f1;
    font-weight: normal;
    margin: 0 0 0.5rem;
    line-height: 1.05;
}

.info .aliases {
    font-size: clamp(0.85rem, 1.8vw, 1.3rem);
    color: #46b2ba;
    margin: 0 0 0.35rem;
}

.info .dob {
    font-size: clamp(0.8rem, 1.5vw, 1.15rem);
    color: #64748b;
    margin: 0;
}

.links {
    display: flex;
    gap: clamp(0.75rem, 2.25vw, 1.85rem);
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0.45rem 1rem;
    border: 2px solid #2a2a2a;
    color: #c8c8c8;
    text-decoration: none;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.btn:hover {
    border-color: #facc15;
    color: #facc15;
}

.btn img.icon {
    width: clamp(16px, 1.9vw, 24px);
    height: clamp(16px, 1.9vw, 24px);
}

.icongithub {
    width: clamp(16px, 1.9vw, 24px);
    height: clamp(16px, 1.9vw, 24px);
    filter: invert(1);
}

.contact-lead {
    font-size: clamp(0.95rem, 2.25vw, 1.7rem);
    color: #64748b;
    margin: 0 0 clamp(1rem, 3vh, 2.25rem);
    line-height: 1.5;
}

/* DETAILS */
.detail-grid {
    display: grid;
    gap: clamp(0.55rem, 1.5vh, 1.1rem);
}

.detail-row {
    display: flex;
    gap: clamp(0.75rem, 2.25vw, 1.85rem);
    font-size: clamp(0.85rem, 1.65vw, 1.25rem);
    line-height: 1.5;
}

.detail-key {
    color: #4ade80;
    min-width: clamp(70px, 9vw, 120px);
    flex-shrink: 0;
}

.detail-val { color: #c8c8c8; }

/* WORKS */
.works-tab h2 {
    font-size: clamp(1.3rem, 3.4vw, 2.6rem);
    font-weight: normal;
    margin: 0 0 clamp(0.75rem, 2.2vh, 1.5rem);
    color: #facc15;
}

.works-tab {
    letter-spacing: 0.1em;
    color: #64748b;
    padding-bottom: 4px;
    border-bottom: 2px solid #facc15;
    margin-bottom: clamp(0.4rem, 1.5vh, 1.1rem);
}

.works-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 2.5vw, 2rem);
    width: 100%;
}

.work-item {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 3rem);
    padding: 0;
    width: 100%;
}

.work-item--compact {
    flex-direction: column;
    align-items: stretch;
    gap: clamp(0.5rem, 1.5vh, 1rem);
}

.work-item--compact .work-media img {
    max-height: min(32vh, 420px);
    margin: 0 auto;
}

.work-item--compact .work-text h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.4rem);
    margin-bottom: 0.35rem;
}

.work-item--compact .work-text p {
    font-size: clamp(0.8rem, 1.6vw, 1.1rem);
    margin-bottom: 0.75rem;
}

.work-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 3vh, 2.25rem);
    width: 100%;
}

.model-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    width: 100%;
}

.work-media, .work-text {
    flex: 1;
    min-width: 0;
}

.work-media img {
    width: 100%;
    max-width: none;
    max-height: min(54vh, 615px);
    height: auto;
    object-fit: contain;
    display: block;
}

.work-text h2 {
    font-size: clamp(1.85rem, 5.25vw, 4.1rem);
    font-weight: normal;
    color: #f1f1f1;
    margin: 0 0 clamp(0.5rem, 1.5vh, 1.1rem);
    line-height: 1.05;
}

.work-text p {
    font-size: clamp(0.85rem, 1.9vw, 1.4rem);
    color: #c8c8c8;
    line-height: 1.6;
    margin: 0 0 clamp(0.75rem, 2.2vh, 1.5rem);
}

.work-text--center {
    text-align: center;
}

.carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.55rem, 1.5vw, 1.1rem);
    width: 100%;
}

.carousel-wrapper {
    overflow: hidden;
    width: min(88vw, 900px);
    flex-shrink: 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
}

.carousel-track img {
    width: min(88vw, 900px);
    max-height: min(51vh, 675px);
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.carousel-btn {
    background: rgba(0,0,0,0.55);
    border: 2px solid #c8c8c8;
    color: #ffffff;
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    padding: clamp(0.35rem, 1.1vh, 0.75rem) clamp(0.55rem, 1.5vw, 1.1rem);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
    z-index: 10;
    line-height: 1;
}

.carousel-btn:hover {
    border-color: #facc15;
    color: #facc15;
}

#model-viewer {
    width: min(62vw, 59vh);
    height: min(62vw, 59vh);
}

@media (max-width: 900px) {
    .works-grid {
        grid-template-columns: 1fr;
    }

    .work-item--compact .work-media img {
        max-height: min(22vh, 280px);
    }

    .profile {
        flex-direction: column;
        text-align: center;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }
}

        /* FOOTER */
        footer {
            padding: 2rem;
            text-align: center;
        }

        .return-btn {
            display: inline-block;
            padding: 8px 20px;
            border: 1px solid #2a2a2a;
            color: #64748b;
            font-family: inherit;
            font-size: 13px;
            cursor: pointer;
            background: transparent;
            transition: border-color 0.2s, color 0.2s;
        }

        .return-btn:hover {
            border-color: #ef4444;
            color: #ef4444;
        }

        /* ENDING OVERLAY */
        #ending {
            display: none;
            position: fixed;
            inset: 0;
            background: #0d0d0d;
            z-index: 200;
            align-items: center;
            justify-content: center;
        }

        #ending.show { display: flex; }

        #end-terminal {
            width: min(480px, 90vw);
            padding: 2rem;
        }


/* boot screen */
#boot {
    position: fixed;
    inset: 0;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.6s ease;
}


#boot.fade-out {
    opacity: 0;
    pointer-events: none;
}

#terminal {
    width: min(680px, 90vw);
    padding: 2rem;
}

.term-line {
    font-size: clamp(12px, 2vw, 14px);
    line-height: 1.8;
    opacity: 0;
    white-space: pre;
}

.term-line.ok   { color: #4ade80; }
.term-line.info { color: #c8c8c8; }
.term-line.hi   { color: #facc15; font-weight: bold; }
.term-line.fin  { color: #94a3b8; }

.cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: #c8c8c8;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }
