/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    --cream: #FDFBF2;
    --cobalt: #4A81C2;
    --cobalt-dark: #3a689e;
    --dark: #1A1A1A;
    --text-light: #FFFFFF;
    --text-dark: #1A1A1A;
    --award-bg: #F8F8F5;
    --gallery-bg: #F4F1E8;
    --border-color: rgba(26, 26, 26, 0.15);
    --gold: #E2A746;
}

/* =========================================
   ADVANCED CINEMATIC CURSOR & TRAIL
   ========================================= */
body, html, a, button, input, textarea, .g-card-wrapper, .s5-hero-frame, .ambience-toggle-btn, .modal-close {
    cursor: none !important;
}

#cursor-trail {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9998; opacity: 0.8;
}

.k-cursor {
    position: fixed; top: 0; left: 0; width: 0; height: 0;
    pointer-events: none; z-index: 10000;
}

/* Base Black State */
.k-cursor-dot {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 6px; height: 6px; background-color: #000; border-radius: 50%;
    transition: width 0.3s cubic-bezier(0.77, 0, 0.175, 1), height 0.3s cubic-bezier(0.77, 0, 0.175, 1), background-color 0.3s ease;
}

.k-cursor-frame {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40px; height: 40px; border: 1.5px solid rgba(0, 0, 0, 0.8); border-radius: 50%;
    transition: width 0.3s cubic-bezier(0.77, 0, 0.175, 1), height 0.3s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.2s, border-width 0.2s, border-color 0.3s ease;
}

.k-cursor-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 120px; height: 120px; opacity: 0; transition: opacity 0.3s;
    animation: spinText 10s linear infinite;
}

.k-cursor-text svg { width: 100%; height: 100%; fill: #000; transition: fill 0.3s ease; }
.k-cursor-text text { font-family: 'Space Grotesk', sans-serif; font-size: 11.5px; font-weight: 600; letter-spacing: 0.15em; }

@keyframes spinText { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }

/* Hover States */
.k-cursor.is-active .k-cursor-dot { width: 80px; height: 80px; }
.k-cursor.is-active .k-cursor-frame { width: 100px; height: 100px; opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
.k-cursor.is-active .k-cursor-text { opacity: 1; }

/* Inverted White States (Triggered by JS on Dark Backgrounds) */
.k-cursor.is-white .k-cursor-dot { background-color: #fff; }
.k-cursor.is-white .k-cursor-frame { border-color: rgba(255, 255, 255, 0.8); }
.k-cursor.is-white .k-cursor-text svg { fill: #fff; }

@media screen and (max-width: 768px), (pointer: coarse) {
    #cursor-trail, .k-cursor { display: none !important; }
    body, html, a, button, input, textarea, .g-card-wrapper, .s5-hero-frame, .ambience-toggle-btn, .modal-close { cursor: auto !important; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body, html { width: 100%; background-color: var(--cream); font-family: 'Space Grotesk', sans-serif; overflow-x: hidden; }
body { padding-right: 0 !important; }

/* =========================================
   SCENE 1: HERO SCENE
   ========================================= */
.viewport-wrapper { position: relative; width: 100vw; height: 100vh; overflow: hidden; background-color: var(--cream); }

/* PERFORMANCE OPTIMIZATIONS: Removed will-change, added hardware acceleration layer rules and paint containments */
.scene {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100vw; height: 56.25vw; min-height: 100vh; min-width: 177.77vh;
    z-index: 2; transform-origin: center center;
    will-change: filter, transform, opacity;
}
.layer { position: absolute; top: -3%; left: -3%; width: 106%; height: 106%; pointer-events: none; }
.layer img { width: 100%; height: 100%; object-fit: cover; }

.blue-frame-container { position: absolute; top: 12%; left: 10%; width: 75%; height: 76%; background-color: var(--cobalt); pointer-events: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.1); }
.info-block { position: absolute; bottom: 6%; left: 4%; color: var(--text-light); text-align: left; text-shadow: 0 4px 15px rgba(0,0,0,0.4);}
.info-title { font-family: 'Noto Serif JP', serif; font-size: 2vw; letter-spacing: 0.1em; margin-bottom: 0.5rem; font-weight: 700; }
.info-links a { color: var(--text-light); text-decoration: none; display: block; font-size: 0.8vw; line-height: 1.6; opacity: 0.9; letter-spacing: 0.05em; transition: opacity 0.3s; }

.kanji-layer { position: absolute; top: 15%; right: 15%; display: flex; align-items: flex-start; gap: 1.5vw; }
.kanji-main { font-family: 'Noto Serif JP', serif; font-size: 11vw; color: var(--text-light); line-height: 1; display: flex; flex-direction: column; text-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.kanji-sub { font-family: 'Space Grotesk', sans-serif; font-size: 0.9vw; color: var(--text-light); writing-mode: vertical-rl; letter-spacing: 0.3em; margin-top: 2vw; position: relative; }
.kanji-sub::before { content: ''; position: absolute; top: -4vw; left: 50%; transform: translateX(-50%); width: 1px; height: 3vw; background-color: var(--text-light); }

.leaf-transition-container { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; overflow: hidden; perspective: 1500px; }
.t-leaf {
    position: absolute; width: 25vw; height: 25vw;
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 1;
    will-change: transform, opacity;
}
.whiteout-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--award-bg); z-index: 45; visibility: hidden; opacity: 0; pointer-events: none; transform: translateZ(0); }

/* =========================================
   SCENE 2: NEW FACE AWARD SCENE
   ========================================= */
.award-scene { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--award-bg); z-index: 1; visibility: hidden; opacity: 0; pointer-events: none; overflow: hidden; color: var(--text-dark); }
.award-hero-bg { position: absolute; top: -5%; left: -5%; width: 110%; height: 110%; z-index: 0; pointer-events: none; }
.award-hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; filter: saturate(0.9) contrast(1.1); }
.award-bg-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(248, 248, 245, 0.3) 0%, rgba(248, 248, 245, 0.8) 60%, rgba(248, 248, 245, 1) 100%); z-index: 1; }
.bg-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: 'Space Grotesk', sans-serif; font-size: 25vw; font-weight: 800; color: rgba(0, 0, 0, 0.04); white-space: nowrap; pointer-events: none; z-index: 2; }
.floating-particles { position: absolute; width: 100%; height: 100%; background-image: radial-gradient(#4a81c2 1px, transparent 1px); background-size: 40px 40px; opacity: 0.15; pointer-events: none; z-index: 2; }

.award-top-wrap { position: absolute; top: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; z-index: 5; }
.top-accent-line { width: 1px; height: 4vw; background-color: var(--text-dark); margin-bottom: 1.5vw; opacity: 0.5; }
.award-top-subtitle { font-family: 'Noto Serif JP', serif; font-size: 1vw; letter-spacing: 0.4em; color: #222; text-transform: uppercase; font-weight: 700; text-shadow: 0 2px 10px rgba(255,255,255,0.8); }

.award-banner-wrap { position: absolute; top: 30%; left: 10%; width: 80%; height: 35%; z-index: 5; }
.award-banner-backdrop { position: absolute; top: -5%; left: -2%; width: 104%; height: 110%; background-color: var(--cobalt); opacity: 0.15; z-index: 1; }
.award-image-banner { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #ddd; overflow: hidden; z-index: 2; box-shadow: 0 30px 60px rgba(0,0,0,0.15); }
.award-image-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transform: scale(1.05); }

.award-kanji-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
.kanji-char { position: absolute; font-family: 'Noto Serif JP', serif; font-weight: 900; font-size: 12vw; color: #111; line-height: 1; text-shadow: 0 15px 35px rgba(248, 248, 245, 0.7), 0 5px 15px rgba(0,0,0,0.3); }
.kanji-1 { top: 12%; left: 14%; } .kanji-2 { top: 38%; left: 13.5%; } .kanji-3 { top: 64%; left: 14%; }
.award-cursive { position: absolute; top: 58%; left: 20%; font-family: 'Dancing Script', cursive; font-size: 2.8vw; color: var(--text-light); white-space: nowrap; transform: rotate(-8deg); text-shadow: 2px 4px 10px rgba(0,0,0,0.4); z-index: 12; letter-spacing: 0.05em; }

.award-bottom-area { position: absolute; bottom: 8%; left: 10%; width: 80%; display: flex; justify-content: space-between; align-items: flex-end; z-index: 10; }
.award-deadline-block { display: flex; align-items: center; gap: 1.5vw; margin-left: 28vw; position: relative; }
.award-deadline-block::before { content: ''; position: absolute; left: -2vw; top: 20%; height: 60%; width: 2px; background-color: var(--cobalt); }
.deadline-text { font-family: 'Noto Serif JP', serif; font-size: 0.9vw; letter-spacing: 0.15em; padding-bottom: 0.5vw; color: #333; }
.deadline-number { font-family: 'Space Grotesk', sans-serif; font-size: 6vw; font-weight: 300; -webkit-text-stroke: 1.5px #1a1a1a; color: transparent; line-height: 0.8; letter-spacing: -0.02em; }
.deadline-day { font-family: 'Noto Sans JP', sans-serif; font-size: 0.9vw; width: 2.5vw; height: 2.5vw; border: 1px solid rgba(26, 26, 26, 0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 0.5vw; color: #111; }

.award-categories-block { text-align: right; padding-bottom: 0.5vw; }
.award-logo { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 1.8vw; letter-spacing: 0.05em; margin-bottom: 1vw; color: #1a1a1a; }
.award-categories { font-family: 'Noto Sans JP', sans-serif; font-weight: 400; font-size: 0.65vw; line-height: 2.2; letter-spacing: 0.15em; color: #444; }

/* =========================================
   SCENE 3: GALLERY SECTION
   ========================================= */
.gallery-section {background-image: linear-gradient(rgba(253, 251, 242, 0.85), rgba(253, 251, 242, 0.35)), url('/static/hero/Image 1.webp');   width: 100vw; height: 100vh; background-color: var(--gallery-bg); position: relative; overflow: hidden; z-index: 10; contain: paint layout; }
.interlude-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; pointer-events: none; }
.interlude-line {  width: 1px; height: 0vh; background-color: var(--cobalt); margin-bottom: 2vw; opacity: 0.6; }
.interlude-kanji { font-family: 'Noto Serif JP', serif; font-size: 2.5vw; color: var(--dark); letter-spacing: 0.3vw; opacity: 0; transform: translateY(20px); }
.interlude-eng { font-family: 'Space Grotesk', sans-serif; font-size: 0.9vw; color: #888; letter-spacing: 0.5vw; text-transform: uppercase; margin-top: 1vw; opacity: 0; transform: translateY(20px); }

.gallery-back-wall { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.gallery-back-wall img { width: 100%; height: 100%; object-fit: cover; }
.gallery-bg-text { position: absolute; top: 15%; left: -5vw; font-family: 'Noto Serif JP', serif; font-size: 24vw; color: rgba(0,0,0,0.03); font-weight: 900; white-space: nowrap; letter-spacing: 0.05em; z-index: 2; pointer-events: none; user-select: none; -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); }
.gallery-scroll-wrapper { display: flex; align-items: flex-start; height: 100%; width: max-content; padding-left: 12vw; padding-right: 25vw; gap: 7vw; position: relative; z-index: 5; }

.g-item { display: flex; flex-direction: column; align-items: center; height: 100%; position: relative; transform-origin: top center; transform: translateZ(0); }
.g-string-container { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 5; }
.g-top-tape { width: 1.8vw; height: 1.5vw; background: repeating-linear-gradient(-45deg, #A4CDE6, #A4CDE6 3px, #fff 3px, #fff 6px, #F09CB0 6px, #F09CB0 9px, #fff 9px, #fff 12px); margin-top: -0.5vw; box-shadow: 8px 12px 12px rgba(0,0,0,0.25); transform: rotate(-2deg); border-radius: 2px; z-index: 6; }
.g-string { background-color: #F09CB0; box-shadow: 3px 2px 4px rgba(0,0,0,0.2); z-index: 4; transform-origin: top center; }

.g-item:nth-child(1) .g-string { width: 1.8px; transform: skewX(-1.5deg); } .g-item:nth-child(2) .g-string { width: 2.2px; transform: skewX(1deg); } .g-item:nth-child(3) .g-string { width: 1.5px; transform: skewX(-0.8deg); } .g-item:nth-child(4) .g-string { width: 2.5px; transform: skewX(2deg); } .g-item:nth-child(5) .g-string { width: 1.9px; transform: skewX(-1.2deg); } .g-item:nth-child(6) .g-string { width: 2.1px; transform: skewX(0.5deg); }
.g-item-up .g-string { height: 10vh; } .g-item-down .g-string { height: 26vh; }

.g-card-wrapper { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; margin-top: -2px; cursor: pointer; }
.g-card { background: linear-gradient(to bottom right, #FFFFFF, #FDFDFD); padding: 0.8vw; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 20px 30px 30px rgba(45, 35, 25, 0.45), 35px 50px 45px rgba(45, 35, 25, 0.25), 10px 15px 20px rgba(0,0,0,0.15); position: relative; width: 21vw; height: 31vw; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1); transform: translateZ(0); }
.g-card-wrapper:hover .g-card { transform: translateY(-8px) translateX(-4px) scale(1.02); box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 30px 45px 40px rgba(45, 35, 25, 0.35), 50px 70px 60px rgba(45, 35, 25, 0.20), 15px 25px 30px rgba(0,0,0,0.12); }
.g-card-inner { width: 100%; height: 100%; position: relative; overflow: hidden; border-radius: 2px; box-shadow: inset 0 3px 6px rgba(0,0,0,0.15), inset 0 0 2px rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.1); background: #111; }
.g-card-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.g-side-tape { position: absolute; right: -1vw; top: 65%; width: 1.5vw; height: 3vw; background: repeating-linear-gradient(-45deg, #A4CDE6, #A4CDE6 3px, #fff 3px, #fff 6px, #F09CB0 6px, #F09CB0 9px, #fff 9px, #fff 12px); box-shadow: 10px 15px 15px rgba(0,0,0,0.35), 4px 6px 6px rgba(0,0,0,0.2); border-radius: 2px; transform: rotate(4deg); z-index: 20; }
.g-bottom-label { position: absolute; bottom: -2.2vw; background: linear-gradient(to bottom, #FFFFFF, #FAF9F6); border: 1px solid #EAE4D3; padding: 0.7vw 2.8vw; border-radius: 30px; box-shadow: 15px 25px 25px rgba(45, 35, 25, 0.35), 8px 12px 15px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,1); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 25; }
.label-main { font-family: 'Noto Serif JP', serif; font-size: 1vw; font-weight: 900; color: #222; letter-spacing: 0.2em; margin-bottom: 0.1vw; text-shadow: 0 1px 1px rgba(255,255,255,0.8); }
.label-sub { font-family: 'Dancing Script', cursive; font-size: 0.85vw; color: #E88394; font-weight: 600; display: flex; align-items: center; gap: 0.4vw; }
.label-sub .tilde { font-size: 0.7vw; opacity: 0.5; transform: translateY(-1px); }

.gallery-front-leaves { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.gallery-front-leaves img { width: 100%; height: 100%; object-fit: cover; filter: drop-shadow(25px 35px 35px rgba(0,0,0,0.35)); }

/* =========================================
   SCENE 4 & 5 & 6: TRANSITION MASTER
   ========================================= */
.transition-master { width: 100vw; height: 100vh; position: relative; background-color: var(--gallery-bg); overflow: hidden; background-image: linear-gradient(rgba(253, 251, 242, 0.85), rgba(253, 251, 242, 0.35)), url('/static/hero/Image 1.webp'); contain: paint layout; }
.monolith { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 1px; height: 0vh; background-color: var(--dark); z-index: 10; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pillar-text { font-family: 'Space Grotesk', sans-serif; color: var(--cream); font-size: 1vw; letter-spacing: 0.8em; text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; opacity: 0; }
.outer-text-left, .outer-text-right { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; opacity: 0; }
.outer-text-left { left: 20%; font-family: 'Noto Serif JP', serif; font-size: 4vw; color: #111; writing-mode: vertical-rl; letter-spacing: 0.5em; }
.outer-text-right { right: 20%; font-family: 'Space Grotesk', sans-serif; font-size: 0.8vw; color: #666; letter-spacing: 0.2em; max-width: 15vw; line-height: 1.8; text-align: justify; }

.interactive-showcase { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; background-color: #111; visibility: hidden; opacity: 0; pointer-events: none; overflow: hidden; display: flex; align-items: center; justify-content: center; transform: translateZ(0); }

.showcase-bg, .showcase-video-layer, .showcase-foreground-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.showcase-bg img, .showcase-video-layer video, .fg-img { width: 100%; height: 100%; object-fit: cover; }
.fg-img { opacity: 0; visibility: hidden; z-index: 1; position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.fg-img.active { opacity: 1; visibility: visible; z-index: 2; }

.cinematic-shadow { position: absolute; top: 0; left: 0; width: 65%; height: 100%; z-index: 3; background: linear-gradient(90deg, rgba(15, 12, 10, 0.9) 0%, rgba(15, 12, 10, 0.7) 35%, transparent 100%); pointer-events: none; }
.bg-kanji-watermark { position: absolute; top: 5vh; left: 6vw; font-family: 'Noto Serif JP', serif; font-size: 25vw; color: rgba(253, 251, 242, 0.03); line-height: 0.8; pointer-events: none; z-index: 1; writing-mode: vertical-rl; }

/* Floating Editorial UI Wrapper */
.cinematic-ui-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; display: flex; pointer-events: none; }
.ui-spine { width: 8vw; height: 100%; border-right: 1px solid rgba(253, 251, 242, 0.15); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 5vh; position: relative; }
.spine-kanji { font-family: 'Noto Serif JP', serif; font-size: 2vw; color: var(--cream); writing-mode: vertical-rl; letter-spacing: 0.5em; text-shadow: 0 4px 15px rgba(0,0,0,0.8); }
.spine-line { width: 1px; height: 10vh; background-color: rgba(253, 251, 242, 0.5); margin: 3vh 0; }
.spine-eng { font-family: 'Space Grotesk', sans-serif; font-size: 0.7vw; color: rgba(253, 251, 242, 0.5); writing-mode: vertical-rl; letter-spacing: 0.3em; transform: rotate(180deg); }

.chat-content-area { width: 32vw; height: 100%; padding: 5vh 0 5vh 4vw; display: flex; flex-direction: column; z-index: 5; pointer-events: auto; }
.chat-header { margin-bottom: 5vh; }
.chat-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.5vw; font-weight: 500; letter-spacing: 0.2em; color: var(--cream); text-transform: uppercase; }
.chat-subtitle { font-family: 'Noto Sans JP', sans-serif; font-size: 0.7vw; letter-spacing: 0.15em; color: rgba(253, 251, 242, 0.6); margin-top: 0.5vw; text-transform: uppercase; }

.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4vh; scrollbar-width: none; padding-right: 2vw; padding-bottom: 2vh; mask-image: linear-gradient(to bottom, black 85%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%); }
.chat-messages::-webkit-scrollbar { display: none; }
.chat-block { display: flex; flex-direction: column; animation: fadeIn 0.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.msg-name { font-family: 'Space Grotesk', sans-serif; font-size: 0.65vw; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 1vh; }
.block-bot .msg-name { color: var(--cream); }
.msg-bot { color: rgba(253, 251, 242, 0.95); font-family: 'Noto Serif JP', serif; font-size: 1.05vw; line-height: 1.9; letter-spacing: 0.05em; text-shadow: 0 2px 10px rgba(0,0,0,0.8); border-left: 2px solid var(--cream); padding-left: 1vw; }
.block-user .msg-name { color: rgba(253, 251, 242, 0.5); }
.msg-user { color: rgba(253, 251, 242, 0.8); font-family: 'Space Grotesk', sans-serif; font-size: 0.9vw; line-height: 1.6; letter-spacing: 0.05em; border-left: 1px solid rgba(253, 251, 242, 0.2); padding-left: 1vw; }

.typing-indicator { display: flex; align-items: center; gap: 5px; height: 1.5vw; }
.typing-dot { width: 6px; height: 6px; background-color: var(--cream); border-radius: 50%; animation: typingBounce 1.4s infinite ease-in-out both; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

.chat-input-area { margin-top: 2vh; border-bottom: 1px solid rgba(253, 251, 242, 0.4); display: flex; align-items: center; padding-bottom: 1vh; position: relative; }
.chat-input { flex: 1; background: transparent; border: none; outline: none; color: var(--cream); font-family: 'Noto Sans JP', sans-serif; font-size: 0.9vw; letter-spacing: 0.05em; }
.chat-input::placeholder { color: rgba(253, 251, 242, 0.4); font-weight: 300; font-style: italic; }
.chat-send-btn { background: transparent; color: var(--cream); border: none; cursor: pointer; font-family: 'Space Grotesk', sans-serif; font-size: 0.85vw; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; position: relative; transition: opacity 0.2s ease; }
.chat-send-btn::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0%; height: 1px; background-color: var(--cream); transition: width 0.3s ease; }
.chat-send-btn:hover { opacity: 0.8; }
.chat-send-btn:hover::after { width: 100%; }

.ambience-toggle-btn { position: absolute; bottom: 5vh; right: 4vw; z-index: 50; display: flex; align-items: center; gap: 12px; background: rgba(20, 15, 10, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(253, 251, 242, 0.15); padding: 10px 18px; border-radius: 50px; cursor: pointer; pointer-events: auto; transition: all 0.3s ease; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.ambience-toggle-btn:hover { background: rgba(20, 15, 10, 0.8); border-color: rgba(253, 251, 242, 0.4); }
.ambience-label { font-family: 'Space Grotesk', sans-serif; font-size: 0.6vw; font-weight: 500; color: var(--cream); letter-spacing: 0.2em; text-transform: uppercase; }
.audio-icon { display: flex; align-items: flex-end; gap: 3px; height: 10px; }
.audio-bar { width: 2px; background-color: var(--cream); transform-origin: bottom; animation: soundBounce 1s infinite alternate ease-in-out; }
.audio-bar:nth-child(1) { height: 100%; animation-delay: 0s; } .audio-bar:nth-child(2) { height: 60%; animation-delay: 0.2s; } .audio-bar:nth-child(3) { height: 80%; animation-delay: 0.4s; } .audio-bar:nth-child(4) { height: 40%; animation-delay: 0.1s; }
.ambience-toggle-btn.muted .audio-bar { animation: none; height: 2px; }
.ambience-toggle-btn.muted .ambience-label { color: rgba(253, 251, 242, 0.5); text-decoration: line-through; }
@keyframes soundBounce { 0% { transform: scaleY(0.3); } 100% { transform: scaleY(1); } }

.scroll-indicator { position: absolute; bottom: 3vh; left: 50%; transform: translateX(-50%); color: var(--cream); font-size: 0.6vw; font-family: 'Space Grotesk', sans-serif; letter-spacing: 0.2em; text-transform: uppercase; animation: pulseScroll 2s infinite; z-index: 50; }
@keyframes pulseScroll { 0%, 100% { opacity: 0.4; transform: translate(-50%, 0); } 50% { opacity: 1; transform: translate(-50%, 5px); } }

/* Scene 5: Architecture Infrastructure */
#scene-5 { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--cream); color: var(--dark); z-index: 30; pointer-events: auto; transform: translateZ(0); }
.s5-bg-image { position: absolute; top: -5%; left: -5%; width: 110%; height: 110%; background-image: url('/static/hero/Image 3.webp'); background-size: cover; background-position: center; z-index: 0; transform: translateZ(0); }
.s5-bg-image::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(253, 251, 242, 0.6);  }

.s5-bg-kanji { position: absolute; top: 50%; left: 55%; transform: translate(-50%, -50%); font-family: 'Noto Serif JP', serif; font-size: 32vw; font-weight: 900; color: transparent; -webkit-text-stroke: 1px rgba(74, 129, 194, 0.15); white-space: nowrap; pointer-events: none; z-index: 1; letter-spacing: 0.05em; -webkit-mask-image: linear-gradient(to right, black 20%, transparent 80%); mask-image: linear-gradient(to right, black 20%, transparent 80%); user-select: none; }

.s5-hero-frame { position: absolute; top: 12%; left: 8%; width: 35vw; height: 76vh; background-color: var(--cobalt); z-index: 5; box-shadow: 0 20px 50px rgba(0,0,0,0.15); transition: box-shadow 0.8s ease; cursor: pointer; }
.s5-hero-frame:hover { box-shadow: 0 35px 70px rgba(0,0,0,0.3); }
.s5-hero-frame:hover .s5-img-main img { transform: scale(1.1); }

.s5-img-main { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 2; }
.s5-img-main img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); transition: transform 0.8s ease; filter: contrast(1.05) saturate(1.1); }

.s5-kanji-layer { position: absolute; top: 10%; right: -5%; display: flex; align-items: flex-start; gap: 1vw; z-index: 15; pointer-events: none; }
.s5-kanji-main { font-family: 'Noto Serif JP', serif; font-size: 8vw; color: var(--text-light); line-height: 1; display: flex; flex-direction: column; text-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.s5-kanji-sub { font-family: 'Space Grotesk', sans-serif; font-size: 0.8vw; color: var(--text-light); writing-mode: vertical-rl; letter-spacing: 0.3em; margin-top: 1.5vw; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
.s5-kanji-sub::before { content: ''; position: absolute; top: -3vw; left: 50%; transform: translateX(-50%); width: 1px; height: 2vw; background-color: var(--text-light); box-shadow: 0 2px 5px rgba(0,0,0,0.5); }

.s5-chapter-num { position: absolute; top: -2vw; left: 2vw; font-family: 'Space Grotesk', sans-serif; font-size: 10vw; font-weight: 300; color: rgba(255,255,255,0.4); line-height: 1; z-index: 6; pointer-events: none; user-select: none; text-shadow: 0 5px 20px rgba(0,0,0,0.2); }

.s5-meta-card { position: absolute; bottom: 5%; right: 5%; color: var(--text-light); text-align: left; z-index: 20; pointer-events: none; text-shadow: 0 2px 15px rgba(0,0,0,0.7); }
.s5-meta-title { font-family: 'Noto Serif JP', serif; font-size: 1.5vw; letter-spacing: 0.1em; margin-bottom: 0.2rem; font-weight: 700; }
.s5-meta-value { font-family: 'Space Grotesk', sans-serif; font-size: 0.75vw; line-height: 1.6; opacity: 0.9; letter-spacing: 0.1em; text-transform: uppercase; }

.s5-architecture-flow { position: absolute; top: 15%; left: 52%; width: 40vw; height: 70vh; z-index: 15; display: flex; flex-direction: column; justify-content: center; gap: 4vw; }
.sys-module { display: flex; flex-direction: column; position: relative; z-index: 2; }
.sys-module:nth-child(2) { margin-left: 3vw; }
.sys-module:nth-child(3) { margin-left: 6vw; }

/* =========================================
   LOADER SPECIFIC STYLES
   ========================================= */
#loader-layer {
    background-color: var(--cobalt);
    display: flex; align-items: center; justify-content: center;
    clip-path: inset(0% 0% 0% 0%);
    pointer-events: auto;
    z-index: 5;
    transform: translateZ(0);
}

.loader-content {
    display: flex; flex-direction: column; align-items: center;
    color: var(--cream);
}

.loader-counter {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 8vw; font-weight: 800; letter-spacing: -0.02em;
    line-height: 1; font-variant-numeric: tabular-nums;
}

.loader-text {
    font-family: 'Noto Serif JP', serif; font-size: 0.9vw;
    letter-spacing: 0.6em; text-transform: uppercase;
    margin-top: 15px; opacity: 0.7;
}

.loader-progress-bar {
    width: 0%; height: 2px; background-color: var(--cream);
    margin-top: 20px; border-radius: 2px;
}

/* Ensure the split Title aligns correctly */
.info-title { display: flex; gap: 0.5vw; }
.info-title span { display: inline-block; }

@media screen and (max-width: 768px) {
    .loader-counter { font-size: 15vw; }
    .loader-text { font-size: 2.5vw; }
}
/* =========================================
   FORCE FOOTER TEXT TO EDGE-TO-EDGE
   ========================================= */
.f-massive-text {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 21.5vw !important;
    font-weight: 800 !important;
    line-height: 0.8 !important;
    text-transform: uppercase !important;
    text-align: center !important;
    color: var(--text-dark) !important;
    letter-spacing: -0.04em !important;

    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    margin-top: 4vw !important;
    margin-bottom: 2vw !important;
}
.footer-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75vw;
    color: #999;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 1.5vw;
    font-weight: 500;
}
@media screen and (max-width: 768px) {
    .footer-heading { font-size: clamp(14px, 4vw, 20px); margin-bottom: 4vw; }
}


.scroll-lock, .scroll-lock body {
    overflow: hidden !important;
    touch-action: none !important; /* Disables swipe-to-scroll on mobile */
    overscroll-behavior: none !important; /* Prevents pull-to-refresh */
}

/* Ensure it stays edge-to-edge on mobile */
@media screen and (max-width: 768px) {
    .f-massive-text {
        font-size: 24vw !important;
        margin-top: 10vw !important;
        margin-bottom: 8vw !important;
    }
}
.sys-header { display: flex; align-items: flex-end; gap: 1vw; margin-bottom: 1.2vw; position: relative; }
.sys-id { font-family: 'Space Grotesk', sans-serif; font-size: 0.65vw; color: var(--cobalt); letter-spacing: 0.2em; font-weight: 700; padding-bottom: 0.2vw; }
.sys-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.3vw; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dark); line-height: 1; }
.sys-kanji { font-family: 'Noto Serif JP', serif; font-size: 0.9vw; color: #aaa; letter-spacing: 0.1em; padding-bottom: 0.1vw; }
.sys-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-color), transparent); margin-bottom: 0.4vw; margin-left: 1vw; }

.sys-details { display: flex; flex-direction: column; gap: 0.8vw; border-left: 1px solid var(--border-color); padding-left: 1.5vw; margin-left: 1vw; transition: border-color 0.3s ease; }
.sys-module:hover .sys-details { border-left-color: var(--cobalt); }
.sys-row { display: flex; align-items: flex-start; gap: 2vw; transition: transform 0.3s ease; cursor: default; }
.sys-row:hover { transform: translateX(8px); }
.sys-label { font-family: 'Space Grotesk', sans-serif; font-size: 0.65vw; color: #666; text-transform: uppercase; letter-spacing: 0.2em; width: 6vw; padding-top: 0.2vw; flex-shrink: 0; transition: color 0.3s ease; }
.sys-row:hover .sys-label { color: var(--gold); }
.sys-value { font-family: 'Noto Sans JP', sans-serif; font-size: 0.9vw; color: #111; letter-spacing: 0.05em; line-height: 1.5; font-weight: 500; flex: 1; }

.s5-spine-right { position: absolute; top: 0; right: 3vw; height: 100%; width: 1px; background-color: var(--border-color); z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.s5-spine-text { font-family: 'Space Grotesk', sans-serif; font-size: 0.7vw; color: #666; writing-mode: vertical-rl; letter-spacing: 0.4em; transform: rotate(180deg); background-color: rgba(253, 251, 242, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 3vh 0.5vw; text-transform: uppercase; border-radius: 4px; }

.leaf-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.g-leaf { position: absolute; background-size: contain; background-repeat: no-repeat; background-position: center; filter: drop-shadow(10px 15px 15px rgba(0,0,0,0.15)); }

/* =========================================
   SCENE 6: LAYERED EDITORIAL CONTACT
   ========================================= */
.contact-section {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('/static/hero/Image 3.webp');
    background-size: cover; background-position: center; background-color: var(--cream);
    display: flex; align-items: center; justify-content: center; z-index: 40;
    clip-path: inset(100% 0 0 0);
    -webkit-backface-visibility: hidden; backface-visibility: hidden; transform: translateZ(0);
    contain: paint layout;
}

.c-blue-frame {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 72vw; height: 68vh;
    background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-dark) 100%);
    box-shadow: 0 40px 80px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 1;
}

.c-vert-accent { position: absolute; top: 4vw; right: 2vw; display: flex; flex-direction: column; align-items: center; gap: 1vw; z-index: 2; }
.c-vert-line { width: 1px; height: 4vw; background-color: var(--text-light); opacity: 0.5; }
.c-vert-text { font-family: 'Space Grotesk', sans-serif; font-size: 0.8vw; color: var(--text-light); writing-mode: vertical-rl; letter-spacing: 0.4em; }

.c-hero-kanji { position: absolute; top: 18%; right: 4vw; font-family: 'Noto Serif JP', serif; font-weight: 700; font-size: 13vw; color: var(--text-light); line-height: 1; display: flex; flex-direction: column; text-shadow: 0 15px 40px rgba(0,0,0,0.2); z-index: 2; }

.c-info-block { position: absolute; bottom: 4vw; left: 4vw; color: var(--text-light); z-index: 2; }
.c-info-title { font-family: 'Noto Serif JP', serif; font-size: 2vw; letter-spacing: 0.1em; margin-bottom: 0.6rem; font-weight: 700; }
.c-info-links { display: flex; flex-direction: column; gap: 0.4vw; }
.c-info-links a { color: var(--text-light); text-decoration: none; font-family: 'Space Grotesk', sans-serif; font-size: 0.8vw; opacity: 0.8; letter-spacing: 0.05em; transition: opacity 0.3s; width: max-content; }
.c-info-links a:hover { opacity: 1; }

.c-form-card {
    margin-bottom: 12vh; position: relative; z-index: 10;
    width: 30vw; padding: 3vw; margin-left: -10vw;
    background-image: linear-gradient(rgba(253, 251, 242, 0.85), rgba(253, 251, 242, 0.35)), url('/static/hero/Image 1.webp');
    background-size: cover; background-position: center;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 40px 80px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,1), inset 0 0 0 1px rgba(255,255,255,0.5);
    border-radius: 4px; transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.c-form-card:hover { transform: translateY(-5px); box-shadow: 0 50px 90px rgba(0,0,0,0.25), inset 0 1px 1px rgba(255,255,255,1), inset 0 0 0 1px rgba(255,255,255,0.6); }

.c-form-header { margin-bottom: 3vw; border-bottom: 1px solid var(--border-color); padding-bottom: 2vw; }
.c-form-title { font-family: 'Space Grotesk', sans-serif; font-size: 0.9vw; font-weight: 500; letter-spacing: 0.25em; color: var(--cobalt); text-transform: uppercase; margin-bottom: 0.5vw; }
.c-form-subtitle { font-family: 'Noto Serif JP', serif; font-size: 2.2vw; color: var(--text-dark); line-height: 1.2; }

.input-group { position: relative; margin-bottom: 2.5vw; }
.c-label-flex { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0.5vw; }
.c-label-eng { font-family: 'Space Grotesk', sans-serif; font-size: 0.7vw; letter-spacing: 0.2em; color: #555; text-transform: uppercase; font-weight: 600; transition: color 0.3s ease; }
.c-label-jp { font-family: 'Noto Sans JP', sans-serif; font-size: 0.65vw; color: #999; letter-spacing: 0.1em; transition: color 0.3s ease; }

.input-group input, .input-group textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-color); padding: 0.8vw 0; font-family: 'Noto Sans JP', sans-serif; font-size: 1vw; color: var(--text-dark); outline: none; transition: border-color 0.3s ease; resize: none; }
.input-group input:focus, .input-group textarea:focus { border-bottom-color: var(--cobalt); }
.input-group input:focus ~ .c-label-flex .c-label-eng, .input-group textarea:focus ~ .c-label-flex .c-label-eng { color: var(--cobalt); }
.input-group input:focus ~ .c-label-flex .c-label-jp, .input-group textarea:focus ~ .c-label-flex .c-label-jp { color: var(--gold); }

.submit-btn { background: var(--dark); color: var(--cream); border: none; width: 100%; padding: 1.2vw; font-family: 'Space Grotesk', sans-serif; font-size: 0.8vw; letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer; position: relative; overflow: hidden; margin-top: 1vw; border-radius: 2px; }
.submit-btn::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--cobalt); transform: scaleX(0); transform-origin: right; transition: transform 0.5s cubic-bezier(0.86, 0, 0.07, 1); z-index: 1; }
.submit-btn span { position: relative; z-index: 2; }
.submit-btn:hover::before { transform: scaleX(1); transform-origin: left; }

.c-leaf { position: absolute; background-size: contain; background-repeat: no-repeat; background-position: center; pointer-events: none; z-index: 20; filter: drop-shadow(15px 25px 20px rgba(0,0,0,0.25)); transform: translateZ(0); }

/* --- HERO SCROLL INDICATOR --- */
.hero-scroll-indicator {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5vh;
    z-index: 100;
    pointer-events: none;
    color: var(--text-light);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3); /* Ensures visibility over bright spots */
}

.hero-scroll-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65vw;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.9;
}

.hero-scroll-line {
    width: 1px;
    height: 7vh;
    background-color: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: var(--text-light);
    animation: dropLine 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes dropLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

@media screen and (max-width: 768px) {
    .hero-scroll-text { font-size: clamp(9px, 2.5vw, 12px); letter-spacing: 0.3em; }
    .hero-scroll-indicator { bottom: 4vh; gap: 1vh; }
    .hero-scroll-line { height: 40px; }
}


/* =========================================
   MASSIVE TYPOGRAPHIC FOOTER
   ========================================= */
.site-footer {
    position: relative; background-color: var(--cream); padding: 6vw 4.5vw 2vw 4.5vw; z-index: 10; overflow: hidden; border-top: 1px solid var(--border-color);
    background-image: linear-gradient(rgba(26, 26, 26, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 26, 26, 0.03) 1px, transparent 1px);
    background-size: 3vw 3vw; background-position: center top;
}

.f-top-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2vw; margin-bottom: 8vw; position: relative; z-index: 2; }
.f-col h4 { font-family: 'Space Grotesk', sans-serif; font-size: 0.75vw; color: #999; letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 1.5vw; }
.f-links { display: flex; flex-direction: column; gap: 1vw; }
.f-links a { font-family: 'Space Grotesk', sans-serif; font-size: 1vw; color: var(--text-dark); text-decoration: none; letter-spacing: 0.05em; transition: color 0.3s ease; width: max-content; }
.f-links a:hover { color: var(--cobalt); }

.f-status { font-family: 'Noto Serif JP', serif; font-size: 1.2vw; color: var(--text-dark); line-height: 1.6; }
.f-status span { display: block; font-family: 'Dancing Script', cursive; color: var(--cobalt); font-size: 1.6vw; margin-top: 0.5vw; }

.back-to-top { display: flex; flex-direction: column; align-items: flex-end; cursor: pointer; justify-self: end; }
.btt-text { font-family: 'Space Grotesk', sans-serif; font-size: 0.7vw; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dark); margin-bottom: 1vw; transition: opacity 0.3s ease; }
.btt-arrow { width: 3.5vw; height: 3.5vw; border: 1px solid var(--border-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; transition: border-color 0.4s ease; }
.btt-arrow-inner { font-family: 'Space Grotesk', sans-serif; font-size: 1.2vw; color: var(--text-dark); position: absolute; transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1); }
.btt-arrow-inner.default { transform: translateY(0); }
.btt-arrow-inner.hover { transform: translateY(150%); color: var(--cobalt); }
.back-to-top:hover .btt-arrow { border-color: var(--cobalt); }
.back-to-top:hover .btt-arrow-inner.default { transform: translateY(-150%); }
.back-to-top:hover .btt-arrow-inner.hover { transform: translateY(0); }
/* Hide mobile text on desktop/tablet */
.mobile-text-layer { display: none; }
.f-massive-text { font-family: 'Noto Serif JP', serif; font-weight: 900; font-size: 10.5vw; line-height: 0.8; text-align: center; color: var(--text-dark); letter-spacing: -0.03em; width: 100%; position: relative; z-index: 2; margin-bottom: 2vw; }

.f-copyright { display: flex; justify-content: space-between; margin-top: 4vw; font-family: 'Space Grotesk', sans-serif; font-size: 0.75vw; color: #888; letter-spacing: 0.1em; text-transform: uppercase; position: relative; z-index: 2; }

/* =========================================
   PROJECT MODAL
   ========================================= */
.project-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: var(--cream); background-image: linear-gradient(rgba(253, 251, 242, 0.4), rgba(253, 251, 242, 0.8)), url('/static/back1.jpg'); background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat; z-index: 9999; overflow-y: auto; overflow-x: hidden; display: none; opacity: 0; color: var(--text-dark); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: translateZ(0); }
.project-modal::-webkit-scrollbar { width: 8px; } .project-modal::-webkit-scrollbar-track { background: transparent; } .project-modal::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
.modal-close { position: fixed; top: 2vw; right: 3vw; z-index: 10000; display: flex; align-items: center; gap: 0.8vw; cursor: pointer; padding: 0.8vw 1.5vw; color: #1a1a1a; background: rgba(253, 251, 242, 0.8); backdrop-filter: blur(8px); border: 1px solid rgba(0,0,0,0.05); border-radius: 50px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s, background 0.3s; }
.modal-close:hover { transform: scale(1.05); background: rgba(253, 251, 242, 1); } .modal-close span { font-family: 'Space Grotesk', sans-serif; font-size: 0.8vw; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; } .modal-close-line { width: 2vw; height: 1.5px; background-color: currentColor; transition: width 0.3s ease; } .modal-close:hover .modal-close-line { width: 1vw; }
.modal-container { max-width: 1400px; margin: 0 auto; padding: 8vw 5vw 10vw 5vw; position: relative; }
.modal-header-flex { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 4vw; margin-bottom: 4vw; border-bottom: 1px solid var(--border-color); padding-bottom: 3vw; position: relative; }
.modal-chapter-title { flex: 1 1 50%; min-width: 300px; display: flex; flex-direction: column; } .modal-chapter { font-family: 'Space Grotesk', sans-serif; font-size: 1vw; text-transform: uppercase; color: #888; letter-spacing: 0.2em; margin-bottom: 1vw; } .modal-title { font-family: 'Noto Serif JP', serif; font-weight: 300; font-size: clamp(3rem, 5.5vw, 8.5rem); line-height: 0.9; text-transform: uppercase; letter-spacing: -0.02em; margin-left: -0.3vw; color: #111; word-break: keep-all; overflow-wrap: normal; }
.modal-meta { flex: 0 0 auto; width: clamp(250px, 22vw, 400px); display: flex; flex-direction: column; gap: 2vw; padding-bottom: 0.5vw; } .modal-core-text { font-family: 'Noto Serif JP', serif; font-size: clamp(0.9rem, 1.1vw, 1.5rem); line-height: 1.6; color: #333; } .modal-roles { display: flex; flex-direction: column; gap: 0.5vw; font-family: 'Space Grotesk', sans-serif; font-size: clamp(0.7rem, 0.85vw, 1rem); color: #666; letter-spacing: 0.05em; } .modal-roles span strong { color: #111; }
.modal-asterisk { position: absolute; top: -2vw; right: 0; font-size: 2.5vw; font-family: 'Noto Serif JP', serif; color: #1a1a1a; animation: rotateSlowly 20s linear infinite; } @keyframes rotateSlowly { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.modal-hero { width: 100%; height: 65vh; overflow: hidden; position: relative; margin-bottom: 6vw; box-shadow: 0 20px 50px rgba(0,0,0,0.1); clip-path: inset(100% 0 0 0); } .modal-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.modal-body-split { display: flex; flex-wrap: wrap; gap: 6vw; align-items: start; }
.m-section-label { font-family: 'Space Grotesk', sans-serif; font-size: clamp(0.7rem, 0.75vw, 1rem); text-transform: uppercase; letter-spacing: 0.25em; color: #888; margin-bottom: 1.5vw; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5vw; }
.modal-left-col { flex: 1 1 300px; display: flex; flex-direction: column; gap: 3vw; } .modal-overview { font-family: 'Noto Sans JP', sans-serif; font-size: clamp(0.9rem, 1vw, 1.2rem); line-height: 1.8; color: #444; } .modal-details-list { list-style: none; } .modal-details-list li { font-family: 'Noto Sans JP', sans-serif; font-size: clamp(0.85rem, 0.95vw, 1.1rem); line-height: 1.7; color: #333; margin-bottom: 1vw; padding-left: 1.2vw; position: relative; } .modal-details-list li::before { content: '✦'; position: absolute; left: 0; top: 0.2vw; font-size: 0.7vw; color: var(--cobalt); } .modal-stack { font-family: 'Space Grotesk', sans-serif; font-size: clamp(0.85rem, 0.9vw, 1.1rem); line-height: 1.6; color: #1a1a1a; font-weight: 500; }
.modal-right-col { flex: 2 1 500px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2vw; } .modal-right-col img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); transition: filter 0.3s ease; } .modal-right-col img:nth-child(3n+1) { grid-column: span 2; aspect-ratio: 16/9; } .modal-right-col img:not(:nth-child(3n+1)) { aspect-ratio: 4/5; } .modal-right-col img:hover { filter: contrast(1.05) brightness(1.05); }

/* ==========================================================================
   RESPONSIVE OVERRIDES (TABLET & MOBILE)
   ========================================================================== */

/* -----------------------------------------
   TABLET (Max Width: 1024px)
   ----------------------------------------- */
@media screen and (max-width: 1024px) {
    .blue-frame-container { width: 85%; left: 7.5%; }
    .info-title { font-size: clamp(24px, 4vw, 50px); }
    .kanji-main { font-size: clamp(80px, 15vw, 180px); }
    .award-banner-wrap { width: 90%; left: 5%; height: 40%; }
    .g-card { width: 45vw; height: 65vw; }
    .chat-content-area { width: 60vw; }
    .s5-hero-frame { width: 45vw; left: 5%; }
    .s5-architecture-flow { left: 55%; width: 40vw; }
    .c-blue-frame { width: 85vw; height: 80vh; }
    .c-form-card { width: 50vw; margin-left: -5vw; }
    .outer-text-left { left: 10%; font-size: 4vw; }
    .outer-text-right { right: 10%; max-width: 20vw; font-size: 1.2vw; }
}
@media screen and (max-width: 768px) {
    /* --- HERO TEXT FIXES (100% ISOLATED TO MOBILE) --- */

    .desktop-text { display: none !important; }
    .mobile-text-layer { display: block !important; z-index: 50; }
    .kanji-wrapper { z-index: 50 !important; }

    /* LOWER LEFT TEXT (MOBILE) */
    .mobile-text {
        left: calc(50% - 46vw) !important;
        bottom: 8% !important;
        width: 85vw !important;
        position: absolute;

        /* --- THE CONTRAST FIX --- */
        background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
        padding: 15px 20px 15px 15px !important;
        border-radius: 8px;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border-left: 2px solid rgba(255,255,255,0.4);
    }

    .info-title {
        font-size: clamp(20px, 6vw, 28px) !important;
        margin-bottom: 6px !important;
        line-height: 1.2;
        font-weight: 800 !important;
        color: #FFFFFF !important;
        text-shadow: 0px 2px 10px rgba(0,0,0,0.5) !important;
    }

    .info-subtitle {
        font-size: clamp(9px, 2.5vw, 12px) !important;
        margin-bottom: 12px !important;
        line-height: 1.5;
        max-width: 70vw;
        white-space: normal;
        opacity: 1 !important; /* Overrides inline HTML opacity */
        font-weight: 700 !important;
        color: #FFFFFF !important;
    }

    .info-links a {
        font-size: clamp(12px, 3.5vw, 15px) !important;
        margin-bottom: 5px !important;
        font-weight: 600 !important;
        color: #FFFFFF !important;
        display: block; /* Ensures links stack cleanly */
    }

    /* TOP RIGHT KANJI TEXT (MOBILE) */
    .kanji-layer {
        right: calc(50% - 46vw) !important;
        top: 12% !important;
        gap: 2vw !important;
        padding: 10px;
    }

    .kanji-main {
        font-size: clamp(45px, 14vw, 70px) !important;
        line-height: 1.05;
        color: #FFFFFF !important;
        text-shadow: 0px 4px 15px rgba(0,0,0,0.6) !important;
    }

    .kanji-sub {
        font-size: clamp(10px, 3vw, 14px) !important;
        margin-top: 5px !important;
        font-weight: 700 !important;
        color: #FFFFFF !important;
        text-shadow: 0px 2px 10px rgba(0,0,0,0.8) !important;
    }

    .kanji-sub::before {
        height: 20px !important;
        top: -25px !important;
        box-shadow: 0 0 5px rgba(0,0,0,0.8);
    }
}

/* -----------------------------------------
   MOBILE (Max Width: 768px)
   ----------------------------------------- */
@media screen and (max-width: 768px) {
    /* SCENE 1: HERO */
    .blue-frame-container { width: 90%; left: 5%; height: 75%; top: 12.5%; }
    .info-block { bottom: 6%; left: 6%; width: 88%; }
    .info-title { font-size: clamp(28px, 8vw, 40px); margin-bottom: 10px; }
    .info-links a { font-size: clamp(14px, 4vw, 20px); margin-bottom: 5px; }
    .kanji-layer { right: 5%; top: 8%; }
    .kanji-main { font-size: clamp(80px, 25vw, 120px); }
    .kanji-sub { font-size: clamp(12px, 3.5vw, 18px); margin-top: 15px; }
    .kanji-sub::before { height: 30px; top: -40px; }

    /* TRANSITION MONOLITH (IMAGE 2 FIX) */
    .outer-text-left {
        left: 2vw; /* Push to extreme left */
        font-size: clamp(22px, 6vw, 32px);
    }
    .outer-text-right {
        right: 2vw; /* Push to extreme right */
        max-width: 25vw; /* Heavily constrain width */
        font-size: clamp(9px, 2.5vw, 12px);
        line-height: 1.4;
        text-align: right; /* Force text to wrap away from the center */
    }
    .pillar-text { font-size: clamp(10px, 2.5vw, 14px); letter-spacing: 0.5em; }

    /* SCENE 2: AWARD */

    .award-top-wrap {
        top: 6%;
    }

    .top-accent-line {
        height: 25px;
        margin-bottom: 10px;
    }

    .award-top-subtitle {
        font-size: clamp(10px, 3vw, 13px);
        padding: 0 6vw;
        text-align: center;
        line-height: 1.8;
        letter-spacing: 0.15em;
    }

    .award-banner-wrap {
        width: 90%;
        left: 5%;
        top: 20%;
        height: 32%; /* Slightly shorter to give text breathing room */
    }

    /* Scale down Kanji and arrange them neatly down the left side */
    .kanji-char {
        font-size: clamp(55px, 15vw, 80px);
        text-shadow: 0 5px 20px rgba(248, 248, 245, 0.9), 0 2px 10px rgba(0,0,0,0.3);
    }
    .kanji-1 { top: 16%; left: 6%; }
    .kanji-2 { top: 35%; left: 6%; }
    .kanji-3 { top: 54%; left: 6%; }

    /* Move cursive to the right to balance the heavy left Kanji */
    .award-cursive {

        display: none;
    }

    /* Stack bottom area cleanly */
    .award-bottom-area {
        flex-direction: column;
        left: 5%;
        width: 90%;
        bottom: 5%;
        align-items: flex-start;
        gap: 3vh;
    }

    .award-deadline-block {
        margin-left: 15px; /* Creates space for the blue vertical line */
        gap: 3vw;
    }

    .award-deadline-block::before {
        left: -15px;
        height: 80%;
        top: 10%;
    }

    .deadline-text { font-size: clamp(10px, 2.5vw, 12px); }
    .deadline-number { font-size: clamp(45px, 14vw, 70px); }
    .deadline-day { width: 22px; height: 22px; font-size: 10px; }

    .award-categories-block {
        text-align: left;
    }

    .award-logo {
        font-size: clamp(18px, 5.5vw, 26px);
        margin-bottom: 6px;
    }

    .award-categories {
        font-size: clamp(9px, 2.5vw, 12px);
        line-height: 1.8;
    }

    /* SCENE 3: GALLERY */
    .gallery-scroll-wrapper { gap: 12vw; padding-left: 10vw; padding-right: 20vw; }
    .g-card { width: 75vw; height: 110vw; padding: 4vw; }
    .gallery-bg-text { font-size: 50vw; top: 30%; }
    .interlude-kanji { font-size: clamp(40px, 12vw, 80px); }
    .interlude-eng { font-size: clamp(14px, 4vw, 24px); letter-spacing: 0.3em; }

    /* SCENE 4: CHAT UI */
    .cinematic-ui-wrapper { flex-direction: column; justify-content: flex-end; }

    /* 2. Change shadow from left-to-right to bottom-to-top.
          This leaves the top half of the screen bright for the character,
          while darkening the bottom half for readable text. */
    .cinematic-shadow {
        width: 100%;
        height: 60%;
        top: auto;
        bottom: 0;
        background: linear-gradient(to top, rgba(15, 12, 10, 0.95) 0%, rgba(15, 12, 10, 0.8) 45%, transparent 100%);
    }

    /* 3. Shift the character image so her face/upper body isn't cut off at the top */
    .fg-img { object-position: 65% 15%; }

    /* 4. Restrict chat area height and pad the bottom so it clears the scroll indicator */
    .chat-content-area {
        width: 100vw;
        height: auto;
        max-height: 55vh;
        padding: 0 6vw 7vh 6vw;
        justify-content: flex-end;
    }

    /* 5. Hide unnecessary elements including the music button */
    .ui-spine { display: none; }
    .ambience-toggle-btn { display: none !important; }

    /* 6. Scale down typography to fit the new bottom layout cleanly */
    .chat-header { margin-bottom: 2vh; }
    .chat-title { font-size: clamp(16px, 5vw, 24px); letter-spacing: 0.1em; }
    .chat-subtitle { font-size: clamp(10px, 2.5vw, 12px); margin-top: 4px; }

    .msg-name { font-size: clamp(9px, 2.5vw, 12px); margin-bottom: 4px; }
    .msg-bot, .msg-user { font-size: clamp(12px, 3.5vw, 16px); line-height: 1.5; padding-left: 3vw; }

    .chat-input { font-size: clamp(12px, 3.5vw, 16px); padding: 2.5vw 0; }
    .chat-send-btn { font-size: clamp(10px, 3vw, 14px); }
    .scroll-indicator { bottom: 2vh; font-size: clamp(9px, 2.5vw, 12px); z-index: 50; }

    /* SCENE 5: ARCHITECTURE (IMAGE 1 FIX) */
    .s5-hero-frame {
        top: 6%;
        left: 5%;
        width: 90vw;
        height: 33vh; /* Strict height to prevent overlap */
    }
    .s5-architecture-flow {
        top: 38%;
        left: 5%;
        width: 90vw;
        height: auto;
        justify-content: flex-start;
        gap: 1.5vh; /* Tightened the space between the 3 main modules */
        background: rgba(253, 251, 242, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 4vw 3vw 5vw 3vw; /* Reduced side padding to give text more horizontal room */
        border-radius: 8px;
        box-sizing: border-box;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        z-index: 10;
    }

    .sys-module { margin-left: 0 !important; }

    .sys-header { margin-bottom: 1.5vw; align-items: center; }

    /* Scaled down headers so they don't awkwardly wrap */
    .sys-id { font-size: clamp(8px, 2.5vw, 11px); padding-bottom: 0; }
    .sys-title { font-size: clamp(11px, 3.2vw, 14px); margin-bottom: 0; line-height: 1.2; letter-spacing: 0.1em; }
    .sys-kanji { font-size: clamp(9px, 2.5vw, 11px); padding-bottom: 0; }

    /* Tightened the list spacing */
    .sys-details { gap: 4px; padding-left: 2.5vw; margin-left: 1.5vw; margin-top: 2px; border-left-width: 1.5px; }
    .sys-row { gap: 2vw; }

    /* Scaled down the inner text and labels */
    .sys-label { font-size: clamp(8px, 2.2vw, 10px); width: 16vw; padding-top: 1px; letter-spacing: 0.1em; }
    .sys-value { font-size: clamp(9px, 2.6vw, 12px); line-height: 1.3; letter-spacing: 0.02em; }

    .sys-module { margin-left: 0 !important; }
    .sys-id { font-size: clamp(10px, 3vw, 14px); padding-bottom: 2px; }
    .sys-title { font-size: clamp(13px, 4vw, 18px); }/* Scaled down slightly */
    .sys-kanji { font-size: clamp(10px, 3vw, 14px); }
    .sys-details { gap: 6px; padding-left: 3vw; margin-left: 2vw; margin-top: 4px; border-left-width: 2px; }
    .sys-row { gap: 3vw; }
    .sys-label { font-size: clamp(9px, 2.8vw, 12px); width: 20vw; padding-top: 2px; }
    .sys-value { font-size: clamp(11px, 3.2vw, 14px); line-height: 1.3; }

    .s5-chapter-num { font-size: clamp(80px, 25vw, 120px); top: -4vw; left: 2vw; z-index: 10; color: rgba(255,255,255,0.9); text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
    .s5-kanji-layer { right: 4vw; top: 4vw; }
    .s5-kanji-main { font-size: clamp(60px, 18vw, 100px); }
    .s5-kanji-sub { font-size: clamp(12px, 3.5vw, 16px); margin-top: 10px; }
    .s5-meta-card { bottom: 4vw; right: 4vw; }
    .s5-meta-title { font-size: clamp(16px, 5vw, 24px); }
    .s5-meta-value { font-size: clamp(10px, 3vw, 14px); }
    .s5-spine-right { display: none; }
    .s5-bg-kanji { font-size: 45vw; left: 50%; opacity: 0.1; }

    /* SCENE 6: CONTACT */
    .c-blue-frame { width: 90vw; height: 85vh; top: 50%; left: 50%; transform: translate(-50%, -50%); }
    .c-hero-kanji { font-size: clamp(60px, 18vw, 100px); top: 3vh; right: 5vw; flex-direction: row; gap: 2vw; }
    .c-vert-accent { display: none; }
    .c-form-card { width: 86vw; left: 50%; margin-left: -43vw; top: 15vh; padding: 6vw; position: absolute; }
    .c-form-header { margin-bottom: 4vw; padding-bottom: 3vw; }
    .c-form-title { font-size: clamp(14px, 4vw, 20px); margin-bottom: 5px; }
    .c-form-subtitle { font-size: clamp(20px, 6vw, 32px); line-height: 1.2; }
    .input-group { margin-bottom: 5vw; }
    .c-label-eng { font-size: clamp(12px, 3.5vw, 16px); }
    .c-label-jp { font-size: clamp(10px, 3vw, 14px); }
    .input-group input, .input-group textarea { font-size: clamp(14px, 4.5vw, 20px); padding: 2vw 0; border-bottom-width: 1.5px; }
    .submit-btn { font-size: clamp(14px, 4vw, 20px); padding: 4vw; margin-top: 2vw; }

    /* FOOTER */
    .site-footer { padding: 12vw 6vw 8vw 6vw; background-size: 6vw 6vw; }
    .f-top-grid { grid-template-columns: 1fr; gap: 10vw; margin-bottom: 15vw; }
    .f-col h4 { font-size: clamp(14px, 4vw, 20px); margin-bottom: 4vw; }
    .f-status { font-size: clamp(16px, 5vw, 24px); }
    .f-status span { font-size: clamp(24px, 7vw, 36px); margin-top: 2vw; }
    .f-links { gap: 3vw; }
    .f-links a { font-size: clamp(14px, 4.5vw, 22px); }
    .back-to-top { justify-self: flex-start; margin-top: 2vw; }
    .btt-text { font-size: clamp(12px, 3.5vw, 18px); margin-bottom: 3vw; }
    .btt-arrow { width: 12vw; height: 12vw; }
    .btt-arrow-inner { font-size: clamp(16px, 5vw, 24px); }
    .f-massive-text { font-size: clamp(36px, 12vw, 80px); margin-bottom: 8vw; }
    .f-copyright { flex-direction: column; text-align: center; gap: 4vw; font-size: clamp(10px, 3vw, 14px); margin-top: 8vw; }

    /* EDITORIAL MODAL */
    .modal-container { padding: 15vw 5vw 10vw 5vw; }
    .modal-close { top: 4vw; right: 4vw; padding: 2.5vw 5vw; }
    .modal-close span { font-size: clamp(12px, 3.5vw, 18px); }
    .modal-header-flex { flex-direction: column; gap: 6vw; align-items: flex-start; margin-bottom: 8vw; padding-bottom: 6vw; }
    .modal-chapter-title { width: 100%; min-width: unset; }
    .modal-title { font-size: clamp(40px, 12vw, 80px); }
    .modal-meta { width: 100%; gap: 4vw; }
    .modal-core-text { font-size: clamp(16px, 4.5vw, 24px); }
    .modal-roles { font-size: clamp(14px, 4vw, 20px); }
    .modal-asterisk { font-size: 10vw; top: -10vw; right: 2vw; }
    .modal-hero { height: 30vh; margin-bottom: 8vw; }
    .modal-body-split { flex-direction: column; gap: 8vw; }
    .modal-left-col, .modal-right-col { width: 100%; flex: 1 1 100%; }
    .modal-left-col { gap: 6vw; }
    .m-section-label { font-size: clamp(14px, 4vw, 20px); margin-bottom: 3vw; padding-bottom: 1.5vw; }
    .modal-overview, .modal-details-list li, .modal-stack { font-size: clamp(14px, 4vw, 20px); }
    .modal-right-col { display: flex; flex-direction: column; gap: 4vw; }
    .modal-right-col img { width: 100%; aspect-ratio: 16/9 !important; }
}
