:root {
    --bg: #13161f;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border: #272e40;
    --accent: #00d4aa;
    --accent-glow: rgba(0, 212, 170, 0.15);
    --accent-hover-border: rgba(0, 212, 170, 0.3);
    --text: #c4ccd8;
    --text-dim: #525e78;
    --text-bright: #edf0f7;
    --statusbar-bg: rgba(12, 14, 20, 0.92);
    --bg-image-filter: blur(12px) brightness(0.08);
    --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --nav-height: 48px;
    --np-bar-height: 36px;
}

/* Wrapper form around the language-switch button shouldn't affect flex layout
   of the music-controls bar; display:contents makes the form visually transparent. */
.lang-form { display: contents; }



:root[data-theme="light"] .portrait-wrap,
:root[data-theme="light"] .about-card:hover .portrait-wrap {
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.6),
        0 0 0  3px #0e1018,      /* inner bezel ring — black */
        0 0 0 13px #d4d0c8,      /* bezel body — frosted, matches page */
        0 0 0 14px #b4b0a8,      /* bezel outer edge */
        0 0 0 16px #8a8680,      /* outer shadow — warm gray */
        0 0 22px rgba(0, 122, 94, 0.2);
}

:root[data-theme="light"] .now-playing-bar {
    background: rgba(237, 233, 220, 0.77);
    color: var(--text-bright);
}

:root[data-theme="light"] {
    --bg: #ede9dc;
    --bg-card: rgba(0, 0, 0, 0.04);
    --border: #c4bfae;
    --accent: #007a5e;
    --accent-glow: rgba(0, 122, 94, 0.28);
    --accent-hover-border: rgba(0, 100, 76, 0.55);
    --text: #2f3540;
    --text-dim: #6b7280;
    --text-bright: #11141a;
    --statusbar-bg: rgba(237, 233, 220, 0.92);
    --bg-image-filter: blur(12px) brightness(1.6) contrast(0.6) opacity(0.35);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font);
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100%;
}

/* Subtle scanline overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Background image — very dim ambient layer */
.bg-image {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url("images/background.82acdf6b1ee0.webp");
    background-position: center;
    background-size: cover;
    filter: var(--bg-image-filter);
    pointer-events: none;
}

/* ─── Loading screen ─── */

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #13161f; /* hard-coded fallback in case vars aren't parsed yet */
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

#loading-screen.loading-fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.loading-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    color: #e8ecf4;
    color: var(--text-bright);
    letter-spacing: 0.03em;
}

.loading-logo .accent {
    color: #00d4aa;
    color: var(--accent);
}

.loading-bar-track {
    width: 200px;
    height: 1px;
    background: #272e40;
    background: var(--border);
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 0;
    background: #00d4aa;
    background: var(--accent);
    box-shadow: 0 0 8px #00d4aa;
    box-shadow: 0 0 8px var(--accent);
    animation: loading-fill 2s ease-out forwards;
}

@keyframes loading-fill {
    0%  { width:   0%; }
    70% { width:  80%; }
    100%{ width: 100%; }
}

#loading-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #525e78;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

/* ─── Matrix rain ─── */

#matrix-rain {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.18;
}

/* ─── Statusbar / Nav ─── */

.statusbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 100;
    background-color: var(--statusbar-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.statusbar-title {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: color 0.2s;
}

.statusbar-title:hover {
    color: var(--text);
}

.statusbar-title .accent {
    color: var(--accent);
}

.statusbar-nav {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.statusbar-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.statusbar-nav a:hover {
    color: var(--accent);
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: 1rem;
}

.music-btn,
.theme-btn,
.lang-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0;
    height: var(--nav-height);
    min-width: 22px;
    position: relative;
    transition: color 0.2s;
}

.music-btn > span,
.theme-btn > span {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    font-size: 24px;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    user-select: none;
}

.theme-btn > span {
    font-size: 20px;
}

.lang-btn {
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    min-width: 26px;
    text-align: center;
}

.music-btn:hover,
.music-btn.active,
.theme-btn:hover,
.lang-btn:hover {
    color: var(--accent);
}

.now-playing {
    font-size: 11px;
    color: var(--text-dim);
    width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s, visibility 0.4s;
}

.now-playing:not(:empty) {
    visibility: visible;
    opacity: 1;
}

.now-playing-char {
    display: inline-block;
    animation: wave-up-soft 2s ease-in-out infinite;
}

/* ─── Now-playing bar (mobile only) ─── */

.now-playing-bar {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: var(--np-bar-height);
    z-index: 99;
    background: rgba(12, 14, 20, 0.77);
    backdrop-filter: blur(8px);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: opacity 0.4s;
}

.now-playing-bar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

/* ─── Credits panel (playlist.txt) ─── */

.credits-toggle {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0;
    height: var(--nav-height);
    min-width: 18px;
    position: relative;
    transition: color 0.2s, transform 0.2s;
    display: none;
}

html.music-active .credits-toggle {
    display: inline-flex;
}

.credits-toggle > span {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    font-size: 18px;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    user-select: none;
}

.credits-toggle:hover,
.credits-toggle[aria-expanded="true"] {
    color: var(--accent);
}

.credits-toggle--bar {
    height: var(--np-bar-height);
    min-width: 22px;
}

.credits-toggle--bar > span {
    font-size: 16px;
}

.credits-panel {
    position: fixed;
    top: calc(var(--nav-height) + 6px);
    left: 50%;
    transform: translate(-50%, -8px);
    width: min(520px, calc(100vw - 2rem));
    max-height: calc(100vh - var(--nav-height) - 24px);
    overflow-y: auto;
    z-index: 200;
    background: rgba(12, 14, 20, 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 212, 170, 0.06);
    color: var(--text);
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

:root[data-theme="light"] .credits-panel {
    background: rgba(237, 233, 220, 0.97);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 122, 94, 0.08);
}

.credits-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.credits-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.credits-title {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.credits-prompt {
    color: var(--accent);
    margin-right: 0.35em;
}

.credits-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-family: var(--font);
    font-size: 18px;
    line-height: 1;
    padding: 0 0.25em;
    transition: color 0.15s;
}

.credits-close:hover {
    color: var(--accent);
}

.credits-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

.credits-row {
    display: grid;
    grid-template-columns: 1.25rem 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    border-left: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.credits-row + .credits-row {
    border-top: 1px dashed rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .credits-row + .credits-row {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.credits-row.is-current {
    background: var(--accent-glow);
    border-left-color: var(--accent);
}

.credits-marker {
    color: var(--accent);
    font-size: 13px;
    text-align: center;
    line-height: 1;
}

.credits-meta {
    min-width: 0;
}

.credits-track-title {
    color: var(--text-bright);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credits-track-sub {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credits-source {
    color: var(--text-dim);
    font-size: 10.5px;
    text-decoration: none;
    letter-spacing: 0.03em;
    border: 1px solid var(--border);
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.credits-source:hover {
    color: var(--accent);
    border-color: var(--accent-hover-border);
    background: var(--accent-glow);
}

.credits-source--plain {
    border-style: dashed;
    cursor: default;
}

.credits-source--plain:hover {
    color: var(--text-dim);
    border-color: var(--border);
    background: transparent;
}

.credits-foot {
    padding: 0.55rem 0.85rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 10.5px;
    text-align: center;
}

.credits-foot a {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-dim);
}

.credits-foot a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.credits-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
}

/* ─── Main ─── */

main {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 5rem) 2rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* ─── Command line prompt ─── */

.cmd-line {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5em;
    letter-spacing: 0.02em;
}

.prompt {
    color: var(--accent);
    font-weight: 700;
}

/* ─── About Section ─── */

.about-card {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 2.5rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.about-card:hover {
    border-color: var(--accent-hover-border);
    box-shadow: 0 0 48px var(--accent-glow);
}

.portrait-wrap {
    position: relative;
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 7px;              /* curved CRT glass */
    border: 2px solid #07080c;       /* screen edge */
    overflow: hidden;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.75),  /* screen depth */
        0 0 0  3px #0e1018,                   /* inner bezel ring */
        0 0 0 13px #1b1e2b,                   /* bezel body */
        0 0 0 14px #272b3c,                   /* bezel outer highlight */
        0 0 0 16px #0c0d15,                   /* outer shadow */
        0 0 22px rgba(0, 212, 170, 0.12);     /* ambient phosphor glow */
    transition: box-shadow 0.4s;
}

/* Scanline + vignette overlay on portrait */
.portrait-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.1) 3px,
            rgba(0, 0, 0, 0.1) 4px
        );
    border-radius: 5px;
    pointer-events: none;
    z-index: 1;
}

#portrait {
    width: 110px;
    height: 110px;
    object-fit: cover;
    display: block;
    /* Teal-tinted CRT phosphor look by default */
    filter: grayscale(1) sepia(0.8) hue-rotate(130deg) saturate(1.2) brightness(0.75);
    transition: filter 0.5s;
}

.about-card:hover .portrait-wrap {
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 0  3px #0e1018,
        0 0 0 13px #1b1e2b,
        0 0 0 14px #272b3c,
        0 0 0 16px #0c0d15,
        0 0 40px rgba(0, 212, 170, 0.45);    /* stronger phosphor glow */
}

.about-card:hover #portrait {
    filter: grayscale(0) brightness(1) contrast(1);
}

/* CRT noise overlay — faint always, stronger on hover */
.portrait-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 5px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
    background-size: 180px 180px;
    mix-blend-mode: screen;
    opacity: 0.35;
    transition: opacity 0.8s ease;
}

.about-card:hover .portrait-wrap::before {
    opacity: 0;
}

.about-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.01em;
    margin-bottom: 0.4em;
}

.about-info h2 {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.2em;
}

.bio {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.7;
}

.comment {
    color: var(--text-dim);
    font-style: normal;
}

/* Blinking cursor */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.5rem;
    background: var(--accent);
    margin-left: 6px;
    vertical-align: baseline;
    position: relative;
    top: 2px;
    box-shadow: 0 0 8px var(--accent);
    animation: blink 1.1s step-end infinite;
}

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

/* ─── Skills Section (htop style) ─── */

.skills-htop {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.25rem 1.5rem;
    font-size: 12px;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.skills-htop:hover {
    border-color: var(--accent-hover-border);
    box-shadow: 0 0 24px var(--accent-glow);
}

.skills-htop-header,
.skill-row {
    display: grid;
    grid-template-columns: 56px 1fr minmax(120px, 2fr) 44px;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0;
}

.skills-htop-header {
    color: var(--accent);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.4rem;
}

.skills-htop-col-pct {
    text-align: right;
}

.skills-htop-group {
    color: var(--text-dim);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 0.6rem;
    margin-bottom: 0.15rem;
    padding-left: 2px;
}

.skill-row {
    transition: background 0.15s;
}

.skill-row:hover {
    background: rgba(0, 212, 170, 0.05);
}

.skill-pid {
    color: var(--text-dim);
    font-size: 11px;
}

.skill-name {
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-bar {
    display: block;
    height: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 1px;
    overflow: hidden;
    position: relative;
}

:root[data-theme="light"] .skill-bar {
    background: rgba(0, 0, 0, 0.08);
}

.skill-bar-fill {
    display: block;
    height: 100%;
    width: var(--pct, 0%);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    transition: width 0.6s ease;
}

.skill-pct {
    color: var(--accent);
    text-align: right;
    font-size: 11px;
    font-weight: 700;
}

/* ─── Projects Section ─── */

.projects-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
    border-color: var(--accent-hover-border);
    box-shadow: 0 0 24px var(--accent-glow);
    transform: translateY(-2px);
}

.project-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.project-name {
    font-size: 13px;
    color: var(--text-bright);
    font-weight: 700;
}

.project-year {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

.project-desc {
    font-size: 12px;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.stack-chip {
    font-size: 10px;
    color: var(--text-dim);
    background: rgba(0, 212, 170, 0.06);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.05em;
}

:root[data-theme="light"] .stack-chip {
    background: rgba(0, 122, 94, 0.08);
}

.project-link {
    color: var(--accent);
    font-size: 11px;
    text-decoration: none;
    letter-spacing: 0.04em;
    margin-top: auto;
}

.project-link:hover {
    text-decoration: underline;
}

/* ─── Now Section ─── */

.now-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.4rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 13px;
    line-height: 1.7;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.now-card:hover {
    border-color: var(--accent-hover-border);
    box-shadow: 0 0 24px var(--accent-glow);
}

.now-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1rem;
    align-items: baseline;
}

.now-key {
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.now-val {
    color: var(--text);
}

/* ─── Man page Section ─── */

.man-page {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.5rem 1.8rem;
    overflow-x: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.man-page:hover {
    border-color: var(--accent-hover-border);
    box-shadow: 0 0 24px var(--accent-glow);
}

.man-body {
    font-family: var(--font);
    font-size: 12px;
    color: var(--text);
    line-height: 1.65;
    white-space: pre;
    margin: 0;
}

.man-h {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.man-b {
    color: var(--text-bright);
    font-weight: 700;
}

.man-i {
    color: var(--text-bright);
    font-style: italic;
}

/* ─── 404 page ─── */

.not-found .prompt-echo {
    color: var(--accent);
    opacity: 0.6;
    margin-right: 0.5em;
}

.not-found-line,
.not-found-msg,
.not-found-hint,
.not-found-help {
    font-size: 12px;
    line-height: 1.8;
    word-break: break-all;
}

.not-found-msg .accent {
    color: var(--accent);
}

.not-found-hint a,
.not-found-help a {
    color: var(--accent);
}

/* ─── Footer uptime ─── */

.footer-uptime {
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

/* ─── Contact Section ─── */

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.contact-link:hover {
    border-color: var(--accent-hover-border);
    color: var(--text-bright);
    box-shadow: 0 0 24px var(--accent-glow);
}

.contact-key {
    color: var(--accent);
    min-width: 3.5rem;
    font-weight: 700;
}

.wave {
    display: inline-block;
    animation: wave-up 2s ease-in-out 1;
    animation-play-state: paused;
}

.contact-link:hover .wave {
    animation-play-state: running;
}

.wave:nth-child(1) { animation-delay: 0.00s; }
.wave:nth-child(2) { animation-delay: 0.12s; }
.wave:nth-child(3) { animation-delay: 0.24s; }
.wave:nth-child(4) { animation-delay: 0.36s; }
.wave:nth-child(5) { animation-delay: 0.48s; }
.wave:nth-child(6) { animation-delay: 0.60s; }
.wave:nth-child(7) { animation-delay: 0.72s; }
.wave:nth-child(8) { animation-delay: 0.84s; }

@keyframes wave-up {
    0%, 35%, 100% { transform: translateY(0); }
    17%           { transform: translateY(-5px); }
}

@keyframes wave-up-soft {
    0%   { transform: translateY(0); }
    25%  { transform: translateY(-3px); }
    50%  { transform: translateY(0); }
    75%  { transform: translateY(1px); }
    100% { transform: translateY(0); }
}

@keyframes wave-up-bar {
    0%   { transform: translateY(0); }
    25%  { transform: translateY(-1.5px); }
    50%  { transform: translateY(0); }
    75%  { transform: translateY(0.5px); }
    100% { transform: translateY(0); }
}

.now-playing-bar .now-playing-char {
    animation-name: wave-up-bar;
}

.contact-arrow {
    color: var(--text-dim);
}

/* ─── Footer ─── */

footer {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}

footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent);
}

/* ─── Impressum page ─── */

.impressum-wrap {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 5rem) 2rem 5rem;
}

.impressum-wrap .cmd-line {
    margin-bottom: 1.5rem;
}

.impressum-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 2.5rem;
    line-height: 1.8;
    font-size: 13px;
}

.impressum-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.impressum-content p {
    margin-bottom: 1.2rem;
    color: var(--text);
}

.impressum-content a {
    color: var(--accent);
    text-decoration: none;
}

.impressum-content a:hover {
    text-decoration: underline;
}

/* ─── Easter egg: hidden terminal ─── */

.terminal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: terminal-fade-in 0.15s ease;
}

@keyframes terminal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.terminal-window {
    width: min(680px, 90vw);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.terminal-title {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}

.terminal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.terminal-close:hover {
    color: var(--accent);
}

.terminal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 160px;
    max-height: 380px;
    overflow-y: auto;
}

.terminal-line {
    font-size: 12px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}

.terminal-line--cmd {
    color: var(--text-bright);
    margin-top: 0.4rem;
}

.terminal-prompt-echo {
    color: var(--accent);
    opacity: 0.5;
}

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

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    flex-shrink: 0;
}

.terminal-prompt {
    color: var(--accent);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.terminal-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--font);
    font-size: 12px;
    flex: 1;
    caret-color: var(--accent);
}

/* ─── Easter egg: sudo prompt ─── */

.sudo-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 2rem 2.5rem;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    animation: sudo-appear 0.15s ease;
}

@keyframes sudo-appear {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ─── Hamburger button ─── */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0;
    height: var(--nav-height);
    min-width: 22px;
    position: relative;
    transition: color 0.2s;
}

.hamburger-btn > span {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    font-size: 22px;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    user-select: none;
}

.hamburger-btn:hover {
    color: var(--accent);
}

/* ─── Responsive ─── */

@media (max-width: 1070px) {
    .statusbar-nav {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    /* Mobile nav dropdown */
    .statusbar.nav-open {
        position: fixed; /* ensure stacking context for absolute child */
    }

    .statusbar.nav-open .statusbar-nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--statusbar-bg);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 2rem 1rem;
        gap: 0;
        z-index: 99;
    }

    .statusbar.nav-open .statusbar-nav a {
        font-size: 13px;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border);
    }

    .statusbar.nav-open .statusbar-nav li:last-child a {
        border-bottom: none;
    }

    .about-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 2rem 1.5rem;
    }

    main,
    .impressum-wrap {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 650px) {
    .now-playing {
        display: none;
    }

    .now-playing-bar {
        display: flex;
    }

    html.music-active .now-playing-bar {
        opacity: 1;
    }

    html:not(.music-active) .now-playing-bar {
        opacity: 0;
        pointer-events: none;
    }

    html.music-active .credits-panel {
        top: calc(var(--nav-height) + var(--np-bar-height) + 4px);
        max-height: calc(100vh - var(--nav-height) - var(--np-bar-height) - 16px);
    }

    main,
    .impressum-wrap {
        padding-top: calc(var(--nav-height) + var(--np-bar-height) + 5rem);
    }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .cursor { display: none; }
    #matrix-rain { display: none; }
    .now-playing-char,
    .wave { animation: none !important; }
}

/* ─── Print ─── */

@media print {
    :root,
    :root[data-theme="light"] {
        --bg: #fff;
        --bg-card: #fff;
        --border: #888;
        --accent: #006848;
        --accent-glow: transparent;
        --accent-hover-border: #006848;
        --text: #000;
        --text-dim: #444;
        --text-bright: #000;
    }

    html, body {
        background: #fff !important;
        color: #000 !important;
    }

    body::after,
    .bg-image,
    #matrix-rain,
    #loading-screen,
    .statusbar,
    .now-playing-bar,
    .music-controls,
    .hamburger-btn,
    .theme-btn,
    .lang-btn,
    .music-btn,
    .cursor,
    .terminal-overlay,
    .sudo-prompt {
        display: none !important;
    }

    main,
    .impressum-wrap {
        padding: 1rem 0 0 !important;
        max-width: none !important;
    }

    .about-card,
    .skills-htop,
    .project-card,
    .now-card,
    .man-page,
    .contact-link,
    .impressum-content {
        background: #fff !important;
        border: 1px solid #888 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .portrait-wrap {
        box-shadow: none !important;
        border: 1px solid #888 !important;
    }

    #portrait { filter: none !important; }

    .skill-bar-fill { box-shadow: none !important; }

    /* Show URLs after links */
    a[href^="http"]::after,
    a[href^="mailto"]::after {
        content: " <" attr(href) ">";
        color: #444;
        font-size: 0.85em;
        word-break: break-all;
    }

    footer {
        border-top: 1px solid #888;
    }
}
