:root {
    --green: #00ff41;
    --black: #000000;
    --gap: clamp(16px, 5vw, 80px);
    --green-dim: #00b32c;
}

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

html, body {
    height: 100%; 
}

body {
    background: var(--black);
    color: var(--green);
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.6;
    padding: var(--gap);
}

.box {
    background: var(--black);
    border: 2px solid var(--green);
    padding: 20px;
}

a {
    color: var(--green);
}

.wrap {
    min-height: calc(100vh - 2 * var(--gap));
    display: grid;
    grid-template-columns: minmax(260px, 24%) 1fr minmax(240px, 28%);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "photo info projects"
        "photo certs projects"
        "links links links";
    gap: 16px;
}

.photo-box { 
    grid-area: photo; 
    align-self: start;
}

.info-box { 
    grid-area: info; 
}

.links-box { 
    grid-area: links; 
}

.projects-box {
    grid-area: projects;
}

.links-box,
.certs-box,
.projects-box {
    display: flex;
    flex-direction: column;
}

#rain {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.wrap {
    position: relative;
    z-index: 1;
}

.whoami {
    margin-top: 6px;
    font-size: 0.95rem;
    color: var(--green-dim);
    min-height: 1.6em;
}

.cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--green);
    vertical-align: -0.15em;
    margin-left: 3px;
    animation: blink 1s steps(1) infinite;
}

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

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

.links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    background: var(--green);
    color: var(--black);
    text-decoration: none;
    border: 2px solid var(--green);
    transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.link svg {
    width: 26px;
    height: 26px;
    flex: none;
    fill: currentColor;
}

.link-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.link-name {
    font-weight: 700;
    font-size: 1rem;
}

.link-user {
    font-weight: 400;
    font-size: 0.8rem;
}

.link:hover,
.link:focus-visible {
    background: var(--black);
    color: var(--green);
    transform: translateY(-3px);
    box-shadow: 0 6px 0 var(--green-dim), 0 0 26px rgba(0, 255, 65, 0.45);
    outline: none;
}

.photo-slot {
    overflow: hidden;
}

.photo-slot img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    filter: grayscale(1) contrast(1.15) brightness(0.9) sepia(1) hue-rotate(65deg) saturate(3);
}

.photo-slot:hover img {
    filter: none;
}

.name {
    position: relative;
    display: inline-block;
    cursor: default;
    animation: jitter 3s steps(1) infinite;
}

.name::before,
.name::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    animation: ghost 3s steps(1) infinite;
}

.name::before {
    color: #00ffd5;
    transform: translate(-3px, 0);
    clip-path: inset(0 0 55% 0);
}

.name::after {
    color: #b8ff00;
    transform: translate(3px, 0);
    clip-path: inset(50% 0 0 0);
}

.name.glitch {
    animation: jitter 0.35s steps(2) 1;
}

.name.glitch::before,
.name.glitch::after {
    opacity: 0.85;
}

@keyframes jitter {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0, 0); }
}

@keyframes ghost {
    0%, 88%, 100% { opacity: 0; }
    90%, 96% { opacity: 0.85; }
}

@media (max-width: 860px) {
    .wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
        grid-template-areas: 
            "photo"
            "info"
            "certs"
            "projects"
            "links";
    }

    .photo-box {
        max-width: 340px;
        width: 100%;
        justify-self: center;
    }

    .link {
        display: block;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .box {
        padding: 14px;
    }

    .name {
        font-size: clamp(2rem, 10vw, 3rem);
    }
}

@media (hover: none) {
    .photo-slot img {
        filter: none;
    }
}

@media (max-width: 1100px) and (min-width: 481px) {
    .wrap {
        grid-template-columns: minmax(180px, 34%) 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "photo info"
            "links certs"
            "projects projects"
            ".     certs";
        align-items: start;
    }

    .photo-box {
        max-width: 340px;
        justify-self: center;
    }

    .links-box {
        display: flex;
        flex-direction: column;
    }

    .info-box {
        align-self: stretch;
    }

    .links {
        flex-direction: column;
    }

    .link {
        width: 100%;
    }
}
