:root {
    --bg: #050505;
    --panel: rgba(9, 9, 11, 0.86);
    --panel-solid: #09090b;
    --line: rgba(255, 255, 255, 0.11);
    --muted: #a1a1aa;
    --text: #f4f4f5;
    --neon: #00ffcc;
    --accent: #ff00ea;
    --warn: #facc15;
    --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "Fira Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("/assets/fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/assets/fonts/fira-code-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/assets/fonts/fira-code-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: var(--font-sans);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 50% 18%, rgba(0, 255, 204, 0.10), transparent 34rem),
        radial-gradient(circle at 82% 72%, rgba(255, 0, 234, 0.09), transparent 28rem),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: auto, auto, 40px 40px, 40px 40px;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(255,255,255,0.02) 50%, rgba(0,0,0,0.05) 50%);
    background-size: 100% 4px;
    mix-blend-mode: overlay;
}

a {
    color: inherit;
}

.seo-content {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cv-desktop {
    min-height: 100vh;
    width: min(100%, 100rem);
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-rows: auto auto;
    gap: clamp(1rem, 2vw, 1.5rem);
    align-content: center;
}

.desktop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    background: rgba(5, 5, 5, 0.72);
    backdrop-filter: blur(18px);
    font-family: var(--font-mono);
    letter-spacing: -0.04em;
    transform-origin: 50% 48%;
    animation: window-zoom-in 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 800;
}

.brand span {
    color: var(--neon);
    text-shadow: 0 0 24px rgba(0, 255, 204, 0.42);
}

.desktop-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.status-dot {
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 999px;
    background: var(--neon);
    box-shadow: 0 0 18px var(--neon);
}

.desktop-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem);
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: stretch;
}

.terminal-window {
    height: clamp(34rem, 70vh, 48rem);
    min-height: 0;
    border: 1px solid rgba(0, 255, 204, 0.34);
    background: linear-gradient(180deg, rgba(24, 24, 27, 0.92), rgba(5, 5, 5, 0.92));
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 30px 90px rgba(0, 0, 0, 0.62), 0 0 65px rgba(0, 255, 204, 0.08);
    backdrop-filter: blur(20px);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    transform-origin: 50% 48%;
    animation: window-zoom-in 460ms 60ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.window-bar {
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.56);
    font-family: var(--font-mono);
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.window-control {
    width: 0.76rem;
    height: 0.76rem;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
}

.window-control.close { background: #ff5f57; }
.window-control.min { background: #ffbd2e; }
.window-control.max { background: #28c840; }

.window-title {
    min-width: 0;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-title strong {
    color: var(--text);
}

.window-badge {
    color: var(--neon);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

#cv-terminal {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: clamp(0.85rem, 1.6vw, 1.25rem);
}

#cv-terminal.terminal {
    height: 100% !important;
    overflow-y: auto !important;
}

.terminal,
.terminal .terminal-output,
.terminal .terminal-output div div {
    font-family: var(--font-mono) !important;
    font-size: clamp(0.82rem, 1.35vw, 0.95rem) !important;
    line-height: 1.42 !important;
}

.cmd,
.terminal .prompt,
.terminal .cmd span,
.terminal .cmd div,
.terminal .cmd textarea {
    font-family: var(--font-mono) !important;
    font-size: clamp(0.76rem, 1.15vw, 0.86rem) !important;
    line-height: 1.28 !important;
}

.terminal .terminal-output > div:first-child div {
    line-height: 1.12 !important;
}

.terminal {
    --color: #e4e4e7;
    --background: transparent;
    --link-color: var(--neon);
    --animation: terminal-glow;
    text-shadow: 0 0 18px rgba(0, 255, 204, 0.09);
}

.cmd a[href],
.cmd a[href] span,
.terminal a[href],
.terminal a[href] span,
.terminal .terminal-output > :not(.raw) a[href],
.terminal .terminal-output > :not(.raw) a[href] span {
    color: var(--neon) !important;
    background: transparent !important;
    text-decoration: underline;
    text-decoration-color: rgba(0, 255, 204, 0.45);
    text-underline-offset: 0.18em;
}

.cmd a[href]:hover,
.cmd a[href]:hover span,
.cmd a[href]:focus-visible,
.cmd a[href]:focus-visible span,
.terminal a[href]:hover,
.terminal a[href]:hover span,
.terminal a[href]:focus-visible,
.terminal a[href]:focus-visible span,
.terminal .terminal-output > :not(.raw) a[href]:hover,
.terminal .terminal-output > :not(.raw) a[href]:hover span,
.terminal .terminal-output > :not(.raw) a[href]:focus-visible,
.terminal .terminal-output > :not(.raw) a[href]:focus-visible span {
    color: var(--accent) !important;
    background: transparent !important;
    text-decoration-color: var(--accent);
    outline: none;
}

.terminal .cmd .cursor.blink,
.terminal .cmd .cmd-cursor,
.terminal .cmd .cmd-cursor span,
.terminal .cmd .cmd-cursor.cmd-blink,
.terminal .cmd .cmd-cursor.cmd-blink span {
    background: var(--neon) !important;
    color: var(--bg) !important;
    box-shadow: 0 0 16px var(--neon);
}

.terminal .cmd .cmd-cursor.cmd-blink,
.terminal .cmd .cmd-cursor.cmd-blink span {
    --original-color: var(--neon);
    --original-background: var(--bg);
    animation: cv-cursor-blink 900ms steps(2, start) infinite !important;
}

.terminal ::selection,
.terminal .terminal-output ::selection,
.terminal .terminal-output div div::selection,
.terminal .terminal-output span::selection,
.terminal .terminal-output span[data-text]::selection,
.terminal .terminal-output span[data-text] span::selection,
.terminal .cmd ::selection,
.terminal .cmd span::selection,
.terminal .cmd span[data-text]::selection,
.terminal .cmd span[data-text] span::selection {
    background: rgba(0, 255, 204, 0.88) !important;
    color: #050505 !important;
    text-shadow: none !important;
}

.terminal ::-moz-selection,
.terminal .terminal-output ::-moz-selection,
.terminal .terminal-output div div::-moz-selection,
.terminal .terminal-output span::-moz-selection,
.terminal .terminal-output span[data-text]::-moz-selection,
.terminal .terminal-output span[data-text] span::-moz-selection,
.terminal .cmd ::-moz-selection,
.terminal .cmd span::-moz-selection,
.terminal .cmd span[data-text]::-moz-selection,
.terminal .cmd span[data-text] span::-moz-selection {
    background: rgba(0, 255, 204, 0.88) !important;
    color: #050505 !important;
    text-shadow: none !important;
}

.terminal .terminal-output div div::selection,
.terminal .terminal-output div div a::selection,
.terminal .terminal-output span[data-text]:not(.emoji)::selection,
.terminal .terminal-output span[data-text]:not(.far):not(.fa):not(.fas):not(.emoji) span::selection,
.terminal .terminal-output span[data-text]:not(.token):not(.inverted):not(.terminal-inverted):not(.cmd-inverted):not(.terminal-error):not(.emoji)::selection,
.cmd span[data-text]:not(.far):not(.fa):not(.fas):not(.emoji) span::selection {
    background-color: rgba(0, 255, 204, 0.88) !important;
    color: #050505 !important;
    text-shadow: none !important;
}

.terminal .terminal-output div div::-moz-selection,
.terminal .terminal-output div div a::-moz-selection,
.terminal .terminal-output span[data-text]:not(.emoji)::-moz-selection,
.terminal .terminal-output span[data-text]:not(.far):not(.fa):not(.fas):not(.emoji) span::-moz-selection,
.terminal .terminal-output span[data-text]:not(.token):not(.inverted):not(.terminal-inverted):not(.cmd-inverted):not(.terminal-error):not(.emoji)::-moz-selection,
.cmd span[data-text]:not(.far):not(.fa):not(.fas):not(.emoji) span::-moz-selection {
    background-color: rgba(0, 255, 204, 0.88) !important;
    color: #050505 !important;
    text-shadow: none !important;
}

@keyframes cv-cursor-blink {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0; }
}

.terminal-window.minimized #cv-terminal {
    display: none;
}

.terminal-window.minimized {
    min-height: auto;
}

.command-panel {
    border: 1px solid var(--line);
    background: rgba(9, 9, 11, 0.72);
    backdrop-filter: blur(18px);
    min-height: 100%;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
    transform-origin: 50% 48%;
    animation: window-zoom-in 620ms 140ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.command-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon), #22d3ee, var(--accent));
}

.panel-kicker {
    color: var(--neon);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.panel-title {
    margin: 0;
    font-size: clamp(1.65rem, 3.3vw, 2.55rem);
    line-height: 0.92;
    font-weight: 900;
    letter-spacing: -0.08em;
    text-transform: uppercase;
}

.panel-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    font-weight: 300;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.command-button {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.42);
    color: var(--text);
    padding: 0.62rem 0.65rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-align: left;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.command-button:hover,
.command-button:focus-visible {
    border-color: var(--neon);
    color: var(--neon);
    background: rgba(0, 255, 204, 0.055);
    transform: translateY(-1px);
    outline: none;
}

.command-button.accent:hover,
.command-button.accent:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 0, 234, 0.055);
}

.system-widget {
    margin-top: auto;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.32);
    font-family: var(--font-mono);
    display: grid;
    gap: 0.62rem;
}

.system-widget__row {
    display: grid;
    grid-template-columns: 4.8rem 1fr;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.system-widget__row i {
    position: relative;
    height: 0.36rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.system-widget__row i::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--load);
    background: linear-gradient(90deg, var(--neon), #22d3ee, var(--accent));
    box-shadow: 0 0 18px rgba(0, 255, 204, 0.35);
    transform-origin: left;
    animation: system-meter 2.8s ease-in-out infinite alternate;
    animation-play-state: paused;
}

body.terminal-ready .system-widget__row i::before {
    animation-play-state: running;
}

.system-widget__row:nth-child(1) i::before {
    animation-duration: 2.4s;
    animation-delay: -0.3s;
}

.system-widget__row:nth-child(2) i::before {
    animation-duration: 3.1s;
    animation-delay: -1.1s;
}

.system-widget__row:nth-child(3) i::before {
    animation-duration: 2.7s;
    animation-delay: -0.7s;
}

.system-widget__row:nth-child(4) i::before {
    animation-duration: 3.6s;
    animation-delay: -1.8s;
}

.panel-footer {
    margin-top: 0;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.7;
}

.panel-footer strong {
    color: var(--neon);
    font-weight: 700;
}

@keyframes terminal-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.58; }
}

@keyframes window-zoom-in {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(0.75rem);
        filter: blur(8px) brightness(1.35);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0) brightness(1);
    }
}

@keyframes system-meter {
    0% { transform: scaleX(0.88); opacity: 0.76; }
    100% { transform: scaleX(1); opacity: 1; }
}

@media (max-width: 900px) {
    .cv-desktop {
        width: 100%;
    }

    .desktop-stage {
        grid-template-columns: 1fr;
    }

    .command-panel {
        order: -1;
    }

    .terminal-window {
        height: 68vh;
    }
}

@media (max-width: 620px) {
    .cv-desktop {
        padding: 0.75rem;
    }

    .desktop-topbar,
    .window-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .desktop-status {
        width: 100%;
        justify-content: space-between;
        font-size: 0.68rem;
    }

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

@media (prefers-reduced-motion: reduce) {
    .terminal-window,
    .command-panel,
    .desktop-topbar,
    .system-widget__row i::before {
        animation: none;
    }
}