/* DevTools index page */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    width: 100%;
    flex-grow: 1;
    box-sizing: border-box;
}

/* === Key Visual === */
.kv {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #0a1020;
    align-self: stretch;
    /* スティッキーヘッダーの下に画像を潜り込ませて、半透明ヘッダー越しに画像が見えるようにする */
    margin-top: -62px;
    z-index: 0;
}
.kv-img {
    width: 100%;
    height: auto;
    max-height: 900px;
    display: block;
    object-fit: cover;
    object-position: right center;
}
.kv-overlay {
    position: absolute;
    inset: 0;
    /* テキスト可読性のための左側黒落としのみ(ビネットなし) */
    background: linear-gradient(to right,
        rgba(8, 12, 24, 0.72) 0%,
        rgba(8, 12, 24, 0.35) 32%,
        rgba(8, 12, 24, 0) 60%);
    pointer-events: none;
}
.kv-content {
    position: absolute;
    inset: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 62px 2rem 0; /* 上は半透明ヘッダーぶんを避ける */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    pointer-events: none;
}
.kv-content .logo {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1.05;
    margin-bottom: 0.75rem;
    text-shadow:
        0 0 28px rgba(120, 200, 255, 0.45),
        0 2px 12px rgba(0, 0, 0, 0.7);
    display: inline-block;
    will-change: transform, text-shadow;
    animation: kvGlitch 5s infinite;
}

/* RGB分離 + 微小ジッターのグリッチ */
@keyframes kvGlitch {
    0%, 8%, 12%, 35%, 38%, 100% {
        transform: translate(0, 0);
        text-shadow:
            0 0 28px rgba(120, 200, 255, 0.45),
            0 2px 12px rgba(0, 0, 0, 0.7);
    }
    /* 大きめバースト */
    9% {
        transform: translate(-2px, 1px);
        text-shadow:
            -3px 0 0 rgba(255, 0, 110, 0.85),
            3px 0 0 rgba(0, 240, 255, 0.85),
            0 0 28px rgba(120, 200, 255, 0.45);
    }
    10% {
        transform: translate(2px, -1px);
        text-shadow:
            3px 0 0 rgba(255, 0, 110, 0.85),
            -3px 0 0 rgba(0, 240, 255, 0.85),
            0 0 28px rgba(120, 200, 255, 0.45);
    }
    11% {
        transform: translate(-1px, 0);
        text-shadow:
            -1px 0 0 rgba(255, 0, 110, 0.85),
            1px 0 0 rgba(0, 240, 255, 0.85),
            0 0 28px rgba(120, 200, 255, 0.45);
    }
    /* 小さい一瞬の瞬き */
    36% {
        transform: translate(1px, 0);
        text-shadow:
            2px 0 0 rgba(255, 0, 110, 0.7),
            -2px 0 0 rgba(0, 240, 255, 0.7),
            0 0 28px rgba(120, 200, 255, 0.45);
    }
    37% {
        transform: translate(-1px, 0);
        text-shadow:
            -2px 0 0 rgba(255, 0, 110, 0.7),
            2px 0 0 rgba(0, 240, 255, 0.7),
            0 0 28px rgba(120, 200, 255, 0.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kv-content .logo { animation: none; }
}
.kv-content .subtitle {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    max-width: 30em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    position: relative;
    display: block;
    padding: 2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(58, 174, 255, 0.18);
}
[data-theme="light"] .card:hover {
    box-shadow: 0 8px 24px rgba(2, 51, 253, 0.15);
}

.card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-active {
    background-color: rgba(58, 174, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(58, 174, 255, 0.35);
}
[data-theme="light"] .status-active {
    background-color: rgba(2, 51, 253, 0.10);
    border-color: rgba(2, 51, 253, 0.3);
}

.status-wip {
    background-color: rgba(139, 148, 158, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(139, 148, 158, 0.3);
}
[data-theme="light"] .status-wip {
    background-color: rgba(87, 83, 78, 0.10);
    border-color: rgba(87, 83, 78, 0.3);
}

@media (max-width: 600px) {
    .container {
        padding: 2rem 1rem;
    }
    /* スマホではヘッダーとKVを重ねない */
    .kv {
        margin-top: 0;
    }
    .kv-img {
        max-height: 280px;
    }
    .kv-content {
        padding: 0 1.5rem;
    }
    .grid {
        grid-template-columns: 1fr;
    }
}
