/* =========================================
   CSS Variables & Theme
========================================= */
:root {
    /* Color Palette derived from sakura & profile */
    --clr-sakura-light: #ffd1dc;
    --clr-sakura: #ffb7c5;
    --clr-sakura-dark: #ff8eaa;
    --clr-bg-dark: #0f0a10;
    --clr-bg-card: #1c1520;
    --clr-text-main: #fcf9fa;
    --clr-text-muted: #d0c8d1;
    --clr-accent: #ff4d79;
    
    /* Typography */
    --font-main: 'Outfit', sans-serif;
    
    /* Layout */
    --nav-height: 80px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   Reset & Base Styles
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--clr-bg-dark);
    color: var(--clr-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   Custom Scrollbar
========================================= */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--clr-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--clr-sakura-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--clr-accent);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =========================================
   Typography & Accents
========================================= */
.text-gradient {
    background: linear-gradient(135deg, var(--clr-sakura), var(--clr-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-text {
    color: var(--clr-accent);
    font-weight: 800;
    letter-spacing: 1px;
}

.title-underline {
    width: 60px;
    height: 4px;
    background: var(--clr-sakura-dark);
    margin-top: 0.5rem;
    border-radius: 2px;
}

/* =========================================
   Navigation Bar
========================================= */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    height: var(--nav-height);
    background: rgba(28, 21, 32, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 183, 197, 0.15);
    border-radius: 12px;
    z-index: 1000;
    transition: var(--transition-normal);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 2.5rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--clr-sakura);
    transition: var(--transition-fast);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    transition: var(--transition-normal);
}

.nav-links a {
    font-weight: 600;
    font-size: 1rem;
    color: var(--clr-text-main);
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--clr-sakura);
    transition: var(--transition-fast);
}

.nav-links a:hover {
    color: var(--clr-sakura-light);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Minimized Nav State */
.navbar.minimized {
    top: 10px;
    width: 200px;
    height: 50px;
    background: rgba(28, 21, 32, 0.85);
    border-radius: 25px;
    cursor: pointer;
}

.navbar.minimized .nav-container {
    justify-content: center;
    padding: 0;
}

.navbar.minimized .nav-logo {
    font-size: 1.2rem;
}

.navbar.minimized .nav-links {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: scale(0.8);
}

.navbar.minimized:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 8px 32px rgba(255, 183, 197, 0.2);
}

/* =========================================
   Hero Section
========================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 60px) 2rem 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Imaes/sakura.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
    filter: blur(2px) saturate(1.2);
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 10, 16, 0.3) 0%, rgba(15, 10, 16, 0.9) 100%);
    z-index: -1;
}

.hero-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4rem;
    max-width: 1100px;
    width: 100%;
    background: rgba(28, 21, 32, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero-image-container {
    flex-shrink: 0;
}

.hero-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--clr-sakura);
    box-shadow: 0 0 30px rgba(255, 183, 197, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: var(--transition-normal);
}

.hero-img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 0 40px rgba(255, 183, 197, 0.6);
}

.hero-text-container {
    flex-grow: 1;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hero-bio {
    font-size: 1.15rem;
    color: var(--clr-text-muted);
}

.hero-bio p {
    margin-bottom: 1rem;
}

.outro-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--clr-sakura-light);
    margin-top: 1.5rem;
}

/* =========================================
   Novels Section
========================================= */
.section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--clr-sakura-light);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 350px));
    gap: 2.5rem;
    justify-content: center;
}

.novel-card {
    position: relative;
    background: var(--clr-bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
    aspect-ratio: 1 / 1;
    min-height: 320px; /* Fallback to prevent collapsing */
}

.novel-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 183, 197, 0.15);
    border-color: rgba(255, 183, 197, 0.3);
}

.card-image-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.novel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.novel-card:hover .novel-img {
    transform: scale(1.08);
    filter: blur(4px) brightness(0.4);
}

.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.novel-card:hover .card-content {
    opacity: 1;
    transform: translateY(0);
}

.novel-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--clr-sakura-light);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.novel-desc {
    color: var(--clr-text-main);
    margin-bottom: 2rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    font-weight: 500;
}

.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--clr-sakura-dark), var(--clr-accent));
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition-fast);
    box-shadow: 0 4px 15px rgba(255, 77, 121, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 121, 0.6);
}

/* =========================================
   Footer
========================================= */
.footer {
    background: var(--clr-bg-card);
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--clr-sakura);
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: var(--clr-text-muted);
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--clr-text-main);
    transition: var(--transition-normal);
}

.social-icon:hover {
    background: var(--clr-sakura);
    color: var(--clr-bg-dark);
    transform: translateY(-5px) rotate(10deg);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    color: rgba(208, 200, 209, 0.5);
    font-size: 0.9rem;
}

/* =========================================
   Animations & Scroll Effects
========================================= */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Media Queries (Responsive)
========================================= */
.menu-toggle {
    display: none;
}

@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 2.5rem;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }

    /* Fix for novel card hover on mobile: show permanently */
    .novel-card {
        aspect-ratio: auto;
        min-height: 400px;
    }

    .card-content {
        opacity: 1;
        transform: translateY(0);
        background: rgba(15, 10, 16, 0.7); /* dark overlay */
    }

    .novel-card .novel-img {
        filter: blur(2px) brightness(0.6);
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-img {
        width: 180px;
        height: 180px;
    }
    
    .navbar {
        width: 95%;
    }
    
    .nav-container {
        padding: 0 1.5rem;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        z-index: 1001;
    }

    .menu-toggle .bar {
        width: 25px;
        height: 3px;
        background-color: var(--clr-sakura);
        margin: 3px 0;
        transition: var(--transition-fast);
        border-radius: 2px;
    }

    /* Transform hamburger into 'X' when open */
    .menu-toggle.open .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.open .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.open .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(28, 21, 32, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 2rem;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 183, 197, 0.15);
        border-top: none;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease, opacity 0.4s ease;
        opacity: 0;
        pointer-events: none;
    }

    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
        pointer-events: all;
    }

    .navbar.minimized .menu-toggle {
        display: none;
    }
}
