:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ce0000;
    --secondary-color: #1a1a1a;
    --gray-color: #888888;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 9999;
    transform: translateZ(9999px);
    /* Force stay on top of 3D elements */
    transition: 0.4s;
}

header.scrolled {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    height: 60px;
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-links a:hover {
    color: #fff;
}

.lang-switcher {
    display: flex;
    gap: 15px;
}

.lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
}

.lang-btn.active {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
    transition: 0.3s;
}

.social-links a:hover {
    color: #fff;
    transform: translateY(-2px);
}

.social-links svg {
    width: 100%;
    height: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20002;
    /* Ensure above mobile nav and other overlays */
    position: relative;
    /* Needed for z-index */
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    z-index: 20000;
    /* High but below toggle */
    transform: translateY(-100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
    pointer-events: none;
    visibility: hidden;
}

.mobile-nav.active {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
    padding: 0;
}

.mobile-nav-links li {
    margin: 30px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-nav.active .mobile-nav-links li {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for links */
.mobile-nav.active .mobile-nav-links li:nth-child(1) {
    transition-delay: 0.3s;
}

.mobile-nav.active .mobile-nav-links li:nth-child(2) {
    transition-delay: 0.4s;
}

.mobile-nav.active .mobile-nav-links li:nth-child(3) {
    transition-delay: 0.5s;
}

.mobile-nav.active .mobile-nav-links li:nth-child(4) {
    transition-delay: 0.6s;
}

.mobile-nav-links a {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
        z-index: 10001;
        /* Ensure above mobile nav */
    }

    .nav-container {
        padding: 0 20px;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Only allow on mobile */
    }

    .header-right .social-links {
        display: none;
        /* Hide header social links on mobile */
    }

    .mobile-social-links {
        display: flex;
        gap: 20px;
        margin-top: 40px;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease 0.7s;
        /* Delay after links */
    }

    .mobile-nav.active .mobile-social-links {
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-social-links a {
        color: #fff;
        opacity: 0.7;
        transition: opacity 0.3s;
    }

    .mobile-social-links a:hover {
        opacity: 1;
    }

    .mobile-social-links svg {
        width: 24px;
        height: 24px;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
        /* Completely kill on desktop */
    }
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.slider-container {
    height: 100%;
    width: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease;
    display: flex;
    align-items: center;
    pointer-events: none;
    /* Fix: Hidden slides shouldn't capture clicks */
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* Hero Indicators */
.hero-indicators {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    gap: 15px;
    z-index: 10;
}

.indicator {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--accent-color);
    width: 60px;
}

.slide-content h1 {
    font-size: clamp(40px, 8vw, 80px);
    line-height: 1.1;
    margin-bottom: 20px;
}

.slide-content p {
    color: var(--accent-color);
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* Sections */
section {
    padding: 100px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
}

/* About Section Enhancements */
#about {
    padding: 150px 0;
    text-align: center;
    background-color: #0a0a0a;
}

.intro-text {
    font-size: clamp(24px, 4vw, 42px);
    line-height: 1.6;
    font-weight: 700;
    color: #fff;
    max-width: 1000px;
    margin: 0 auto;
    letter-spacing: 0.05em;
    word-break: keep-all;
}

@media (max-width: 768px) {
    #about {
        padding: 80px 0;
    }

    .intro-text {
        font-size: 20px;
        line-height: 1.5;
    }
}

.section-title {
    font-size: 32px;
    margin-bottom: 60px;
    letter-spacing: 2px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.view-all {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--accent-color);
}

.news-list-container {
    display: flex;
    flex-direction: column;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: 0.3s;
}

.news-item:hover {
    background: rgba(139, 0, 0, 0.05);
    padding-left: 20px;
}

.news-meta {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.news-date {
    font-size: 14px;
    color: var(--gray-color);
    font-weight: 600;
}

.news-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 2px 8px;
    letter-spacing: 1px;
}

#home-news-list .news-tag {
    display: none;
}

.news-title {
    flex: 1;
    font-size: 20px;
    font-weight: 400;
}

.news-arrow {
    opacity: 0.2;
    transition: 0.3s;
    font-size: 24px;
}

.news-item:hover .news-arrow {
    opacity: 1;
    transform: translateX(10px);
    color: var(--accent-color);
}

.intro-text {
    font-size: clamp(20px, 4vw, 36px);
    line-height: 1.6;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    word-break: break-word;
    /* Allow break for long words if necessary */
    overflow-wrap: break-word;
    /* Standard property */
    white-space: normal;
    /* Ensure wrapping */
    box-sizing: border-box;
}

:lang(ja) .intro-text {
    word-break: break-all;
    /* Better wrapping for Japanese */
}

/* Works Grid */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 50px 30px;
    perspective: 1000px;
}

.work-card {
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
    position: relative;
    transform: perspective(1000px) rotateX(var(--rX, 0deg)) rotateY(var(--rY, 0deg));
}

.work-card:hover {
    z-index: 10;
}

.work-img {
    width: 100%;
    aspect-ratio: 2/3;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.4s ease;
    overflow: hidden;
    position: relative;
    transform: translateZ(20px);
}

.card__shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(115deg,
            transparent 20%,
            rgba(255, 255, 255, 0.4) 48%,
            rgba(255, 255, 255, 0.5) 52%,
            transparent 80%);
    background-size: 200% 200%;
    background-position: var(--x) var(--y);
    mix-blend-mode: color-dodge;
    opacity: 0;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.card__glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--x) var(--y),
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    z-index: 4;
    transition: opacity 0.3s ease;
}

.work-card:hover .card__shine,
.work-card:hover .card__glare {
    opacity: 1;
}

.work-card:hover .work-img {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 59, 48, 0.2);
}

.work-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0.6;
}

.work-info {
    padding: 20px 0;
    transform: translateZ(20px);
}

.work-info h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.work-year {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 15px;
    }

    .work-info h3 {
        font-size: 16px;
    }

    .work-year {
        font-size: 12px;
    }
}

/* Contact Form */
.contact-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 80px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 15px;
    background: var(--secondary-color);
    border: 1px solid #333;
    color: #fff;
    border-radius: 0;
    /* Remove default rounded borders on iOS */
    -webkit-appearance: none;
    /* Remove default styling on iOS */
    -moz-appearance: none;
    appearance: none;
    font-size: 16px;
    /* Prevent zoom on iOS */
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
}

.btn-submit {
    background: var(--accent-color);
    color: #fff;
    padding: 15px 40px;
    border: none;
    cursor: pointer;
    font-weight: 700;
}


/* News Modal (Lightbox) */
.news-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    overflow-y: auto;
    cursor: pointer;
    padding: 40px 0;
}

.news-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0a0a0a;
    width: 90%;
    max-width: 800px;
    padding: 60px;
    margin: auto;
    /* Magic centering for flex children */
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.modal-header {
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.modal-tag {
    color: var(--accent-color);
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 12px;
    margin-bottom: 10px;
    display: block;
}

.modal-title {
    font-size: clamp(24px, 4vw, 36px);
    margin-bottom: 15px;
    line-height: 1.2;
}

.modal-date {
    color: var(--gray-color);
    font-size: 14px;
}

.modal-body {
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 60px;
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-nav-btn {
    color: var(--gray-color);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

.modal-nav-btn:hover {
    color: var(--accent-color);
}

.modal-nav-btn.disabled {
    opacity: 0.2;
    cursor: default;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 40px 20px;
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }

    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        position: relative;
    }

    .news-title {
        order: -1;
        width: 100%;
        font-size: 16px;
        line-height: 1.5;
    }

    .news-meta {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .news-date {
        font-size: 13px;
        opacity: 0.7;
    }

    .news-arrow {
        position: absolute;
        right: 0;
        bottom: 0;
        font-size: 20px;
    }

    /* Contact Form Mobile */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .btn-submit {
        width: 100%;
    }
}

footer {
    padding: 80px 0 40px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-social-links a {
    color: var(--gray-color);
    transition: 0.3s;
}

.footer-social-links a:hover {
    color: var(--accent-color);
}

.footer-social-links svg {
    width: 24px;
    height: 24px;
}

footer p {
    color: var(--gray-color);
    font-size: 14px;
    letter-spacing: 1px;
    opacity: 0.6;
}