@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap');

/* ── Reset & Variables ────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #00bbff;
    --bright: #00eeff;
    --dim: #006699;
    --dark: #003355;
    --bg: #080c10;
    --bg-panel: #0a1018;
    --amber: #ffaa00;
    --red: #ff4444;
    --mint: #00ff88;
    --white: #c8d6e0;
    --border: #112233;
    --border-light: #1a3044;
}

body {
    background: var(--bg);
    font-family: 'Fira Code', 'Courier New', monospace;
    color: var(--blue);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── CRT Effects ──────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 1000;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 120, 255, 0.01);
    pointer-events: none;
    z-index: 999;
    animation: flicker 0.08s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.85; }
    100% { opacity: 1; }
}

/* ── Matrix Canvas ────────────────────────────────────── */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.04;
}

/* ── Dashboard Grid ───────────────────────────────────── */
.dashboard {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    min-height: calc(100vh - 40px);
    margin: 20px auto;
    display: grid;
    grid-template-rows: auto auto minmax(250px, 1fr) auto;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        "header   header    header"
        "skills   approach  beyond"
        "terminal terminal  terminal"
        "footer   footer    footer";
    gap: 0;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────── */
.header {
    grid-area: header;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo {
    font-size: 10px;
    line-height: 1.15;
    color: var(--blue);
    white-space: pre;
    flex-shrink: 0;
    animation: glitch-skew 6s infinite linear alternate-reverse;
}

@keyframes glitch-skew {
    0%, 96% { transform: skew(0deg); }
    97% { transform: skew(1.5deg); }
    98% { transform: skew(-1deg); }
    99% { transform: skew(2deg); }
    100% { transform: skew(0deg); }
}

.header-info {
    flex: 1;
    min-width: 0;
}

.header-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--bright);
    margin-bottom: 2px;
}

.header-role {
    font-size: 12px;
    color: var(--amber);
    margin-bottom: 4px;
}

.header-sub {
    font-size: 11px;
    color: var(--dim);
    margin-bottom: 8px;
    line-height: 1.5;
}

.header-contact {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.header-contact a {
    color: var(--dim);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.header-contact a:hover {
    color: var(--bright);
}

.header-contact .contact-label {
    color: var(--amber);
    font-weight: 700;
}

/* ── Panels ───────────────────────────────────────────── */
.panel {
    background: var(--bg-panel);
    padding: 18px 22px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.panel:last-of-type {
    border-right: none;
}

.panel::-webkit-scrollbar {
    width: 4px;
}

.panel::-webkit-scrollbar-track {
    background: var(--bg);
}

.panel::-webkit-scrollbar-thumb {
    background: var(--dark);
    border-radius: 2px;
}

.panel-skills   { grid-area: skills; }
.panel-approach { grid-area: approach; }
.panel-beyond   { grid-area: beyond; }

.panel-title {
    font-size: 10px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Skills */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.skill-name {
    color: var(--white);
    min-width: 95px;
}

.skill-bar-track {
    flex: 1;
    display: flex;
    gap: 2px;
}

.skill-bar-seg {
    height: 8px;
    flex: 1;
    border-radius: 1px;
    background: var(--border);
    transition: background 0.3s;
}

.skill-bar-seg.filled {
    background: var(--blue);
}

.skill-bar-seg.filled.high {
    background: var(--bright);
}

/* Details list */
.details-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.details-list li {
    font-size: 12px;
    color: var(--dim);
    padding-left: 18px;
    position: relative;
    line-height: 1.6;
}

.details-list li::before {
    content: '~';
    position: absolute;
    left: 0;
    color: var(--dark);
}

.details-list .dl-accent {
    color: var(--white);
}

/* ── Terminal Area ────────────────────────────────────── */
.terminal-area {
    grid-area: terminal;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.nav-bar {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 0 18px;
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

.nav-link {
    color: var(--dim);
    text-decoration: none;
    font-size: 11px;
    padding: 7px 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--bright);
    background: rgba(0, 187, 255, 0.04);
    border-bottom-color: var(--blue);
}

.nav-link:active {
    background: rgba(0, 187, 255, 0.08);
}

.terminal-topbar {
    background: #0c1218;
    border-bottom: 1px solid var(--border);
    padding: 5px 18px;
    font-size: 10px;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.terminal-topbar-user {
    color: var(--dim);
}

.terminal-topbar-path {
    color: var(--dim);
}

.terminal-body {
    background: rgba(8, 12, 16, 0.97);
    padding: 16px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    height: 0;
    flex: 1 1 0;
}

.terminal-body::-webkit-scrollbar {
    width: 5px;
}

.terminal-body::-webkit-scrollbar-track {
    background: var(--bg);
}

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

/* ── Footer ───────────────────────────────────────────── */
.footer {
    grid-area: footer;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 5px 28px;
    font-size: 10px;
    color: #1a2a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--mint);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

/* ── Terminal Output ──────────────────────────────────── */
.line {
    margin-bottom: 2px;
    line-height: 1.7;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.line.ascii-art {
    font-size: 10px;
    line-height: 1.2;
    color: var(--blue);
}

.prompt-prefix { color: var(--bright); }
.prompt-path   { color: var(--amber); }
.prompt-symbol { color: var(--blue); font-weight: bold; }
.cmd-text      { color: var(--white); }
.highlight     { color: var(--amber); }
.accent        { color: var(--bright); }
.error         { color: var(--red); }
.dim           { color: var(--dim); }

.bold {
    font-weight: 700;
    color: var(--blue);
}

.section-header {
    color: var(--amber);
    font-weight: 700;
    border-bottom: 1px dashed var(--dark);
    padding-bottom: 4px;
    margin-bottom: 4px;
    display: inline-block;
}

.input-line {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 13px;
}

.input-line input {
    background: transparent;
    border: none;
    color: var(--white);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: inherit;
    outline: none;
    flex: 1;
    caret-color: var(--blue);
}

.skill-filled { color: var(--blue); }
.skill-empty  { color: var(--border); }

/* ── Tablet (2 columns) ───────────────────────────────── */
@media (max-width: 1000px) {
    .dashboard {
        max-width: 100%;
        min-height: 100vh;
        margin: 0;
        border: none;
        border-radius: 0;
        overflow: visible;
        grid-template-rows: auto auto minmax(250px, 1fr) auto;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "header   header"
            "skills   approach"
            "terminal terminal"
            "footer   footer";
    }

    .panel-beyond {
        display: none;
    }

    .header { padding: 14px 20px; gap: 16px; }
    .header-logo { font-size: 8px; }
    .header-name { font-size: 18px; }
    .header-sub { font-size: 10px; }

    .panel { padding: 14px 18px; }
    .panel-title { margin-bottom: 10px; }
    .skill-item { font-size: 11px; }
    .skill-name { min-width: 80px; }
    .details-list li { font-size: 11px; }

    .nav-link { font-size: 10px; padding: 6px 10px; }
    .terminal-body { padding: 14px; }
    .line { font-size: 12px; }
    .line.ascii-art { font-size: 9px; }
    .input-line { font-size: 12px; }

    .footer { padding: 5px 20px; }
}

/* ── Mobile landscape / small tablet ─────────────────── */
@media (max-width: 740px) {
    body {
        overflow-y: auto;
    }

    .dashboard {
        height: auto;
        min-height: 100vh;
        grid-template-rows: auto auto auto auto;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "header   header"
            "skills   approach"
            "terminal terminal"
            "footer   footer";
    }

    .terminal-body {
        height: 50vh;
        flex: none;
    }

    .header-logo { display: none; }
    .header-name { font-size: 16px; }
    .header-role { font-size: 11px; }
    .header-sub { font-size: 10px; }

    .header-contact {
        gap: 12px;
    }

    .header-contact a { font-size: 11px; }

    .skill-bar-seg { height: 6px; }
    .skills-list { gap: 5px; }

    .nav-bar {
        flex-wrap: wrap;
        padding: 4px 12px;
    }

    .nav-link {
        font-size: 10px;
        padding: 4px 8px;
    }

    .line { font-size: 11px; }
    .line.ascii-art { font-size: 7px; }
    .input-line { font-size: 11px; }
}

/* ── Phone portrait ──────────────────────────────────── */
@media (max-width: 520px) {
    .terminal-body {
        height: 45vh;
    }

    .dashboard {
        grid-template-rows: auto auto auto auto auto;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "skills"
            "terminal"
            "footer";
    }

    .panel-approach {
        display: none;
    }

    .header {
        padding: 12px 14px;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }

    .header-name { font-size: 16px; }
    .header-role { font-size: 10px; margin-bottom: 2px; }
    .header-sub { margin-bottom: 6px; }

    .header-contact {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .header-contact a { font-size: 10px; }

    .panel {
        padding: 12px 14px;
    }

    .panel-title {
        font-size: 9px;
        margin-bottom: 8px;
    }

    .skill-item { gap: 6px; font-size: 10px; }
    .skill-name { min-width: 70px; }
    .skill-bar-seg { height: 6px; }

    .nav-bar {
        padding: 2px 8px;
        gap: 0;
    }

    .nav-link {
        font-size: 9px;
        padding: 4px 6px;
    }

    .terminal-topbar {
        padding: 4px 12px;
        font-size: 9px;
    }

    .terminal-body { padding: 10px 12px; }
    .line { font-size: 10px; }
    .line.ascii-art { font-size: 6px; }
    .input-line { font-size: 10px; }

    .footer {
        padding: 4px 14px;
        font-size: 9px;
    }
}
