:root {
    --primary-color: #ff007f;
    /* Magenta/Pinkish tone based on description */
    --secondary-color: #1a1a1a;
    --text-color: #333;
    --bg-color: #fff;
    --hero-text-color: #fff;
    --font-main: 'Noto Sans KR', sans-serif;
    --font-eng: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background: #000;
    /* Prevent white lines between sections */
}

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

html {
    scroll-behavior: smooth;
}

/* Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    padding: 20px 0;
    transition: background 0.3s ease;
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #1a1a1a;
    /* Dark text for visibility on light Spline bg */
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

#main-header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    /* Essential for z-index to work */
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: #1a1a1a;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Nav Styles */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        z-index: 1000;
        transition: right 0.3s ease;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    nav a {
        font-size: 1.5rem;
    }

    /* Hamburger Animation when Active */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

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

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


.logo-img {
    height: 60px;
    /* Adjust based on actual aspect ratio */
    width: auto;
    display: block;
}

/* Hero Section */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #f0f0f0;
    /* Fallback */
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Removed gradient to let Spline 3D show clearly */
    background: #f0f0f0;
}

spline-viewer {
    width: 100%;
    height: 100%;
    display: block;
}



.hero-content {
    position: relative;
    z-index: 2;
}

.main-copy {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.sub-copy {
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    /* Changed to white */
}

/* Stats Section */
#stats {
    padding: 50px 0;
    /* Reduced from 80px to ~60% (user asked for 80%, giving a bit more reduction for sleekness) */
    background: #000;
    /* Changed to black */
    text-align: center;
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
    /* Estimated height to prevent scrollbar jump */
}

#stats .container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.stat-item {
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-content {
    display: flex;
    align-items: baseline;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-eng);
}

.stat-unit {
    font-size: 2.5rem;
    /* Smaller than number */
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-eng);
    margin-left: 5px;
}

.stat-label {
    font-size: 1.1rem;
    color: #fff;
    /* Changed to white */
    font-weight: 600;
    letter-spacing: 1px;
}

/* Brands Section */
#brands {
    padding: 60px 0;
    background: #fff;
    /* Changed to white as requested implies cleaner look */
    text-align: center;
}

#brands h2 {
    margin-bottom: 40px;
    font-size: 1.5rem;
    color: #333;
    font-weight: 700;
}

.brand-carousel {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.brand-track {
    display: flex;
    width: calc(175px * 40);
    /* 70% of 250px = 175px */
    will-change: transform;
    /* Optimize scaling */
    animation: scroll 50s linear infinite;
}

.brand-item {
    width: 175px;
    padding: 0 20px;
    /* Reduced padding slightly */
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-item img {
    max-width: 100%;
    max-height: 56px;
    /* 70% of 80px = 56px */
    object-fit: contain;
    filter: grayscale(100%);
    /* Optional: make them uniform */
    opacity: 0.7;
    transition: filter 0.3s, opacity 0.3s;
}

.brand-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-175px * 20));
        /* Move by half the total width */
    }
}

/* Services Section */
#services {
    padding: 100px 0;
    background: #f8f9fa;
    /* Light grey bg to make white cards pop */
}

.services-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    position: relative;
}

.services-left {
    position: sticky;
    top: 150px;
    height: fit-content;
    text-align: right;
    padding-right: 20px;
}

.services-left h3 {
    font-size: 2.5rem;
    /* Match Works title size */
    font-family: var(--font-eng);
    color: var(--secondary-color);
    line-height: 1.2;
}

.services-right {
    position: relative;
    padding-left: 40px;
    /* Space for the line */
}

/* Timeline Line */
.timeline-line {
    position: absolute;
    top: 40px;
    left: 0;
    width: 2px;
    height: calc(100% - 100px);
    background: #e0e0e0;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s ease-out;
}

/* Service Cards */
.service-card {
    position: relative;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 60px;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(50px);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.service-card.active {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    position: absolute;
    top: 40px;
    /* Align with top of card content approximately */
    left: -49px;
    /* Distance to line center (40px padding + half of line width + dot centering) */
    width: 16px;
    height: 16px;
    background: #fff;
    border: 3px solid #ccc;
    border-radius: 50%;
    z-index: 2;
    transition: border-color 0.3s, background-color 0.3s;
}

.service-card.active .timeline-dot {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.service-card h4 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.service-desc {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.service-detail {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
    word-break: keep-all;
}

.service-link {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    margin-left: 5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.service-link:hover {
    opacity: 0.8;
}

/* Responsive Services */
@media (max-width: 900px) {
    .services-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .services-left {
        position: static;
        text-align: left;
        margin-bottom: 20px;
    }

    .services-left h3 {
        font-size: 2.5rem;
    }

    .services-right {
        padding-left: 30px;
    }

    .timeline-line {
        left: 0;
    }

    .timeline-dot {
        left: -39px;
    }
}


/* WORKS Section */
#works {
    padding: 50px 0 150px 0;
    /* Top 50px, Bottom 150px */
    background: #f0f0f0;
    /* Match Hero bg */
    content-visibility: auto;
    contain-intrinsic-size: 1500px;
}

#works h2 {
    margin-bottom: 60px;
    font-size: 2.5rem;
    color: #1a1a1a;
    text-align: center;
    font-family: var(--font-eng);
    font-weight: 700;
}

.works-accordion {
    max-width: 1000px;
    margin: 0 auto;
    border-top: 1px solid #ddd;
}

.work-item {
    border-bottom: 1px solid #ddd;
    overflow: hidden;
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 20px;
    cursor: pointer;
    background: #f0f0f0;
    /* Match section bg */
    transition: background 0.3s;
}

.work-header:hover {
    background: #e6e6e6;
    /* Slightly darker on hover */
}

.work-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    transition: transform 0.3s ease, color 0.3s ease;
    transform-origin: left center;
}

.work-header:hover h3 {
    transform: scale(1.1);
    /* Enlarge text on hover */
    color: #000;
}

.toggle-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.work-item.active .toggle-icon {
    transform: rotate(45deg);
}

.work-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background: #f0f0f0;
    /* Match section bg */
}

.work-item.active .work-content {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.work-inner {
    display: flex;
    gap: 40px;
    padding: 40px;
    align-items: center;
}

.work-image {
    flex: 1;
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.work-image img {
    width: 100%;
    max-height: 600px;
    height: auto;
    display: block;
    object-fit: contain;
    /* Prevent cropping */
}

.work-text {
    flex: 1;
    font-size: 1rem;
    color: #000;
    /* Changed to black */
    line-height: 1.7;
    word-break: keep-all;
}

/* Responsive WORKS */
@media (max-width: 768px) {
    .work-inner {
        flex-direction: column;
        padding: 30px 20px;
        gap: 20px;
    }

    .work-image {
        width: 100%;
        max-width: 100%;
    }

    .work-header h3 {
        font-size: 1.1rem;
    }
}

#contact {
    padding: 100px 0;
    background: #1a1a1a;
    color: #fff;
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}

#contact .container {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
}

.contact-info,
.contact-form {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    font-family: var(--font-eng);
}

.contact-info p {
    margin-bottom: 15px;
    opacity: 0.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: #333;
    color: #fff;
    font-family: var(--font-main);
}

.contact-form button {
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-form button:hover {
    background: #d81b60;
}

.privacy-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

footer {
    padding: 30px 0;
    background: #000;
    color: #555;
    text-align: center;
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-copy {
        font-size: 2.5rem;
    }

    #stats .container {
        flex-direction: column;
        gap: 40px;
    }

    #contact .container {
        flex-direction: column;
    }

    footer {
        font-size: 0.7rem;
        /* Prevent line break on mobile */
    }
}

/* Utility Classes */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline;
    }
}

/* Privacy Policy Modal */
.privacy-link {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.privacy-link:hover {
    color: var(--primary-color);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #000;
}

.modal-body {
    margin-top: 15px;
    text-align: left;
    line-height: 1.6;
    color: #333;
}

.modal-body h3 {
    margin-bottom: 20px;
    text-align: center;
}

.modal-body h4 {
    font-size: 1.1rem;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #000;
}

.modal-body ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 5px;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}