:root {
    --bg-color: #050505;
    --card-bg: #111;
    --text-main: #fff;
    --text-dim: #666;
    --accent-music: #8a2be2;
    --accent-novel: #cc0000;
    --accent-video: #00ccaa;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', 'Zen Kaku Gothic New', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Header --- */
header {
    padding: 60px 20px 40px;
    text-align: center;
    width: 100%;
    max-width: 800px;
}
h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0;
}
p.subtitle {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Main Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
}

/* --- カード構造 (Hybrid Layout) --- */
.project-card {
    background-color: #000;
    height: 420px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    z-index: 10;
}

/* 1. メインエリア（画像・タイトル部分） */
.card-main-link {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    text-decoration: none;
    color: white;
    position: relative;
    z-index: 2;
}

/* 2. サブリンクエリア（下のボタン群） */
.card-sub-links {
    height: 60px;
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.sub-btn {
    color: #666;
    font-size: 1.2rem;
    text-decoration: none;
    padding: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sub-btn:hover {
    color: #fff;
    transform: scale(1.1);
}
.sub-btn span {
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* --- 共通テキスト設定 --- */
.category-bg {
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    transform: rotate(-90deg);
    transform-origin: left top;
    pointer-events: none;
    white-space: nowrap;
}

.project-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
    z-index: 2;
}
.project-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    z-index: 2;
}

/* --- MUSIC Style (jasui vision) --- */
.card-music { 
    background: radial-gradient(circle at top right, #2a0a4a 0%, #000 70%); 
}
.card-music:hover { border-color: var(--accent-music); }
.card-music .project-name { 
    font-family: 'Inter', sans-serif; 
    letter-spacing: -0.02em;
    color: #fff; 
}
.card-music:hover .project-name { color: var(--accent-music); }
.card-music:hover .sub-btn { color: #aaa; } 
.card-music .sub-btn:hover { color: var(--accent-music); }

/* --- NOVEL Style (蹴るモーフ) --- */
.card-novel { 
    background: #080000; 
    border-left: 4px solid #333; 
}
.card-novel:hover { 
    border-left-color: var(--accent-novel); 
    border-color: #333; 
    background: linear-gradient(to bottom, #1a0000, #000);
}
.card-novel .project-name { 
    font-family: "Shippori Mincho", serif; 
}
.card-novel:hover .project-name { color: var(--accent-novel); }
.card-novel .category-bg { font-family: serif; }
.card-novel:hover .sub-btn { color: #aaa; }
.card-novel .sub-btn:hover { color: var(--accent-novel); }

/* --- VIDEO Style (in-facto) --- */
.card-video { 
    background: #000; 
    font-family: 'Courier New', monospace; 
}
/* 走査線エフェクト */
.card-video::after {
    content: " "; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 1; background-size: 100% 4px, 6px 100%; pointer-events: none;
}
/* RECアニメーション */
.card-video::before {
    content: '● REC';
    position: absolute;
    top: 20px; right: 20px;
    font-size: 0.7rem;
    color: #cc0000;
    font-family: monospace;
    opacity: 0.7;
    animation: blink 2s infinite;
    z-index: 5;
}
@keyframes blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.card-video:hover { border-color: var(--accent-video); }
.card-video:hover .project-name { color: var(--accent-video); text-shadow: 0 0 5px rgba(0,204,170,0.5); }
.card-video .project-name { font-family: monospace; }
.card-video:hover .sub-btn { color: #aaa; }
.card-video .sub-btn:hover { color: var(--accent-video); }

/* --- Footer (Personal) --- */
.personal-section {
    margin-top: 60px;
    text-align: center;
    padding-bottom: 60px;
    width: 100%;
}
.personal-links {
    display: inline-flex;
    gap: 20px;
    background: #111;
    padding: 15px 30px;
    border-radius: 50px;
    border: 1px solid #222;
}
.personal-links a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.personal-links a:hover {
    color: #fff;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .projects-grid { 
        grid-template-columns: 1fr; 
    }
    .project-card { 
        height: auto; 
        min-height: 250px; 
    }
    .category-bg {
        font-size: 2.5rem;
        top: 10px;
    }
    .card-main-link { padding-bottom: 20px; }
}