/* --- Draggable window shell --- */
.draggable-window {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 400px;
    border: 4px solid var(--ink-black);
    background-color: transparent;
    overflow: visible;
}

.draggable-window::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    width: 100%;
    height: 100%;
    background-color: var(--hot-pink);
    mix-blend-mode: multiply;
    z-index: 0;
    pointer-events: none;
}

.window-inner {
    position: relative;
    z-index: 1;
    background-color: var(--bg-bone);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.window-header {
    z-index: 50;
    background-color: var(--acid-green);
    border-bottom: 4px solid var(--ink-black);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(17, 17, 17, 0.1) 10px,
        rgba(17, 17, 17, 0.1) 20px
    );
    cursor: grab;
    user-select: none;
}

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

.window-title {
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

.ctrl-btn {
    width: 24px;
    height: 24px;
    border: 2px solid var(--ink-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    background-color: var(--bg-bone);
}

.ctrl-btn:hover {
    background-color: var(--ink-black);
    color: var(--bg-bone);
}

.window-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.warning-text {
    font-weight: bold;
    color: var(--hot-pink);
    border-left: 4px solid var(--hot-pink);
    padding-left: 1rem;
    animation: blink 2s infinite;
}

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

    50% {
        opacity: 0.5;
    }
}

.data-readout {
    font-size: 0.85rem;
    line-height: 1.5;
}

#punkWindow {
    width: 540px;
}

.btn-brutal {
    background-color: var(--ink-black);
    color: var(--acid-green);
    border: none;
    padding: 1rem;
    font-family: var(--font-tech);
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px var(--tech-blue);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-brutal:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--tech-blue);
}

a.btn-brutal {
    display: inline-block;
    text-decoration: none;
    color: var(--acid-green);
}

/* --- GitHub window (flat layout; chart via ghchart.rshah.org) --- */
.window-content--github {
    flex: 1;
    min-height: 0;
    padding: 1rem 1.1rem 1.1rem;
    gap: 0.85rem;
}

.github-profile-cta {
    flex-shrink: 0;
    text-align: center;
    width: 100%;
}

.github-profile-scroll {
    flex: 1;
    min-height: 0;
    max-height: min(52vh, 460px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    user-select: text;
    -webkit-user-select: text;
}

.github-profile-root {
    padding: 0;
}

.github-profile-status {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.35rem 0;
}

.github-profile-status--error {
    color: var(--hot-pink);
    border-left: 3px solid var(--hot-pink);
    padding-left: 0.75rem;
}

.github-profile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.github-profile-top {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.github-profile-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border: 2px solid var(--ink-black);
    object-fit: cover;
    display: block;
}

.github-profile-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.github-profile-name {
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.github-profile-login {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink-black);
    opacity: 0.72;
}

.github-profile-bio {
    font-size: 0.76rem;
    line-height: 1.45;
    margin-top: 0.1rem;
}

.github-profile-stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    margin: 0;
    padding: 0.65rem 0 0;
    border-top: 2px solid var(--ink-black);
    font-size: 0.72rem;
}

.github-profile-stats li {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.github-profile-stat-label {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
}

.github-profile-stat-value {
    font-weight: 800;
    color: var(--tech-blue);
}

.github-profile-orgs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--ink-black);
}

.github-profile-orgs-label {
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.github-profile-org-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.github-profile-org-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem 0.2rem 0.25rem;
    border: 2px solid var(--ink-black);
    background-color: var(--bg-bone);
    color: var(--ink-black);
    text-decoration: none;
    font-family: var(--font-tech);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    max-width: 100%;
}

.github-profile-org-badge:hover {
    color: var(--tech-blue);
}

.github-profile-org-badge-img {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1px solid var(--ink-black);
    object-fit: cover;
    display: block;
}

.github-profile-org-badge-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.github-profile-activity {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--ink-black);
}

.github-profile-activity-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
}

.github-profile-activity-label {
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.github-profile-year {
    font-family: var(--font-tech);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.45rem;
    border: 2px solid var(--ink-black);
    background-color: var(--bg-bone);
    color: var(--ink-black);
    cursor: pointer;
    user-select: auto;
    -webkit-user-select: auto;
}

.github-profile-year:focus {
    outline: none;
    /* Inset ring: outer outline + positive offset clips against overflow-x:hidden on scroll */
    box-shadow: inset 0 0 0 2px var(--tech-blue);
}

@media (forced-colors: active) {
    .github-profile-year:focus {
        outline: 2px solid ButtonText;
        outline-offset: -4px;
        box-shadow: none;
    }
}

.github-profile-chart {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.github-profile-chart-slot {
    min-height: 2.5rem;
}

.github-profile-chart-loading {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-black);
    opacity: 0.55;
    margin: 0;
}

.github-profile-chart-fallback {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hot-pink);
    margin: 0;
}

/* --- LinkedIn window (badge JSONP → custom layout) --- */
.window-content--linkedin {
    flex: 1;
    min-height: 0;
    padding: 1rem 1.1rem 1.1rem;
    gap: 0.85rem;
}

.linkedin-profile-cta {
    flex-shrink: 0;
    text-align: center;
    width: 100%;
}

.linkedin-profile-scroll {
    flex: 1;
    min-height: 0;
    max-height: min(52vh, 460px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    user-select: text;
    -webkit-user-select: text;
}

.linkedin-profile-root {
    padding: 0;
}

.linkedin-profile-status {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.35rem 0;
}

.linkedin-profile-status--error {
    color: var(--hot-pink);
    border-left: 3px solid var(--hot-pink);
    padding-left: 0.75rem;
}

.linkedin-profile {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.linkedin-profile-top {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.linkedin-profile-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border: 2px solid var(--ink-black);
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.linkedin-profile-avatar--placeholder {
    background:
        radial-gradient(circle at 50% 38%, #788fa5 0 32%, transparent 33%),
        linear-gradient(180deg, #9db3c8 0 62%, #56687a 62% 100%);
}

.linkedin-profile-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.linkedin-profile-name {
    font-weight: 800;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.15;
}

.linkedin-profile-headline {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.45;
}

.linkedin-profile-block {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.55rem;
    border-top: 2px solid var(--ink-black);
}

.linkedin-profile-block-label {
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.linkedin-profile-affiliation-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.linkedin-profile-affiliation-value {
    font-size: 0.76rem;
    line-height: 1.55;
}

.linkedin-profile-affiliation-link {
    color: var(--ink-black);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.linkedin-profile-affiliation-link:hover {
    color: #0a66c2;
}


marquee {
    background-color: var(--hot-pink);
    color: var(--ink-black);
    border-bottom: 4px solid var(--ink-black);
    padding: 0.75rem 0;
    overflow: hidden;
    white-space: nowrap;
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
    position: relative;
    z-index: 50;
    margin-bottom: -4px;
}

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

.btn-cursor {
    animation: blinker 1s step-start infinite;
}

.glitch-text {
    font-family: var(--font-loud);
    font-size: 3rem;
    line-height: 0.9;
    position: relative;
    color: var(--ink-black);
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-bone);
}

.glitch-text::before {
    left: 3px;
    text-shadow: -2px 0 var(--hot-pink);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -3px;
    text-shadow: -2px 0 var(--acid-green);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
    }

    80% {
        clip-path: inset(10% 0 70% 0);
    }

    100% {
        clip-path: inset(30% 0 40% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
    }

    40% {
        clip-path: inset(30% 0 20% 0);
    }

    60% {
        clip-path: inset(70% 0 10% 0);
    }

    80% {
        clip-path: inset(50% 0 30% 0);
    }

    100% {
        clip-path: inset(5% 0 80% 0);
    }
}

.data-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #333;
    padding-bottom: 0.5rem;
}

.data-list--settings .data-list__toggle {
    cursor: pointer;
    user-select: none;
}

.data-list--settings .data-list__toggle:hover {
    color: var(--hot-pink);
}

.data-list--settings .data-list__value {
    font-weight: bold;
}

/* --- whoami captcha + contact --- */
.window-content--whoami {
    padding: 1.5rem;
    gap: 1.25rem;
}

.whoami-captcha {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.whoami-captcha.is-complete {
    display: none;
}

.whoami-captcha__label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--hot-pink);
}

.whoami-captcha__hint {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink-black);
    opacity: 0.72;
}

.whoami-captcha__canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    cursor: crosshair;
    touch-action: none;
    background: var(--paper-color);
    border: 2px solid var(--ink-black);
    -webkit-tap-highlight-color: transparent;
}

.whoami-captcha__status {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    min-height: 1rem;
}

.whoami-contact {
    display: none;
}

.whoami-contact.is-revealed {
    display: flex;
}

.whoami-contact .whoami-contact__link {
    color: var(--ink-black);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid var(--acid-green);
    user-select: text;
    -webkit-user-select: text;
}

.whoami-contact .whoami-contact__link:hover {
    color: var(--hot-pink);
    border-bottom-color: var(--hot-pink);
}

.whoami-contact__value {
    font-weight: 800;
    user-select: text;
    -webkit-user-select: text;
}

@media (max-width: 768px) {
    /* Inline widths on some windows — !important so narrow viewports win */
    .draggable-window {
        width: min(400px, calc(100vw - 16px)) !important;
    }

    #punkWindow.draggable-window {
        width: min(540px, calc(100vw - 16px)) !important;
    }

    .window-header {
        padding: 0.45rem 0.65rem;
        gap: 0.5rem;
    }

    .window-title {
        flex: 1;
        min-width: 0;
        font-size: 0.78rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .window-content {
        padding: 1.15rem;
        gap: 1rem;
    }

    .glitch-text {
        font-size: 2rem;
    }

    .btn-brutal {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .data-list {
        gap: 1rem;
        font-size: 0.82rem;
    }

    .whoami-captcha__label,
    .whoami-captcha__hint,
    .whoami-captcha__status {
        font-size: 0.66rem;
    }

    /* GitHub window: wide on small screens — do not pin left/top (would block drag; !important beats inline) */
    #githubWindow.draggable-window {
        width: calc(100vw - 12px) !important;
        max-width: none;
        max-height: calc(100dvh - 56px);
        display: flex;
        flex-direction: column;
    }

    #githubWindow .window-inner {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    #githubWindow .window-content--github {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 0.75rem 0.6rem 0.85rem;
    }

    #githubWindow .github-profile-scroll {
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
    }

    #linkedinWindow.draggable-window {
        width: calc(100vw - 12px) !important;
        max-width: none;
        max-height: calc(100dvh - 56px);
        display: flex;
        flex-direction: column;
    }

    #linkedinWindow .window-inner {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    #linkedinWindow .window-content--linkedin {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 0.75rem 0.6rem 0.85rem;
    }

    #linkedinWindow .linkedin-profile-scroll {
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
    }
}
