/* ============================================
   SELECTMOOD - Custom CSS
   Supplements the Tailwind build output
   ============================================ */

:root {
    --color-primary: #1A1A1A;
    --color-secondary: #4A3B2F;
    --color-accent: #7A6348;
    --color-accent-light: #9A8668;
    --color-bg: #FAF9F6;
    --color-bg-alt: #F3EEE7;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #5C5854;
    --color-text-muted: #8C847E;
    --color-border: #E8E2D9;
    --color-border-light: #F0EBE3;
    --color-success: #3D644B;
    --color-error: #964F4A;
    --section-py: 160px;
    --section-py-mobile: 80px;
    --container-max: 1280px;
    --transition-base: 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-slow: 800ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
        system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo",
        "Noto Sans KR", "Malgun Gothic", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

/* Grain Texture Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
.font-heading {
    font-family: var(--font-playfair, "Playfair Display"), "Georgia", serif;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.font-accent {
    font-family: var(--font-cormorant, "Cormorant Garamond"), "Georgia", serif;
    font-style: italic;
    letter-spacing: 0.05em;
}

.font-nav {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Scroll Reveal */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                    transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .scroll-reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* Selection */
::selection {
    background-color: var(--color-accent);
    color: #fff;
}

/* Buttons */
.btn-premium {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    overflow: hidden;
}

.btn-premium-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-premium-primary:hover {
    background-color: var(--color-accent);
}

.btn-premium-outline {
    border: 1px solid var(--color-border);
    color: inherit;
}

.btn-premium-outline:hover:not([class*='hover:bg-']) {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Vertical text */
.vertical-text {
    writing-mode: vertical-rl;
}

/* Hero Ken Burns zoom animation */
@keyframes hero-zoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.animate-hero-zoom {
    animation: hero-zoom 20s ease-out forwards;
}

/* Scroll line animation */
@keyframes scroll-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.animate-scroll-line {
    animation: scroll-line 2.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* Header scroll state (JS managed via inline styles as fallback) */
#site-header.scrolled {
    background-color: rgba(250, 249, 246, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light);
    height: 4rem;
}

@media (min-width: 1024px) {
    #site-header.scrolled {
        height: 5rem;
    }
}

/* Text alignment & spacing consistency */
.text-balanced {
    text-wrap: balance;
}

blockquote p {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* Ensure consistent paragraph spacing in content sections */
.content-text p {
    margin-bottom: 1.5em;
}
.content-text p:last-child {
    margin-bottom: 0;
}

/* Improve text rendering for long-form content */
.leading-relaxed-kr {
    line-height: 2;
    word-break: keep-all;
}

/* Text drop shadow for hero text on dark backgrounds */
.text-shadow-dark {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* ============================================
   Fluid Responsive Typography
   PC와 모바일 간 비례적 폰트 스케일링
   ============================================ */
@media (max-width: 767px) {
    /* Page titles: 72px(PC) → 28px(mobile) */
    h2.text-4xl {
        font-size: clamp(1.75rem, 7vw, 2.25rem);
    }

    /* Hero H1: 96px(PC) → 32px(mobile) */
    h1.text-3xl, h1.text-4xl {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    /* Section H2: 60px(PC) → 24px(mobile) */
    h2.text-3xl {
        font-size: clamp(1.5rem, 6vw, 1.875rem);
    }

    /* Sub-headings H3: 48px(PC) → 22px(mobile) */
    h3.text-3xl, h3.text-2xl {
        font-size: clamp(1.25rem, 5.5vw, 1.5rem);
    }

    /* Large body text: 24px(PC) → 15px(mobile) */
    .text-lg {
        font-size: 0.9375rem;
    }

    /* Section padding reduce */
    .py-24 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Button sizing */
    .btn-premium {
        padding: 0.75rem 1.75rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   Responsive Fixes
   ============================================ */

/* Header logo - responsive width */
.header-logo {
    width: calc(100vw - 8rem);
    max-width: 15rem;
}

@media (min-width: 640px) {
    .header-logo {
        max-width: 18rem;
    }
}

/* Header right section - responsive gap */
.header-right-section {
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (min-width: 400px) {
    .header-right-section {
        gap: 1.5rem;
    }
}

/* Footer logo - responsive width */
.footer-logo {
    width: 100%;
    max-width: 27rem;
}

/* Mobile menu */
.mobile-menu-closed {
    visibility: hidden;
}

#mobile-menu {
    background-color: var(--color-surface);
    height: 100vh;
    height: 100dvh;
}

/* Arbitrary Tailwind utilities missing from JIT build */
.max-w-\[280px\] {
    max-width: 280px;
}

@media (min-width: 1024px) {
    .lg\:grid-cols-\[5fr_2fr\] {
        grid-template-columns: 5fr 2fr;
    }
}

/* Phase card text - scale font to match PC line break structure on all devices */
/* Longest segment: "SELECT MOOD Tower 건립을 통해 오프라인 거점을 확보합니다." = 465px@18px, ratio 25.83 */
@media (max-width: 767px) {
    [data-phase-card] .text-lg {
        font-size: min(0.9375rem, 3.0vw);
    }
}
@media (min-width: 768px) and (max-width: 1279px) {
    [data-phase-card] .text-lg {
        font-size: min(1.125rem, 1.5vw);
    }
}

/* xl breakpoint utilities (not in pre-built Tailwind) */
@media (min-width: 80rem) {
    .xl\:whitespace-nowrap {
        white-space: nowrap;
    }
}

