@charset "utf-8";
/* ==========================================================================
   1. 基本 & 共通設定
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: #fffaf0;
    color: #5d4037;
    overflow-x: hidden;
}

body.loading-active,
body.fv-active {
    overflow-y: scroll;
}

/* ==========================================================================
   2. ローディングアニメーション
   ========================================================================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fffaf0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.cube-loader-preview {
    width: 43px;
    height: 43px;
    position: relative;
    perspective: 300px;
}

.cube-loader-preview .cube {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    animation: cube-rotate-animation 3s infinite linear;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.cube-loader-preview .cube-face {
    position: absolute;
    width: 43px;
    height: 43px;
    background-color: #e65b7e;
    opacity: 0.8;
    border: 1px solid rgba(255,255,255,0.2);
    box-sizing: border-box;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    outline: 1px solid transparent;
}

.cube-loader-preview .front  { transform: translate3d(0, 0, 21.5px); }
.cube-loader-preview .back   { transform: translate3d(0, 0, -21.5px) rotateY(180deg); }
.cube-loader-preview .right  { transform: translate3d(21.5px, 0, 0) rotateY(90deg); }
.cube-loader-preview .left   { transform: translate3d(-21.5px, 0, 0) rotateY(-90deg); }
.cube-loader-preview .top    { transform: translate3d(0, -21.5px, 0) rotateX(90deg); }
.cube-loader-preview .bottom { transform: translate3d(0, 21.5px, 0) rotateX(-90deg); }

@keyframes cube-rotate-animation {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    50% { transform: rotateX(180deg) rotateY(360deg); }
    100% { transform: rotateX(360deg) rotateY(720deg); }
}

/* ==========================================================================
   3. ウェルカムカバー（ファーストビュー）
   ========================================================================== */
#welcome-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffd1dc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 60px 0;
    z-index: 9999;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-sizing: border-box;
}

#welcome-cover.is-scrolled {
    transform: translateY(-100vh);
}

.cover-content {
    text-align: center;
    z-index: 10;
}
.site-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 3px 3px 0px #ffb6c1;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}
.site-subtitle {
    font-size: 1.2rem;
    color: #ffa07a;
    font-weight: 500;
}

.fv-images {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.fv-img-item {
    width: calc(28% - 15px); 
    aspect-ratio: 1 / 1;
    background: none;
    padding: 0;
    border-radius: 0;
    transform-origin: top center;
    filter: drop-shadow(0 12px 16px rgba(255, 105, 180, 0.35));
    opacity: 0;
    transform: scale(0);
    animation-fill-mode: forwards !important;
}

.fv-img-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    border-radius: 0;
}
.fv-logo-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    z-index: 100;
    will-change: transform;
}

.fv-logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.05em;
    text-shadow: 3px 3px 0px #e65b7e;
    display: inline-block;
}

.fv-logo-text span {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px) scale(0.5);
}

body.fv-active .fv-logo-text span {
    animation: bounceInLetter 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: calc(var(--delay) + 0.2s);
}

@keyframes bounceInLetter {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.5);
    }
    70% {
        transform: translateY(-10px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   4. 画像バウンズポップアップ設定（ランダム出現）
   ========================================================================== */
body.fv-active .fv-img-item {
    animation: bouncePopup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

body.fv-active .item-1 { animation-delay: 0.2s; }
body.fv-active .item-2 { animation-delay: 0.5s; }
body.fv-active .item-3 { animation-delay: 0.1s; }
body.fv-active .item-4 { animation-delay: 0.7s; }
body.fv-active .item-5 { animation-delay: 0.3s; }
body.fv-active .item-6 { animation-delay: 0.0s; }
body.fv-active .item-7 { animation-delay: 0.6s; }
body.fv-active .item-8 { animation-delay: 0.4s; }

@keyframes bouncePopup {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
/* ==========================================================================
   5. メインコンテンツ（共通2カラムレイアウト構造）
   ========================================================================== */
#main-content {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
    gap: 40px;
}

#site-header {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.header-inner {
    position: sticky;
    top: 60px;
    background: #fff;
    padding: 40px 16px; 
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(93, 64, 55, 0.04);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: #e65b7e;
    margin-bottom: 40px;
    letter-spacing: 0.05em;
    display: flex;
    flex-direction: column;
    text-align: center;
}

#site-header nav {
    width: 100%;
}
#site-header nav ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 16px;
}
#site-header nav ul li { width: 100%; }

#site-header nav ul li a {
    display: block;
    color: #5d4037;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 0.05em;
    padding: 12px 20px;
    border-radius: 15px;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

#site-header nav ul li a:hover,
#site-header nav ul li a.active {
    background-color: #fcdad7;
    color: #e65b7e;
}
#site-header nav ul li a:active {
    transform: scale(0.97);
}

.portfolio-grid {
    flex-grow: 1;
    width: calc(100% - 280px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    align-items: start;
}

.portfolio-grid.contact-grid {
    display: flex;
    flex-direction: column;
}

#main-content .portfolio-grid {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.5s cubic-bezier(0.215, 0.61, 0.355, 1), 
                transform 1.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}
#main-content.is-visible .portfolio-grid {
    opacity: 1;
    transform: translateY(0);
}

/*body:not(.loading-active):not(.fv-active) #main-content .portfolio-grid {
    opacity: 0;
    animation: rightContentFadeIn 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

@keyframes rightContentFadeIn {
    0% { opacity: 0; transform: scale(0.95) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}*/

.work-item {
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}
.work-item:hover {
    transform: translateY(-6px);
}

.work-thumbnail {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 16px;
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(93, 64, 55, 0.03);
}
.work-thumbnail img,
.zigzag-gallery .work-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.work-item:hover img {
    transform: scale(1.05);
}
/* ==========================================================================
   6. パソコン表示時のフッター設定
   ========================================================================== */
#site-footer {
    width: 240px;
    margin-top: -20px;
    padding: 0 4px;
    
    position: sticky;
    top: 410px;
}

.footer-sns {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
}

.sns-link {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    flex-grow: 1;
    flex-basis: 30%;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    border: 1px solid #f5ebe6;
    padding: 8px; 
}
.sns-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.sns-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(93, 64, 55, 0.08);
}
.copyright {
    font-size: 0.75rem;
    color: #a3b899;
    font-weight: bold;
    text-align: center;
}
.page-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #e65b7e;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(230, 91, 126, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.page-top-btn:hover {
    background-color: #fcdad7;
    color: #e65b7e;
    transform: translateY(-3px);
}

.page-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .page-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   7. プロフィールページ
   ========================================================================== */
.profile-flex-wrapper {
    display: flex;
    gap: 40px;
    align-items: top;
    margin-top: 20px;
}

.profile-left {
    flex: 1.2;
}

.profile-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-image-box {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(93, 64, 55, 0.05);
}

.profile-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .profile-flex-wrapper {
        flex-direction: column-reverse;
        gap: 30px;
    }
    
    .profile-right {
        width: 100%;
    }
    
    .profile-image-box {
        max-width: 240px;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   8. イラスト＆デザインページ
   ========================================================================== */

.zigzag-gallery .work-item {
    background: #fff;
    padding: 12px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(93, 64, 55, 0.03);
    margin: 0 !important;
    transform: none !important;
}
.portfolio-grid.zigzag-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 確実に横3列に並べる */
    gap: 40px 30px; /* 縦のすきま40px、横のすきま30px */
    flex-grow: 1;
}
.zigzag-gallery .work-item:nth-child(2n),
.zigzag-gallery .work-item:nth-child(2n-1) {
    transform: none !important;
}

.zigzag-gallery .work-item:hover {
    transform: translateY(-5px) scale(1.02) !important; /* ナナメに傾けず、上に浮かす */
    box-shadow: 0 12px 30px rgba(93, 64, 55, 0.08);
    z-index: 2;
}
.work-info {
    padding: 12px 4px 4px;
    text-align: left;
}
.work-info h3 {
    font-size: 0.95rem;
    font-weight: bold;
    color: #5d4037;
    margin-bottom: 4px;
}
.work-info p {
    font-size: 0.8rem;
    color: #a3b899;
    font-weight: bold;
}

/* ==========================================================================
   9. モーダルポップアップ
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(93, 64, 55, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: #fffaf0;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(93, 64, 55, 0.15);
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.modal.is-open .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #5d4037;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.modal-close-btn:hover { color: #e65b7e; }

.modal-body {
    display: flex;
    gap: 40px;
    margin-top: 10px;
}

.modal-left-img {
    flex: 1.2;
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    overflow: visible !important;
    position: relative;
    cursor: zoom-in;
}
.modal-left-img img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab
}
.modal-left-img.is-zoomed {
    cursor: grabbing;
    transition: none;
}
.modal-right-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#modal-title {
    color: #e65b7e;
    font-size: 1.6rem;
    font-weight: 800;
    border-bottom: 3px dashed #fcdad7;
    padding-bottom: 10px;
}

.modal-spec-table {
    width: 100%;
    border-collapse: collapse;
}
.modal-spec-table th, .modal-spec-table td {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}
.modal-spec-table th {
    text-align: left;
    color: #a3b899;
    width: 100px;
}

.modal-concept-box h3 {
    font-size: 1rem;
    color: #5d4037;
    margin-bottom: 8px;
}
.modal-concept-box p {
    font-size: 0.9rem;
    line-height: 1.7;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #f5ebe6;
}

.modal-content.is-illust-modal {
    max-width: 700px;
}
.modal-content.is-illust-modal .modal-body {
    flex-direction: column;
    gap: 20px;
    align-items: center;
}
.modal-content.is-illust-modal .modal-left-img {
    width: 100%;
    max-height: 70vh;
}
.modal-content.is-illust-modal .modal-right-info {
    width: 100%;
    text-align: center;
}
.modal-content.is-illust-modal #modal-title {
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.4rem;
}

/* ==========================================================================
   10. お問い合わせページ
   ========================================================================== */
.contact-container {
    width: 100%;
    max-width: 1200px;   
    margin: 0 auto;     
    background: #fff;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(93, 64, 55, 0.02);
}

.contact-container h2 {
    color: #e65b7e;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 30px;
    border-bottom: 3px dashed #fcdad7;
    padding-bottom: 12px;
}

.contact-lead {
    margin-bottom: 25px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #a3b899;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    font-size: 0.95rem;
    font-weight: bold;
    color: #5d4037;
}
.required {
    color: #e65b7e;
    margin-left: 6px;
    font-size: 0.8rem;
    background-color: #fcdad7;
    padding: 2px 6px;
    border-radius: 4px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    font-family: inherit;
    width: 100%;
    padding: 14px 18px;
    background-color: #fffaf0;
    border: 2px solid #f5ebe6;
    border-radius: 12px;
    color: #5d4037;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #fcdad7;
    background-color: #fff;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
}
.checkbox-label input[type="checkbox"] {
    display: none;
}
.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #f5ebe6;
    background-color: #fffaf0;
    border-radius: 6px;
    margin-right: 8px;
    transition: background-color 0.3s, border-color 0.3s;
}
.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
    background-color: #e65b7e;
    border-color: #e65b7e;
}
.checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.contact-form textarea { resize: vertical; }
.form-submit { text-align: center; margin-top: 35px; }

.submit-btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background-color: #e65b7e;
    border: none;
    padding: 14px 40px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(230, 91, 126, 0.2);
    transition: transform 0.2s ease, background-color 0.3s ease;
}
.submit-btn:hover {
    background-color: #f07693;
    transform: translateY(-2px);
}
.submit-btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   11. タブレット・スマホ用のレスポンシブ
   ========================================================================== */
@media (max-width: 1024px) {
    #main-content { 
        display: flex;
        flex-direction: column; 
        padding: 40px 20px; 
        gap: 40px; 
    }
    
    #site-header { 
        width: 100%; 
    }
    
    .header-inner { 
        position: static; 
        padding: 30px 20px; 
    }
    
    .sidebar-logo { 
        margin-bottom: 20px; 
    }
    
    #site-header nav {
        margin-bottom: 0;
    }
    #site-header nav ul { 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 10px; 
    }
    #site-header nav ul li { 
        width: auto; 
    }
    
    .portfolio-grid {
        width: 100%;
    }
    
    #site-footer {
        position: static; 
        width: 100%; 
        margin-top: 40px;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-sns {
        max-width: 180px; 
        gap: 10px;
        margin-bottom: 10px;
    }
    .sns-link {
        padding: 6px; 
    }
}

@media (max-width: 768px) {
    .portfolio-grid.zigzag-gallery { grid-template-columns: 1fr; gap: 25px; }
    .zigzag-gallery .work-item:nth-child(5) { margin-top: 0 !important; }
    .zigzag-gallery .work-item:hover { transform: none !important; }
    .modal-body { flex-direction: column; gap: 20px; }
    .modal-content { padding: 30px 20px; }
    .checkbox-group { flex-direction: column; gap: 12px; }
}
