/* colors */
:root {
    --background-color: #181926;
    --secondary-color: #b4befe;
    --primary-color: #cdd6f4;
    --accent-color: #bf9aca;
    --indent-color: #1e2030;
    --muted-color: #7f849c;
    --terminal-border: rgba(180, 190, 254, 0.24);
    --terminal-glow: rgba(191, 154, 202, 0.2);
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    scrollbar-gutter: stable;
    background-color: var(--background-color);
}

body {
    margin: 0;
    font-family: "Roboto Mono", monospace;
    color: var(--primary-color);
    background:
        linear-gradient(rgba(180, 190, 254, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(180, 190, 254, 0.035) 1px, transparent 1px),
        var(--background-color);
    background-size: 32px 32px;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: "";
    background: repeating-linear-gradient(
        to bottom,
        rgba(205, 214, 244, 0.035),
        rgba(205, 214, 244, 0.035) 1px,
        transparent 1px,
        transparent 5px
    );
    mix-blend-mode: screen;
}

a {
    color: inherit;
    text-decoration: none;
}

.terminal-page {
    position: relative;
    z-index: 1;
}

.terminal-stage {
    position: fixed;
    inset: 3.25rem 0 4.85rem;
    z-index: 5;
    pointer-events: none;
}

.mobile-terminal-stage {
    display: none;
}

.section {
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.terminal-window {
    --window-opacity: 0.82;
    --window-scale: 0.98;
    position: absolute;
    display: flex;
    box-sizing: border-box;
    max-width: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--terminal-border);
    border-radius: 8px;
    background: rgba(30, 32, 48, 0.95);
    box-shadow: 0 18px 64px rgba(0, 0, 0, 0.28);
    cursor: grab;
    isolation: isolate;
    opacity: var(--window-opacity);
    transform: scale(var(--window-scale));
    transform-origin: center;
    transition:
        height 220ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease,
        transform 180ms ease;
    pointer-events: auto;
}

.terminal-window::before {
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    content: "";
    opacity: 0;
    box-shadow: 0 24px 90px var(--terminal-glow);
    transition: opacity 180ms ease;
}

.terminal-window:active {
    cursor: grabbing;
}

.focused-window {
    --window-opacity: 1;
    --window-scale: 1;
    border-color: rgba(191, 154, 202, 0.72);
    box-shadow:
        0 18px 64px rgba(0, 0, 0, 0.28),
        0 24px 90px var(--terminal-glow);
}

.focused-window::before {
    opacity: 1;
}

.window-pop {
    animation: window-pop 420ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--pop-delay, 0ms);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.45rem;
    padding: 0 0.9rem;
    border-bottom: 1px solid var(--terminal-border);
    border-radius: 8px 8px 0 0;
    background: rgba(24, 25, 38, 0.96);
    user-select: none;
}

.terminal-bar span,
.window-close {
    width: 0.68rem;
    height: 0.68rem;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: var(--accent-color);
}

.window-close {
    padding: 0;
    cursor: pointer;
}

.window-close:hover {
    background: #f38ba8;
}

.window-close:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 3px;
}

.terminal-bar span:nth-child(2) {
    background: var(--secondary-color);
}

.terminal-bar span:nth-child(3) {
    background: var(--primary-color);
}

.terminal-bar p {
    margin: 0 0 0 0.45rem;
    overflow: hidden;
    color: var(--muted-color);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terminal-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 190, 254, 0.42) transparent;
}

.prompt-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-height: 1.45rem;
    margin-bottom: 0.9rem;
    color: var(--primary-color);
    font-size: 0.86rem;
    line-height: 1.45;
}

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

.cursor {
    width: 0.55rem;
    height: 1.05rem;
    align-self: center;
    background: var(--secondary-color);
    animation: blink 1s step-start infinite;
}

.window-output {
    animation: output-panel 220ms ease-out both;
}

.window-output p {
    margin: 0.55rem 0 0;
    color: var(--primary-color);
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.eyebrow,
.tree-root,
.meta,
.branch {
    color: var(--accent-color) !important;
    font-size: 0.78rem !important;
}

h1,
h2 {
    margin: 0;
    color: var(--secondary-color);
    letter-spacing: 0;
}

h1 {
    color: var(--accent-color);
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1;
}

h2 {
    font-size: 1rem;
    line-height: 1.35;
}

.profile-layout {
    display: grid;
    grid-template-columns: clamp(5.5rem, 18%, 8rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.profile-picture {
    width: min(100%, 8rem);
    aspect-ratio: 1;
    border: 1px solid var(--terminal-border);
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0.5rem 0.5rem 0 rgba(191, 154, 202, 0.16);
}

.terminal-links,
.skill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.terminal-links a,
.skill-grid span {
    border: 1px solid var(--terminal-border);
    border-radius: 6px;
    padding: 0.45rem 0.62rem;
    background: rgba(24, 25, 38, 0.78);
    color: var(--secondary-color);
    font-size: 0.8rem;
    cursor: pointer;
}

.terminal-links a::before {
    content: "./";
    color: var(--accent-color);
}

.terminal-links a:hover {
    color: var(--accent-color);
    border-color: rgba(191, 154, 202, 0.6);
}

.project-grid,
.git-log {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

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

.project-grid article,
.git-log article {
    border-left: 3px solid rgba(191, 154, 202, 0.7);
    border-radius: 0 6px 6px 0;
    padding: 0.65rem 0.75rem;
    background: rgba(24, 25, 38, 0.66);
}

.project-grid p,
.git-log p {
    font-size: 0.82rem;
}

.commit-hash {
    color: var(--secondary-color);
}

.branch {
    margin: 0 0.45rem;
}

.commit-body {
    margin-left: 1.15rem !important;
    color: var(--muted-color) !important;
}

.contact-output {
    display: grid;
    gap: 1rem;
}

.ping-lines {
    display: grid;
    gap: 0.1rem;
}

.ping-lines p,
.mail-command p {
    margin: 0;
    font-size: 0.82rem;
}

.mail-command {
    border-top: 1px dashed rgba(180, 190, 254, 0.24);
    padding-top: 0.75rem;
}

.desktop-taskbar {
    position: fixed;
    right: 0;
    bottom: 1.72rem;
    left: 0;
    z-index: 999;
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.45rem 1rem;
    box-sizing: border-box;
    border-top: 1px solid rgba(180, 190, 254, 0.16);
    background: rgba(24, 25, 38, 0.9);
    backdrop-filter: blur(12px);
    animation: taskbar-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both;
}

.desktop-taskbar button {
    min-width: 6.2rem;
    border: 1px solid var(--terminal-border);
    border-radius: 6px;
    padding: 0.52rem 0.7rem;
    background: rgba(30, 32, 48, 0.96);
    color: var(--primary-color);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.desktop-taskbar button:hover,
.desktop-taskbar button:focus-visible,
.desktop-taskbar .active-taskbar-item {
    border-color: rgba(191, 154, 202, 0.72);
    color: var(--secondary-color);
    box-shadow: inset 0 -2px 0 var(--accent-color);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes output-panel {
    from {
        opacity: 0;
        transform: translateY(0.4rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes window-pop {
    from {
        opacity: 0;
        transform: translateY(1.25rem) scale(0.92);
    }
}

@keyframes taskbar-enter {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    html {
        scroll-snap-type: y mandatory;
    }

    .desktop-terminal-stage {
        display: none;
    }

    .desktop-taskbar {
        display: none;
    }

    .mobile-terminal-stage {
        position: fixed;
        inset: 3.65rem 0.75rem 2.55rem;
        z-index: 5;
        display: grid;
        align-items: center;
        pointer-events: none;
    }

    .mobile-terminal-window {
        position: relative;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        max-height: calc(100dvh - 7rem);
        overflow: hidden;
        cursor: default;
        opacity: 1;
        transform: none;
        transition:
            height 280ms cubic-bezier(0.22, 1, 0.36, 1),
            border-color 180ms ease,
            box-shadow 180ms ease,
            opacity 180ms ease,
            transform 180ms ease;
        pointer-events: auto;
    }

    .mobile-terminal-window .terminal-body {
        overflow: auto;
        max-height: calc(100dvh - 9.5rem);
        cursor: default;
        scrollbar-width: thin;
        scrollbar-color: rgba(180, 190, 254, 0.42) transparent;
    }

    .mobile-window-output {
        animation: mobile-output-panel 260ms ease-out both;
    }
}

@media (max-width: 560px) {
    .mobile-terminal-stage {
        inset: 3.55rem 0.65rem 2.45rem;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-picture {
        width: 5.5rem;
    }

    .terminal-bar p,
    .prompt-line,
    .window-output p {
        font-size: 0.76rem;
    }
}

@keyframes mobile-output-panel {
    from {
        opacity: 0;
        transform: translateY(0.55rem) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
