:root {
    /* Colors */
    --bg-dark: #0a0a0e;
    --bg-overlay: #14141d;
    --accent-primary: #d1c4e9;
    /* Neon Lavender */
    --accent-secondary: #e0f7fa;
    /* Ice Blue */
    --text-main: #eceff1;
    --text-muted: #b0bec5;

    /* Fonts */
    --font-serif: 'Zen Old Mincho', serif;
    --font-sans: 'Noto Sans JP', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-dark);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(176, 190, 197, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(209, 196, 233, 0.5);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Layers */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-base {
    background: radial-gradient(circle at center bottom, #1a1a2e 0%, var(--bg-dark) 70%);
}

.bg-overlay {
    background-image: url('../assets/images/bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Glassmorphism Card Utility - Premium Polish */
.glass-card {
    background: rgba(20, 20, 29, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    background: rgba(40, 40, 50, 0.4);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.4);
}

/* Layout */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    /* Increased for logic split */
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    /* Scroll Snap Alignment */
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 0.2em;
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(209, 196, 233, 0.3);
    word-break: keep-all;
    /* Prevent awkward Japanese line breaks */
}

/* Hero Section */
.hero-section {
    position: relative;
}

.hero-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-visual {
    position: relative;
    width: 80vh;
    /* Scaled to Viewport Height for impact */
    max-width: 600px;
    margin-bottom: -100px;
    /* Overlap effect */
    z-index: 1;
}

.chara-img-hero {
    width: 100%;
    height: auto;
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    filter: drop-shadow(0 0 20px rgba(179, 157, 219, 0.1));
    /* Fluffy slow float animation */
    animation: float 12s ease-in-out infinite;
}

.chara-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(179, 157, 219, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: pulse 5s ease-in-out infinite;
}

.hero-text {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 2rem;
    background: radial-gradient(rgba(10, 10, 14, 0.8), transparent 70%);
    /* Legibility bg */
    padding: 2rem;
}

.main-title {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    line-height: 1.1;
    word-break: keep-all;
    /* Prevent awkward Japanese line breaks */
}

.subtitle {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 0.5em;
    text-transform: uppercase;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    opacity: 0.7;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
}

.profile-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1000px;
    width: 100%;
}

.profile-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.profile-img {
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    opacity: 0.9;
    /* Atmospheric Glow & Float */
    filter: drop-shadow(0 0 15px rgba(179, 157, 219, 0.3));
    animation: float 14s ease-in-out infinite reverse;
    /* Reverse and slower for difference */
    transition: filter 0.5s ease;
}

.profile-img:hover {
    filter: drop-shadow(0 0 25px rgba(179, 157, 219, 0.6));
}

.profile-section .profile-card {
    flex: 1;
    max-width: 500px;
}


/* Links Section Refactor */
.links-primary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.main-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 450px;
    padding: 3rem 2rem;
}

.main-link .icon {
    font-size: 2.5rem;
}

.main-link .link-name {
    font-size: 1.5rem;
}

.links-secondary {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.link-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    background: rgba(20, 20, 29, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    /* Pill shape */
    transition: all 0.3s ease;
}

.link-chip:hover {
    background: rgba(20, 20, 29, 0.8);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Tags Refactor */
.tag-title {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.chip {
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    color: var(--accent-primary);
    font-weight: 700;
    transition: all 0.2s ease;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.05);
}

/* Guidelines Accordion */
.guideline-wrapper {
    margin-top: 2rem;
    width: 100%;
    max-width: 800px;
}

.guideline-details summary {
    cursor: pointer;
    font-weight: 700;
    padding: 1rem;
    list-style: none;
    /* Hide default triangle */
    text-align: center;
    color: var(--text-muted);
}

.guideline-details summary:hover {
    color: var(--text-main);
}

.guideline-details[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.guideline-content {
    padding: 1rem;
    line-height: 1.8;
}

/* Credits Section */
.credits-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    min-width: 300px;
}

.credit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.credit-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.credit-item .role {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.credit-item .name,
.credit-item .name-link {
    font-weight: 700;
}

.credit-item .name-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* Integrated Credits in Profile */
.profile-credits {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    min-width: auto;
    /* Reset */
    align-items: flex-start;
    /* Align left with text */
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Mobile Adjustments for new layout */
/* Animations */



/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(-1.5deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.7;
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(10px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.fade-in {
    opacity: 0;
    filter: blur(5px);
    transition: opacity 1.5s ease-out, filter 1.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
    filter: blur(0);
}

/* Mobile Responsive */
@media (max-width: 900px) {

    /* Enable Snap for Mobile Section Navigation */
    html {
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
        /* Prevent horizontal scroll */
        width: 100vw;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .main-container {
        padding: 0 1.5rem;
        /* Balanced Padding */
        width: 100%;
        overflow: hidden;
        /* Contain children */
        padding-bottom: 4rem;
        /* Ensure footer space */
    }

    .section {
        min-height: 100vh;
        /* 1 content per screen */
        padding: 4rem 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        display: flex;
        justify-content: center;
    }

    /* Fix Hero Overlap on Mobile */
    .hero-section {
        padding-top: 6rem;
    }

    .main-title {
        font-size: 2.5rem;
    }

    .hero-visual {
        width: 100%;
        max-width: 320px;
        /* Limit width */
        margin-bottom: 0;
    }

    .chara-img-hero {
        /* Ensure animation doesn't cause overflow */
        max-width: 100%;
    }

    .hero-text {
        background: transparent;
        margin-top: 1rem;
        padding: 1rem;
    }

    /* Redesigned Profile Layout for Mobile */
    .profile-layout {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }

    .profile-visual {
        order: 1;
        /* Image Top */
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 0;
    }

    .profile-img {
        max-height: 50vh;
        width: 100%;
        max-width: 350px;
        opacity: 1;
    }

    .profile-section .profile-card {
        order: 2;
        /* Text Bottom */
        width: 100%;
        max-width: 100%;
        margin-top: 0;
        padding: 1.5rem;
    }

    .links-primary {
        flex-direction: column;
        align-items: center;
    }

    .main-link {
        width: 100%;
        max-width: 100%;
        padding: 1.5rem;
    }

    /* Fix Overflow credits */
    .credits-list {
        min-width: 0;
        /* Override any min-width */
        width: 100%;
    }

    .link-card,
    .tags-container,
    .guideline-text {
        width: 100%;
        box-sizing: border-box;
        /* Ensure padding doesn't add width */
    }

    /* Reduce guideline font size on mobile to prevent excessive line breaks */
    .guideline-content {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .guideline-content strong {
        font-size: 0.9rem;
    }

    /* Footer fix */
    .footer {
        padding-bottom: 4rem;
        /* Safe area for mobile browsers */
        margin-bottom: 0;
        width: 100%;
    }
}

/* Lightbox Zoom Effect */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 30px rgba(179, 157, 219, 0.4));
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.profile-img {
    cursor: zoom-in;
    /* Indicate interactive */
}