/* ===== Variables ===== */
:root {
    /* アイコンのネオン緑を主アクセントに昇格 */
    --accent: #4ade80;              /* neon green (primary accent) */
    --accent-glow: #22c55e;
    --accent-hover: #86efac;
    --accent-sub: #60a5fa;          /* blue (secondary) */

    --bg-body: #020617;
    --bg-sidebar: #0f172a;
    --bg-terminal: #1e1e1e;
    --bg-card: #0f172a;
    --bg-active: #172554;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* フォント */
    --font-body: 'Noto Sans JP', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --font-display: 'Space Mono', 'JetBrains Mono', monospace;
}

/* ===== Base ===== */
body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
}

.text-accent { color: var(--accent); }

/* ========== Terminal-style Buttons ========== */
.btn-accent {
    background-color: var(--accent);
    color: #0f172a;
    border: none;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.02em;
    position: relative;
    padding: 0.6rem 1.4rem;
    box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    transition: box-shadow 0.25s, transform 0.15s;
}
.btn-accent:hover {
    background-color: var(--accent-hover);
    color: #0f172a;
    box-shadow: 0 0 24px rgba(74, 222, 128, 0.35);
}
.btn-accent:active {
    transform: translateY(1px);
}

.btn-outline-light {
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    border-color: var(--border);
    color: var(--text-primary);
    padding: 0.6rem 1.4rem;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-outline-light:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.2);
}

/* 角括弧プロンプト風の飾り */
.btn-bracket::before,
.btn-bracket::after {
    color: var(--accent);
    font-family: var(--font-mono);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-bracket::before { content: "["; margin-right: 6px; }
.btn-bracket::after  { content: "]"; margin-left: 6px; }
.btn-bracket:hover::before,
.btn-bracket:hover::after { opacity: 1; }

/* ========== Section Title (monospace prompt) ========== */
.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.section-title:not(.plain)::before {
    content: "$ ";
    color: var(--accent);
    opacity: 0.7;
    font-weight: 400;
}
.section-description {
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ===== Hero ===== */
.hero-section {
    padding: 6rem 0 5rem;
    background:
        radial-gradient(circle at 50% 0%, rgba(74, 222, 128, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, #0f172a 0%, #020617 100%);
    position: relative;
    overflow: hidden;
}

/* ドットグリッド背景（かすかに） */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(74, 222, 128, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at 50% 40%, black 40%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 40%, transparent 75%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-icon {
    width: 92px;
    height: 92px;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    box-shadow:
        0 0 40px rgba(74, 222, 128, 0.25),
        0 0 120px rgba(74, 222, 128, 0.08);
}

.hero-prompt {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.04em;
}
.hero-prompt::before {
    content: "❯ ";
    color: var(--accent);
    font-weight: 700;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0;
    line-height: 1.05;
    position: relative;
    display: inline-block;
}
.hero-title::after {
    content: "_";
    color: var(--accent);
    font-weight: 400;
    margin-left: 4px;
    animation: blink-caret 1.1s steps(1) infinite;
}
@keyframes blink-caret {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-top: 1.2rem;
    font-weight: 500;
    letter-spacing: -0.005em;
}
.hero-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 1rem;
    line-height: 1.85;
}
.hero-description code {
    font-family: var(--font-mono);
    color: var(--accent);
    background: rgba(74, 222, 128, 0.08);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.88em;
}
.hero-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===== Demo ===== */
.demo-section {
    padding: 4rem 0;
}

.demo-window {
    /* デモは実物のUIを忠実に再現するため、ローカルで青アクセントに戻す。
       ランディング全体のネオン緑は装飾レイヤーの世界観なので、
       プロダクト実体レイヤーでは混ぜない。 */
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-glow: #3b82f6;

    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.demo-titlebar {
    background: #1e293b;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.demo-titlebar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.demo-titlebar-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.demo-titlebar-buttons {
    display: flex;
    gap: 0;
}
.win-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: background-color 0.15s;
}
.win-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.win-btn-close:hover {
    background: #e81123;
    color: #fff;
}

.demo-body {
    display: flex;
    height: 480px;
    background: var(--bg-body);
}

/* Sidebar */
.demo-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}
.demo-sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.demo-sidebar-header .btn-accent {
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 8px 10px;
    letter-spacing: 0;
}

/* ===== Demo Search Bar ===== */
.demo-search-bar {
    display: flex;
    align-items: center;
    background: #020617;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}
.demo-search-icon {
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(255,255,255,0.03);
    border-right: 1px solid var(--border);
    height: 28px;
    display: flex;
    align-items: center;
}
.demo-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 4px 8px;
    height: 28px;
}
.demo-search-bar input::placeholder {
    color: var(--text-muted);
}
.demo-archive-btn {
    border: none;
    border-left: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0 8px;
    height: 28px;
    cursor: not-allowed;
}
.demo-session-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.demo-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

/* Session Items */
.demo-session-item {
    padding: 10px 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
}
.demo-session-item:hover {
    background-color: rgba(96, 165, 250, 0.08);
}
.demo-session-item.active {
    background-color: var(--bg-active);
    border-left-color: var(--accent);
}
.demo-session-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.demo-session-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.demo-session-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.badge-claude {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}
.badge-gemini {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.badge-codex {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.badge-terminal {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}
.demo-session-branch {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}
.demo-session-status {
    font-size: 0.7rem;
    color: var(--accent);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.demo-session-memo-preview {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.demo-session-notification {
    color: #facc15;
    font-size: 0.75rem;
    animation: bellShake 2s ease-in-out infinite;
}
@keyframes bellShake {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(12deg); }
    20% { transform: rotate(-10deg); }
    30% { transform: rotate(6deg); }
    40% { transform: rotate(0deg); }
}

/* Splitters */
.demo-splitter-v {
    width: 4px;
    background: var(--border);
    cursor: col-resize;
    flex-shrink: 0;
}
.demo-splitter-v:hover { background: var(--accent); }
.demo-splitter-h {
    height: 4px;
    background: var(--border);
    cursor: row-resize;
    flex-shrink: 0;
}
.demo-splitter-h:hover { background: var(--accent); }

/* Main Area */
.demo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Terminal */
.demo-terminal-area {
    flex: 1;
    min-height: 0;
    background: var(--bg-terminal);
    position: relative;
    overflow: hidden;
}
#demoTerminal {
    width: 100%;
    height: 100%;
    padding: 4px;
}

/* Bottom Panel */
.demo-bottom-panel {
    height: 170px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
}
.demo-panel-tabs {
    padding: 4px 12px 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.demo-panel-tabs .nav-link {
    font-size: 0.78rem;
    padding: 4px 10px;
    color: var(--text-muted);
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.demo-panel-tabs .nav-link.active {
    color: var(--text-primary);
    background: transparent;
    border-bottom: 2px solid var(--accent);
}
.demo-panel-content {
    flex: 1;
    min-height: 0;
}
.demo-tab-pane {
    display: none;
    height: 100%;
    padding: 8px 12px;
}
.demo-tab-pane.active {
    display: flex;
}
.demo-input-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.demo-input-wrap textarea {
    resize: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.82rem;
    background: #020617;
    border-color: var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
}
.demo-input-wrap textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}
.demo-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.demo-keyhints {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.demo-keyhints kbd {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: var(--text-primary);
}
.demo-keyhints .sep {
    opacity: 0.35;
}
.demo-memo {
    width: 100%;
    height: 100%;
    resize: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    background: #020617;
    border-color: var(--border);
    color: var(--text-primary);
}
.demo-memo:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.demo-hint {
    font-size: 0.85rem;
}

/* ===== Features ===== */
.features-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.feature-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.7;
}
.feature-card[data-screenshot] {
    cursor: pointer;
}
.feature-card-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.feature-card:hover .feature-card-hint {
    opacity: 1;
    color: var(--accent);
}

/* ===== Screenshot Modal ===== */
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.screenshot-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}
.screenshot-modal-content {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    overflow: auto;
}
.screenshot-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1;
}
.screenshot-modal-close:hover {
    color: var(--text-primary);
}
.screenshot-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.screenshot-modal-image {
    text-align: center;
}
.screenshot-modal-image img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.screenshot-noimage {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    height: 300px;
    background: #020617;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.screenshot-noimage i {
    font-size: 3rem;
    opacity: 0.3;
}

/* ===== Demo Dialog ===== */
.demo-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: var(--radius-lg);
}
.demo-dialog {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 420px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.demo-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.demo-dialog-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.demo-dialog-body {
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.demo-dialog-body label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--text-primary);
}
.demo-dialog-body input,
.demo-dialog-body select {
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 12px;
    background: #020617;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
}
.demo-dialog-body .demo-dialog-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 8px;
    padding: 8px;
    background: rgba(96, 165, 250, 0.08);
    border-radius: 4px;
}

/* ===== Screenshots ===== */
.screenshots-section {
    padding: 4rem 0;
}
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 2rem;
}
.screenshot-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: border-color 0.2s, transform 0.2s;
    background: var(--bg-sidebar);
    position: relative;
}
.screenshot-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.screenshot-item img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
}
.screenshot-item:hover img {
    transform: scale(1.02);
}
.screenshot-caption {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.screenshot-caption i {
    opacity: 0.5;
    font-size: 0.9rem;
}
@media (max-width: 480px) {
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Community ===== */
.community-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}
.btn-discord {
    background: #5865f2;
    color: #fff;
    border: none;
    font-weight: 500;
}
.btn-discord:hover {
    background: #4752c4;
    color: #fff;
}

/* ===== CTA ===== */
.cta-section {
    padding: 4rem 0;
}
.cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* ===== Section Divider (terminal prompt breadcrumb) ===== */
.section-divider {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 0.02em;
    user-select: none;
}
.section-divider span {
    position: relative;
    display: inline-block;
    padding: 0 14px;
}
.section-divider span::before,
.section-divider span::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.section-divider span::before { right: 100%; }
.section-divider span::after  { left: 100%; background: linear-gradient(-90deg, transparent, var(--border), transparent); }

/* ===== Demo titlebar status dot (connected) ===== */
.demo-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    animation: status-pulse 2.2s ease-in-out infinite;
    margin-left: 4px;
}
@keyframes status-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
    50%      { opacity: 0.6; box-shadow: 0 0 3px rgba(34, 197, 94, 0.3); }
}

/* ===== Footer (terminal easter-egg) ===== */
.site-footer {
    padding: 3rem 0 3.5rem;
    border-top: 1px solid var(--border);
    background: #020617;
}
.footer-term {
    margin: 0 auto;
    max-width: 420px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
}
.footer-term .p {
    color: var(--accent);
    font-weight: 700;
    margin-right: 6px;
}
.footer-term a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
    transition: color 0.2s, border-color 0.2s;
}
.footer-term a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.footer-term .cursor {
    color: var(--accent);
    animation: blink-caret 1.1s steps(1) infinite;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .demo-body { height: 400px; }
    .demo-sidebar { width: 180px; min-width: 180px; }
    .demo-bottom-panel { height: 120px; min-height: 120px; }
}
@media (max-width: 480px) {
    .demo-sidebar { width: 140px; min-width: 140px; }
    .demo-session-name { font-size: 0.75rem; }
}

/* ===== Language Toggle ===== */
.lang-toggle {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 100;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.lang-toggle a,
.lang-toggle strong {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 2px 4px;
}
.lang-toggle strong {
    color: var(--accent);
    font-weight: 700;
}
.lang-toggle a:hover {
    color: var(--accent);
}
.lang-toggle span {
    color: rgba(255, 255, 255, 0.25);
    padding: 0 2px;
}
