/* ==================================================================
   Melodify
   Dark theme (#121212 / #1e1e1e) with a purple accent (#6c63ff),
   set in Poppins — see design_justification.md.
   ================================================================== */

:root {
    --primary-color: #6c63ff;
    --primary-hover: #8a83ff;
    --primary-dark: #5a52d4;
    --background: #121212;
    --surface: #1e1e1e;
    --surface-2: #262626;
    --on-background: #ffffff;
    --on-surface: rgba(255, 255, 255, 0.87);
    --on-surface-muted: rgba(255, 255, 255, 0.65);
    --border: rgba(255, 255, 255, 0.08);
    --border-radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 72px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--on-background);
    background-color: var(--background);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img,
video {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--primary-hover);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #fff;
}

:focus-visible {
    outline: 3px solid var(--primary-hover);
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 1rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ------------------------------------------------------------------
   Typography
   ------------------------------------------------------------------ */

h1 {
    font-size: clamp(2.2rem, 1.4rem + 3.5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    position: relative;
    display: inline-block;
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 2.5rem;
}

/* Purple underline under section headings */
h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: var(--primary-color);
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

p {
    color: var(--on-surface-muted);
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.6rem;
    border: 2px solid transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline {
    border-color: rgba(255, 255, 255, 0.85);
    background: transparent;
    color: #fff;
}

.btn-outline:hover {
    background: #fff;
    color: var(--background);
}

.btn-small {
    min-height: 36px;
    padding: 0.4rem 1.1rem;
    font-size: 0.85rem;
}

/* ------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------ */

.navbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: background-color var(--transition), border-color var(--transition);
}

.navbar.scrolled {
    background: rgba(18, 18, 18, 0.95);
    border-bottom-color: var(--border);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
}

.logo:hover {
    color: #fff;
}

.logo-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    font-size: 1rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    position: relative;
    display: block;
    padding: 0.5rem 0;
    color: var(--on-surface);
    font-weight: 500;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--primary-hover);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
    width: 100%;
}

.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1.15rem;
}

/* ------------------------------------------------------------------
   Hero (home) and page headers (artists, events)
   ------------------------------------------------------------------ */

.hero,
.page-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 4rem) 0 5rem;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

.hero {
    min-height: 88vh;
    background: var(--background) url('events/main.webp') center / cover no-repeat;
}

.page-header {
    min-height: 70vh;
    background: var(--surface);
}

.hero::before,
.video-overlay {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at center, rgba(18, 18, 18, 0.62) 0%, rgba(18, 18, 18, 0.9) 75%),
        linear-gradient(180deg, rgba(18, 18, 18, 0.4) 0%, var(--background) 100%);
}

.video-background {
    position: absolute;
    inset: 0;
    z-index: -2;
}

/* The overlay must sit above the video, inside the same layer */
.video-background .video-overlay {
    z-index: 1;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content,
.header-content {
    width: 100%;
    max-width: 760px;
    padding: 0 1rem;
}

.hero-content p,
.header-content p {
    margin: 1.25rem auto 2rem;
    max-width: 52ch;
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem);
    color: var(--on-surface);
}

/* Search bars */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 0.35rem 0.35rem 0.35rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
}

.search-bar > i {
    color: var(--on-surface-muted);
}

.search-bar input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0;
    border: 0;
    background: transparent;
    outline: none;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-btn {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    transition: background-color var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
}

.search-status {
    min-height: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--on-surface);
}

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */

.section {
    padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section-alt {
    background: #171717;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.5rem;
}

.grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Fixed column counts on wide screens so rows come out even */
@media (min-width: 1100px) {
    .grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.empty-message {
    grid-column: 1 / -1;
    padding: 2rem;
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
    text-align: center;
}

[hidden] {
    display: none !important;
}

/* ------------------------------------------------------------------
   Cards (shared)
   ------------------------------------------------------------------ */

.music-card,
.artist-card,
.event-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.music-card:hover,
.artist-card:hover,
.event-card:hover {
    transform: translateY(-6px);
    border-color: rgba(108, 99, 255, 0.35);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.card-media {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-card:hover .card-media img,
.artist-card:hover .card-media img,
.event-card:hover .card-media img {
    transform: scale(1.05);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    padding: 1.1rem 1.25rem 1.25rem;
}

.card-content h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-content p {
    font-size: 0.9rem;
}

.album-year {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--on-surface-muted);
}

/* Play button on covers */
.play-button {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition), background-color var(--transition);
}

.play-button:hover {
    background: var(--primary-dark);
    color: #fff;
}

.music-card:hover .play-button,
.artist-card:hover .play-button,
.play-button:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Touch screens have no hover, so always show the button */
@media (hover: none) {
    .play-button {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------------------
   Artists
   ------------------------------------------------------------------ */

.artist-card .card-media {
    aspect-ratio: 1;
}

.artist-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.artist-links a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--on-surface);
}

.artist-links a:hover {
    background: var(--primary-color);
    color: #fff;
}

.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 1.25rem;
}

.genre-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 160px;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    background: var(--surface-2) center / cover no-repeat;
    overflow: hidden;
    isolation: isolate;
}

.genre-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(18, 18, 18, 0.9), rgba(18, 18, 18, 0.25) 70%);
}

.genre-card h3 {
    font-size: 1.4rem;
}

.genre-card p {
    font-size: 0.9rem;
    color: var(--on-surface);
}

/* ------------------------------------------------------------------
   Events
   ------------------------------------------------------------------ */

.view-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.view-option {
    min-height: 40px;
    padding: 0.4rem 1.1rem;
    border: 1px solid rgba(108, 99, 255, 0.6);
    border-radius: 50px;
    background: transparent;
    color: var(--on-surface);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color var(--transition), color var(--transition);
}

.view-option:hover {
    background: rgba(108, 99, 255, 0.15);
}

.view-option[aria-pressed="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.event-card .card-media {
    aspect-ratio: 16 / 10;
}

.event-date {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 1;
    display: grid;
    min-width: 56px;
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
    background: rgba(18, 18, 18, 0.85);
    text-align: center;
    line-height: 1.1;
}

.event-date .day {
    font-size: 1.4rem;
    font-weight: 700;
}

.event-date .month {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.event-card h3 {
    white-space: normal;
}

.event-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.event-meta i {
    width: 1rem;
    margin-top: 0.3rem;
    color: var(--primary-hover);
}

.event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.event-footer + .ticket-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--on-surface);
}

.price {
    font-weight: 600;
    color: var(--primary-hover);
}

.festivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1.5rem;
}

.festival-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 380px;
    border-radius: var(--border-radius);
    background: var(--surface-2) center / cover no-repeat;
    overflow: hidden;
    isolation: isolate;
}

.festival-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.1) 65%);
}

.festival-content {
    padding: 2rem;
}

.festival-date {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-hover);
}

.festival-card h3 {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.festival-card p {
    margin-bottom: 1.25rem;
    color: var(--on-surface);
}

/* ------------------------------------------------------------------
   Call to action & newsletter
   ------------------------------------------------------------------ */

.cta-section {
    padding: clamp(3.5rem, 8vw, 6rem) 0;
    background: var(--background);
    text-align: center;
}

.cta-section h2::after,
.newsletter-section h2::after {
    left: 50%;
    transform: translateX(-50%);
}

.cta-section p {
    max-width: 52ch;
    margin: 0 auto 2rem;
    color: var(--on-surface);
}

.newsletter-section {
    padding: clamp(3.5rem, 8vw, 5rem) 0;
    background: linear-gradient(135deg, #24204f 0%, #1a1a2e 100%);
    text-align: center;
}

.newsletter-section p {
    max-width: 50ch;
    margin: 0 auto 1.75rem;
    color: var(--on-surface);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    width: min(100%, 480px);
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background: rgba(18, 18, 18, 0.6);
}

.newsletter-form input:focus-visible {
    outline-offset: 0;
    border-color: var(--primary-color);
}

.newsletter-form input[aria-invalid="true"] {
    border-color: #ff7b7b;
}

.form-status {
    min-height: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--on-surface);
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */

.site-footer {
    padding: 4rem 0 0;
    background: #0a0a0a;
    border-top: 1px solid var(--border);
}

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

.footer-about {
    max-width: 36ch;
    margin: 1rem 0 1.25rem;
    font-size: 0.95rem;
}

.site-footer h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links {
    display: grid;
    gap: 0.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--on-surface-muted);
}

.footer-links a:hover {
    color: var(--primary-hover);
}

.footer-bottom {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */

@media (max-width: 860px) {
    .hamburger {
        display: grid;
        place-items: center;
    }

    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem clamp(1rem, 4vw, 2rem) 1.25rem;
        background: rgba(18, 18, 18, 0.98);
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.9rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links a::after {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .hero,
    .page-header {
        min-height: 0;
        padding-top: calc(var(--nav-height) + 3rem);
        padding-bottom: 3.5rem;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .grid-wide {
        grid-template-columns: 1fr;
    }

    .card-content {
        padding: 0.9rem 1rem 1rem;
    }

    .play-button {
        width: 42px;
        height: 42px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .festival-card {
        min-height: 300px;
    }

    .festival-content {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
