/* ============================================================
   STATTE — Arte in Atto — Residenza Artistica
   Design: mobile-first, black & white handmade festival
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=Inter:wght@300;400;500&display=swap');

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

:root {
    --ink:    #111111;
    --paper:  #f5f1e8;
    --white:  #ffffff;
    --grey:   #555555;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    background-color: var(--paper);
    overflow-x: hidden;
    position: relative;
}

/* ============================================================
   ANIMATED BACKGROUND WORDS
   ============================================================ */
#bg-words {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-word {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: var(--ink);
    opacity: 0;
    white-space: nowrap;
    user-select: none;
    will-change: transform, opacity;
    animation: floatWord linear infinite;
}

@keyframes floatWord {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(var(--rot));
    }
    8% {
        opacity: var(--max-opacity);
    }
    88% {
        opacity: var(--max-opacity);
    }
    100% {
        opacity: 0;
        transform: translateY(var(--travel)) rotate(var(--rot));
    }
}

/* Puntini di texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 18px 50px;
}

/* ============================================================
   HEADER / LOGO
   ============================================================ */
.site-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.logo {
    width: 70vw;
    max-width: 260px;
    height: auto;
    display: block;
    filter: drop-shadow(1px 2px 0 rgba(0,0,0,0.07));
}

.logo-fallback {
    display: none;
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    color: var(--ink);
}

.logo.error + .logo-fallback {
    display: block;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 1px;
    transition: opacity 0.2s;
}
.back-link:hover, .back-link:active {
    opacity: 0.55;
}

/* ============================================================
   TRACK CARD
   ============================================================ */
.track-card {
    background: var(--white);
    border: 2.5px solid var(--ink);
    border-radius: 3px;
    padding: 28px 20px 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 6px 6px 0 var(--ink);
    text-align: center;
}

.track-number {
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    background: var(--ink);
    color: var(--paper);
    padding: 3px 16px;
    border-radius: 30px;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.track-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.4rem, 10vw, 3.2rem);
    line-height: 1.05;
    margin-bottom: 6px;
    color: var(--ink);
}

.track-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 28px;
}

/* ============================================================
   AUDIO PLAYER — custom styled
   ============================================================ */
.audio-wrap {
    width: 100%;
    margin-bottom: 0;
}

audio {
    width: 100%;
    height: 44px;
    border-radius: 30px;
    outline: none;
    accent-color: var(--ink);
}

/* ============================================================
   QR CODE SECTION
   ============================================================ */
.qr-section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1.5px dashed var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-label {
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    color: var(--ink);
    margin-bottom: 12px;
}

.qr-code {
    display: inline-block;
    padding: 10px;
    background: var(--white);
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
}

.qr-code canvas,
.qr-code img {
    display: block;
}

/* ============================================================
   INDEX PAGE — tracce grid
   ============================================================ */
.intro {
    font-family: 'Caveat', cursive;
    font-size: 1.55rem;
    color: var(--ink);
    text-align: center;
    margin: 0 0 22px;
    line-height: 1.3;
}

.tracks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
    max-width: 480px;
}

.track-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    border: 2.5px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    padding: 18px 10px 14px;
    text-decoration: none;
    color: var(--ink);
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    border-radius: 2px;
}

.track-link:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink);
}

.track-link .num {
    font-family: 'Caveat', cursive;
    font-size: 0.95rem;
    color: var(--grey);
    margin-bottom: 4px;
}

.track-link .name {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    line-height: 1.15;
    margin-bottom: 6px;
}

.track-link .play-icon {
    font-size: 1.4rem;
    margin-top: 4px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    margin-top: 36px;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--grey);
}
