/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    /* smooth 제거로 더 정밀한 제어 */
    scroll-padding: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    overflow-y: scroll;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Hamburger Menu */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar {
    width: 30px;
    height: 3px;
    background-color: #ff69b4;
    transition: all 0.3s ease;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999;
    transition: left 0.3s ease;
    padding-top: 80px;
    border-right: 1px solid #333;
}

.side-menu.active {
    left: 0;
}

.menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.menu-list li {
    padding: 15px 30px;
    border-bottom: 1px solid #222;
}

.menu-list li a {
    font-size: 1.1rem;
    display: block;
    transition: color 0.3s;
}

.menu-list li a:hover {
    color: #aaa;
}

.sub-menu {
    margin-top: 10px;
    padding-left: 20px;
    display: none;
}

.menu-list li:hover .sub-menu {
    display: block;
}

.sub-menu li {
    border-bottom: none;
    padding: 5px 0;
}

.sub-menu li a {
    font-size: 0.9rem;
    color: #888;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: fill;
}

.portfolio-video {
    top: -30px;
    height: calc(100% + 30px);
}

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

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeInUp 1.5s ease-out;
}

.hero-logo {
    width: 150px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.hero-title {
    font-family: 'Malgun Gothic', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.reveal-wrapper {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: 1.2;
    /* Ensure no clipping of descenders if possible, or adjust height */
}

.reveal-text {
    display: inline-block;
    transform: translateY(100%);
    /* Start hidden below */
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0.9;
}

.hero-parallax-text {
    position: absolute;
    top: 18%;
    left: 15%;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1;
    text-align: left;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    word-break: keep-all;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-decoration: none;
}

.parallax-line {
    will-change: transform, opacity;
}

.parallax-line:first-child {
    margin-bottom: 40px;
}

.parallax-line:nth-child(n+2) {
    font-family: 'Malgun Gothic', sans-serif;
    font-weight: 300;
    color: #aaa;
    font-size: 2.25rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-logo {
        width: 100px;
    }
}

/* Sections Common */
.section {
    padding: 100px 0;
    background-color: #111;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    min-height: 100vh;
}

.section-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    object-fit: cover;
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    position: relative;
    z-index: 10;
    color: #fff;
    font-family: 'Playfair Display', serif;
}

.center {
    text-align: center;
}

/* About Section */
.about-section {
    background-color: #0a0a0a;
    padding-top: 0;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-image-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.about-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    color: #ccc;
}

.about-image-wrapper:hover .about-image {
    transform: scale(1.05);
}

.about-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

.about-text .section-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    line-height: 2.4;
    /* Increased from 1.6 by 50% */
}

.about-parallax-line {
    display: inline-block;
    /* Allows transform */
    will-change: transform, opacity;
}

.ceo-name {
    font-family: 'Malgun Gothic', sans-serif;
    font-size: 2rem;
    margin-bottom: 0;
    color: #ccc;
}

.ceo-desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #aaa;
    margin-bottom: 40px;
}

.about-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

/* Portfolio Section */
.portfolio-section {
    background-color: #111;
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: flex-start;
    /* Align items to start */
}

.portfolio-item {
    width: calc(33.333% - 20px);
    /* 3 columns with gap consideration */
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-bottom: 30px;
    break-inside: avoid;
    background: #fff;
    /* Changed from #222 to #fff */
    display: flex;
    flex-direction: column;
}

/* Varying Heights for Masonry Rhythm */
.portfolio-item.tall {
    height: 600px;
}

.portfolio-item.medium {
    height: 450px;
}

.portfolio-item.short {
    height: 300px;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.portfolio-item img {
    width: 100%;
    height: 60%;
    /* Occupy top 60% */
    display: block;
    object-fit: contain;
    transition: transform 0.7s ease;
    background: #fff;
}

.portfolio-overlay {
    position: relative;
    /* Changed from absolute */
    width: 100%;
    height: 40%;
    /* Occupy bottom 40% */
    background: transparent;
    /* Removed dark overlay */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    opacity: 1;
    /* Always visible */
    transition: none;
    padding: 20px;
    text-align: left;
    /* Changed from center to left */
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    font-size: 1.5rem;
    padding: 10px 0;
    border-top: 1px solid #ddd;
    color: #000;
    /* Black text */
    margin-bottom: 10px;
}

.portfolio-overlay p {
    font-size: 0.9rem;
    color: #000;
    /* Black text */
    line-height: 1.4;
}

.portfolio-item:hover .portfolio-overlay h3 {
    transform: translateY(0);
}




/* Hidden Spacer Utility */
.portfolio-item.hidden-spacer {
    visibility: hidden;
    pointer-events: none;
    background: transparent !important;
    box-shadow: none !important;
}

/* Expanded State for Portfolio Item */
.portfolio-item.expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    margin-bottom: 0;
    height: 100vh !important;
    /* Override height classes */
}

.portfolio-item.expanded img {
    width: 60%;
    height: 80%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.portfolio-item.expanded .portfolio-overlay {
    display: none;
}

.portfolio-item.minimized {
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.bloom-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.bloom-image {
    position: absolute;
    width: 150px;
    height: auto;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.expanded-info {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #fff;
    z-index: 10001;
    opacity: 0;
    width: 80%;
}

.expanded-info h3 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
}

.expanded-info p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ccc;
}

/* Footer */
.footer {
    background-color: #000;
    padding: 120px 0;
    border-top: 1px solid #222;
    color: #666;
    min-height: 400px !important;
    /* 내용에 맞는 최소 높이만 설정 */
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.footer-logo {
    width: 80px;
    margin-bottom: 5px;
    opacity: 0.5;
}

.footer-right {
    text-align: right;
}

.footer-right p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
    .about-content {
        flex-direction: column;
    }

    .portfolio-grid {
        column-count: 2;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .footer-right {
        text-align: center;
    }
}

@media (max-width: 600px) {
    .portfolio-grid {
        column-count: 1;
    }
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Sound Toggle Button */
.sound-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Portfolio Modal */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 20px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.portfolio-modal.active .modal-content {
    transform: scale(1);
}

/* Portfolio Parallax Text (Copy of Hero Parallax) */
.portfolio-parallax-text {
    position: absolute;
    top: 18%;
    left: 15%;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    text-align: left;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    word-break: keep-all;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-decoration: none;
    pointer-events: auto;
}

.portfolio-parallax-line {
    will-change: transform, opacity;
}

.portfolio-parallax-line:first-child {
    margin-bottom: 40px;
}

.portfolio-parallax-line:nth-child(n+2) {
    font-family: 'Malgun Gothic', sans-serif;
    font-weight: 300;
    color: #aaa;
    font-size: 2.25rem;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #ff4d4d;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-image-wrapper {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.modal-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 40px;
}

#modal-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    color: #fff;
}

#modal-desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 30px;
}

.modal-cast h4 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    display: inline-block;
}

#modal-cast-info {
    color: #888;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }

    .modal-image-wrapper {
        width: 50%;
        height: auto;
        min-height: 500px;
    }

    .modal-info {
        width: 50%;
        padding: 50px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Contact Modal Styles */
.contact-modal-content {
    max-width: 600px;
    padding: 40px;
}

.contact-body {
    width: 100%;
}

.contact-title {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: #fff;
    font-family: 'Playfair Display', serif;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: #aaa;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    padding: 15px;
    border-radius: 5px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-submit-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.contact-submit-btn:hover {
    background: #ddd;
}

.contact-submit-btn:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
}

/* 폼 제출 결과 메시지 */
.form-message {
    text-align: center;
    padding: 40px 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.form-message.success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.form-message.success p {
    color: #2ecc71;
    font-size: 1.2rem;
    line-height: 1.8;
}

.form-message.error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.5);
}

.form-message.error p {
    color: #e74c3c;
    font-size: 1.2rem;
    line-height: 1.8;
}

.bloom-image-trail {
    position: fixed;
    width: 350px;
    height: auto;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: block;
}