/* --- FONTS --- */
@font-face {
    font-family: 'Neue Haas';
    src: url('./fonts/NeueHaasDisplayBlack.ttf') format('truetype');
    font-weight: 900;
}
@font-face {
    font-family: 'Neue Haas';
    src: url('./fonts/NeueHaasDisplayBold.ttf') format('truetype');
    font-weight: 700;
}
@font-face {
    font-family: 'Neue Haas';
    src: url('./fonts/NeueHaasDisplayRoman.ttf') format('truetype');
    font-weight: 400;
}

/* --- VARIABLES --- */
:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-color: #FF751F;
    --velocity-orange: #FF751F;
    --gray-dark: #111111;
    --gray-light: #333333;
    --font-main: 'Neue Haas', Helvetica, Arial, sans-serif;
    --container-width: 1200px;
    --border-color: rgba(255, 255, 255, 0.15);
}

/* --- RESET & GLOBAL --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
    max-width: 100%;
    -webkit-font-smoothing: antialiased;
}

/* Grain Overlay - fine grain */
.grain-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* --- UTILITIES --- */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 2rem; }
.container.narrow { max-width: 800px; }
section { padding: 6rem 0; border-bottom: 1px solid var(--border-color); position: relative; }

/* Reduced margin for tighter layout */
.section-title { font-size: 3rem; font-weight: 900; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: -0.02em; }

/* --- NAVIGATION --- */
.navbar { position: fixed; top: 0; width: 100%; padding: 1.5rem 0; z-index: 1000; background: rgba(5, 5, 5, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); }
.nav-container { display: flex; justify-content: space-between; align-items: center; max-width: var(--container-width); margin: 0 auto; padding: 0 2rem; }
.logo { font-weight: 900; font-size: 1.5rem; text-decoration: none; color: var(--text-color); letter-spacing: -0.05em; }
.logo-period { color: var(--velocity-orange); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--text-color); text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; transition: color 0.3s; }
.nav-cta { background: transparent; color: var(--text-color) !important; padding: 0.5rem 1.25rem; border-radius: 50px; border: 1px solid var(--accent-color); font-size: 0.9rem; transition: background 0.3s, color 0.3s; }
.nav-links a:focus-visible, .nav-cta:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; }

/* --- HERO --- */
.hero {
    height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-top: 4rem;
    position: relative;
    background-color: #0a0a0a;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image: url('./images/hero.webp');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    animation: hero-image-move 30s ease-in-out infinite alternate;
    will-change: transform;
    z-index: 0;
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6));
    z-index: 1;
}
.hero .hero-content { position: relative; z-index: 2; }
.hero .scroll-indicator { z-index: 2; }
@keyframes hero-image-move {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.03) translate(-1%, -0.5%); }
}
@keyframes scroll-indicator-bounce {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
    50% { transform: translate(-50%, 6px); opacity: 1; }
}
.hero-title { font-size: clamp(4rem, 15vw, 12rem); line-height: 0.85; font-weight: 900; letter-spacing: -0.04em; }
.hero-period { color: var(--velocity-orange); }
.hero-meta { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; align-items: center; }
.pill { border: 1px solid var(--text-color); padding: 0.5rem 1.5rem; border-radius: 50px; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; background: rgba(0,0,0,0.3); }
.pill.highlight { background: var(--accent-color); border-color: var(--accent-color); }
.pill-register { text-decoration: none; color: var(--text-color); border-color: var(--velocity-orange); background: rgba(255, 117, 31, 0.2); transition: background 0.3s, border-color 0.3s, color 0.3s; }
.pill-register:focus-visible { outline: 2px solid var(--velocity-orange); outline-offset: 4px; }
.scroll-indicator { position: absolute; bottom: 2rem; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; font-size: 0.8rem; opacity: 0.6; animation: scroll-indicator-bounce 2s ease-in-out infinite; }
.scroll-indicator .line { width: 1px; height: 40px; background: white; }

/* --- MARQUEE --- */
.marquee-wrapper { background: var(--text-color); color: var(--bg-color); padding: 1rem 0; overflow: hidden; white-space: nowrap; border-top: 1px solid var(--text-color); border-bottom: 1px solid var(--text-color); }
.marquee-content { display: inline-block; font-size: 1.5rem; font-weight: 900; text-transform: uppercase; animation: marquee 25s linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* --- COUNTDOWN --- */
.countdown-section { padding: 2.5rem 0; border-bottom: 1px solid var(--border-color); }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 0.5rem; margin: 0 auto; }
.cd-item { background: var(--gray-dark); border: 1px solid var(--border-color); border-radius: 6px; padding: 1.15rem 0.4rem 0.55rem; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-height: 4rem; }
.cd-item::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent-color); }
.cd-item span { display: block; font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 900; line-height: 1; color: var(--text-color); letter-spacing: -0.02em; }
.cd-item label { font-size: 0.6rem; opacity: 0.6; letter-spacing: 0.1em; text-transform: uppercase; }
.countdown-live { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.countdown-live h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; color: var(--accent-color); }

/* --- SPEAKER --- */
.speaker-card { display: grid; grid-template-columns: 1fr 1.5fr; background: var(--gray-dark); border: 1px solid var(--border-color); overflow: hidden; }
.speaker-image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: filter 0.4s ease; }
.speaker-card.in-view .speaker-image img { filter: grayscale(0%); }
.speaker-details { padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.badge { color: var(--accent-color); font-weight: 700; letter-spacing: 0.1em; margin-bottom: 1rem; font-size: 0.9rem; }
.speaker-details h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 0.95; margin-bottom: 1.5rem; text-transform: uppercase; }
.speaker-details p { font-size: 1.1rem; line-height: 1.5; opacity: 0.8; max-width: 500px; }

/* --- SCHEDULE & STICKER --- */

@keyframes wiggle {
    0% { transform: rotate(-17deg); }
    50% { transform: rotate(-13deg); }
    100% { transform: rotate(-17deg); }
}

/* WRAPPER: Handles Positioning + GSAP Entrance */
.sticker-wrapper {
    position: absolute;
    /* MOVED: Positive top value brings it down into the section, closer to text */
    top: 5rem;
    right: 1.5rem;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through if it covers anything */
}

/* IMAGE: Handles Wiggle + Hover Effects */
.schedule-sticker {
    width: 180px;
    height: auto;
    pointer-events: auto; /* Re-enable clicks on the image itself */
    transform: rotate(-15deg); /* Base rotation */
    animation: wiggle 3s ease-in-out infinite;
    filter: grayscale(100%) drop-shadow(0px 4px 6px rgba(0,0,0,0.5));
    transition: filter 0.3s, transform 0.3s;
}

.sticker-wrapper.in-view .schedule-sticker {
    filter: grayscale(0%) drop-shadow(0px 4px 6px rgba(0,0,0,0.5));
}

.schedule-item { display: grid; grid-template-columns: 90px 1fr; align-items: start; gap: 0 0.5rem; border-bottom: 1px solid var(--border-color); padding: 2rem 0; transition: padding 0.3s; }
.schedule-item:last-child { border-bottom: none; }
.schedule-item .time { font-weight: 700; color: var(--accent-color); font-size: 1.2rem; padding-top: 0.1rem; }
.schedule-item h3 { font-size: 1.8rem; text-transform: uppercase; margin-bottom: 0.5rem; }
.schedule-item p { opacity: 0.6; }

/* --- MEDIA GRID (RESIZED) --- */
.media-section { padding: 0; }
.media-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    /* Changed fixed height to auto so it hugs the 450px iframe + header exactly */
    height: auto; 
}

.media-box {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: #000;
}

.media-header {
    background: var(--gray-dark);
    padding: 0.8rem 1.5rem;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    color: white;
    /* Fixed height for header to ensure map matches music exactly */
    height: 50px; 
    display: flex;
    align-items: center;
}

.media-box iframe { flex-grow: 1; width: 100%; min-height: 0; border: none; display: block; }

/* Map specific: grayscale → color on scroll */
.map-box iframe { 
    filter: grayscale(100%);
    height: 450px;
    transition: filter 0.5s ease;
}
.map-box.in-view iframe { filter: none; }

/* Music specific - iframe fills column to avoid horizontal gap */
.iframe-wrapper { 
    height: 450px; 
    width: 100%;
    display: block;
    background: #111;
    overflow: hidden;
    filter: grayscale(100%);
    border-radius: 0;
    transition: filter 0.5s ease;
}
.iframe-wrapper.in-view { filter: none; }
.music-box iframe { height: 450px !important; width: 100% !important; max-width: none !important; border-radius: 0 !important; border: none !important; display: block !important; }
.music-box .iframe-wrapper iframe { border-radius: 0 !important; }
.iframe-wrapper iframe { border-radius: 0 !important; }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-trigger { width: 100%; text-align: left; background: none; border: none; padding: 1.5rem 0; color: white; font-family: var(--font-main); font-size: 1.2rem; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; text-transform: uppercase; }
.faq-trigger:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; }
.faq-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-content p { padding-bottom: 1.5rem; opacity: 0.8; line-height: 1.6; }

/* --- REGISTRATION --- */
.form-wrapper { background: var(--gray-dark); padding: 3rem; border: 1px solid var(--border-color); }
.form-header { text-align: center; margin-bottom: 2rem; }
.form-header h2 { font-size: 2.5rem; font-weight: 900; }
.form-header p { opacity: 0.6; }
.input-group { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.field { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.8rem; text-transform: uppercase; font-weight: 700; opacity: 0.6; }
input { width: 100%; background: transparent; border: none; border-bottom: 2px solid #333; padding: 0.8rem 0; color: white; font-family: var(--font-main); font-size: 1.1rem; transition: border-color 0.3s; }
input:focus { outline: none; border-color: var(--accent-color); }
.submit-btn { width: 100%; background: white; color: black; border: none; padding: 1rem; font-weight: 900; font-size: 1.1rem; cursor: pointer; text-transform: uppercase; transition: background 0.3s; font-family: var(--font-main); }
.submit-btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; }
.form-success { text-align: center; padding: 3rem 2rem; }
.form-success h2 { font-size: 2.5rem; font-weight: 900; margin-bottom: 1rem; text-transform: uppercase; }
.form-success p { opacity: 0.8; font-size: 1.1rem; }

/* --- FOOTER --- */
.site-footer { padding-top: 5rem; border-top: 1px solid var(--border-color); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 4rem; }
.footer-col h3 { font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem; }
.footer-col h4 { text-transform: uppercase; font-weight: 700; margin-bottom: 1.5rem; opacity: 0.5; }
.footer-col a { display: block; color: white; text-decoration: none; margin-bottom: 0.8rem; transition: color 0.3s; }
.footer-col a:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.social-icons { display: flex; gap: 1.5rem; }
.social-icons a { font-size: 1.5rem; }
.footer-bottom { border-top: 1px solid var(--border-color); padding: 2rem; text-align: center; font-size: 0.8rem; opacity: 0.5; text-transform: uppercase; }

/* --- HOVER (desktop only; disabled on touch to avoid glitches) --- */
@media (hover: hover) {
    .nav-links a:hover { color: var(--accent-color); }
    .nav-cta:hover { background: var(--accent-color) !important; color: var(--bg-color) !important; }
    .pill-register:hover { background: var(--velocity-orange); border-color: var(--velocity-orange); color: var(--bg-color); }
    .speaker-card:hover .speaker-image img { filter: grayscale(0%); }
    .schedule-sticker:hover {
        animation: none;
        filter: grayscale(0%) drop-shadow(0px 8px 15px rgba(0,0,0,0.6));
        transform: rotate(-15deg) scale(1.05);
    }
    .schedule-item:hover { padding-left: 2rem; background: linear-gradient(90deg, rgba(255,255,255,0.03), transparent); }
    .submit-btn:hover { background: var(--accent-color); color: white; }
    .footer-col a:hover { color: var(--accent-color); }
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .sticker-wrapper { width: 120px; top: 3.5rem; right: 1rem; }
    .schedule-sticker { width: 100%; }
    .countdown-grid { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
    .cd-item span { font-size: clamp(1.25rem, 6vw, 2rem); }
    .cd-item label { font-size: 0.5rem; }
    .speaker-card { grid-template-columns: 1fr; }
    .speaker-image { height: 300px; }
    .schedule-item { grid-template-columns: 1fr; gap: 0.5rem; }
    .schedule-item .time { margin-bottom: 0; }
    .media-grid { grid-template-columns: 1fr; height: auto; }
    .media-box { height: auto; border-right: none; border-bottom: 1px solid var(--border-color); }
    .map-box { height: auto; min-height: 350px; }
    .map-box iframe { height: 300px; min-height: 300px; }
    /* Apple Music on mobile: edge to edge, no overlay */
    .music-box { overflow: hidden; border-radius: 0; padding: 0; margin: 0; }
    .music-box .iframe-wrapper { overflow: hidden !important; border-radius: 0 !important; width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .music-box .iframe-wrapper iframe { border-radius: 0 !important; width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .input-group { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .social-icons { justify-content: center; }
}