html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-user-drag: none;
}

.hero-container {
    position: relative;
    overflow: hidden;
}

.hero-bg {
    display: block;
    width: 100%;
}

.hero-content {
    position: absolute;
    top: 59%;
    left: 0;
    transform: translateY(-50%);
    text-align: center;
    width: 100%;
    pointer-events: none;
}

.hero-content>* {
    pointer-events: auto;
}

.hero-title {
    font-family: 'Zen Kaku Gothic Antique', sans-serif;
    font-size: clamp(14px, 2.5vw, 2.5rem);
    letter-spacing: 2px;
    font-weight: bold;
    margin: 0;
    color: #204350;
}

.hero-title img {
    width: clamp(60px, 10vw, 150px);
    height: auto;
    margin: 5rem auto;
}

.profile-image {
    display: block;
    width: clamp(300px, 70vw, 1500px);
    max-width: 100%;
    height: auto;
    margin: 2vw auto 0 auto;
}

.gaiyou-image {
    display: block;
    width: clamp(300px, 70vw, 1500px);
    max-width: 100%;
    height: auto;
    margin: 1vw auto 0 auto;
}

.main-nav {
    position: absolute;
    top: 10%;
    left: 0;
    transform: translateY(-50%);
    text-align: center;
    width: 100%;
}

.nav-decoration {
    display: block;
    margin: 0 auto 1rem auto;
    width: clamp(300px, 60vw, 1500px);
    max-width: 100%;
    height: auto;
}


.nav-buttons-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem auto 0 auto;
}

.nav-button {
    display: block;
    width: clamp(100px, 15vw, 150px);
    height: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-button:hover {
    transform: scale(1.05);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.main-nav a {
    text-decoration: none;
    color: #204350;
    font-size: clamp(14px, 2.5vw, 2.5rem);
    font-family: 'Zen Kaku Gothic Antique', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
}

.content-section {
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.section-title {
    font-family: 'Zen Kaku Gothic Antique', sans-serif;
    font-size: clamp(14px, 2.5vw, 2.5rem);
    letter-spacing: 2px;
    font-weight: bold;
    margin: 0;
    color: #204350;
}

.section-title img {
    width: clamp(60px, 10vw, 150px);
    height: auto;
    margin: 0 auto;
}

.works-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10vw 1rem;
    width: 90%;
    max-width: 1800px;
    margin: 5rem auto 0 auto;
    padding: 0 2rem;
}

.works-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid rgba(128, 128, 128, 0.5);
    box-sizing: border-box;
}

.works-gallery img:hover {
    transform: scale(1.02);
}

.works-botan {
    width: clamp(100px, 20vw, 200px);
    margin: 8rem auto;
    display: block;
}

.footer-section {
    position: relative;
    padding: 0;
    margin: -7vw 0 0 0;
    overflow: hidden;
}

.footer-image {
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
}

.footer-title {
    position: absolute;
    top: 85%;
    left: 5%;
    transform: translateY(-50%);
    width: clamp(80px, 20vw, 250px);
    height: auto;
    display: block;
}

.footer-title img {
    width: 100%;
    height: auto;
}

.footer-nav {
    position: absolute;
    top: 85%;
    right: 5%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 3rem;
    z-index: 10;
}

.footer-nav a {
    text-decoration: none;
    color: white;
    font-size: clamp(14px, 2vw, 2rem);
    font-family: 'Zen Kaku Gothic Antique', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    display: inline-block;
    transition: transform 0.2s ease;
}

.footer-nav a:hover {
    transform: scale(1.1);
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transform: scale(0.8);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-content.anim-fade-out {
    opacity: 0 !important;
}

/* po111などの詳細画像用のスクロール可能なクラス */
.modal-content.scrollable {
    max-height: none;
    height: auto;
    width: 70%;
    /* 必要に応じて調整 */
    margin-top: 50px;
    margin-bottom: 50px;
    object-fit: unset;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    /* ここを変更して縦スクロール可能に */
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* オーバーレイがスクロール可能な場合の配置調整 */
.modal-overlay.scroll-mode {
    align-items: flex-start;
    /* 上端揃えにしてスクロール可能に */
    padding-top: 50px;
    padding-bottom: 50px;
}

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

.close-btn {
    position: fixed;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1002;
    user-select: none;
    -webkit-user-select: none;
}

.close-btn:hover {
    color: #bbb;
}

.nav-btn {
    cursor: pointer;
    position: fixed;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}


/* Loading Screen Styles */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container {
    position: relative;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 50%;
}

.loader-mask-wrapper {
    width: 150px;
    height: 150px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 600'%3E%3Cpath d='M0,100 Q25,120 50,100 T100,100 T150,100 T200,100 L200,600 L0,600 Z' fill='black'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 600'%3E%3Cpath d='M0,100 Q25,120 50,100 T100,100 T150,100 T200,100 L200,600 L0,600 Z' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 200px 600px;
    mask-size: 200px 600px;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    /* Positions will be controlled by JS based on actual loading progress */
}

.loader-img-spin {
    width: 150px;
    height: 150px;
    object-fit: contain;
    animation: spin 3s linear infinite;
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scroll Animation Styles */
/* Scroll Animation Styles */
.slide-in-diagonal {
    opacity: 0;
    /* Slide from bottom-right */
    transform: translate(40px, 40px);
    /* Bouncy "pop" animation using cubic-bezier */
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
}

.slide-in-diagonal.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Ensure no conflict with grid layout when wrapping works images */
.work-item-wrapper {
    width: 100%;
    height: auto;
    display: block;
    overflow: hidden;
    /* Optional: keeps things tidy during animation */
}