:root {
    --bg: #000000;
    --bg-soft: #050505;
    --panel: #0d0d0d;
    --panel-2: #131313;
    --line: #222222;
    --text: #f4f4f5;
    --muted: #9ca3af;
    --accent: #ff453a;
    --accent-soft: rgba(255, 69, 58, 0.16);
    --radius: 18px;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body.app-body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.app-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 8%, rgba(255, 69, 58, 0.1), transparent 34%),
        radial-gradient(circle at 88% 20%, rgba(59, 130, 246, 0.08), transparent 33%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.shell {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-shell {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.86);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.06em;
    font-size: 1.2rem;
    color: #fff;
    background: linear-gradient(160deg, #1a1a1a, #090909);
    border: 1px solid #2a2a2a;
    box-shadow: 0 0 0 1px rgba(255, 69, 58, 0.08), 0 0 24px rgba(255, 69, 58, 0.22);
}

.brand-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
}

.brand-text strong {
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.08em;
    font-size: 1.5rem;
}

.brand-text small {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: var(--muted);
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.site-search {
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0 1rem;
}

.site-search i {
    color: #737373;
    font-size: 0.9rem;
}

.site-search input {
    border: 0;
    outline: 0;
    width: 100%;
    color: #e5e7eb;
    font-size: 0.95rem;
    background: transparent;
}

.site-search input::placeholder {
    color: #666;
}

.desktop-search {
    min-width: 280px;
}

.mobile-search-toggle {
    border: 1px solid var(--line);
    background: var(--panel);
    color: #d4d4d8;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 160ms ease, border-color 160ms ease;
}

.mobile-search-toggle:hover {
    border-color: #3a3a3a;
    transform: translateY(-1px);
}

.mobile-search {
    display: none;
    padding-bottom: 0.9rem;
}

.mobile-search.is-visible {
    display: block;
    animation: dropIn 220ms ease;
}

.site-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--line);
    background: rgba(8, 8, 8, 0.96);
}

.nav-scroll {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.65rem 0;
}

.nav-scroll::-webkit-scrollbar {
    height: 5px;
}

.nav-scroll::-webkit-scrollbar-thumb {
    background: #252525;
    border-radius: 999px;
}

.nav-link {
    color: #d1d5db;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.46rem 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 180ms ease;
}

.nav-link:hover {
    color: #fff;
    border-color: #2c2c2c;
    background: #121212;
}

.nav-link.is-active {
    color: #fff;
    border-color: #3a3a3a;
    background: linear-gradient(180deg, #181818, #101010);
}

.hero-wrap {
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #0a0a0a;
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 16 / 7;
    min-height: 380px;
    max-height: 600px;
    width: 100%;
    height: auto;
}

.hero-wrap .swiper-container,
.hero-wrap .swiper-wrapper,
.hero-wrap .swiper-slide {
    height: 100%;
}

.hero-slide {
    height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.hero-media-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-media-img {
    object-fit: cover;
    object-position: center center;
    transform: scale(1);
    filter: saturate(1.02) contrast(1.04) brightness(0.84);
    transition: transform 6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.swiper-slide-active .hero-media-img {
    transform: scale(1.1);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.45) 48%, rgba(0, 0, 0, 0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 56ch;
    height: 100%;
    justify-content: flex-end;
    padding: 2rem 2rem 1.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.hero-content > * {
    opacity: 0;
    transform: translateY(14px);
}

.swiper-slide-active .hero-content > * {
    animation: heroTextIn 600ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.swiper-slide-active .hero-content > *:nth-child(2) {
    animation-delay: 90ms;
}

.swiper-slide-active .hero-content > *:nth-child(3) {
    animation-delay: 170ms;
}

.swiper-slide-active .hero-content > *:nth-child(4) {
    animation-delay: 250ms;
}

.swiper-slide-active .hero-content > *:nth-child(5) {
    animation-delay: 330ms;
}

.hero-content h2 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    line-height: 0.95;
    letter-spacing: 0.03em;
    font-size: clamp(2.1rem, 6vw, 4.4rem);
}

.hero-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-score {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 69, 58, 0.28);
    color: #fff;
    padding: 0.28rem 0.62rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-score i {
    color: #ffe27a;
}

.hero-genre {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(20, 20, 20, 0.65);
    color: #e5e7eb;
    padding: 0.24rem 0.58rem;
    font-size: 0.78rem;
}

.hero-description {
    margin: 0;
    color: #d1d5db;
    max-width: 64ch;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.hero-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.46rem;
    border: 1px solid rgba(255, 69, 58, 0.38);
    background: rgba(255, 69, 58, 0.17);
    color: #ffe3df;
    width: fit-content;
    border-radius: 999px;
    padding: 0.34rem 0.7rem;
    font-size: 0.8rem;
    animation: pulseGlow 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-countdown .countdown {
    color: #fff;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.62rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: transform 170ms ease, box-shadow 170ms ease;
}

.hero-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 69, 58, 0.32);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.section-head h2 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.05em;
    font-size: clamp(1.35rem, 2.8vw, 2rem);
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.surface-card {
    background: linear-gradient(180deg, var(--panel), #090909);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.45);
}

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

.anime-card {
    border-radius: 14px;
    border: 1px solid #1f1f1f;
    background: #0b0b0b;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    animation: cardIn 420ms ease both;
}

.anime-card:hover {
    transform: translateY(-4px);
    border-color: #383838;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.44);
}

.anime-card-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.anime-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.anime-card:hover .anime-card-cover img {
    transform: scale(1.03);
}

.anime-card-body {
    padding: 0.75rem;
}

.anime-card h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.anime-meta {
    margin-top: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.tag-pill {
    border: 1px solid #2a2a2a;
    background: #111;
    color: #f4f4f5;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-size: 0.78rem;
}

.tag-pill.accent {
    border-color: rgba(255, 69, 58, 0.42);
    background: var(--accent-soft);
    color: #ffd3cf;
}

.countdown {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.notice-card {
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid #2a1f1f;
    background: linear-gradient(180deg, rgba(255, 69, 58, 0.08), rgba(255, 69, 58, 0.03));
    color: #ffd7d4;
}

.ad-shell {
    margin: 1rem 0;
    border: 1px dashed #2a2a2a;
    border-radius: 14px;
    background: #090909;
    padding: 0.85rem;
    display: grid;
    place-items: center;
    gap: 0.5rem;
    width: 100%;
}

.ad-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #777;
}

.ad-shell ins {
    margin: 0 auto;
    width: min(100%, 860px);
    min-height: 90px;
}

.ad-shell.ad-unfilled {
    display: none !important;
}

.anime-grid > .ad-shell {
    grid-column: 1 / -1;
}

.anime-grid > .ad-shell ins {
    width: min(100%, 860px);
    min-height: 90px;
}

.section-ad {
    margin-top: 1rem;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: #060606;
    padding: 1.8rem 0 1.4rem;
}

.footer-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}

.footer-grid h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.footer-grid p,
.footer-grid li,
.footer-grid a {
    color: #a3a3a3;
    font-size: 0.84rem;
}

.footer-grid ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.4rem;
}

.footer-grid a:hover {
    color: #f3f4f6;
}

.footer-bottom {
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    border-top: 1px solid #1b1b1b;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    color: #7c7c7c;
    font-size: 0.78rem;
}

.pagination-wrap {
    margin-top: 1.4rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
}

.page-link {
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #232323;
    display: grid;
    place-items: center;
    color: #d4d4d8;
    background: #0e0e0e;
    transition: all 150ms ease;
}

.page-link:hover {
    border-color: #343434;
    color: #fff;
}

.page-link.is-active {
    background: var(--accent);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip-link {
    border: 1px solid #282828;
    background: #0c0c0c;
    color: #d4d4d8;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    transition: all 160ms ease;
}

.chip-link:hover {
    color: #fff;
    border-color: #3a3a3a;
}

.chip-link.is-current {
    color: #fff;
    border-color: #4a4a4a;
    background: #191919;
}

.line-clamp-1,
.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 {
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    -webkit-line-clamp: 2;
}

.text-primary {
    color: var(--accent) !important;
}

.bg-primary {
    background: var(--accent) !important;
}

.bg-dark,
.bg-darker {
    background: var(--panel) !important;
    border: 1px solid var(--line) !important;
}

.text-gray-300,
.text-gray-400,
.text-gray-500 {
    color: var(--muted) !important;
}

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTextIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 69, 58, 0);
    }
}

@media (max-width: 1024px) {
    .desktop-search {
        display: none;
    }

    .mobile-search-toggle {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .shell,
    .page-shell {
        width: calc(100% - 1rem);
    }

    .hero-wrap {
        height: clamp(240px, 72vw, 370px);
    }

    .hero-content {
        padding: 1.2rem 1.1rem 1rem;
    }

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