/* --- 1. Reset & Base --- */
:root {
    --color-bg: #0A192F;
    --color-text: #F4F4F4;
    --color-gold: #C5A059;
    --color-gray: #8892B0;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-mincho: 'Shippori Mincho', serif;
    --font-en: 'Manrope', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-jp);
    line-height: 1.8;
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.5s;
}
body.loaded { opacity: 1; }

html { scroll-behavior: smooth; }

a { text-decoration: none; color: inherit; transition: 0.3s; }
img { width: 100%; display: block; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; outline: none; -webkit-appearance: none; border-radius: 0; }

/* --- 2. Utility --- */
.en { font-family: var(--font-en); letter-spacing: 0.05em; }
.mincho { font-family: var(--font-mincho); }
.gold { color: var(--color-gold); }
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
#bg-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* Chunking for Mobile Text */
.txt-chunk { display: inline-block; }
.pc-br { display: block; }

/* --- 3. Loading --- */
#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--color-bg); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo img { width: 180px; height: auto; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* --- 4. Header & Menu --- */
.header {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px; z-index: 2000;
}
.logo { z-index: 2001; display: flex; height: 100%; align-items: center; }
.logo img { height: 40px; width: auto; }

.menu-btn {
    width: 40px; height: 20px; cursor: pointer; z-index: 2001;
    display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; 
}
.menu-btn span { height: 2px; background-color: #fff; width: 100%; transition: 0.4s ease; }
.menu-btn span:last-child { width: 60%; }
.menu-btn.active span:first-child { transform: rotate(45deg) translate(5px, 8px); width: 100%; }
.menu-btn.active span:last-child { transform: rotate(-45deg) translate(5px, -8px); width: 100%; }

.nav-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: rgba(10, 25, 47, 0.98); z-index: 1500;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.5s;
}
.nav-overlay.active { opacity: 1; visibility: visible; }
.nav-list { text-align: center; }
.nav-list li { margin: 30px 0; opacity: 0; transform: translateY(20px); transition: 0.5s; }
.nav-overlay.active .nav-list li { opacity: 1; transform: translateY(0); }
.nav-list a { font-size: 32px; font-family: var(--font-en); font-weight: 700; color: #fff; }
.nav-list a:hover { color: var(--color-gold); letter-spacing: 0.1em; }

/* --- 5. Hero --- */
.hero { 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    position: relative; 
    width: 100%;
}
.hero-content { 
    z-index: 2; 
    width: 100%; 
    padding: 0 20px; 
}
.hero-sub { 
    font-size: clamp(14px, 3vw, 24px); 
    color: var(--color-gold); 
    letter-spacing: 0.2em; 
    margin-bottom: 20px; 
    display: inline-block; 
    font-weight: 500;
}
.hero-title { 
    font-size: clamp(40px, 9vw, 115px); 
    font-weight: 700; 
    line-height: 1.2;
    font-feature-settings: "palt"; 
    letter-spacing: 0.05em;
    padding-left: 0.4em;
}

/* --- 6. About --- */
.about {
    padding: 100px 5%;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.about-text {
    font-size: clamp(20px, 4vw, 48px);
    line-height: 1.6;
    letter-spacing: 0.04em;
    font-weight: 500;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
}

/* --- 7. Services --- */
.services { background-color: var(--color-bg); position: relative; z-index: 2; padding-bottom: 100px; }
.services-wrapper { display: flex; max-width: 1400px; margin: 0 auto; padding: 100px 5%; gap: 60px; }
.services-header { width: 30%; position: sticky; top: 100px; height: fit-content; }
.services-title-en { font-size: 60px; font-weight: 700; color: rgba(255,255,255,0.05); line-height: 1; }
.services-title-jp { font-size: 24px; margin-top: -20px; margin-left: 10px; color: var(--color-gold); }
.services-list { width: 70%; display: flex; flex-direction: column; gap: 40px; }
.service-card {
    border: 1px solid rgba(197, 160, 89, 0.3); padding: 50px;
    background: rgba(255,255,255,0.02); backdrop-filter: blur(5px);
    transition: 0.4s; opacity: 1;
}
.service-card:hover { border-color: var(--color-gold); background: rgba(197, 160, 89, 0.1); transform: translateX(10px); }
.service-num { font-size: 14px; color: var(--color-gold); display: block; margin-bottom: 10px; }
.service-name { font-size: 28px; margin-bottom: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-desc { font-size: 14px; color: var(--color-gray); }

/* --- 8. Works --- */
.works { padding: 100px 0; overflow: hidden; background-color: #081426; }
.works-title { padding-left: 5%; font-size: 40px; margin-bottom: 60px; }
.works-track-wrapper { width: 100%; overflow: hidden; }
.works-track { display: flex; width: max-content; gap: 40px; padding-left: 5%; padding-right: 5%; }
.work-item { width: 500px; height: 350px; position: relative; flex-shrink: 0; overflow: hidden; }
.work-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.work-item:hover img { transform: scale(1.1); }
.work-info { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); }

/* --- 9. Company --- */
.company { padding: 120px 0; background-color: var(--color-bg); }
.company-header { margin-bottom: 60px; text-align: left; }
.company-title-en { font-size: 40px; font-weight: 700; color: var(--color-text); margin-bottom: 10px; }
.company-title-jp { font-size: 16px; color: var(--color-gold); }
.company-info { width: 100%; border-top: 1px solid rgba(255,255,255,0.2); }
.company-row { display: flex; border-bottom: 1px solid rgba(255,255,255,0.2); padding: 30px 0; align-items: flex-start; }
.company-label { width: 25%; color: var(--color-gold); font-weight: 500; font-size: 16px; }
.company-value { width: 75%; color: var(--color-text); font-size: 16px; line-height: 1.8; }

/* --- 10. Contact Trigger --- */
.contact-section { height: 80vh; display: flex; justify-content: center; align-items: center; background: #050d1a; }
.contact-circle {
    width: 200px; height: 200px; border: 1px solid var(--color-gold); border-radius: 50%;
    display: flex; justify-content: center; align-items: center; transition: 0.5s; position: relative; cursor: pointer;
}
.contact-circle:hover { background-color: var(--color-gold); color: #000; transform: scale(1.1); }

/* --- 11. Contact Form Overlay --- */
#contactOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #0A192F; z-index: 3000;
    opacity: 0; visibility: hidden; transition: 0.6s;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#contactOverlay.active { opacity: 1; visibility: visible; }
.contact-container { width: 90%; max-width: 800px; margin: 100px auto; padding-bottom: 100px; position: relative; }
.contact-close {
    position: fixed; top: 30px; right: 40px; font-size: 40px; color: var(--color-text); 
    cursor: pointer; transition: 0.3s; z-index: 3001; font-weight: 300;
}
.contact-close:hover { color: var(--color-gold); transform: rotate(90deg); }

.form-header { text-align: center; margin-bottom: 60px; }
.form-title { font-size: 32px; font-family: var(--font-en); margin-bottom: 20px; }
.form-intro { font-size: 14px; color: var(--color-gray); line-height: 1.8; }
.form-row { display: flex; gap: 40px; margin-bottom: 40px; }
.form-group { flex: 1; position: relative; margin-bottom: 40px; }
.form-group.full { width: 100%; }
.form-label { font-size: 12px; color: var(--color-gold); margin-bottom: 10px; display: block; letter-spacing: 0.1em; }
.required-mark { color: #ff6b6b; margin-left: 5px; }
.form-input, .form-select, .form-textarea {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.2);
    color: #fff; font-size: 16px; padding: 12px 0; transition: 0.3s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-bottom-color: var(--color-gold); }
.form-select { cursor: pointer; }
.form-select option { background-color: #0A192F; color: #fff; }
.form-textarea { resize: none; height: 120px; }
.form-privacy { font-size: 12px; color: var(--color-gray); margin-bottom: 40px; text-align: center; line-height: 1.6; }
.form-privacy a { text-decoration: underline; }
.form-btn-wrapper { text-align: center; }
.submit-btn {
    background: transparent; border: 1px solid var(--color-gold); color: var(--color-gold);
    padding: 15px 80px; font-size: 16px; letter-spacing: 0.1em; cursor: pointer; transition: 0.4s;
    position: relative; overflow: hidden;
}
.submit-btn:hover { background: var(--color-gold); color: #000; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.success-message, .error-message { display: none; text-align: center; padding: 60px 0; animation: fadeIn 0.5s; }
.success-title { font-size: 24px; color: var(--color-gold); margin-bottom: 20px; }
.error-text { color: #ff6b6b; }
@keyframes fadeIn { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

/* ★PC版: 20pxの間隔（少しだけ空ける） */
.form-clear {
    display: block; 
    margin: 20px auto 0; /* PCは20px */
    width: fit-content;
    font-size: 13px;
    color: var(--color-gray);
    cursor: pointer;
    text-decoration: underline;
    transition: 0.3s;
    opacity: 0.7;
    letter-spacing: 0.05em;
}
.form-clear:hover {
    color: var(--color-gold);
    opacity: 1;
}

/* --- 12. Scroll to Top Button --- */
#scrollTopBtn {
    position: fixed; bottom: 30px; right: 25px;
    width: 45px; height: 45px;
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid var(--color-gold);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 90;
    opacity: 0; pointer-events: none; transition: all 0.4s ease;
    backdrop-filter: blur(4px);
}
#scrollTopBtn.active { opacity: 1; pointer-events: auto; }
#scrollTopBtn::before {
    content: ''; width: 10px; height: 10px;
    border-top: 2px solid var(--color-gold);
    border-left: 2px solid var(--color-gold);
    transform: rotate(45deg); margin-top: 4px;
}
#scrollTopBtn:hover { background: var(--color-gold); }
#scrollTopBtn:hover::before { border-color: #0A192F; }

/* Footer */
.footer { padding: 40px 5%; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; font-size: 12px; color: var(--color-gray); }

/* --- SP Responsive Fixes --- */
@media (max-width: 768px) {
    .header { padding: 0 20px; }
    .logo img { height: 30px; }
    
    .about { padding: 60px 10px; }
    .about-text { font-size: clamp(24px, 7vw, 40px); line-height: 1.6; width: 100%; }
    .txt-chunk { display: inline; }
    .pc-br { display: none; } 
    
    .services-wrapper { flex-direction: column; padding: 80px 5%; }
    .services-header { position: relative; top: 0; width: 100%; margin-bottom: 40px; }
    .services-list { width: 100%; }
    .service-card { padding: 30px 20px; } 
    .service-name { font-size: 20px; } 
    .work-item { width: 80vw; height: 60vw; }
    
    .form-row { flex-direction: column; gap: 0; margin-bottom: 0; }
    .contact-close { top: 20px; right: 20px; }
    .contact-container { margin-top: 80px; }
    .company-row { flex-direction: column; padding: 20px 0; }
    .company-label { width: 100%; margin-bottom: 10px; }
    .company-value { width: 100%; }

    /* ★スマホ版: 強制的に80pxの間隔を空ける */
    .form-clear {
        margin-top: 80px; 
    }
}