/* Base color variables */
:root {
    --color-bg: #0a0a0a;
    --color-text: #33ff33;
    --page-padding: 20px;
    
    /* OPTIMIZED: High-intensity core + balanced edge glow (CPU Friendly) */
    --crt-glow: 
        0 0 2px rgba(255, 255, 255, 0.95),   
        0 0 9px rgba(51, 255, 51, 0.75);
}

    html {
        background-color: var(--color-bg);
        min-height: 100%;
        overflow-y: auto;
    }

@media (min-width: 601px) {
    @supports (scrollbar-width: thin) and (not selector(::-webkit-scrollbar)) {
        html {
            scrollbar-color: rgba(51, 255, 51, 0.45) var(--color-bg);
            scrollbar-width: thin;
        }
    }
}

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Courier New', Courier, monospace;
        padding: var(--page-padding);
    margin: 0;
    min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
    overflow-y: auto;
}

.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

@media (min-width: 601px) {
html::-webkit-scrollbar {
    width: 12px;
}

html::-webkit-scrollbar-track {
    background: repeating-linear-gradient(
        to bottom,
        rgba(51, 255, 51, 0.04) 0,
        rgba(51, 255, 51, 0.04) 2px,
        rgba(0, 0, 0, 0.25) 2px,
        rgba(0, 0, 0, 0.25) 4px
    );
    border-left: 1px solid rgba(51, 255, 51, 0.22);
}

html::-webkit-scrollbar-thumb {
    background-color: rgba(51, 255, 51, 0.45);
    border: 3px solid var(--color-bg);
    border-radius: 0;
    box-shadow:
        0 0 2px rgba(255, 255, 255, 0.35),
        0 0 8px rgba(51, 255, 51, 0.55),
        0 0 16px rgba(51, 255, 51, 0.2);
    filter: blur(0.6px);
}

html::-webkit-scrollbar-thumb:hover {
    background-color: rgba(138, 255, 138, 0.62);
}

html::-webkit-scrollbar-corner {
    background-color: var(--color-bg);
}
}

@media (max-width: 480px), (pointer: coarse) and (hover: none) {
    body {
        overflow: clip;
    }
}

/* ── CRT screen overlays (pure CSS, no JS) ── */

/* Scanlines: faint horizontal lines across the whole viewport. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.14) 3px,
        rgba(0, 0, 0, 0.14) 3px
    );
    /* Force onto its own GPU layer */
    will-change: transform;
    transform: translateZ(0);
}

/* Vignette: darkened edges like the curved glass of a CRT tube. */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 55%,
        rgba(0, 0, 0, 0.55) 100
    );
    /* Force onto its own GPU layer */
    will-change: transform;
    transform: translateZ(0);
}

@keyframes crt-flicker {
    0%   { opacity: 0.97; }
    50%  { opacity: 1; }
    100% { opacity: 0.97; }
}

#terminal {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - (var(--page-padding) * 2));
    min-height: calc(100dvh - (var(--page-padding) * 2));
    overflow-x: clip;
    overflow-y: visible;
    width: 100%;
    min-width: 0;
    max-width: 800px;
    margin: 0 auto;

    /* PERFORMANCE FIX: Apply text-shadow ONLY to the terminal text container */
    text-shadow: var(--crt-glow);

    /* EXTRA DRAMA: Ambient background glow behind text that doesn't cause lag */
    background: radial-gradient(circle at center, rgba(51, 255, 51, 0.05) 0%, transparent 70%);

    /* PERFORMANCE FIX: Restrict the flicker animation to the terminal content */
    animation: crt-flicker 0.15s infinite;
    
    /* HARDWARE ACCELERATION: Offloads rendering math to your GPU */
    will-change: transform, opacity;
    transform: translateZ(0);
}

#session {
    margin-top: auto;
    min-width: 0;
}

#output {
    min-width: 0;
    white-space: pre-wrap;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.input-line {
    display: flex;
    min-width: 0;
    line-height: 1.4;
    animation: appear 0.001s steps(1, end) 5s backwards;
}

.prompt {
    color: var(--color-text);
    flex: 0 0 auto;
    margin-right: 10px;
    margin-top: 2px;
}

#output a {
    color: var(--color-text);
    text-decoration: underline;
    overflow-wrap: anywhere;
}

#output a:hover {
    color: var(--color-text);
}

.contact-list {
    display: grid;
    gap: 0.35em;
    min-width: 0;
    padding-left: 1ch;
}

.contact-line {
    column-gap: 1ch;
    display: grid;
    grid-template-columns: 9ch minmax(0, 1fr);
    line-height: 1.4;
    min-width: 0;
}

.contact-label {
    white-space: nowrap;
}

.contact-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.help-line {
    display: grid;
    grid-template-columns: 16ch minmax(0, 1fr);
    column-gap: 2.5ch;
    line-height: 1.4;
}

.help-line + .help-line {
    margin-top: 0.35em;
}

.help-command {
    display: block;
    overflow-wrap: anywhere;
}

.help-description {
    min-width: 0;
    overflow-wrap: anywhere;
}

.qualification-list {
    display: grid;
    gap: 1.25em;
    min-width: 0;
}

.qualification-entry {
    min-width: 0;
}

.qualification-school {
    margin-bottom: 0.3em;
}

.qualification-line {
    column-gap: 1ch;
    display: grid;
    grid-template-columns: 7ch minmax(0, 1fr);
    line-height: 1.4;
    min-width: 0;
}

.qualification-label {
    white-space: nowrap;
}

.qualification-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.section-divider {
    width: 100%;
    height: 1.4em;
    border-top: 2px solid var(--color-text);
}

.section-divider-compact {
    height: 0.75em;
}

.section-heading {
    overflow-wrap: normal;
    white-space: normal;
}

.section-heading-tail {
    white-space: nowrap;
}

.org-header {
    line-height: 1.4;
}

.org-meta-line {
    column-gap: 1ch;
    display: grid;
    grid-template-columns: 9ch minmax(0, 1fr);
    min-width: 0;
}

.org-meta-line + .org-meta-line {
    margin-top: 0.1em;
}

.org-label {
    white-space: nowrap;
}

.org-tenure {
    white-space: nowrap;
}

.org-location {
    min-width: 0;
}

.org-roles {
    display: grid;
    gap: 0.35em;
    margin-top: 0.65em;
}

.org-divider {
    border-top: 2px dashed var(--color-text);
    height: 0;
    margin: 0.75em 0 1.25em;
    width: 100%;
}

.role-title,
.role-dates,
.org-location,
.description-text {
    overflow-wrap: anywhere;
}

.role-title {
    padding-left: 2ch;
}

.role-dates {
    padding-left: 2ch;
}

.description-text {
    padding-left: 2ch;
    white-space: pre-wrap;
}

/* Decorative Matrix-style code stream rendered by the `matrix` command. */
.matrix-rain {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75ch;
    height: 12em;
    margin: 1em 0;
    overflow: hidden;
    padding: 0 1ch;
    position: relative;
}

.matrix-rain::after {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 72%,
        var(--color-bg) 100%
    );
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.matrix-column {
    animation: matrix-fall var(--matrix-duration, 2.8s) linear infinite;
    animation-delay: var(--matrix-delay);
    display: block;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
    opacity: var(--matrix-opacity, 0.8);
    text-align: center;
    white-space: pre;
}

@keyframes matrix-fall {
    from {
        transform: translateY(-115%);
    }
    to {
        transform: translateY(95%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .matrix-column {
        animation: none;
    }
}

/* Interactive `exp` menu rows. The highlighted row is drawn in reverse
   video (green background, dark text) like a classic terminal selection. */
#exp-menu {
    display: grid;
    gap: 0.35em;
    padding-bottom: 0.75em;
}

#exp-menu .menu-item {
    background: transparent;
    color: inherit;
    display: grid;
    font: inherit;
    grid-template-columns: 1.5ch minmax(0, 1fr) 18ch;
    column-gap: 1ch;
    line-height: 1.4;
    min-height: 1.4em;
    overflow-wrap: anywhere;
    padding: 0.25em 0.5em;
    text-align: left;
    text-shadow: var(--crt-glow);
    white-space: normal;
    width: 100%;
}

#exp-menu .menu-company {
    min-width: 0;
}

#exp-menu .menu-tenure {
    text-align: left;
    white-space: nowrap;
}

#exp-menu .menu-selected {
    background-color: var(--color-text);
    color: var(--color-bg);
}

#command-input {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    outline: none;
    flex-grow: 1;
    min-width: 0;
    width: 0;
    text-shadow: var(--crt-glow);
    caret-shape: block;
}

.logo {
    font-size: 0.6em;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: pre;
}

/* ── intro animations ── */

@keyframes appear {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes type-in {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes welcome-in {
    0%   { display: none; width: 0; }
    1%   { display: inline-block; width: 0; }
    100% { display: inline-block; width: 100%; }
}

@keyframes reboot-appear {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes reboot-welcome-in {
    0%   { display: none; width: 0; }
    1%   { display: inline-block; width: 0; }
    100% { display: inline-block; width: 100%; }
}

/* logos fade in together */
#logo-1,
#logo-2 {
    animation: appear 0.6s steps(1, end) 2.7s both;
    text-shadow: var(--crt-glow);
}

.welcome-line {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: welcome-in 1s steps(71, end) 3.9s backwards;
}

@keyframes reboot-boot-reveal {
    from { height: 0; }
    to   { height: 22.4em; }
}

@keyframes reboot-boot-reveal-mobile {
    from { height: 0; }
    to   { height: 100%; }
}

@keyframes reboot-boot-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes reboot-session-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#boot {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--color-text);
    max-width: 100%;
    white-space: pre;
    line-height: 1.4;
    height: 0;
    overflow: hidden;
    animation:
        boot-reveal 2.2s steps(16, end) forwards,
        boot-out 0s ease 2.3s forwards;
}

#boot[data-rebooting="true"] {
    animation:
        reboot-boot-reveal 2.2s steps(16, end) forwards,
        reboot-boot-out 0s ease 2.3s forwards;
}

#session[data-rebooting="true"] {
    animation: reboot-session-in 0.1s steps(1, end) 2.5s both;
}

#session[data-rebooting="true"] .input-line {
    animation: reboot-appear 0.001s steps(1, end) 5s backwards;
}

#logo-1[data-rebooting="true"],
#logo-2[data-rebooting="true"] {
    animation: reboot-appear 0.6s steps(1, end) 2.7s both;
}

.welcome-line[data-rebooting="true"] {
    animation: reboot-welcome-in 1s steps(71, end) 3.9s backwards;
}

#boot[data-reboot-reset="true"],
#session[data-reboot-reset="true"],
#session[data-reboot-reset="true"] .input-line,
#logo-1[data-reboot-reset="true"],
#logo-2[data-reboot-reset="true"],
.welcome-line[data-reboot-reset="true"] {
    animation: none !important;
}

@keyframes boot-reveal {
    to { height: 22.4em; }
}

@keyframes boot-reveal-mobile {
    to { height: 100%; }
}

@keyframes boot-out {
    to { opacity: 0; }
}

@media (max-width: 600px) {
    :root {
        --page-padding: 12px;
    }

    #session {
        margin-top: 0;
    }

    #boot {
        width: 100%;
        font-size: 0.78em;
        line-height: 1.25;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        animation-name: boot-reveal-mobile, boot-out;
    }

    #boot[data-rebooting="true"] {
        animation-name: reboot-boot-reveal-mobile, reboot-boot-out;
    }

    .logo {
        font-size: clamp(4.9px, 1.55vw, 6px);
        line-height: 1.1;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        transform: none;
    }

    #output {
        font-size: 18px;
        line-height: 1.45;
    }

    .input-line {
        font-size: 18px;
        line-height: 1.45;
    }

    .prompt {
        margin-right: 6px;
    }

    .welcome-line {
        white-space: normal;
        overflow: visible;
        animation: appear 0.6s steps(1, end) 3.9s backwards;
    }

    #exp-menu .menu-item {
        grid-template-columns: 1.5ch minmax(0, 1fr);
        padding-block: 0.45em;
        row-gap: 0.1em;
    }

    #exp-menu .menu-tenure {
        grid-column: 2;
        text-align: left;
        white-space: normal;
    }

    .help-command {
        width: auto;
    }

    .help-line {
        grid-template-columns: 9ch minmax(0, 1fr);
    }
}
