@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..1000;1,6..96,400..1000&family=Inter:wght@300;400;600&family=Noto+Serif+JP:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #ffffff;
    --dark-bg: #1a1a1a;
    --text-color: #1a1a1a;
    --light-text: #ffffff;
    --serif-font: 'Noto Serif JP', 'Bodoni Moda', serif;
    --script-font: 'Dancing Script', cursive;
    --body-font: 'Inter', 'Noto Serif JP', sans-serif;
    --light-border: rgba(0, 0, 0, 0.05);
    --dark-border: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    font-family: var(--body-font);
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Script font for brand elements only */
.nav-brand, .hero-title-script, .hero-title-main {
    font-family: var(--script-font) !important;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--light-border);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.nav-brand {
    font-size: 2rem;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem; /* Small gap between li, but links have internal padding */
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    transition: all 0.4s ease;
}

.nav-links li:nth-child(1) a:hover,
.nav-links li:nth-child(1) a.active {
    background-color: #E3F2FD; /* Pastel Blue for Top */
}

.nav-links li:nth-child(2) a:hover,
.nav-links li:nth-child(2) a.active {
    background-color: #FCE4EC; /* Pastel Pink for About */
}

.nav-links li:nth-child(3) a:hover,
.nav-links li:nth-child(3) a.active {
    background-color: #E8F5E9; /* Pastel Green for Works */
}

.nav-cta a:hover,
.nav-cta a.active {
    background-color: #FFFDE7; /* Pastel Yellow for Company */
    transform: translateY(-2px);
}

/* Hero Section - 6-Grid Background */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: #0a0a0a;
    scroll-snap-align: start;
}

.hero-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    object-fit: cover;
    filter: grayscale(0%);
    opacity: 0.8;
    animation: fadeToMono 8s forwards ease-in-out 3s;
}

/* .grid-cell is no longer used in HTML but kept for reference or future grid overlays */
.grid-cell {
    display: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    z-index: 2;
}

/* Content Card */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(40px);
    width: min(800px, 90vw);
    height: min(400px, 60vh);
    max-width: 90vw;
    z-index: 11;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: expandBox 2.5s forwards cubic-bezier(0.77, 0, 0.175, 1) 4.5s;
    overflow: hidden;
}

.hero-title-script {
    font-size: 6rem;
    color: #1a1a1a;
    display: block;
    line-height: 0.8;
    margin-bottom: 1rem;
    animation: fadeOutAndShrink 1.5s forwards ease 4s;
}

.hero-title-main {
    font-size: 4.5rem;
    color: #1a1a1a;
    margin: 0;
    transition: transform 1s ease-in-out;
}

.hero-subtitle {
    font-size: 1rem;
    color: #444;
    letter-spacing: 0.15em;
    margin-top: 1.5rem;
    animation: fadeOutAndShrink 1.5s forwards ease 4s;
}

.hero-menu {
    display: flex;
    gap: 1.5rem;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    height: 0;
    animation: fadeInMenu 1.5s forwards ease 5.5s;
}

.hero-menu-item {
    font-family: var(--serif-font);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: #1a1a1a;
    padding: 1rem 2.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.hero-menu-item:hover {
    color: #1a1a1a;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #333;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    animation: fadeOutNormal 1.5s forwards ease 4s;
}

.mouse {
    width: 2px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.mouse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    animation: scrollLine 2s infinite;
}

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

/* Section Transitions (White & Black) */
.section {
    min-height: 100vh;
    padding: 6rem 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
}

.section-black {
    background-color: var(--primary-bg);
    color: var(--text-color);
}

.section-black .section-title { color: var(--text-color); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.mini-container {
    max-width: 800px;
}

.section-title {
    font-family: var(--serif-font);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 400;
    letter-spacing: 0.1em;
}

/* About Section */
.about-content {
    text-align: center;
}

.editorial-text {
    font-family: var(--serif-font);
    font-size: 1.5rem;
    line-height: 2.2;
    margin-bottom: 3rem;
    font-weight: 300;
}

.no-break {
    display: inline-block;
}

.editorial-subtext {
    font-size: 0.95rem;
    color: #888;
    max-width: 600px;
    margin: 0 auto;
    line-height: 2;
}

/* Works Section */
.works-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.works-tab {
    padding: 0.8rem 2rem;
    border: 1px solid #eee;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-family: var(--serif-font);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.works-tab:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.works-tab.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.works-category {
    display: none;
}

.works-category.active {
    display: block;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.work-item {
    background: #fff;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    height: auto;
    display: block;
}

.work-info {
    position: relative;
    z-index: 2;
    background: transparent;
    padding: 0;
    width: 100%;
    transform: none;
    transition: none;
}

.work-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.work-item h3 {
    font-family: var(--serif-font);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 0.7rem;
    color: #1a1a1a;
}

.work-item p {
    font-size: 0.85rem;
    color: #888;
}

/* Company Section */
.company-table {
    max-width: 600px;
    margin: 0 auto;
}

.company-row {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.5rem 0;
}

.company-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 0.05em;
}

.company-value {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Contact Card */
.contact-card {
    background: #fff;
    padding: 4rem;
    border: 1px solid var(--light-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #aaa;
    letter-spacing: 0.05em;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 1.2rem;
    background: #f9f9f9;
    border: 1px solid #eee;
    color: var(--text-color);
    font-size: 0.95rem;
    font-family: var(--body-font);
    transition: all 0.3s;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #fff;
}

.submit-btn {
    width: 100%;
    border: 1px solid #fff;
    background: #fff;
    color: #1a1a1a;
    font-size: 0.95rem;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.submit-btn:hover {
    background: transparent;
    color: #fff;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 5%;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid var(--light-border);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-title-script { font-size: 4rem; }
    .hero-title-main { font-size: 3rem; }
    .hero-content { padding: 4rem 5rem; }
    .works-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar { padding: 1rem 5%; }
    .nav-links { display: none; }

    .hero-grid-bg {
        /* Prevent distortion on vertical screens */
        object-fit: cover;
        object-position: center;
    }

    .hero-content {
        padding: 2rem 1.5rem;
        width: 90vw;
        height: auto;
        min-height: 250px;
    }

    .hero-title-script {
        font-size: 3.5rem;
        margin-bottom: 0.5rem;
    }

    .hero-title-main {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }

    .hero-subtitle {
        letter-spacing: 0.1em;
        font-size: 0.75rem;
        max-width: 80%;
    }

    .hero-menu {
        flex-direction: column;
        gap: 1.2rem;
        margin-top: 2rem;
        width: 100%;
        align-items: center;
    }

    .hero-menu-item {
        font-size: 1rem;
        padding: 0.8rem 2rem;
        width: 70%;
        display: block;
        text-align: center;
    }

    .section-title { font-size: 1.8rem; }

    .section {
        padding: 4rem 10%;
    }

    .editorial-text {
        font-size: 1.2rem;
        line-height: 1.8;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .editorial-subtext {
        font-size: 0.85rem;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .works-nav {
        gap: 0.3rem;
    }

    .works-tab {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .contact-card {
        padding: 2rem;
    }

    .company-row {
        flex-direction: column;
        gap: 0.3rem;
    }

    .company-label {
        width: auto;
    }
}
@keyframes fadeToMono {
    0% { filter: grayscale(0%); opacity: 0.8; }
    100% { filter: grayscale(100%); opacity: 0.6; }
}

@keyframes expandBox {
    0% {
        width: min(800px, 90vw);
        height: min(400px, 60vh);
        background: rgba(255, 255, 255, 0.6);
    }
    100% {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border: none;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 0;
    }
}

@keyframes fadeOutAndShrink {
    0% { opacity: 1; transform: translateY(0); max-height: 150px; }
    100% { opacity: 0; transform: translateY(-20px); max-height: 0; padding: 0; margin: 0; visibility: hidden; border: none; }
}

@keyframes fadeInMenu {
    0% { opacity: 0; visibility: hidden; transform: translateY(20px); height: 0; margin-top: 0; }
    100% { opacity: 1; visibility: visible; transform: translateY(0); height: auto; margin-top: 3rem; }
}

@keyframes fadeOutNormal {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    color: #1a1a1a;
    transition: transform 0.3s ease;
}

.back-to-top:hover {
    background: #1a1a1a;
    transform: translateY(-5px);
}

.back-to-top:hover svg {
    color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 25px;
        right: 25px;
        width: 50px;
        height: 50px;
    }
}
