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

body {
    font-family: 'Noto Serif JP', serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh; /* 追加: ページ全体のずれ修正 */
}

/* Scanline Effect */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 1000;
    pointer-events: none;
    animation: scanlines 1s steps(4) infinite;
}

@keyframes scanlines {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(50px);
  }
}

#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    background-size: cover;
    filter: brightness(70%);
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    border-bottom: 1px solid #ff00ff;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 4px 0;
    transition: 0.3s;
}

.content {
    padding: 8rem 2rem 2rem;
    text-align: center;
}

.section {
    padding: 2rem;
    margin-bottom: 4rem;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

h1, h2 {
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.glitch {
    position: relative;
    text-shadow: 0.05em 0 0 #00ffff, -0.05em 0 0 #ff00ff;
    animation: glitch-anim 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    animation: glitch-anim-2 1.5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    animation: glitch-anim-3 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-0.05em, 0.05em); }
    40% { transform: translate(-0.05em, -0.05em); }
    60% { transform: translate(0.05em, 0.05em); }
    80% { transform: translate(0.05em, -0.05em); }
    100% { transform: translate(0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(90% 0 5% 0); }
    100% { clip-path: inset(5% 0 90% 0); }
}

@keyframes glitch-anim-3 {
     0% { clip-path: inset(70% 0 15% 0); }
    100% { clip-path: inset(15% 0 70% 0); }
}

h1.glitch {
    font-size: 4rem;
    font-weight: 700;
}

h2.glitch {
    font-size: 2rem;
}

.placeholder {
    width: 100%;
    max-width: 800px;
    height: 450px;
    background-color: #111;
    border: 1px solid #ff00ff;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    color: #ff00ff;
}

.book-covers {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.book-cover {
     width: 200px;
     height: 300px;
     background-color: #111;
     border: 1px solid #00ffff;
}

.sns-icons a {
    margin: 0 1rem;
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sns-icons a:hover {
    color: #ff00ff;
}

.contact-button {
    display: inline-block;
    padding: 1rem 2rem;
    border: 1px solid #ff00ff;
    color: #ff00ff;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.3s, color 0.3s;
}

.contact-button:hover {
    background-color: #ff00ff;
    color: #000;
}

/* == Portfolio Section == */

/* Desktop Grid Layout */
.portfolio-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 最小幅を150pxに調整 */
    gap: 1rem;
}

.portfolio-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #00ffff;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 10px #ff00ff;
    pointer-events: none;
}

.portfolio-item:hover .play-icon {
    opacity: 1;
}

.portfolio-controls {
    display: none; /* Hidden on desktop */
}

/* Mobile Styles */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px; /* Adjust based on navbar height */
        left: 0;
        background-color: rgba(0, 0, 0, 0.95);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 1.5rem 0;
        text-align: center;
    }

    .hamburger {
        display: flex;
    }

    h1.glitch {
        font-size: 2.5rem;
    }
    
    .content {
        padding-top: 6rem;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    top: 50%;
    transform: translateY(-50%);
}

.modal-content iframe {
    width: 100%;
    height: 450px;
}

.close-modal {
    color: #fff;
    position: absolute;
    top: -30px;
    right: -5px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Podcast Section */
.eigaba-image {
    max-width: 200px;
    height: auto;
    border: 1px solid #00ffff;
    margin: 0 auto 1rem auto;
    display: block; /* To center it with margin: auto */
}

.podcast-links a {
    margin: 0.5rem;
}

/* Book Section */
.book-covers a {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.book-cover-img {
    width: 45%;
    max-width: 120px;
    height: auto;
    border: 1px solid #00ffff;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.9rem;
    border-top: 1px solid #00ffff;
    /* margin-top: 4rem; */ /* ページ全体のずれ修正のため削除 */
}