/* --------------------------------------------------
   MIYA PORTFOLIO SYSTEM — STYLE SHEET
-------------------------------------------------- */

:root {
    --bg-color: #050505;
    --surface-color: #111111;
    --border-color: #222222;
    --text-main: #ffffff;
    --text-dim: #777777;

    --accent-color: #00ff66;
    --accent-glow: rgba(0, 255, 102, 0.4);
    --accent-bg: rgba(0, 255, 102, 0.08);

    --font-heading: 'Syne', 'Zen Kaku Gothic New', sans-serif;
    --font-mono: 'JetBrains Mono', 'Space Grotesk', monospace;
}

body.theme-audio {
    --accent-color: #00ff66;
    --accent-glow: rgba(0, 255, 102, 0.4);
    --accent-bg: rgba(0, 255, 102, 0.08);
    --bg-color: #050505;
}

body.theme-visual {
    --accent-color: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.4);
    --accent-bg: rgba(0, 240, 255, 0.08);
    --bg-color: #06090e;
}

body.theme-redoom {
    --accent-color: #ff0055;
    --accent-glow: rgba(255, 0, 85, 0.4);
    --accent-bg: rgba(255, 0, 85, 0.08);
    --bg-color: #0a030b;
}

/* 隠しコマンド（SECRET MODE）適用時のカラー */
body.theme-secret {
    --accent-color: #ff00ff;
    --accent-glow: rgba(255, 0, 255, 0.6);
    --accent-bg: rgba(255, 0, 255, 0.15);
    --bg-color: #050008;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* CRT Scanline Overlay */
.crt-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9990;
    opacity: 0.6;
}

/* Custom Cursor */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out, width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-follower.active {
    width: 64px;
    height: 64px;
    background-color: var(--accent-bg);
}

/* Boot Loader */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: #020202;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    width: 90%;
    max-width: 520px;
}

.loader-line {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.loader-line.alert {
    color: #ff3366;
    font-weight: 700;
}

.loader-bar {
    width: 100%;
    height: 3px;
    background: var(--border-color);
    margin-top: 20px;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--accent-color);
    transition: width 0.8s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.brand {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 1.2rem;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
}

.brand:hover {
    transform: scale(1.05);
    text-shadow: 0 0 12px var(--accent-glow);
}

.brand-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 400;
}

.mode-switcher {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    transition: all 0.3s ease;
}

.mode-btn .num {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-right: 4px;
}

.mode-btn.active {
    color: #000000;
    background: var(--accent-color);
    box-shadow: 0 0 12px var(--accent-glow);
}

.status-badge {
    font-size: 0.75rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
    animation: blink 1s infinite alternate;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 130px 5vw 60px 5vw;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.15;
}

.hero-content {
    text-align: center;
    z-index: 2;
}

.top-tag {
    color: var(--text-dim);
    letter-spacing: 4px;
    font-size: 0.75rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 18vw, 18rem);
    line-height: 0.85;
    font-weight: 800;
    user-select: none;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 0.05em;
}

.hero-title .char {
    display: inline-block;
    text-align: center;
    transition: transform 0.3s, color 0.3s;
    will-change: transform;
}

.hero-title .char:hover {
    color: var(--accent-color);
    transform: translateY(-12px) scale(1.05);
}

.mode-indicator {
    color: var(--accent-color);
    letter-spacing: 3px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-subtext {
    color: var(--text-dim);
    font-size: clamp(0.95rem, 1.8vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto;
}

/* Marquee Ticker */
.ticker-wrapper {
    background: var(--accent-color);
    color: #000000;
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 800;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.ticker {
    display: inline-block;
    animation: marquee 22s linear infinite;
}

.ticker span {
    display: inline-block;
    padding-right: 20px;
}

/* Main Content */
.main-content {
    padding: 100px 5vw 60px 5vw;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.count {
    color: var(--accent-color);
    font-weight: 700;
}

/* Cards Grid */
.grid-container {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 30px;
}

.grid-container.active {
    display: grid;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
    position: relative;
    transition: transform 0.3s, border-color 0.3s;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
}

.card-top {
    display: flex;
    justify-content: space-between;
}

.card-num {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.card-tag {
    font-size: 0.7rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 2px 8px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 15px 0 10px 0;
}

.card-desc {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-bottom: 15px;
}

.card-code {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-left: 2px solid var(--accent-color);
    margin-bottom: 20px;
}

.mini-gallery-preview {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.mini-gallery-preview img {
    width: 30%;
    height: 60px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    opacity: 0.8;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.card:hover .arrow {
    transform: translateX(8px);
    color: var(--accent-color);
}

/* Camera Frame */
.camera-frame {
    border-style: dashed;
}

.viewfinder-hud {
    font-size: 0.7rem;
    color: var(--accent-color);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.rec-dot {
    color: #ff3366;
    animation: blink 0.8s infinite alternate;
}

/* Dynamic Modal Popup */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    z-index: 9995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-wrapper {
    background: #0d0d0d;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 40px var(--accent-glow);
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 35px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-wrapper {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
}

.modal-close:hover {
    color: var(--accent-color);
}

.modal-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.modal-tag {
    font-size: 0.75rem;
    background: var(--accent-color);
    color: #000;
    font-weight: 800;
    padding: 2px 8px;
}

.modal-code {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.modal-body p {
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Audio Player in Modal */
.audio-player-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin: 20px 0;
}

.player-label {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.track-playlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.track-btn {
    background: #141414;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.track-btn .t-num {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
}

.track-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-main);
}

.track-btn.active {
    background: var(--accent-bg);
    border-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 0 10px var(--accent-glow);
}

.audio-control-wrapper {
    background: #000000;
    border: 1px solid var(--border-color);
    padding: 15px;
}

.now-playing-info {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

audio {
    width: 100%;
    filter: invert(0.9);
}

/* Gallery in Modal */
.gallery-slider-wrapper {
    margin: 25px 0;
    background: #000000;
    border: 1px solid var(--border-color);
    padding: 15px;
    overflow: hidden;
}

.gallery-slider-header {
    font-size: 0.7rem;
    color: var(--accent-color);
    margin-bottom: 12px;
    font-weight: 700;
}

.gallery-track-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gallery-track {
    display: flex;
    gap: 15px;
    width: max-content;
    animation: galleryAutoScroll 22s linear infinite;
}

.gallery-track:hover {
    animation-play-state: paused;
}

.gallery-item {
    width: 260px;
    flex-shrink: 0;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.gallery-item img:hover {
    border-color: var(--accent-color);
}

.gallery-item span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 6px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 25px;
}

.modal-status {
    color: var(--accent-color);
}

/* About Section */
.about-section {
    padding: 60px 5vw 100px 5vw;
    max-width: 1400px;
    margin: 0 auto;
}

.about-box {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 60px 40px;
}

.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin-top: 30px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-dim);
}

.about-text p.highlight {
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 700;
}

.stat-item {
    border-left: 2px solid var(--accent-color);
    padding-left: 15px;
    margin-bottom: 22px;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.stat-val {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Terminal Contact */
.terminal-section {
    padding: 0 5vw 100px 5vw;
    max-width: 1400px;
    margin: 0 auto;
}

.terminal-window {
    background: #020202;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.terminal-header {
    background: #141414;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.terminal-title {
    font-size: 0.8rem;
    color: #888;
    margin-left: 10px;
}

.terminal-body {
    padding: 35px;
    font-size: 0.95rem;
}

.prompt {
    color: var(--accent-color);
    font-weight: 700;
}

.terminal-output {
    margin: 10px 0 25px 0;
}

.alert-text {
    color: #ff3366;
    border-left: 2px solid #ff3366;
    padding-left: 12px;
}

.terminal-links {
    margin-bottom: 25px;
}

.term-btn {
    color: var(--text-main);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    background: var(--accent-bg);
    padding: 10px 20px;
    font-weight: 700;
    display: inline-block;
}

.cursor-block {
    display: inline-block;
    width: 9px;
    height: 16px;
    background: var(--accent-color);
    vertical-align: middle;
    animation: blink 0.8s infinite;
}

/* Detailed Footer Styling */
.footer {
    background: #020202;
    border-top: 1px solid var(--border-color);
    padding: 80px 5vw 40px 5vw;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo span {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 400;
}

.footer-desc {
    color: var(--text-dim);
    font-size: 0.88rem;
    max-width: 420px;
    line-height: 1.8;
}

.footer-heading {
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    letter-spacing: 1.5px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.25s ease, transform 0.25s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-main);
    transform: translateX(4px);
}

.footer-info {
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.8;
}

.footer-bottom {
    max-width: 1400px;
    margin: 30px auto 0 auto;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Animations */
.reveal-item {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-item.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes galleryAutoScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes blink {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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

    .cursor-dot,
    .cursor-follower {
        display: none;
    }

    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 12px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 70vh;
        padding-top: 150px;
    }

    .mode-switcher {
        width: 100%;
        justify-content: center;
    }
}