/* ============================================
   miris.bar - MiRiS Game Making Circle
   Dark-academia game development dashboard
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-midnight: #0A1028;
    --panel-blue: #141A38;
    --border-blue: #2A3050;
    --candle-amber: #D4A84B;
    --soft-blue-white: #C0C8E0;
    --muted-blue: #6A7090;
    --code-green: #80C8A0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-midnight);
    color: var(--soft-blue-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(13px, 0.9vw, 16px);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.06;
}

/* --- Candle Glow Ambient --- */
.candle-glow {
    position: fixed;
    top: -100px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center, rgba(212, 168, 75, 0.12) 0%, rgba(212, 168, 75, 0.05) 30%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    z-index: 100;
    background: linear-gradient(180deg, var(--deep-midnight) 0%, rgba(10, 16, 40, 0.9) 80%, transparent 100%);
}

.logotype {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 32px);
    color: var(--soft-blue-white);
    letter-spacing: -0.5px;
}

/* --- Candle Flame --- */
.candle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.candle-flame {
    filter: drop-shadow(0 0 20px rgba(212, 168, 75, 0.4));
    opacity: 0;
    transition: opacity 0.5s ease;
}

.candle-flame.lit {
    opacity: 1;
}

.flame-path {
    transform-origin: center bottom;
    animation: flicker 0.8s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% { transform: scaleX(1) scaleY(1); opacity: 1; }
    25% { transform: scaleX(0.92) scaleY(1.04); opacity: 0.9; }
    50% { transform: scaleX(1.05) scaleY(0.96); opacity: 1; }
    75% { transform: scaleX(0.95) scaleY(1.02); opacity: 0.85; }
    100% { transform: scaleX(1.02) scaleY(0.98); opacity: 0.95; }
}

.flame-base {
    animation: baseGlow 1.2s ease-in-out infinite alternate;
}

@keyframes baseGlow {
    0% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

.candle-stick {
    width: 6px;
    height: 16px;
    background: linear-gradient(180deg, #D4A84B 0%, #8B6914 100%);
    border-radius: 0 0 2px 2px;
    margin-top: -2px;
}

/* --- Navigation Tabs --- */
.nav-tabs {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    display: flex;
    gap: 2px;
    padding: 0 32px;
    z-index: 99;
    background: var(--deep-midnight);
    border-bottom: 1px solid rgba(42, 48, 80, 0.6);
}

.nav-tab {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted-blue);
    background: transparent;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-tab:hover {
    color: var(--soft-blue-white);
}

.nav-tab.active {
    color: var(--candle-amber);
    border-bottom-color: var(--candle-amber);
}

/* --- Dashboard Grid --- */
.dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 16px;
    padding: 130px 32px 32px;
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* --- Panels --- */
.panel {
    background: var(--panel-blue);
    border: 1px solid rgba(42, 48, 80, 0.6);
    border-radius: 4px;
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(12px);
    position: relative;
    overflow: hidden;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    border-color: rgba(42, 48, 80, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.panel-featured {
    grid-column: span 2;
}

/* --- Panel Header --- */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.panel-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--soft-blue-white);
    line-height: 1.3;
}

.panel-excerpt {
    color: var(--muted-blue);
    font-size: clamp(12px, 0.85vw, 14px);
    line-height: 1.5;
    margin-bottom: 8px;
}

.panel-toggle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--candle-amber);
    opacity: 0.6;
    transition: opacity 0.2s ease;
    display: inline-block;
}

.panel:hover .panel-toggle {
    opacity: 1;
}

.panel.expanded .panel-toggle {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* --- Panel Details (Progressive Disclosure) --- */
.panel-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
}

.panel.expanded .panel-details {
    opacity: 1;
    margin-top: 16px;
}

/* --- Status Dots --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-active {
    background-color: var(--candle-amber);
    animation: pulse 2s ease-in-out infinite;
}

.status-complete {
    background-color: var(--code-green);
}

.status-planned {
    background-color: #4A6FA5;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 75, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(212, 168, 75, 0); }
}

/* --- Status List --- */
.status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 48, 80, 0.4);
}

.status-item:last-child {
    border-bottom: none;
}

.status-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--soft-blue-white);
    flex: 1;
}

.status-label {
    font-size: 11px;
    color: var(--muted-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Update Log --- */
.update-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-entry {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 48, 80, 0.3);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--muted-blue);
    white-space: nowrap;
    flex-shrink: 0;
}

.log-message {
    font-size: 13px;
    color: var(--soft-blue-white);
}

/* --- Resource Grid --- */
.resource-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.resource-item {
    padding: 16px;
    background: rgba(10, 16, 40, 0.4);
    border: 1px solid rgba(42, 48, 80, 0.4);
    border-radius: 3px;
}

.resource-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--candle-amber);
    margin-bottom: 6px;
}

.resource-desc {
    font-size: 12px;
    color: var(--muted-blue);
    line-height: 1.5;
}

/* --- Tools List --- */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(10, 16, 40, 0.3);
    border: 1px solid rgba(42, 48, 80, 0.3);
    border-radius: 3px;
}

.tool-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--soft-blue-white);
}

.tool-version {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--code-green);
}

/* --- Code Block --- */
.code-block {
    background: rgba(10, 16, 40, 0.6);
    border: 1px solid rgba(42, 48, 80, 0.4);
    border-radius: 3px;
    padding: 16px;
    margin-top: 12px;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--code-green);
    line-height: 1.6;
}

/* --- Member List --- */
.member-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 48, 80, 0.3);
}

.member-item:last-child {
    border-bottom: none;
}

.member-handle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--candle-amber);
}

.member-role {
    font-size: 12px;
    color: var(--muted-blue);
}

/* --- Documentation Links --- */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--soft-blue-white);
    text-decoration: none;
    padding: 8px 12px;
    background: rgba(10, 16, 40, 0.3);
    border: 1px solid rgba(42, 48, 80, 0.3);
    border-radius: 3px;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: block;
}

.doc-link:hover {
    color: var(--candle-amber);
    border-color: rgba(212, 168, 75, 0.3);
}

/* --- Notes --- */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.note-marker {
    font-family: 'JetBrains Mono', monospace;
    color: var(--candle-amber);
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1.65;
}

.note-text {
    font-size: 13px;
    color: var(--soft-blue-white);
    line-height: 1.65;
}

/* --- Footer --- */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-top: 1px solid rgba(42, 48, 80, 0.4);
    margin-top: 24px;
    position: relative;
    z-index: 2;
}

.footer-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted-blue);
}

.footer-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--code-green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--code-green);
    border-radius: 50%;
    display: inline-block;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel-featured {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        padding: 120px 16px 16px;
    }

    .panel-featured {
        grid-column: span 1;
    }

    .header {
        padding: 16px;
    }

    .nav-tabs {
        padding: 0 16px;
        overflow-x: auto;
    }

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

    .footer {
        padding: 16px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* --- Selection styling --- */
::selection {
    background: rgba(212, 168, 75, 0.3);
    color: var(--soft-blue-white);
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--deep-midnight);
}

::-webkit-scrollbar-thumb {
    background: var(--border-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-blue);
}
