:root {
    --bg-color: #1a1025;
    /* Dark purple from sky */
    --text-color: #f0f0f0;
    --accent-primary: #ffd700;
    /* Sunflower Yellow */
    --accent-secondary: #48a9a6;
    /* Ocean Teal */
    --glass-bg: rgba(20, 10, 30, 0.85);
    /* Darker, less transparent */

    /* Typography */
    --font-pixel: 'DotGothic16', sans-serif;
    --font-body: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.8;
    image-rendering: auto;
    /* Revert pixelated for text clarity, use only on images if needed */
}

/* Background Image */
.pixel-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/pixel_bg.png');
    background-size: cover;
    background-position: center center;
    z-index: -1;
    image-rendering: pixelated;
    /* Apply mostly to the BG */
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    border-bottom: none;
    transition: opacity 1.5s ease;
}

.nav-right-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-family: var(--font-pixel);
    /* Pixel font for logo */
    font-size: 2rem;
    color: var(--accent-primary);
    text-shadow: 2px 2px 0 #000;
}

.nav-links {
    display: flex;
    /* Ensure it's flex */
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border: 2px solid transparent;
    /* Match button style */
    transition: all 0.2s;
}

.nav-links a:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.8);
}

.audio-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid transparent;
    color: white;
    /* Default color for ON icon */
    padding: 5px;
    width: 36px;
    /* Icon size + padding */
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    /* Slight rounded corners matching links */
}

.audio-btn svg {
    width: 24px;
    height: 24px;
}

/* Toggle Logic */
.audio-btn .icon-sound-on {
    display: none;
}

.audio-btn .icon-sound-off {
    display: block;
    color: #ff4444;
    /* Red for Mute */
}

/* Playing State */
.audio-btn.playing .icon-sound-on {
    display: block;
    color: white;
    /* White for Play */
}

.audio-btn.playing .icon-sound-off {
    display: none;
}

.audio-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.8);
}



/* Scroll lock */




/* Common Section */
section {
    padding: 3.5rem 5% 1rem 5%;
    /* Reduced top, added bottom space */
    position: relative;
    z-index: 5;
}

.section-title {
    font-family: var(--font-pixel);
    /* Pixel font for section titles */
    font-size: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    /* Reduced from 3rem */
    line-height: 1.2;
    /* Tighter line height to reduce top gap */
    color: var(--accent-primary);
    text-shadow: 3px 3px 0 #000;
}

/* RPG Box Style */
.rpg-box {
    background: rgba(20, 20, 30, 0.9);
    border: 4px solid white;
    /* Asymmetric padding: more at bottom to balance visual weight */
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
    position: relative;
    /* Fluid Sizing: min 300px, preferred 94%, max 1000px */
    width: clamp(300px, 94%, 1050px);
    /* Slightly wider max-width for iPad Pro */
    margin: 0 auto;
}

/* About Layout - Fluid Card Strategy */
.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    gap: clamp(1.5rem, 5cqi, 3.5rem);
    /* Increased max gap slightly */

    /* Container Query Setup */
    container-type: inline-size;
    width: 100%;
    max-width: 920px;
    /* Increased to fill more space on iPad Pro */
    margin-inline: auto;
    /* Center the container itself */
}

.about-icon img {
    /* Fluid sizing based on container width */
    width: clamp(140px, 30cqi, 260px);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
    background: #000;
    image-rendering: pixelated;
    flex-shrink: 0;
    /* Prevent icon from squishing */
}

.profile-info {
    margin-top: 1rem;
    font-size: clamp(0.8rem, 2cqi, 0.95rem);
    /* Fluid font size */
    line-height: 1.6;
    text-align: center;
    color: var(--accent-secondary);
}

.about-text {
    flex: 1;
    /* Fill remaining space comfortably */
    min-width: 0;
    /* Prevent flex overflow */
}

.about-catch {
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.4;
    white-space: normal;
    /* Allow wrapping */
    font-size: clamp(1.1rem, 4.5cqi, 1.8rem);
    /* Fluid font size */
}

.about-desc {
    white-space: normal;
    /* Allow wrapping */
    font-size: clamp(0.9rem, 2.5cqi, 1.1rem);
    /* Fluid font size */
}

.pc-br {
    display: block;
}

.sp-br {
    display: none;
}

/* Mobile About */
@media (max-width: 767px) {
    .about-catch {
        font-size: 1rem;
    }

    .about-container {
        flex-direction: column;
        /* Icon first, then Text */
        text-align: center;
        gap: 1.5rem;
    }
}

/* Works Grid */
#works .rpg-box {
    max-width: 1100px;
    /* Wider to allow 3 columns */
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.work-card {
    background: rgba(0, 0, 0, 0.7);
    border: 4px solid #fff;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.work-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.placeholder-img {
    width: 100%;
    height: 150px;
    background: repeating-linear-gradient(45deg,
            #333,
            #333 10px,
            #444 10px,
            #444 20px);
    border: 2px solid white;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-size: 1.5rem;
}



/* Contact Form Removed */
/* SNS Links styles below */

.sns-links {
    text-align: center;
    margin-top: 2rem;
}

.sns-links a {
    color: white;
    font-size: 1.5rem;
    margin: 0 1rem;
    text-decoration: none;
}

.sns-links a:hover {
    text-decoration: underline;
    color: var(--accent-primary);
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    /* Prevent layout shift on PC */
}

#contact {
    padding-bottom: 8rem;
}

/* --- New Hero Section Styles --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-areas: "hero";
}

.intro-white-bar,
.hero-visual-container,
.intro-overlay {
    grid-area: hero;
    width: 100%;
    height: 100%;
}

.intro-white-bar {
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    transform: translateX(-100%);
}

.hero-visual-container {
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
}

.hero-main-visual {
    height: 100vh;
    width: 100%;
    object-fit: cover;
    object-position: center;
    animation: breath 8s ease-in-out infinite;
}

@keyframes breath {

    0%,
    100% {
        transform: scale(1.0);
    }

    50% {
        transform: scale(1.03);
    }
}

.intro-overlay {
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    pointer-events: none;
    padding-bottom: 8vh;
    /* Adjust base position */
}

.copy-container {
    position: relative;
    text-align: center;
    padding: clamp(1rem, 5vw, 2rem);
    opacity: 0;
    width: 100%;
    pointer-events: auto;
    cursor: pointer;
}

.mist-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(20px);
    z-index: -1;
}

.catchphrase {
    font-family: var(--font-main);
    color: var(--text-color);
    font-size: clamp(1.5rem, 6vw, 4rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.3);
    line-height: 1.6;
    width: 100%;
    word-wrap: break-word;
}

/* Message Window styles removed */

.next-arrow {
    margin-top: 1.5rem;
    color: var(--accent-primary);
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: bounce 0.8s infinite alternate;
    opacity: 0;
    display: inline-block;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(5px);
    }
}

/* JS Animation Trigger Classes */
.slide-in-bar {
    animation: slideBar 0.8s ease-out forwards;
}

@keyframes slideBar {
    to {
        transform: translateX(0);
    }
}

.fade-in-visual {
    transition: opacity 1.5s ease-in-out;
    opacity: 1 !important;
}

.fade-in-copy {
    transition: opacity 2s ease;
    opacity: 1 !important;
}

/* removed slide-up-window */

.intro-fade-out {
    transition: opacity 1s ease;
    opacity: 0 !important;
    pointer-events: none;
}

body.intro-active {
    overflow: hidden;
}

nav.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 767px) {
    .nav-links {
        display: none;
        /* Hide nav links on mobile */
    }

    /* removed mobile message window padding */

    /* About Section Mobile Updates */
    .about-text {
        text-align: left;
        /* Left align on mobile */
        width: 100%;
        flex: auto;
    }

    .about-catch {
        text-align: center;
        /* Center title on mobile */
    }

    .pc-br {
        display: none;
    }

    .sp-br {
        display: block;
    }
}