/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #1a1814;
    color: #e8e0d0;
    font-family: Georgia, 'Times New Roman', serif;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
.chrome-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #c8c8c8, #f0f0f0, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background-position 0.4s ease;
    background-size: 200% 200%;
}

.chrome-title:hover {
    background-position: 100% 100%;
}

.data-text {
    font-family: 'Space Mono', monospace;
}

/* ===== AURORA LINE ===== */
.aurora-line {
    height: 2px;
    background: linear-gradient(90deg, #4a9e8a, #9b6bc8, #4a9e8a);
    background-size: 200% 100%;
    animation: aurora 4s ease-in-out infinite;
    border-radius: 1px;
}

@keyframes aurora {
    0%, 100% {
        opacity: 0.6;
        transform: scaleX(1);
        background-position: 0% 50%;
    }
    50% {
        opacity: 1;
        transform: scaleX(1.05);
        background-position: 100% 50%;
    }
}

/* ===== SHAKE ERROR ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.3s ease 1;
}

/* ===== HEADER ===== */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 20px 30px 12px;
    background: #2d2820;
    border-bottom: 1px solid rgba(200, 168, 74, 0.2);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.site-header .aurora-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.header-left h1 {
    font-size: 24px;
    letter-spacing: 1px;
    text-transform: lowercase;
}

.header-tagline {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #a0a0a0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #c8c8c8;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-active {
    background: #4a9e8a;
    box-shadow: 0 0 6px #4a9e8a;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-status {
    color: #4a9e8a;
}

.header-status::before {
    content: attr(data-label) ": ";
    color: #a0a0a0;
    font-size: 10px;
}

.header-time {
    color: #c8a84a;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    padding: 24px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Panel spans */
.panel-mission {
    grid-column: span 6;
    grid-row: span 2;
}

.panel-corkboard {
    grid-column: span 6;
    grid-row: span 2;
}

.panel-metrics {
    grid-column: span 4;
}

.panel-journal {
    grid-column: span 8;
}

.panel-reference {
    grid-column: span 5;
}

.panel-alerts {
    grid-column: span 7;
}

/* ===== PANEL BASE ===== */
.panel {
    background: linear-gradient(160deg, #2d2820 0%, #25211a 50%, #2d2820 100%);
    border-radius: 2px;
    overflow: hidden;
    box-shadow:
        inset 0 0 20px rgba(45, 40, 32, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(200, 168, 74, 0.2);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.panel:hover {
    box-shadow:
        inset 0 0 20px rgba(45, 40, 32, 0.8),
        0 4px 20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(200, 168, 74, 0.4);
    transform: translateY(-1px);
}

.panel-header {
    padding: 14px 18px 10px;
}

.panel-header h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.panel-body {
    padding: 6px 18px 18px;
}

/* ===== MISSION STATUS ===== */
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(200, 168, 74, 0.1);
}

.status-row:last-of-type {
    border-bottom: none;
}

.status-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0a0a0;
}

.status-value {
    font-size: 14px;
    color: #c8a84a;
}

.status-alert {
    color: #c8a84a;
    font-weight: 700;
}

/* ===== CORKBOARD / COLLAGE ===== */
.corkboard {
    position: relative;
    min-height: 260px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    padding: 12px 18px 18px;
}

.collage-fragment {
    position: relative;
    transform: rotate(var(--rotation, 0deg));
    clip-path: polygon(2% 0%, 98% 1%, 100% 97%, 1% 100%);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.collage-fragment:hover {
    transform: rotate(0deg) scale(1.03);
    z-index: 2;
}

.frag-content {
    width: 100%;
    height: 100%;
    min-height: 120px;
}

.frag-photo-1 {
    background: linear-gradient(135deg, #3a3228, #4a3e30, #2d2820);
    background-image:
        radial-gradient(circle at 30% 40%, rgba(74, 158, 138, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(155, 107, 200, 0.1) 0%, transparent 40%);
}

.frag-photo-2 {
    background: linear-gradient(225deg, #2d2820, #3a3228);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(200, 168, 74, 0.12) 0%, transparent 60%);
}

.frag-photo-3 {
    background: linear-gradient(180deg, #3a3228, #1a1814);
    background-image:
        radial-gradient(circle at 40% 30%, rgba(74, 158, 138, 0.2) 0%, transparent 50%);
}

.frag-note {
    background: #e8e0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.note-text {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: #2d2820;
    line-height: 1.5;
    text-align: center;
}

.pin {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #c8a84a 40%, #8a6a20 100%);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

/* ===== METRICS ===== */
.panel-metrics .panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.metric-block {
    text-align: center;
    padding: 12px 8px;
    border: 1px solid rgba(200, 168, 74, 0.1);
    border-radius: 2px;
}

.metric-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #4a9e8a;
    margin-bottom: 4px;
}

.metric-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0a0a0;
}

/* ===== JOURNAL ===== */
.journal-entry {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(200, 168, 74, 0.1);
}

.journal-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.journal-date {
    font-size: 11px;
    color: #9b6bc8;
    display: block;
    margin-bottom: 6px;
}

.journal-text {
    font-size: 14px;
    line-height: 1.7;
    color: #e8e0d0;
}

/* ===== REFERENCE INDEX ===== */
.reference-list {
    list-style: none;
}

.ref-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(200, 168, 74, 0.08);
    transition: background 0.2s ease;
    cursor: default;
}

.ref-item:hover {
    background: rgba(74, 158, 138, 0.06);
}

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

.ref-code {
    font-size: 11px;
    color: #4a9e8a;
    white-space: nowrap;
}

.ref-title {
    font-family: Georgia, serif;
    font-size: 13px;
    color: #c8c8c8;
}

/* ===== ALERTS ===== */
.alert-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 2px;
    border-left: 3px solid transparent;
    background: rgba(26, 24, 20, 0.5);
}

.alert-warning {
    border-left-color: #c8a84a;
}

.alert-info {
    border-left-color: #9b6bc8;
}

.alert-success {
    border-left-color: #4a9e8a;
}

.alert-time {
    font-size: 11px;
    color: #a0a0a0;
    white-space: nowrap;
    min-width: 40px;
}

.alert-msg {
    font-size: 13px;
    color: #e8e0d0;
    line-height: 1.4;
}

/* ===== FOOTER ===== */
.site-footer {
    padding: 20px 30px;
    text-align: center;
    position: relative;
}

.site-footer .aurora-line {
    margin-bottom: 16px;
}

.footer-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #a0a0a0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(6, 1fr);
        padding: 16px;
        gap: 12px;
    }

    .panel-mission,
    .panel-corkboard,
    .panel-metrics,
    .panel-journal,
    .panel-reference,
    .panel-alerts {
        grid-column: span 6;
        grid-row: span 1;
    }

    .site-header {
        padding: 16px 20px 12px;
    }

    .header-tagline {
        display: none;
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .panel-mission,
    .panel-corkboard,
    .panel-metrics,
    .panel-journal,
    .panel-reference,
    .panel-alerts {
        grid-column: span 1;
    }

    .panel-metrics .panel-body {
        grid-template-columns: 1fr 1fr;
    }

    .header-right {
        margin-top: 8px;
    }
}
