/* ============================================
   muhan.dev — Editorial Developer Dashboard
   ============================================ */

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

:root {
    --pale-blue-white: #D0D8E8;
    --muted-blue-grey: #90A0B8;
    --nature-green: #60C090;
    --midnight-base: #0C1424;
    --panel-dark: #14203A;
    --border-line: #2A3A50;
    --leaf-accent: #4A6A50;
    --particle-blue: #6A8A90;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'EB Garamond', Georgia, serif;
    --font-code: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--midnight-base);
    color: var(--muted-blue-grey);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Particles Canvas --- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Nature SVG Accents --- */
.nature-accent {
    position: fixed;
    color: var(--leaf-accent);
    opacity: 0.10;
    z-index: 0;
    pointer-events: none;
}

.nature-accent--top-left {
    top: -20px;
    left: -20px;
    width: 200px;
    height: 200px;
}

.nature-accent--top-right {
    top: 40px;
    right: -30px;
    width: 160px;
    height: 160px;
    transform: scaleX(-1);
}

.nature-accent--bottom-left {
    bottom: 20px;
    left: 30px;
    width: 140px;
    height: 140px;
}

/* --- Dashboard Grid --- */
.dashboard {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    padding: 12px;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --- Panel Base --- */
.panel {
    background-color: var(--panel-dark);
    border: 1px solid var(--border-line);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    animation: panelFadeIn 0.6s ease forwards;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.2s; }
.panel:nth-child(3) { animation-delay: 0.3s; }
.panel:nth-child(4) { animation-delay: 0.4s; }
.panel:nth-child(5) { animation-delay: 0.5s; }
.panel:nth-child(6) { animation-delay: 0.6s; }
.panel:nth-child(7) { animation-delay: 0.7s; }
.panel:nth-child(8) { animation-delay: 0.8s; }
.panel:nth-child(9) { animation-delay: 0.9s; }
.panel:nth-child(10) { animation-delay: 1.0s; }
.panel:nth-child(11) { animation-delay: 1.1s; }
.panel:nth-child(12) { animation-delay: 1.2s; }
.panel:nth-child(13) { animation-delay: 1.3s; }

@keyframes panelFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--pale-blue-white);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-line);
    padding-bottom: 10px;
}

.panel__corner-leaf {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    color: var(--leaf-accent);
    opacity: 0.15;
}

.panel__corner-leaf--right {
    left: auto;
    right: 8px;
}

/* --- Code & Green Accents --- */
.code-green {
    color: var(--nature-green);
    font-family: var(--font-code);
}

.code-text {
    color: var(--nature-green);
    font-family: var(--font-code);
    font-size: 0.82rem;
}

/* ============================
   HEADER PANEL
   ============================ */
.panel--header {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px 36px;
    background: linear-gradient(180deg, var(--panel-dark) 0%, rgba(20, 32, 58, 0.6) 100%);
    border-bottom: 2px solid var(--border-line);
}

.header__content {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.header__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4rem);
    color: var(--pale-blue-white);
    letter-spacing: 0.08em;
}

.header__dot {
    color: var(--nature-green);
}

.header__cursor {
    color: var(--nature-green);
    font-family: var(--font-code);
    font-size: clamp(2rem, 4vw, 3.2rem);
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.header__subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: var(--muted-blue-grey);
    margin-top: 8px;
    font-style: italic;
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

.header__meta {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.header__meta-item {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--muted-blue-grey);
    letter-spacing: 0.04em;
}

/* ============================
   SYSTEM OVERVIEW
   ============================ */
.panel--system {
    grid-column: span 4;
}

.system-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat {
    display: grid;
    grid-template-columns: 40px 1fr 42px;
    align-items: center;
    gap: 10px;
}

.stat__label {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--muted-blue-grey);
    letter-spacing: 0.08em;
}

.stat__bar {
    height: 6px;
    background-color: var(--border-line);
    border-radius: 3px;
    overflow: hidden;
}

.stat__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--nature-green), var(--particle-blue));
    border-radius: 3px;
    width: 0%;
    transition: width 1.5s ease;
}

.stat__value {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--nature-green);
    text-align: right;
}

.system-uptime {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-line);
}

/* ============================
   COMMITS
   ============================ */
.panel--commits {
    grid-column: span 5;
}

.commit-list {
    list-style: none;
}

.commit-item {
    display: grid;
    grid-template-columns: 70px 1fr 50px;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 58, 80, 0.5);
    align-items: baseline;
}

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

.commit-hash {
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--nature-green);
}

.commit-msg {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--muted-blue-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.commit-time {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--particle-blue);
    text-align: right;
}

/* ============================
   BUILD PIPELINE
   ============================ */
.panel--pipeline {
    grid-column: span 3;
}

.pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.pipeline-stage {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-line);
    border-radius: 4px;
    background: rgba(12, 20, 36, 0.5);
}

.pipeline-stage__icon {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

.pipeline-stage--pass .pipeline-stage__icon {
    color: var(--nature-green);
}

.pipeline-stage--active .pipeline-stage__icon {
    color: #E8B040;
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pipeline-stage__name {
    font-family: var(--font-code);
    font-size: 0.82rem;
    color: var(--pale-blue-white);
    flex: 1;
}

.pipeline-stage__time {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--particle-blue);
}

.pipeline-connector {
    width: 2px;
    height: 12px;
    background: var(--border-line);
    margin-left: 22px;
}

.pipeline-summary {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-line);
}

/* ============================
   TERMINAL
   ============================ */
.panel--terminal {
    grid-column: span 6;
    padding: 0;
}

.terminal__header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(12, 20, 36, 0.8);
    border-bottom: 1px solid var(--border-line);
}

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

.terminal__dot--red { background-color: #E05050; }
.terminal__dot--yellow { background-color: #E8B040; }
.terminal__dot--green { background-color: var(--nature-green); }

.terminal__title {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--muted-blue-grey);
    margin-left: 8px;
}

.terminal__body {
    padding: 16px 20px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    line-height: 1.9;
}

.terminal__line {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.terminal__prompt {
    color: var(--nature-green);
    user-select: none;
}

.terminal__command {
    color: var(--pale-blue-white);
}

.terminal__line--output {
    padding-left: 18px;
}

.terminal__text {
    color: var(--muted-blue-grey);
}

.terminal__text--green {
    color: var(--nature-green);
}

.terminal__cursor-blink {
    color: var(--nature-green);
    animation: cursorBlink 1s step-end infinite;
}

/* ============================
   DEPENDENCIES
   ============================ */
.panel--deps {
    grid-column: span 3;
}

.deps-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dep-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(42, 58, 80, 0.4);
}

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

.dep-name {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--pale-blue-white);
}

.dep-version {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--muted-blue-grey);
}

.dep-status {
    font-family: var(--font-code);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dep-status--current {
    color: var(--nature-green);
    background: rgba(96, 192, 144, 0.1);
    border: 1px solid rgba(96, 192, 144, 0.2);
}

.dep-status--update {
    color: #E8B040;
    background: rgba(232, 176, 64, 0.1);
    border: 1px solid rgba(232, 176, 64, 0.2);
}

/* ============================
   DEPENDENCIES (cont) + TERMINAL
   ============================ */
.panel--deps + .panel--terminal {
    /* adjacency styling if needed */
}

/* ============================
   ACTIVITY GRAPH
   ============================ */
.panel--activity {
    grid-column: span 6;
}

.activity-graph {
    display: grid;
    grid-template-columns: repeat(26, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 12px;
}

.activity-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background-color: var(--border-line);
    transition: background-color 0.3s ease;
}

.activity-cell--low {
    background-color: rgba(96, 192, 144, 0.25);
}

.activity-cell--med {
    background-color: rgba(96, 192, 144, 0.5);
}

.activity-cell--high {
    background-color: var(--nature-green);
}

.activity-legend {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

.activity-legend__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-code);
    font-size: 0.68rem;
    color: var(--muted-blue-grey);
}

.activity-legend__box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.activity-legend__box--low {
    background-color: rgba(96, 192, 144, 0.25);
}

.activity-legend__box--med {
    background-color: rgba(96, 192, 144, 0.5);
}

.activity-legend__box--high {
    background-color: var(--nature-green);
}

/* ============================
   API ENDPOINTS
   ============================ */
.panel--endpoints {
    grid-column: span 6;
}

.endpoints-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.endpoint {
    display: grid;
    grid-template-columns: 48px 1fr 56px 40px;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 3px;
    background: rgba(12, 20, 36, 0.4);
    border: 1px solid rgba(42, 58, 80, 0.5);
}

.endpoint__method {
    font-family: var(--font-code);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 2px 4px;
    border-radius: 2px;
}

.endpoint__method--get {
    color: var(--nature-green);
    background: rgba(96, 192, 144, 0.1);
}

.endpoint__method--post {
    color: #6AB0E8;
    background: rgba(106, 176, 232, 0.1);
}

.endpoint__method--put {
    color: #E8B040;
    background: rgba(232, 176, 64, 0.1);
}

.endpoint__method--del {
    color: #E05050;
    background: rgba(224, 80, 80, 0.1);
}

.endpoint__path {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--pale-blue-white);
}

.endpoint__latency {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--particle-blue);
    text-align: right;
}

.endpoint__status {
    font-family: var(--font-code);
    font-size: 0.72rem;
    text-align: center;
}

.endpoint__status--ok {
    color: var(--nature-green);
}

/* ============================
   EDITORIAL / NOTES
   ============================ */
.panel--editorial {
    grid-column: span 6;
}

.editorial-entry {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(42, 58, 80, 0.5);
}

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

.editorial-entry__heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--pale-blue-white);
    margin-bottom: 10px;
}

.editorial-entry__body {
    font-family: var(--font-body);
    font-size: clamp(0.92rem, 1.1vw, 1.05rem);
    color: var(--muted-blue-grey);
    line-height: 1.85;
}

.editorial-entry__date {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--particle-blue);
    letter-spacing: 0.05em;
}

/* ============================
   PROJECTS
   ============================ */
.panel--projects {
    grid-column: span 6;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-item {
    display: grid;
    grid-template-columns: 1fr 80px 1fr 40px;
    gap: 10px;
    align-items: center;
}

.project-item__name {
    font-family: var(--font-code);
    font-size: 0.82rem;
    color: var(--pale-blue-white);
}

.project-item__lang {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--particle-blue);
    text-align: right;
}

.project-item__progress {
    height: 5px;
    background-color: var(--border-line);
    border-radius: 3px;
    overflow: hidden;
}

.project-item__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--leaf-accent), var(--nature-green));
    border-radius: 3px;
    width: 0%;
    transition: width 1.5s ease;
}

.project-item__pct {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--nature-green);
    text-align: right;
}

/* ============================
   LIVE LOGS
   ============================ */
.panel--logs {
    grid-column: span 8;
}

.logs-feed {
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-line) transparent;
}

.logs-feed::-webkit-scrollbar {
    width: 4px;
}

.logs-feed::-webkit-scrollbar-track {
    background: transparent;
}

.logs-feed::-webkit-scrollbar-thumb {
    background: var(--border-line);
    border-radius: 2px;
}

.log-entry {
    display: grid;
    grid-template-columns: 66px 50px 1fr;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(42, 58, 80, 0.3);
    align-items: baseline;
    font-family: var(--font-code);
    font-size: 0.76rem;
}

.log-entry__time {
    color: var(--particle-blue);
}

.log-entry__level {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1px 4px;
    border-radius: 2px;
    text-align: center;
}

.log-entry__level--info {
    color: var(--nature-green);
    background: rgba(96, 192, 144, 0.08);
}

.log-entry__level--warn {
    color: #E8B040;
    background: rgba(232, 176, 64, 0.08);
}

.log-entry__level--debug {
    color: var(--particle-blue);
    background: rgba(106, 138, 144, 0.08);
}

.log-entry__level--error {
    color: #E05050;
    background: rgba(224, 80, 80, 0.08);
}

.log-entry__msg {
    color: var(--muted-blue-grey);
}

/* ============================
   CLOCK / STATUS
   ============================ */
.panel--clock {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.clock-display {
    text-align: center;
}

.clock-time {
    display: block;
    font-family: var(--font-code);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--pale-blue-white);
    letter-spacing: 0.1em;
}

.clock-date {
    display: block;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--particle-blue);
    margin-top: 4px;
}

.status-indicators {
    display: flex;
    gap: 20px;
}

.status-dot {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot__light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot--active .status-dot__light {
    background-color: var(--nature-green);
    box-shadow: 0 0 6px rgba(96, 192, 144, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot--idle .status-dot__light {
    background-color: var(--particle-blue);
    opacity: 0.6;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(96, 192, 144, 0.5); }
    50% { box-shadow: 0 0 12px rgba(96, 192, 144, 0.8); }
}

.status-dot__label {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--muted-blue-grey);
    letter-spacing: 0.04em;
}

/* ============================
   MAGNETIC HOVER EFFECT
   ============================ */
.panel[data-magnetic] {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}

.panel[data-magnetic]:hover {
    box-shadow: 0 0 20px rgba(96, 192, 144, 0.05), inset 0 0 30px rgba(12, 20, 36, 0.3);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1200px) {
    .panel--system { grid-column: span 6; }
    .panel--commits { grid-column: span 6; }
    .panel--pipeline { grid-column: span 6; }
    .panel--deps { grid-column: span 6; }
    .panel--terminal { grid-column: span 12; }
    .panel--activity { grid-column: span 12; }
    .panel--endpoints { grid-column: span 12; }
    .panel--editorial { grid-column: span 12; }
    .panel--projects { grid-column: span 12; }
    .panel--logs { grid-column: span 12; }
    .panel--clock { grid-column: span 6; }
}

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

    .panel--system,
    .panel--commits,
    .panel--pipeline,
    .panel--deps,
    .panel--terminal,
    .panel--activity,
    .panel--endpoints,
    .panel--editorial,
    .panel--projects,
    .panel--logs,
    .panel--clock {
        grid-column: 1 / -1;
    }

    .header__title {
        font-size: 2rem;
    }

    .header__meta {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    .commit-item {
        grid-template-columns: 60px 1fr 40px;
    }

    .project-item {
        grid-template-columns: 1fr 60px 1fr 35px;
    }

    .endpoint {
        grid-template-columns: 40px 1fr 48px 36px;
    }

    .status-indicators {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* ============================
   SELECTION & SCROLLBAR
   ============================ */
::selection {
    background-color: rgba(96, 192, 144, 0.3);
    color: var(--pale-blue-white);
}

body::-webkit-scrollbar {
    width: 6px;
}

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

body::-webkit-scrollbar-thumb {
    background: var(--border-line);
    border-radius: 3px;
}

body {
    scrollbar-width: thin;
    scrollbar-color: var(--border-line) var(--midnight-base);
}
