/* ==========================================================================
   RESON MUSIC - WMG DNA REFACTOR v24.0
   Based on WMG.com Source
   ========================================================================== */

:root {
    /* --- WMG COLOR PALETTE --- */
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-dark: #0a0a0a;
    --color-gray-light: #f4f4f4;
    
    /* --- THEME VARIABLES (Default Dark) --- */
    --bg-color: var(--color-black);
    --text-color: var(--color-white);
    --border-color: rgba(255, 255, 255, 0.2);
    --accent-color: var(--color-white); /* Enforce Monochrome */
    
    /* --- TYPOGRAPHY --- */
    --font-display: 'Syncopate', sans-serif;
    --font-body: 'Manrope', sans-serif;
    /* User requested to remove the "code font" look. Switching mono class to use a geometric sans but styled like a label */
    --font-mono: 'Manrope', sans-serif; 
    --font-zh: 'Noto Sans SC', sans-serif;
    
    /* --- LAYOUT --- */
    --header-height: 80px; /* Responsive via media query below */
    --content-width: 1600px;
    --margin-mobile: 20px;
    --margin-desktop: 60px;
    
    /* --- ANIMATION --- */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
}

/* LIGHT MODE OVERRIDES */
html.light-mode {
    --bg-color: var(--color-white);
    --text-color: var(--color-black);
    --border-color: rgba(0, 0, 0, 0.15);
    --accent-color: var(--color-blue);
}

/* Responsive Header Height */
@media (min-width: 768px) {
    :root {
        --header-height: 100px;
    }
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

html {
    background-color: var(--bg-color); /* Ensures overscroll matches theme */
    transition: background-color 0.5s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease, color 0.5s ease;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; width: 100%; height: auto; }
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }

/* ==========================================================================
   TYPOGRAPHY UTILITIES
   ========================================================================== */

.t-display {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.t-hero {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
}

.t-h1 { font-size: clamp(2rem, 5vw, 4rem); }
.t-h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
.t-h3 { font-size: 1.5rem; font-weight: 700; }

.t-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Utility to disable transitions during theme switch */
.no-transition, .no-transition * {
    transition: none !important;
}

.t-mono {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Bilingual Support */
body.lang-cn .t-display,
body.lang-cn .t-hero,
body.lang-cn .t-h1,
body.lang-cn .t-h2 {
    font-family: var(--font-zh);
    font-weight: 900;
    letter-spacing: 0.05em;
}

.lang-wrap .zh { display: none; }
body.lang-cn .lang-wrap .en { display: none; }
body.lang-cn .lang-wrap .zh { display: inline-block; }

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

.site-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.content-margins {
    padding-left: var(--margin-mobile);
    padding-right: var(--margin-mobile);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .content-margins {
        padding-left: var(--margin-desktop);
        padding-right: var(--margin-desktop);
        max-width: var(--content-width);
    }
}

.grid-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.col-span-4 { grid-column: span 12; }
.col-span-6 { grid-column: span 12; }
.col-span-8 { grid-column: span 12; }

@media (min-width: 768px) {
    .col-span-4 { grid-column: span 4; }
    .col-span-6 { grid-column: span 6; }
    .col-span-8 { grid-column: span 8; }
    .col-span-12 { grid-column: span 12; }
}

.col-span-12 { grid-column: span 12; }

/* Curtain Text */
.transition-curtain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.curtain-text {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 900;
    color: var(--bg-color); /* Inverted text */
    opacity: 0; /* Animated in JS */
}

/* ==========================================================================
   HEADER (WMG Style)
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--margin-mobile);
    z-index: 1000;
    mix-blend-mode: difference; /* Crucial for WMG look */
    color: white;
    pointer-events: none; /* Click through header area */
}

@media (min-width: 768px) {
    .site-header { padding: 0 var(--margin-desktop); }
}

.site-header > * { pointer-events: auto; }

.site-branding {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
}

.site-navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* WMG Toggler */
.wmg-toggler {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    transition: all 0.3s;
}

.wmg-toggler:hover {
    background: white;
    color: black;
    border-color: white;
}

.wmg-toggler:active {
    transform: scale(0.95);
}

/* Menu Items */
.nav-list {
    display: none;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .nav-list { display: flex; }
}

.nav-item {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s;
}

.nav-item:hover::after { width: 100%; }

.nav-item:active {
    opacity: 0.7;
}

/* ==========================================================================
   MOBILE NAVIGATION
   ========================================================================== */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 30px;
    height: 30px;
    justify-content: center;
    z-index: 2000;
    position: relative;
}

@media (min-width: 1024px) {
    .mobile-menu-btn { display: none; }
}

.menu-bar {
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
}

/* Active Hamburger */
body.menu-open .menu-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .menu-bar:nth-child(2) { opacity: 0; }
body.menu-open .menu-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav-overlay {
    position: fixed;
    top: -20vh; /* Extend upward to cover Safari address bar */
    left: 0;
    width: 100%;
    height: 140vh; /* Full Safari coverage: -20vh to 120vh */
    background: var(--bg-color); /* Theme adaptive */
    z-index: 1500;
    padding: 160px 2rem 2rem; /* 140px + 20vh offset compensation */
    padding-top: calc(140px + 20vh); /* Compensate for -20vh top */
    padding-bottom: calc(2rem + 20vh); /* Offset content to visual center */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    visibility: hidden; /* Handled by JS */
    opacity: 0;
}

.mobile-nav-link {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 6rem); /* Massive */
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-color);
    line-height: 0.9;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(50px) skewY(5deg); /* Init state for anim */
}

.mobile-nav-link:hover {
    color: var(--text-color);
    -webkit-text-stroke: 0;
    transform: translateX(20px);
}

.mobile-nav-link:active {
    opacity: 0.7;
    transform: translateX(30px);
}

/* Removing old CSS transitions for menu open to let GSAP handle it */
/* body.menu-open .mobile-nav-overlay { transform: translateX(0); } */
/* body.menu-open .mobile-nav-link { ... } */

/* ==========================================================================
   HERO SECTION (Video/Canvas)
   ========================================================================== */

.hero-container {
    position: relative;
    height: 100vh; /* Fallback for older browsers */
    height: 100svh; /* Stable viewport height - prevents resize on scroll */
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#noise-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    mix-blend-mode: exclusion;
    color: white;
    width: 100%;
}

/* ==========================================================================
   CARDS (WMG News/Artist Style)
   ========================================================================== */

.news-card {
    display: block;
    position: relative;
    margin-bottom: 2rem;
    cursor: pointer;
}

.news-card__thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    margin-bottom: 1.5rem;
    background: #222;
}

.news-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out-expo), filter 0.3s;
    /* filter: grayscale(100%); Removed */
}

.news-card:hover .news-card__thumb img {
    transform: scale(1.05);
    /* filter: grayscale(0%); Removed */
}

.news-card:active .news-card__thumb img {
    transform: scale(1.02);
}

.news-card__meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.news-card__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.1;
    font-weight: 700;
    text-transform: uppercase;
    transition: color 0.3s;
}

.news-card:hover .news-card__title {
    color: var(--accent-color);
}

/* ==========================================================================
   SECTIONS & COMPONENTS
   ========================================================================== */

.section-pad {
    padding-top: 120px;
    padding-bottom: 120px;
    border-bottom: 1px solid var(--border-color);
}

/* Ticker */
.ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    display: flex; /* Enable flex for double tracks */
}

.ticker-track {
    display: flex;
    width: max-content;
    flex-shrink: 0; /* Prevent shrinking */
    animation: ticker 80s linear infinite; /* Slowed down to 80s */
    will-change: transform;
    backface-visibility: hidden;
}

.ticker-item {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    padding-right: 4rem;
    -webkit-text-stroke: 1px var(--text-color);
    color: transparent;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); } /* Scroll full width of one track */
}

/* Footer */
.site-footer {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.site-footer .t-display {
    letter-spacing: -0.05em; /* Match Header Logo spacing */
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Preloader */
.preloader {
    position: fixed;
    top: -20vh; /* Extend upward to cover Safari address bar area */
    left: 0;
    width: 100%;
    height: 140vh; /* 120vh + 20vh for top coverage */
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    overflow: hidden; /* Prevent content leakage */
}

.preloader-text {
    position: absolute; /* Absolute positioning to control vertical placement */
    top: 70vh; /* 50vh + 20vh offset to center in VIEWPORT (parent is offset -20vh) */
    transform: translateY(-50%);
    
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-color);
}
/* APPENDED STYLES */

/* ==========================================================================
   MULTI-HERO SECTIONS (Gateway System)
   ========================================================================== */

.hero-gateway {
    position: relative;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100dvh; /* iOS address bar fix */
    display: flex;
    align-items: flex-end; /* Content at bottom */
    padding-bottom: 10vh; /* Spacing from bottom */
    overflow: hidden;
    cursor: pointer; /* Indicates clickability */
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.hero-gateway:last-child {
    border-bottom: none;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    color: white;
    pointer-events: none; /* Let clicks pass through to section */
}

.hero-content a {
    pointer-events: auto;
}

/* Background Variations */
.hero-gateway .img-bg {
    background-size: cover;
    background-position: center;
    /* filter: grayscale(100%); Removed */
    transition: transform 1.5s var(--ease-out-expo), filter 0.5s ease;
}

.hero-gateway:hover .img-bg {
    transform: scale(1.05);
    /* filter: grayscale(0%); Removed */
}

.hero-gateway .solid-bg {
    background-color: var(--color-black);
}

.hero-gateway .grid-bg {
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
}

.hero-gateway .map-bg {
    /* Map specific styling in JS or Leaflet CSS */
    opacity: 0.6;
    filter: grayscale(100%) invert(1) contrast(1.2);
    mix-blend-mode: hard-light;
}

/* Kinetic Text Hover Effect */
.glitch-hover {
    position: relative;
    display: inline-block;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-color);
    transition: color 0.3s;
}

.glitch-hover::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--text-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s var(--ease-out-expo);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.hero-gateway:hover .glitch-hover {
    color: var(--text-color);
    -webkit-text-stroke: 0;
}

.hero-gateway:hover .glitch-hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* CTA Button */
.hero-cta {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.7;
}

.btn-magnetic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: 1px solid var(--text-color);
    border-radius: 50px;
    color: var(--text-color);
    text-transform: uppercase;
    transition: all 0.3s ease;
    background: transparent;
    backdrop-filter: blur(5px);
}

.btn-magnetic:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.btn-magnetic:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.25);
}

.content-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    height: 100%;
}

/* Curtain Transition */
.transition-curtain {
    position: fixed;
    top: -20vh; /* Extend upward to cover Safari address bar area */
    left: 0;
    width: 100%;
    height: 0; /* Start hidden by default */
    background-color: var(--text-color); /* Inverted curtain color */
    z-index: 9999;
    pointer-events: none;
    overflow: hidden; /* Prevent content leakage */
    will-change: height, top; /* Hint for GPU acceleration */
}

/* Curtain animation handled by GSAP in app.js */

/* ==========================================================================
   KINETIC ACCORDION (Index Gateways)
   ========================================================================== */

.kinetic-accordion {
    display: flex;
    flex-direction: column; /* Default to stack on mobile */
    height: auto; /* Auto height for stacked */
    width: 100%;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

/* Mobile Scroll Snap */
@media (max-width: 768px) {
    .kinetic-accordion {
        scroll-snap-type: y proximity; /* Soft snap */
    }
    .acc-item {
        scroll-snap-align: start;
        min-height: 60vh; /* Ensure enough space */
    }
}

@media (min-width: 768px) {
    .kinetic-accordion {
        flex-direction: row; /* Row on desktop */
        height: 70vh;
    }
}

.acc-item {
    flex: none; /* Disable flex sizing on mobile */
    width: 100%;
    height: 200px; /* Fixed height for mobile items */
    position: relative;
    border-bottom: 1px solid var(--border-color); /* Border bottom on mobile */
    border-right: none;
    transition: flex 0.7s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    cursor: pointer;
    background: var(--bg-color);
    /* Anti-aliasing fixes */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    outline: 1px solid transparent; /* Hack to force edge smoothing */
    backface-visibility: hidden;
    transform: translateZ(0);
}

@media (min-width: 768px) {
    .acc-item {
        flex: 1;
        width: auto;
        height: auto;
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
    
    .acc-item:hover {
        flex: 3;
    }
}

/* Texture Layer (Replaces Image) */
.acc-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0;
    z-index: 0;
    transition: opacity 0.5s ease;
    background: var(--bg-color);
    pointer-events: none;
}

.acc-item:hover .acc-texture {
    opacity: 0.1; /* Subtle background texture */
}

.texture-content {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 4rem;
    line-height: 0.8;
    color: var(--text-color);
    white-space: pre-wrap;
    word-break: break-all;
    transform: translateY(0);
    /* Animation handled in JS for stability */
}

/* Content Layer */
.acc-content {
    position: relative;
    z-index: 10;
    width: 100%;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

/* Collapsed State: Vertical Text */
.acc-vertical {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s, transform 0.5s;
    font-family: var(--font-mono);
    letter-spacing: 0.2em;
    pointer-events: none;
    color: var(--text-color);
}

.acc-item:hover .acc-vertical {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* Expanded State: Horizontal Info */
.acc-info {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s 0.1s, transform 0.4s 0.1s;
}

.acc-item:hover .acc-info {
    opacity: 1;
    transform: translateY(0);
}

/* Touch feedback for all interactive elements */
@media (hover: none) {
    .btn-magnetic:active,
    .nav-item:active,
    .acc-item:active {
        opacity: 0.8;
    }
}

.acc-title {
    font-size: clamp(2rem, 4vw, 4rem);
    margin-bottom: 1rem;
    color: var(--text-color); /* Theme reactive */
}

.acc-desc {
    font-family: var(--font-mono);
    color: var(--text-color);
    opacity: 0.7;
    max-width: 300px;
}

/* Contact Location Block (Mobile Fix) */
.contact-location-block {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.contact-location-block.border-right {
    border-right: none; /* No right border on mobile */
}

@media (min-width: 768px) {
    .contact-location-block.border-right {
        border-right: 1px solid var(--border-color);
    }
    
    .contact-location-block.padding-left {
        padding-left: 4rem;
    }
}

/* Ticker Performance Optimization */
.ticker-item img {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Scroll-reactive Marquee Track Optimization */
.marquee-track {
    display: flex;
    width: max-content; /* CRITICAL fix for width calculation */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

@media (max-width: 768px) {
    .ticker-item img {
        box-shadow: none !important; /* Kill shadow on mobile */
        height: clamp(160px, 45vw, 280px) !important; /* Larger on mobile (~1.5x), min 160px */
    }
    
    /* Tighten Ticker Spacing on Mobile */
    .ticker-top {
        top: 15% !important; /* Adjusted for taller container */
    }
    .ticker-bottom {
        bottom: 10% !important; /* Move down further */
    }
    
    /* Reduce Ticker Section Height on Mobile */
    .ticker-section {
        height: 60vh !important; /* Reduced to 85% of 70vh */
    }
    
    /* Accordion Item Narrower on Mobile */
    .acc-item {
        height: 20vh !important; /* 3 items = 60vh total */
    }
    
    /* Increase Ticker Font Size on Mobile (1.5x) */
    .ticker-top .t-h2 {
        font-size: 2.25rem !important;
    }
    .ticker-bottom .t-hero {
        /* Default inherit from .t-hero */
    }
}

@media (max-width: 768px) {
    .ticker-bottom .t-hero {
        font-size: 6.6rem !important; /* Increased by 1.7x (3.9rem * 1.7 ≈ 6.6rem) */
    }
}

/* Fix Album Spacing in Scroll Reactive Marquee */
.scroll-reactive .ticker-item {
    padding: 0 1rem !important; /* Default mobile spacing */
}

@media (min-width: 768px) {
    .scroll-reactive .ticker-item {
        padding: 0 3.6rem !important; /* Increased by another 80% (2rem * 1.8 = 3.6rem) */
    }
}
