/* =========================================
   90s YAADEIN — Styles
   ========================================= */

/* --- Variables & Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #C8956C;
    --accent: #D4A76A;
    --text: #F5E6D0;
    --glass: rgba(30, 20, 10, 0.55);
    --glass-border: rgba(200, 160, 100, 0.15);
    --glass-hover: rgba(200, 160, 100, 0.08);
}

[data-theme="truck"] {
    --primary: #FF8C00;
    --accent: #FFB030;
    --text: #E8E0F0;
    --glass: rgba(10, 10, 35, 0.55);
    --glass-border: rgba(255, 180, 50, 0.15);
    --glass-hover: rgba(255, 180, 50, 0.08);
}

[data-theme="auto"] {
    --primary: #66BB6A;
    --accent: #81C784;
    --text: #E0F0E0;
    --glass: rgba(12, 25, 18, 0.55);
    --glass-border: rgba(100, 200, 100, 0.15);
    --glass-hover: rgba(100, 200, 100, 0.08);
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #0a0604;
    color: var(--text);
    user-select: none;
}

/* --- Landing Screen --- */
.landing {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #3a2210 0%, #1a0f08 50%, #0a0503 100%);
    transition: opacity 1s ease, visibility 1s ease;
    overflow-y: auto;
}

.landing.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.landing-content {
    text-align: center;
    padding: 2.5rem 1.5rem 1.5rem;
    max-width: 960px;
    width: 100%;
    animation: landingFadeIn 1.5s ease forwards;
}

.landing-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    animation: gentleFloat 3s ease-in-out infinite;
}

.landing-title {
    font-size: clamp(2.8rem, 10vw, 5.5rem);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.t-woh {
    font-family: 'Noto Serif Devanagari', serif;
    font-weight: 900;
    color: #D4A76A;
}

.landing-tagline {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2rem;
}

/* --- Scene Cards --- */
.scene-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.scene-card {
    position: relative;
    background: linear-gradient(145deg, rgba(60,40,20,0.6), rgba(30,18,8,0.8));
    border: 1px solid rgba(200, 160, 100, 0.15);
    border-radius: 14px;
    padding: 0.6rem;
    cursor: pointer;
    font-family: inherit;
    color: #f0e6d8;
    transition: all 0.4s ease;
    overflow: hidden;
}

.scene-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 40%, rgba(212, 167, 106, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.scene-card:hover {
    border-color: rgba(200, 160, 100, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(200, 160, 100, 0.08);
}

.scene-card:hover::before { opacity: 1; }

.scene-card:hover .card-img {
    transform: scale(1.08);
}

.scene-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,5,3,0.6) 0%, transparent 40%);
    pointer-events: none;
}

.card-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.3rem 0 0.5rem;
}

.card-dash {
    display: inline-block;
    width: 18px;
    height: 1px;
    background: rgba(200, 160, 100, 0.35);
}

.card-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.card-arrow {
    position: absolute;
    bottom: 0.7rem;
    right: 0.8rem;
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s ease;
    color: rgba(212, 167, 106, 0.7);
}

/* --- Landing Footer --- */
.landing-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(200, 160, 100, 0.1);
}

.landing-cassette {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.landing-footer-text {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
}

.landing-note {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.05em;
    margin: 0;
    margin-left: auto;
}

/* --- App Container --- */
.app {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.app.visible { opacity: 1; }

/* --- Backgrounds --- */
.backgrounds {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.bg {
    position: absolute;
    inset: -20px;
    opacity: 0;
    transition: opacity 1.4s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg.active { opacity: 1; }

/* Film grain overlay — shared by all scenes */
.bg::before {
    content: '';
    position: absolute;
    inset: 0;
    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='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

/* Vignette + bottom gradient — shared by all scenes */
.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.5) 100%),
        linear-gradient(to top, rgba(5,3,2,0.7) 0%, rgba(5,3,2,0.3) 15%, transparent 40%),
        linear-gradient(to bottom, rgba(5,3,2,0.4) 0%, transparent 20%);
    pointer-events: none;
    z-index: 1;
}

/* Salon — warm barber shop interior */
.bg-salon {
    background-image: url('../images/salon-bg.png');
    animation: kenBurnsSalon 25s ease-in-out infinite alternate;
}

/* Truck — sunset highway from cab */
.bg-truck {
    background-image: url('../images/truck-bg.png');
    animation: kenBurnsTruck 28s ease-in-out infinite alternate;
}

/* Auto — rainy Mumbai night from inside auto */
.bg-auto {
    background-image: url('../images/auto-bg.png');
    animation: kenBurnsAuto 22s ease-in-out infinite alternate;
}

/* --- Particles --- */
.particles {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: var(--accent);
    border-radius: 50%;
    animation: particleDrift ease-in-out infinite;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    z-index: 20;
}

.logo {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem;
    text-decoration: none;
    color: inherit;
    max-width: 160px;
}

.logo-woh {
    font-family: 'Noto Serif Devanagari', serif;
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--accent);
    transition: color 0.6s ease;
}

.logo-tag {
    display: block;
    width: 100%;
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.4);
    margin-top: -0.15rem;
}

.main-nav {
    display: flex;
    gap: 2.2rem;
    padding-top: 0.3rem;
}

.nav-link {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    cursor: pointer;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-link:hover { color: rgba(255,255,255,0.8); }

.nav-link.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* --- Scene Content --- */
.scene-content {
    position: fixed;
    right: 5%;
    bottom: 18%;
    z-index: 5;
    max-width: 520px;
    text-align: right;
}

.memory-year {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.45);
    margin-bottom: 1.2rem;
}

.my-line {
    display: inline-block;
    width: 28px;
    height: 1px;
    background: rgba(255,255,255,0.3);
}

.scene-title {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: clamp(2.8rem, 5.5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 0.6rem;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s ease, color 0.6s ease;
}

.scene-sub {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease 0.12s, transform 0.6s ease 0.12s;
}

.scene-title.animate-in,
.scene-sub.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.scene-title.animate-out,
.scene-sub.animate-out {
    opacity: 0;
    transform: translateY(-15px);
    transition-delay: 0s;
}

/* --- Floating Memories --- */
.memories {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.memory-bubble {
    position: absolute;
    left: var(--x);
    top: var(--y);
    padding: 0.55rem 1.1rem;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(255,255,255,0.65);
    pointer-events: auto;
    cursor: default;
    white-space: nowrap;
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
    animation: bubbleFloat 8s ease-in-out infinite;
}

.memory-bubble:hover {
    opacity: 1 !important;
    background: var(--glass-hover);
    border-color: rgba(255,255,255,0.15);
    transform: scale(1.04);
}

.memory-bubble:nth-child(1) { animation-delay: 0s; opacity: 0.7; }
.memory-bubble:nth-child(2) { animation-delay: -2.5s; opacity: 0.6; }
.memory-bubble:nth-child(3) { animation-delay: -5s; opacity: 0.5; }

/* --- Spotify Player --- */
.player {
    position: fixed;
    top: 5rem;
    left: 1.5rem;
    width: 380px;
    background: var(--glass);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    z-index: 20;
    transition: background 0.6s ease, border-color 0.6s ease, transform 0.3s ease;
}

.player.collapsed .player-body,
.player.collapsed .player-link { display: none; }

.player-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.player-live-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
    flex-shrink: 0;
}

.player-name {
    flex: 1;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
    transition: color 0.6s ease;
}

.player-grip {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.player-grip:hover { background: rgba(255,255,255,0.08); }

.player-body { padding: 0 0.7rem 0.4rem; }

.player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.65rem;
}

.player-signin-hint {
    margin: 0;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.player-signin-hint svg {
    color: #1DB954;
    flex-shrink: 0;
}

.player-link {
    font-size: 0.6rem;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.player-link:hover { color: rgba(255,255,255,0.65); }

/* --- Live Listeners --- */
.listeners {
    position: fixed;
    bottom: 5.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    font-size: 0.68rem;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    z-index: 15;
    transition: background 0.6s ease, border-color 0.6s ease;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
    flex-shrink: 0;
}

#listener-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,0.75);
}

/* --- Controls --- */
.controls {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.6rem;
    z-index: 15;
}

.ctrl-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ctrl-btn:hover {
    background: var(--glass-hover);
    color: rgba(255,255,255,0.85);
}

.ctrl-btn svg { flex-shrink: 0; }

/* --- Hint --- */
.hint {
    position: fixed;
    bottom: 5.5rem;
    right: 50%;
    transform: translateX(50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.58rem;
    font-weight: 300;
    color: rgba(255,255,255,0.22);
    z-index: 4;
    transition: opacity 0.5s;
}

.hint-circle {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    animation: hintPulse 2.5s ease-in-out infinite;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem 1rem;
    background: linear-gradient(to top, rgba(8,5,3,0.92) 0%, rgba(8,5,3,0.6) 70%, transparent 100%);
    z-index: 10;
}

.bn-arrow {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    min-width: 160px;
    transition: opacity 0.2s;
    border-radius: 6px;
}

.bn-arrow:hover { opacity: 0.75; }

.bn-prev { text-align: left; }
.bn-next { text-align: right; }

.bn-label {
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.35);
}

.bn-name {
    font-size: 0.88rem;
    font-weight: 500;
}

.bn-prev .bn-name::before {
    content: '\2190  ';
    opacity: 0.5;
}

.bn-next .bn-name::after {
    content: '  \2192';
    opacity: 0.5;
}

.bn-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.bn-dots {
    display: flex;
    gap: 5px;
}

.bn-dot {
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.15);
    border-radius: 1px;
    transition: background 0.5s ease;
}

.bn-dot.active {
    background: var(--accent);
}

.bn-num {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}

.bn-all {
    font-size: 0.48rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.35);
}

/* =========================================
   Animations
   ========================================= */

@keyframes landingFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes warmFlicker {
    0% { opacity: 0.7; transform: scale(1); }
    15% { opacity: 1; transform: scale(1.02); }
    30% { opacity: 0.8; transform: scale(0.99); }
    50% { opacity: 0.95; transform: scale(1.01); }
    70% { opacity: 0.85; transform: scale(1); }
    85% { opacity: 1; transform: scale(1.01); }
    100% { opacity: 0.9; transform: scale(1); }
}

@keyframes starTwinkle {
    0% { opacity: 0.4; }
    25% { opacity: 0.9; }
    50% { opacity: 0.5; }
    75% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes rainfall {
    from { transform: rotate(-18deg) translateY(0); }
    to { transform: rotate(-18deg) translateY(16px); }
}

@keyframes bubbleFloat {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(4px, -6px); }
    40% { transform: translate(-3px, -10px); }
    60% { transform: translate(6px, -7px); }
    80% { transform: translate(-2px, -3px); }
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 0 4px rgba(231, 76, 60, 0); }
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 0.15; }
}

@keyframes particleDrift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: var(--p-o, 0.15);
    }
    33% {
        transform: translate(var(--dx, 15px), var(--dy, -25px)) scale(1.3);
        opacity: calc(var(--p-o, 0.15) * 1.8);
    }
    66% {
        transform: translate(calc(var(--dx, 15px) * -0.6), calc(var(--dy, -25px) * 1.4)) scale(0.7);
        opacity: calc(var(--p-o, 0.15) * 0.6);
    }
}

/* --- Ken Burns — slow zoom & pan per scene --- */
@keyframes kenBurnsSalon {
    0%   { transform: scale(1.05) translate(0, 0); }
    100% { transform: scale(1.15) translate(-1.5%, -1%); }
}

@keyframes kenBurnsTruck {
    0%   { transform: scale(1.08) translate(0.5%, 0); }
    100% { transform: scale(1.18) translate(-1%, -1.5%); }
}

@keyframes kenBurnsAuto {
    0%   { transform: scale(1.05) translate(-0.5%, 0.5%); }
    100% { transform: scale(1.14) translate(1%, -1%); }
}

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

@media (max-width: 1024px) {
    .header { padding: 1.2rem 1.5rem; }
    .main-nav { gap: 1.5rem; }
    .player { width: 340px; }
    .scene-content { right: 4%; bottom: 25%; }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .logo { max-width: none; }
    .main-nav { gap: 1.2rem; }
    .nav-link { font-size: 0.65rem; }

    .player {
        position: fixed;
        top: auto;
        bottom: 4.5rem;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-width: 380px;
    }

    .scene-content {
        left: 5%;
        right: 5%;
        bottom: 50%;
        max-width: none;
        text-align: center;
    }

    .scene-content .memory-year {
        justify-content: center;
    }

    .scene-title { font-size: clamp(2rem, 9vw, 3rem); }

    .memories { display: none; }

    .controls {
        bottom: 4.8rem;
        right: 0.5rem;
    }

    .ctrl-btn span:last-child { display: none; }

    .listeners {
        bottom: auto;
        top: auto;
        left: auto;
        right: 0.5rem;
        bottom: 4.8rem;
    }

    .hint { display: none; }

    .bottom-nav { padding: 0.6rem 0.8rem 0.8rem; }
    .bn-arrow { min-width: auto; padding: 0.4rem; }
    .bn-name { font-size: 0.75rem; }
    .bn-label { display: none; }
}

@media (max-width: 480px) {
    .landing-content { padding: 1.5rem 1rem 1rem; }
    .landing-title { font-size: clamp(2.5rem, 15vw, 4rem); }
    .scene-cards { gap: 0.7rem; }
    .card-name { font-size: 0.65rem; }
    .card-img-wrap { aspect-ratio: 2 / 3; }
    .landing-footer { flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
    .landing-note { margin-left: 0; }
    .player { left: 0.3rem; right: 0.3rem; }
    .scene-title { font-size: clamp(1.8rem, 10vw, 2.5rem); }
    .main-nav { gap: 0.8rem; }
}
