:root {
    --bg-gradient: radial-gradient(circle at 20% -10%, #331322 0%, #0b0818 45%, #010206 100%);
    --accent: #f94d6a;
    --accent-secondary: #72ebff;
    --surface: rgba(12, 6, 21, 0.82);
    --surface-alt: rgba(23, 14, 43, 0.86);
    --text-primary: #f8eefc;
    --text-secondary: #d4c0ff;
    --muted: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 40px 70px rgba(5, 0, 12, 0.65);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-gradient), url('https://images.unsplash.com/photo-1604079628040-94301bb21b11?auto=format&fit=crop&w=1600&q=80') no-repeat center/cover fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.18;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: -1;
}

.page-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.texture-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, rgba(249, 77, 106, 0.12) 0%, rgba(4, 10, 30, 0.65) 38%, rgba(7, 23, 43, 0.85) 100%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: -1;
}

.fog-layer {
    position: fixed;
    inset: 0;
    background: url('https://i.imgur.com/Q5R9Zfj.png') repeat;
    opacity: 0.25;
    animation: drift 48s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.fog-front {
    filter: blur(6px);
    opacity: 0.3;
    animation-duration: 60s;
}

.fog-back {
    filter: blur(12px);
    opacity: 0.2;
}

.crows {
    position: fixed;
    top: 12vh;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
    z-index: 2;
}

.crow {
    position: relative;
    display: block;
    width: 42px;
    height: 20px;
    background: linear-gradient(90deg, rgba(249, 77, 106, 0.15), rgba(255, 255, 255, 0));
    clip-path: polygon(0% 60%, 20% 30%, 45% 50%, 70% 0%, 100% 45%, 70% 52%, 57% 80%, 40% 60%, 15% 80%);
    transform-origin: center;
    animation: swoop 14s ease-in-out infinite;
    animation-delay: calc(var(--i, 1) * 4s);
    opacity: 0.45;
}

.crows .crow:nth-child(1) { --i: 1; }
.crows .crow:nth-child(2) { --i: 2; animation-duration: 18s; }
.crows .crow:nth-child(3) { --i: 3; animation-duration: 22s; }

.bg-orb {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    --mx: 0px;
    --my: 0px;
    transform: translate3d(var(--mx), var(--my), 0);
    animation: gloom 16s ease-in-out infinite;
}

.orb-one {
    background: #f94d6a;
    top: -60px;
    left: -120px;
}

.orb-two {
    background: #5f1ea9;
    bottom: 10%;
    right: 5%;
    animation-delay: 2s;
}

.orb-three {
    background: #4ed0ff;
    top: 35%;
    right: -140px;
    animation-delay: 5s;
}

@keyframes gloom {
    0%, 100% {
        opacity: 0.55;
        filter: blur(40px) brightness(1);
    }
    50% {
        opacity: 0.8;
        filter: blur(46px) brightness(1.1);
    }
}

@keyframes drift {
    0% { transform: translate3d(-15%, 0, 0); }
    50% { transform: translate3d(10%, 0, 0); }
    100% { transform: translate3d(-15%, 0, 0); }
}

@keyframes swoop {
    0% { transform: translate3d(-20vw, 0, 0) scale(0.8) rotate(-8deg); opacity: 0; }
    20% { opacity: 0.45; }
    50% { transform: translate3d(0, -4vh, 0) scale(1) rotate(5deg); }
    80% { transform: translate3d(25vw, -2vh, 0) scale(0.9) rotate(-3deg); }
    100% { transform: translate3d(40vw, 2vh, 0) scale(0.6) rotate(3deg); opacity: 0; }
}

@keyframes glitch {
    0% { clip-path: polygon(0 2%, 100% 0, 100% 23%, 0 25%); transform: translate3d(0, 0, 0); }
    10% { clip-path: polygon(0 35%, 100% 32%, 100% 55%, 0 52%); transform: translate3d(2px, -2px, 0); }
    20% { clip-path: polygon(0 12%, 100% 10%, 100% 35%, 0 38%); transform: translate3d(-3px, 2px, 0); }
    30% { clip-path: polygon(0 65%, 100% 60%, 100% 85%, 0 90%); transform: translate3d(3px, 1px, 0); }
    40% { clip-path: polygon(0 0, 100% 0, 100% 25%, 0 25%); transform: translate3d(-1px, -1px, 0); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 25%, 0 25%); transform: translate3d(0, 0, 0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(249, 77, 106, 0.45); }
    50% { transform: scale(1.05); box-shadow: 0 0 50px rgba(249, 77, 106, 0.6); }
}

@keyframes heroFlicker {
    0%, 100% { filter: drop-shadow(0 0 22px rgba(249, 77, 106, 0.45)); }
    30% { filter: drop-shadow(0 0 42px rgba(249, 77, 106, 0.6)); }
    60% { filter: drop-shadow(0 0 28px rgba(114, 235, 255, 0.4)); }
    70% { filter: drop-shadow(0 0 52px rgba(249, 77, 106, 0.7)); }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem clamp(1.2rem, 5vw, 4rem);
    background: linear-gradient(180deg, rgba(6, 4, 12, 0.92), rgba(6, 4, 12, 0));
    border-bottom: 1px solid rgba(249, 77, 106, 0.18);
    backdrop-filter: blur(18px);
}

.logo {
    font-family: 'Creepster', cursive;
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 18px rgba(249, 77, 106, 0.6);
}

.logo span {
    color: var(--accent-secondary);
    margin-left: 0.5rem;
    text-shadow: 0 0 14px rgba(114, 235, 255, 0.55);
}

.nav-links {
    display: none;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.nav-links a:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 12px rgba(114, 235, 255, 0.5);
}

.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.6rem;
    background: linear-gradient(135deg, rgba(249, 77, 106, 0.95), rgba(130, 24, 62, 0.95));
    color: #fff5fb;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    box-shadow: 0 16px 48px rgba(249, 77, 106, 0.45);
}

.cta:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 24px 60px rgba(249, 77, 106, 0.55);
    filter: brightness(1.1);
}

.cta.outline {
    background: transparent;
    color: var(--accent-secondary);
    border: 1px solid rgba(114, 235, 255, 0.45);
    box-shadow: none;
}

.ghost-btn {
    display: none;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 6vw, 6rem) 0;
    position: relative;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -10% 40% 55% -10%;
    background: radial-gradient(circle at top, rgba(114, 235, 255, 0.15), transparent 60%);
    filter: blur(12px);
    z-index: -1;
}

.hero-content {
    max-width: 560px;
}

.tag {
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(114, 235, 255, 0.3);
    border-radius: 999px;
    background: rgba(8, 17, 34, 0.65);
    box-shadow: 0 0 22px rgba(114, 235, 255, 0.25);
}

.hero-title {
    position: relative;
    display: inline-block;
    margin: 0.8rem 0 0.3rem;
    animation: heroFlicker 6s ease-in-out infinite;
}

.hero-title .hero-glitch {
    font-family: 'Creepster', cursive;
    font-size: clamp(3.1rem, 6vw, 4.6rem);
    color: var(--accent);
    text-shadow: 0 0 30px rgba(249, 77, 106, 0.6), 0 0 10px rgba(249, 77, 106, 0.8);
    position: relative;
    display: inline-block;
}

.hero-title.flicker-glow .hero-glitch {
    text-shadow: 0 0 40px rgba(249, 77, 106, 0.75), 0 0 22px rgba(114, 235, 255, 0.6);
}

.hero-title .hero-glitch::before,
.hero-title .hero-glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 55%);
    opacity: 0.7;
    animation: glitch 3.6s infinite;
}

.hero-title .hero-glitch::before {
    color: #72ebff;
    transform: translate3d(-3px, 0, 0);
}

.hero-title .hero-glitch::after {
    color: #7d1f3b;
    clip-path: polygon(0 50%, 100% 45%, 100% 100%, 0 100%);
    transform: translate3d(3px, 1px, 0);
    animation-delay: 0.9s;
}

.hero-drip {
    position: absolute;
    left: 14%;
    bottom: -10px;
    width: 68%;
    height: 28px;
    background: radial-gradient(circle at 50% -20%, rgba(249, 77, 106, 0.85), rgba(130, 16, 34, 0.8));
    clip-path: polygon(0 0, 10% 100%, 20% 45%, 30% 100%, 40% 55%, 50% 100%, 60% 45%, 70% 100%, 80% 50%, 90% 100%, 100% 0);
    filter: blur(0.4px);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.8rem;
    text-shadow: 0 0 14px rgba(114, 235, 255, 0.25);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.countdown {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    position: relative;
}

.countdown-item {
    width: 74px;
    height: 90px;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(33, 14, 45, 0.88), rgba(12, 3, 22, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    font-family: 'Jura', sans-serif;
    border: 1px solid rgba(249, 77, 106, 0.35);
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(249, 77, 106, 0.25), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.countdown-item:hover::before {
    opacity: 1;
}

.countdown-item span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-secondary);
    text-shadow: 0 0 18px rgba(114, 235, 255, 0.5);
}

.countdown-item small {
    color: var(--text-secondary);
    letter-spacing: 0.12em;
}

.hero-visual {
    max-width: 420px;
}

.hero-card {
    background: linear-gradient(145deg, rgba(24, 8, 38, 0.92), rgba(7, 1, 14, 0.94));
    padding: 2rem;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(249, 77, 106, 0.18);
    transition: transform 0.7s ease, opacity 0.7s ease;
    position: relative;
    isolation: isolate;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -30% 45% 40% -35%;
    background: radial-gradient(circle at top, rgba(249, 77, 106, 0.4), transparent 70%);
    filter: blur(30px);
    z-index: -1;
}

.hero-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-family: 'Jura', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-secondary);
}

.hero-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-card ul {
    margin: 1.2rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    list-style: none;
}

.hero-card ul li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.6rem;
}

.hero-card ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(249, 77, 106, 0.8);
}

.sigil {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 1.2rem;
    background: conic-gradient(from 180deg, rgba(249, 77, 106, 0.65), rgba(114, 235, 255, 0.2), rgba(249, 77, 106, 0.65));
    position: relative;
    overflow: hidden;
    animation: pulse 4.5s ease-in-out infinite;
    border: 1px solid rgba(249, 77, 106, 0.4);
}

.sigil::after {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    filter: drop-shadow(0 0 8px rgba(249, 77, 106, 0.6));
}

section {
    padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 7vw, 6rem);
    position: relative;
}

.features h2,
.classes h2,
.story h2,
.download h2,
.community h2 {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
    font-family: 'Creepster', cursive;
    letter-spacing: 0.08em;
    color: var(--accent-secondary);
    text-shadow: 0 0 28px rgba(114, 235, 255, 0.5);
}

.feature-grid {
    display: grid;
    gap: 1.6rem;
}

.feature-card {
    background: linear-gradient(150deg, rgba(26, 10, 40, 0.88), rgba(9, 2, 18, 0.92));
    border-radius: 26px;
    padding: 1.8rem;
    border: 1px solid rgba(249, 77, 106, 0.16);
    box-shadow: var(--card-shadow);
    transition: transform 0.4s ease, opacity 0.7s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(249, 77, 106, 0.22), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-family: 'Jura', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.class-carousel {
    display: grid;
    gap: 1.5rem;
}

.class-card {
    padding: 1.9rem;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(29, 12, 55, 0.94), rgba(10, 3, 21, 0.92));
    border: 1px solid rgba(114, 235, 255, 0.22);
    box-shadow: 0 20px 40px rgba(23, 7, 46, 0.55);
    transition: transform 0.4s ease, opacity 0.7s ease;
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: "";
    position: absolute;
    inset: -20% -10% 70% 30%;
    background: radial-gradient(circle, rgba(114, 235, 255, 0.18), transparent 65%);
    opacity: 0.7;
    transition: transform 0.4s ease;
}

.class-card:hover::before {
    transform: translate3d(6px, -6px, 0);
}

.class-card h3 {
    font-size: 1.4rem;
    margin: 0 0 0.6rem;
    font-family: 'Creepster', cursive;
    letter-spacing: 0.04em;
    color: var(--accent-secondary);
}

.class-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.1rem;
}

.class-role {
    font-family: 'Jura', sans-serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--accent-secondary);
}

.story {
    position: relative;
}

.story-wrapper {
    display: grid;
    gap: 1.8rem;
    background: rgba(7, 3, 15, 0.82);
    border-radius: 32px;
    padding: clamp(2.2rem, 5vw, 3rem);
    border: 1px solid rgba(114, 235, 255, 0.15);
    box-shadow: var(--card-shadow);
    transition: transform 0.7s ease, opacity 0.7s ease;
    position: relative;
    overflow: hidden;
}

.story-wrapper::before {
    content: "";
    position: absolute;
    inset: -10% 20% 60% -15%;
    background: radial-gradient(circle, rgba(249, 77, 106, 0.35), transparent 70%);
    filter: blur(18px);
}

.story-content p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.story-panel {
    background: rgba(16, 9, 30, 0.88);
    border-radius: 24px;
    padding: 1.6rem;
    border: 1px solid rgba(249, 77, 106, 0.2);
    box-shadow: inset 0 0 18px rgba(249, 77, 106, 0.25);
}

.story-panel ul {
    margin: 1rem 0 0;
    padding-left: 1rem;
    color: var(--text-secondary);
}

.download .store-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    text-decoration: none;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    border: 1px solid rgba(249, 77, 106, 0.28);
    background: rgba(22, 8, 35, 0.7);
    color: var(--accent-secondary);
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0 20px rgba(249, 77, 106, 0.2);
}

.badge:hover {
    background: linear-gradient(135deg, rgba(249, 77, 106, 0.85), rgba(130, 24, 62, 0.85));
    color: #fff5fb;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 30px rgba(249, 77, 106, 0.45);
}

.community {
    text-align: center;
    position: relative;
}

.community-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin-top: 1.5rem;
}

.community::before {
    content: "";
    position: absolute;
    inset: 15% 20% 30% 20%;
    background: radial-gradient(circle, rgba(249, 77, 106, 0.18), transparent 70%);
    filter: blur(18px);
    z-index: -1;
}

.site-footer {
    text-align: center;
    padding: 2rem 1.5rem 3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    background: rgba(6, 3, 14, 0.75);
    border-top: 1px solid rgba(249, 77, 106, 0.18);
    backdrop-filter: blur(14px);
}

body.js-ready .hero-card,
body.js-ready .feature-card,
body.js-ready .class-card,
body.js-ready .story-wrapper {
    opacity: 0;
    transform: translateY(30px);
}

body.js-ready .revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .ghost-btn {
        display: inline-flex;
    }

    .hero {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .hero {
        padding-top: 5rem;
    }

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

    .class-carousel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .story-wrapper {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

@media (max-width: 420px) {
    .countdown {
        gap: 0.6rem;
    }

    .countdown-item {
        width: 64px;
        height: 78px;
    }

    .hero-card {
        padding: 1.6rem;
    }
}
