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

:root {
    --primary: #ff7a00;
    --primary-dark: #e06600;
    --accent: #ffb347;
    --bg-dark: #0d0d1a;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0c0;
    --text-muted: #7a7a8a;
    --border-glass: rgba(255, 255, 255, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-card: 20px;
    --radius-sm: 12px;
    --transition: 0.3s ease;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(145deg, #0b0b1a 0%, #1a0a2e 40%, #0f1f2d 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 122, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 122, 0, 0.6); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== Header & Nav ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(10, 10, 30, 0.75);
    border-bottom: 1px solid var(--border-glass);
    padding: 0 2rem;
    transition: background var(--transition);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.8rem 0;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff7a00, #ffb347, #ff7a00);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 4s linear infinite;
    letter-spacing: 1px;
    text-shadow: 0 0 30px rgba(255, 122, 0, 0.3);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all var(--transition);
    position: relative;
    font-size: 0.95rem;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
    transition: width var(--transition);
}

nav ul li a:hover {
    color: #fff;
    background: rgba(255, 122, 0, 0.15);
}

nav ul li a:hover::after {
    width: 60%;
}

/* ===== Main Container ===== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

main > section {
    flex: 1 1 65%;
    min-width: 280px;
}

aside {
    flex: 1 1 28%;
    min-width: 240px;
}

/* ===== Section Headers ===== */
section h2, aside h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ff9a3c, #ffd194);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}

section h2::after, aside h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 10px;
    margin-top: 6px;
}

/* ===== Comics Grid ===== */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    animation: fadeUp 0.6s ease forwards;
}

.comics-grid article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 1rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.comics-grid article:nth-child(1) { animation-delay: 0.05s; }
.comics-grid article:nth-child(2) { animation-delay: 0.1s; }
.comics-grid article:nth-child(3) { animation-delay: 0.15s; }
.comics-grid article:nth-child(4) { animation-delay: 0.2s; }
.comics-grid article:nth-child(5) { animation-delay: 0.25s; }
.comics-grid article:nth-child(6) { animation-delay: 0.3s; }
.comics-grid article:nth-child(7) { animation-delay: 0.35s; }
.comics-grid article:nth-child(8) { animation-delay: 0.4s; }
.comics-grid article:nth-child(9) { animation-delay: 0.45s; }
.comics-grid article:nth-child(10) { animation-delay: 0.5s; }
.comics-grid article:nth-child(11) { animation-delay: 0.55s; }
.comics-grid article:nth-child(12) { animation-delay: 0.6s; }

.comics-grid article:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(255, 122, 0, 0.3);
}

.comics-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 200/280;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
    transition: transform var(--transition);
}

.comics-grid article:hover img {
    transform: scale(1.03);
}

.comics-grid h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #fff;
}

.comics-grid p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

/* ===== Recommend Grid ===== */
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.recommend-grid article {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 1rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
    animation: fadeUp 0.6s ease forwards;
    opacity: 0;
}

.recommend-grid article:nth-child(1) { animation-delay: 0.1s; }
.recommend-grid article:nth-child(2) { animation-delay: 0.2s; }
.recommend-grid article:nth-child(3) { animation-delay: 0.3s; }
.recommend-grid article:nth-child(4) { animation-delay: 0.4s; }

.recommend-grid article:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 12px 36px rgba(255, 179, 71, 0.25);
}

.recommend-grid img {
    width: 100%;
    aspect-ratio: 300/200;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
}

.recommend-grid h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.recommend-grid p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Detail Section ===== */
#detail article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    animation: fadeUp 0.7s ease;
}

#detail h3 {
    font-size: 1.4rem;
    color: var(--accent);
    margin: 1.5rem 0 0.8rem;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

#detail h3:first-of-type {
    margin-top: 0;
}

#detail p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ===== Characters Grid ===== */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.characters-grid article {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 1.2rem;
    text-align: center;
    transition: all var(--transition);
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
}

.characters-grid article:nth-child(1) { animation-delay: 0.05s; }
.characters-grid article:nth-child(2) { animation-delay: 0.1s; }
.characters-grid article:nth-child(3) { animation-delay: 0.15s; }
.characters-grid article:nth-child(4) { animation-delay: 0.2s; }
.characters-grid article:nth-child(5) { animation-delay: 0.25s; }
.characters-grid article:nth-child(6) { animation-delay: 0.3s; }

.characters-grid article:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 12px 36px rgba(255, 122, 0, 0.3);
}

.characters-grid img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    margin-bottom: 0.8rem;
    transition: transform var(--transition);
}

.characters-grid article:hover img {
    transform: scale(1.05);
}

.characters-grid h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.characters-grid p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Platform Section ===== */
#platform article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    animation: fadeUp 0.6s ease;
}

#platform p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ===== App Section ===== */
#app article {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.1), rgba(255, 179, 71, 0.08));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    animation: pulseGlow 3s ease-in-out infinite;
}

#app h3 {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

#app p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

#app div {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

#app button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(255, 122, 0, 0.4);
}

#app button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 122, 0, 0.6);
}

#app button:active {
    transform: scale(0.98);
}

/* ===== Reviews ===== */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.reviews-list article {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    transition: all var(--transition);
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

.reviews-list article:nth-child(1) { animation-delay: 0.02s; }
.reviews-list article:nth-child(2) { animation-delay: 0.04s; }
.reviews-list article:nth-child(3) { animation-delay: 0.06s; }
.reviews-list article:nth-child(4) { animation-delay: 0.08s; }
.reviews-list article:nth-child(5) { animation-delay: 0.1s; }
.reviews-list article:nth-child(6) { animation-delay: 0.12s; }
.reviews-list article:nth-child(7) { animation-delay: 0.14s; }
.reviews-list article:nth-child(8) { animation-delay: 0.16s; }
.reviews-list article:nth-child(9) { animation-delay: 0.18s; }
.reviews-list article:nth-child(10) { animation-delay: 0.2s; }
.reviews-list article:nth-child(11) { animation-delay: 0.22s; }
.reviews-list article:nth-child(12) { animation-delay: 0.24s; }
.reviews-list article:nth-child(13) { animation-delay: 0.26s; }
.reviews-list article:nth-child(14) { animation-delay: 0.28s; }
.reviews-list article:nth-child(15) { animation-delay: 0.3s; }

.reviews-list article:hover {
    background: rgba(255, 122, 0, 0.1);
    border-color: var(--primary);
    transform: translateX(4px);
}

.reviews-list p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.reviews-list p:first-child {
    font-weight: 600;
    color: var(--accent);
}

.reviews-list p:nth-child(2) {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== Aside ===== */
aside {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 1.8rem;
    box-shadow: var(--shadow-card);
    height: fit-content;
    animation: fadeUp 0.7s ease;
}

aside h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

aside h2:first-of-type {
    margin-top: 0;
}

aside ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

aside ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color var(--transition);
}

aside ul li:hover {
    color: var(--accent);
    padding-left: 4px;
}

/* ===== Footer ===== */
footer {
    background: rgba(10, 10, 30, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-glass);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: 3rem;
}

footer h2 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

footer ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

footer ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

footer ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

footer ul li a:hover {
    color: var(--primary);
}

footer ul li a:hover::after {
    width: 100%;
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }
    aside {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    nav ul {
        gap: 0.5rem;
    }
    nav ul li a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    .logo h1 {
        font-size: 1.5rem;
    }
    main {
        padding: 1.5rem 1rem;
    }
    section h2, aside h2 {
        font-size: 1.5rem;
    }
    .comics-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    .recommend-grid {
        grid-template-columns: 1fr;
    }
    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    #app article {
        padding: 1.5rem;
    }
    #app button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    footer ul {
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .comics-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    .comics-grid article {
        padding: 0.6rem;
    }
    .comics-grid h3 {
        font-size: 0.95rem;
    }
    .comics-grid p {
        font-size: 0.75rem;
    }
    #detail article {
        padding: 1rem;
    }
    #detail h3 {
        font-size: 1.1rem;
    }
    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    aside {
        padding: 1rem;
    }
}

/* ===== Dark Mode (always dark, but we add a media query for extra safety) ===== */
@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(145deg, #0b0b1a 0%, #1a0a2e 40%, #0f1f2d 100%);
        color: var(--text-primary);
    }
    /* keep dark regardless */
}

/* ===== Utility ===== */
img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

/* ===== Smooth scroll offset for fixed header ===== */
section[id] {
    scroll-margin-top: 80px;
}