:root {
    --bg: #050608;
    --bg-soft: rgba(255, 255, 255, 0.04);
    --panel: rgba(255, 255, 255, 0.05);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f4f6f8;
    --muted: rgba(244, 246, 248, 0.72);
    --accent: #58d9ca;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

html[data-theme="light"] {
    --bg: #f2f3f5;
    --bg-soft: rgba(17, 17, 17, 0.04);
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: rgba(255, 255, 255, 0.92);
    --line: rgba(17, 17, 17, 0.08);
    --text: #111318;
    --muted: rgba(17, 19, 24, 0.68);
    --accent: #129a8d;
    --shadow: 0 20px 46px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

body.page-home {
    overflow: hidden;
}

body.page-thanks {
    overflow: hidden;
    background: #000;
    cursor: none;
}

[hidden] {
    display: none !important;
}

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

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

a {
    text-decoration: none;
}

button {
    cursor: pointer;
}

#ambient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.95;
}

.site-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 24px;
}

.page-home .site-shell {
    height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
}

.topbar {
    position: sticky;
    top: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1320px;
    margin: 0 auto 20px;
    padding: 14px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.page-home .topbar {
    margin-bottom: 0;
}

.brand {
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
}

.main-nav,
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.main-nav a,
.toolbar-button,
.home-action-chip,
.slider-arrow,
.home-dot,
.section-link,
.platform-link,
.mono-pill {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
}

.main-nav a,
.toolbar-button,
.section-link,
.platform-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.main-nav a:hover,
.toolbar-button:hover,
.section-link:hover,
.platform-link:hover,
.home-action-chip:hover,
.slider-arrow:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
}

.page-wrap {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

.page-home .page-wrap {
    min-height: 0;
    display: grid;
}

.home-screen {
    min-height: 0;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    gap: 14px;
    align-items: center;
}

.home-stage {
    position: relative;
    min-height: 0;
    height: min(68vh, 700px);
    border-radius: 32px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 18% 22%, rgba(88, 217, 202, 0.08), transparent 32%),
        radial-gradient(circle at 82% 78%, rgba(88, 217, 202, 0.06), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
        color-mix(in srgb, var(--panel-strong) 72%, transparent);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.home-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(108deg, rgba(255,255,255,0.03) 0%, transparent 30%, transparent 70%, rgba(88,217,202,0.04) 100%);
    pointer-events: none;
}

.home-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    gap: 18px;
    padding: clamp(28px, 5vw, 72px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity .35s ease, transform .35s ease;
}

.home-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.home-slide__meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-slide__number {
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--muted);
}

.home-slide__tag {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(88, 217, 202, 0.24);
    background: rgba(88, 217, 202, 0.1);
    font-weight: 700;
}

.home-slide__title {
    margin: 0;
    max-width: 900px;
    font-size: clamp(2.8rem, 7vw, 6rem);
    line-height: .92;
    letter-spacing: -0.04em;
}

.home-slide__text {
    margin: 0;
    max-width: 860px;
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    line-height: 1.75;
    color: var(--muted);
}

.home-slide__link,
.home-action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 18px;
    width: fit-content;
    border-radius: 16px;
    border: 1px solid rgba(88, 217, 202, 0.24);
    background: rgba(88, 217, 202, 0.1);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.home-slide__link:hover,
.home-action-chip:hover {
    background: rgba(88, 217, 202, 0.16);
}

.slider-arrow {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 2rem;
    line-height: 1;
    box-shadow: var(--shadow);
}

.home-dots {
    position: absolute;
    right: 22px;
    bottom: 22px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

.home-dot {
    width: 36px;
    height: 10px;
    padding: 0;
    border-radius: 999px;
    transition: transform .2s ease, background .2s ease;
}

.home-dot.is-active {
    background: var(--accent);
    transform: scaleX(1.1);
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.home-action-chip {
    width: 100%;
    min-height: 58px;
    border-radius: 18px;
    font-weight: 800;
    justify-content: center;
}

.home-action-chip.is-active {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.home-action-chip.is-timer {
    background: rgba(255, 112, 112, 0.14);
    border-color: rgba(255, 112, 112, 0.28);
}

.content-screen {
    display: grid;
    gap: 18px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 22px 24px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
    box-shadow: var(--shadow);
}

.section-head h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
}

.gallery-grid {
    column-count: 3;
    column-gap: 18px;
    min-height: 52vh;
}

.gallery-grid.is-empty {
    column-count: 1;
}

.gallery-empty {
    min-height: 52vh;
    border-radius: 28px;
    border: 1px dashed var(--line);
    background: color-mix(in srgb, var(--panel-strong) 74%, transparent);
}

.gallery-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease;
}

.gallery-card:hover,
.music-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}

.gallery-card__image {
    width: 100%;
    min-height: 220px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.25);
}

.gallery-card__body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.gallery-card__caption {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
    word-break: break-word;
}

.gallery-card__meta {
    display: inline-flex;
    width: fit-content;
    min-height: 34px;
    padding: 0 12px;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    font-size: .9rem;
}

.music-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.music-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-strong) 84%, transparent);
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease;
}

.music-card__cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.25);
}

.music-card__body {
    display: grid;
    gap: 8px;
}

.music-card__body h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.music-card__body p {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
}

.dino-shell,
.unlock-box {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-strong) 86%, transparent);
    box-shadow: var(--shadow);
}

#dino-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1400 / 260;
    border-radius: 16px;
    background: #f7f7f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.dino-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.mono-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: .12em;
}

.thanks-screen {
    position: relative;
    min-height: 100vh;
    background: #000;
}

.thanks-words {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 8px;
    align-content: center;
    max-width: 1180px;
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(26px, 8vw, 120px);
}

.thanks-word {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
    text-stroke: 1px rgba(255, 255, 255, 0.22);
    font-size: clamp(1.05rem, 2vw, 1.75rem);
    line-height: 1.7;
    user-select: none;
    transition: color .12s linear, opacity .24s ease, transform .24s ease;
}

.thanks-word.is-lit {
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
}

.thanks-word.is-gone {
    opacity: 0;
    transform: scale(.92);
}

.flashlight {
    position: fixed;
    width: 96px;
    height: 96px;
    margin-left: -48px;
    margin-top: -48px;
    border-radius: 50%;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.96),
        inset 0 0 24px rgba(255, 255, 255, 0.07);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .gallery-grid {
        column-count: 2;
    }

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

@media (max-width: 900px) {
    .site-shell {
        padding: 16px;
    }

    .topbar {
        position: static;
        border-radius: 28px;
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav,
    .toolbar {
        justify-content: center;
    }

    body.page-home {
        overflow-y: auto;
    }

    .page-home .site-shell {
        height: auto;
        min-height: 100vh;
        display: block;
    }

    .home-screen {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .slider-arrow {
        width: 100%;
        height: 48px;
        border-radius: 16px;
    }

    .home-stage {
        order: 1;
        height: auto;
        min-height: 58vh;
        border-radius: 24px;
    }

    .home-slide {
        padding: 24px;
    }

    .home-slide__title {
        font-size: clamp(2.2rem, 12vw, 4rem);
    }

    .home-slide__text {
        font-size: 1rem;
        line-height: 1.65;
    }

    .home-actions {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        column-count: 1;
    }

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

/* Safe area for Somee free-plan banner on desktop */
@media (min-width: 901px) {
    .page-home .page-wrap {
        grid-template-rows: minmax(0, 1fr) auto;
        align-content: start;
        gap: 10px;
        padding-bottom: 96px;
    }

    .page-home .home-stage {
        height: min(58vh, 610px);
    }

    .page-home .home-actions {
        margin-top: 0;
    }

    .page-home .home-action-chip {
        min-height: 54px;
    }
}

/* Keep gallery image-only even if old cached markup is still in the browser */
.gallery-card__body,
.gallery-card__caption,
.gallery-card__meta {
    display: none !important;
}
