/* --- Reset & Base Settings --- */
:root {
    --font-color-dark: #222;
    --font-color-light: #fff;
    --base-color: #fff;
    --bg-light-color: #f8f8f8;
    --accent-color: #345c7d;
    --font-family-ja: 'Noto Sans JP', sans-serif;
    --font-family-en: 'Montserrat', sans-serif;
    --container-width: 1200px;
    --container-narrow-width: 800px;
}

body {
    font-family: var(--font-family-ja);
    color: var(--font-color-dark);
    background-color: var(--base-color);
    line-height: 1.8;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; vertical-align: middle; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.container-narrow { max-width: var(--container-narrow-width); margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.section-padding { padding: 100px 0; }
.bg-light { background-color: var(--bg-light-color); }
.section-title { font-family: var(--font-family-en); text-align: center; font-size: 2rem; font-weight: 600; letter-spacing: 0.1em; margin-bottom: 60px; }
.section-lead { text-align: center; margin-bottom: 30px; }
p { text-align: center; margin: 0 0 1em 0; }
.section-button-area { text-align: center; margin-top: 40px; }
.button { display: inline-block; padding: 14px 50px; background-color: var(--accent-color); color: var(--font-color-light); border: 2px solid var(--accent-color); border-radius: 50px; text-decoration: none; font-weight: 500; transition: all 0.3s ease; cursor: pointer; }
.button:hover { background-color: var(--base-color); color: var(--accent-color); }

/* --- Header --- */
.header { background-color: transparent; padding: 20px 0; position: fixed; width: 100%; top: 0; z-index: 100; transition: background-color 0.4s, box-shadow 0.4s; }
.header.scrolled { background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.header-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.header-logo img { height: 40px; }
.logo-name { font-family: var(--font-family-en); font-weight: 600; font-size: 1.1rem; color: var(--font-color-light); text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); transition: color 0.3s; }
.header.scrolled .logo-name { color: var(--font-color-dark); text-shadow: none; }
.header-nav ul { margin: 0; padding: 0; list-style: none; display: flex; gap: 35px; }
.header-nav a { font-family: var(--font-family-en); text-decoration: none; color: var(--font-color-light); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.05em; position: relative; padding-bottom: 5px; text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); transition: color 0.3s ease; }
.header-nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width 0.3s ease; }
.header-nav a:hover { color: #ddd; }
.header.scrolled .header-nav a { color: var(--font-color-dark); text-shadow: none; }
.header.scrolled .header-nav a:hover { color: var(--accent-color); }
.header.scrolled .header-nav a:hover::after { width: 100%; }

/* --- Hamburger Menu Button --- */
.hamburger-button { display: none; position: relative; width: 40px; height: 40px; background: none; border: none; cursor: pointer; z-index: 101; }
.hamburger-bar { position: absolute; left: 5px; width: 30px; height: 2px; background-color: var(--font-color-light); transition: all 0.3s ease-in-out; }
.header.scrolled .hamburger-bar { background-color: var(--font-color-dark); }
.hamburger-bar:nth-child(1) { top: 10px; }
.hamburger-bar:nth-child(2) { top: 19px; }
.hamburger-bar:nth-child(3) { top: 28px; }
.is-menu-open .hamburger-bar:nth-child(1) { top: 19px; transform: rotate(45deg); }
.is-menu-open .hamburger-bar:nth-child(2) { opacity: 0; }
.is-menu-open .hamburger-bar:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* --- Hero --- */
.hero { height: 100vh; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.hero-image::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.2); z-index: 1; }
.hero-slideshow { width: 100%; height: 100%; }
.hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.15); transition: opacity 1.5s ease-in-out; }
.hero-slide.is-active { opacity: 1; animation: kenburns 8s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.0); } to { transform: scale(1.15); } }
.hero-text { position: relative; z-index: 2; color: var(--font-color-light); text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.hero-text h1 { font-family: var(--font-family-en); font-size: 3.5rem; font-weight: 600; margin: 0; letter-spacing: 0.05em; }
.hero-text p { font-size: 1.1rem; margin-top: 10px; }

/* --- Concept --- */
.concept { position: relative; z-index: 0; overflow: hidden; }
.concept-bg-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 400px; z-index: -1; opacity: 0.04; }
.concept-bg-logo img { width: 100%; }

/* --- Works --- */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.work-item { aspect-ratio: 4 / 3; overflow: hidden; cursor: pointer; position: relative; }
.work-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.work-item:hover img { transform: scale(1.05); }
.work-item-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%); padding: 40px 20px 20px; box-sizing: border-box; opacity: 0; transition: opacity 0.3s ease; }
.work-item:hover .work-item-overlay { opacity: 1; }
.work-item-overlay h3 { color: #fff; margin: 0; font-size: 1.2rem; text-align: left; }

/* --- Company --- */
.company-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; text-align: left; }
.company-map { min-height: 300px; background-color: #eee; }
.company-info-list dt { font-weight: 600; margin-top: 1em; }
.company-info-list dt:first-child { margin-top: 0; }
.company-info-list dd { margin-left: 0; }

/* --- CTA Banner --- */
.cta-banner {
    background-color: var(--accent-color);
    padding: 50px 0;
}
.cta-banner p {
    color: var(--font-color-light);
    font-size: 1.6rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
    letter-spacing: .08em;
}

/* --- Contact Form --- */
.contact-form-container { max-height: 0; overflow: hidden; transition: max-height 0.7s ease-in-out; }
.contact-form { margin-top: 40px; text-align: left; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-group .required { color: #e74c3c; margin-left: 5px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.form-group textarea { resize: vertical; }
.form-group button { width: 100%; }

/* --- Footer --- */
.footer { background-color: var(--font-color-dark); color: var(--base-color); padding: 30px 0; text-align: center; font-size: 0.8rem; }
.footer p { margin: 0; opacity: 0.7; }

/* --- Lightbox --- */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.lightbox.is-open { display: flex; }
.lightbox-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(20, 20, 20, 0.9); backdrop-filter: blur(8px); }
.lightbox-container { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; width: 100%; max-width: 1400px; height: 90vh; max-height: 800px; position: relative; }
.lightbox-content { position: relative; display: flex; align-items: center; justify-content: center; }
#lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-info { background-color: rgba(0,0,0,0.2); color: #fff; padding: 30px; overflow-y: auto; text-align: left; }
.lightbox-header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 10px; margin-bottom: 20px; }
#lightbox-title { margin: 0; }
#lightbox-description { font-size: 0.9em; line-height: 1.7; }
.lightbox-close { position: absolute; top: -10px; right: 0px; font-size: 40px; color: #fff; background: transparent; border: none; cursor: pointer; line-height: 1; z-index: 10; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0, 0, 0, 0.3); color: #fff; border: none; cursor: pointer; transition: background-color 0.2s; z-index: 5; font-size: 1.2rem; padding: 15px; }
.lightbox-nav:hover { background-color: rgba(0, 0, 0, 0.6); }
.image-nav.prev { left: 10px; }
.image-nav.next { right: 10px; }
.project-nav { top: auto; bottom: 20px; font-size: 1rem; padding: 10px 20px; }
.project-nav.prev { left: 20px; }
.project-nav.next { right: 20px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .logo-name { display: none; }
    .hamburger-button { display: block; }
    .header-nav { position: fixed; top: 0; right: -100%; width: 70%; max-width: 300px; height: 100vh; background-color: rgba(20, 20, 20, 0.9); backdrop-filter: blur(10px); transition: right 0.5s ease-in-out; z-index: 100; overflow-y: auto; }
    .is-menu-open .header-nav { right: 0; }
    .header-nav ul { flex-direction: column; justify-content: flex-start; align-items: center; min-height: 100vh; gap: 20px; padding: 120px 20px 80px; box-sizing: border-box; }
    .header-nav a { color: #fff !important; text-shadow: none; font-size: 1.2rem; }
    .header-nav a:hover { color: #ddd !important; }
    .header-nav a::after { background-color: #fff !important; }
    .header-nav a:hover::after { width: 100%; }
    .hero-text h1 { font-size: 2.5rem; }
    .concept-bg-logo { width: 300px; opacity: 0.03; }
    .works-grid { grid-template-columns: repeat(2, 1fr); }
    .company-info-grid { grid-template-columns: 1fr; }
    .company-map { grid-row: 1; }
    .cta-banner p { font-size: 1.3rem; padding: 0 20px; }
    .lightbox-container { grid-template-columns: 1fr; height: 85vh; }
    .lightbox-info { grid-row: 2; overflow-y: visible; max-height: 30vh; }
    .project-nav { bottom: auto; top: 20px; }
}

@media (max-width: 480px) {
    .works-grid { grid-template-columns: 1fr; }
}
