@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=IBM+Plex+Sans+Arabic:wght@300;400;600&display=swap');

#entry-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #05050a;
    background-image:
        linear-gradient(rgba(42, 138, 138, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 138, 138, 0.015) 1px, transparent 1px);
    background-size: 8px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
}

#entry-screen.hidden {
    opacity: 0;
    filter: blur(12px);
    pointer-events: none;
}

.entry-content {
    text-align: center;
}

.entry-pixel-art {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2rem;
}

.px-dot {
    width: 8px;
    height: 8px;
    background: #2a8a8a;
    display: block;
    animation: dotBounce 1.2s ease infinite;
    animation-delay: calc(var(--d) * 0.15s);
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    40% {
        transform: translateY(-12px);
        opacity: 1;
    }
}

.entry-name {
    font-size: clamp(0.9rem, 3vw, 1.4rem);
    color: #c8c8d8;
    margin-bottom: 0.6rem;
    font-family: var(--font-arabic);
    font-weight: 900;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    text-rendering: optimizeSpeed;
    text-shadow:
        1px 0 0 currentColor,
        -1px 0 0 currentColor,
        0 1px 0 currentColor,
        0 -1px 0 currentColor,
        2px 2px 0 rgba(0, 0, 0, 0.6);
    letter-spacing: 3px;
    paint-order: stroke fill;
    -webkit-text-stroke: 0.5px currentColor;
}

.entry-sub {
    font-size: 0.4rem;
    color: #4a4a60;
    letter-spacing: 5px;
    margin-bottom: 2rem;
}

.loading-bar-wrap {
    width: 260px;
    height: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(42, 138, 138, 0.15);
    margin: 0 auto 0.8rem;
    padding: 2px;
    overflow: hidden;
}

.loading-blocks {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 100%;
}

.loading-block {
    height: 100%;
    flex: 1;
    background: #2a8a8a;
    opacity: 0;
    transition: opacity 0.15s;
}

.loading-block.filled {
    opacity: 1;
    box-shadow: 0 0 4px rgba(42, 138, 138, 0.4);
}

.loading-pct {
    font-size: 0.38rem;
    color: #4a4a60;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.entry-cta {
    font-size: 0.5rem;
    color: #2a8a8a;
    letter-spacing: 4px;
    animation: pressStart 1s steps(2) infinite;
}

@keyframes pressStart {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.pixel-avatar {
    transition: box-shadow 0.1s ease, transform 0.1s ease;
}

#type-name,
#type-title {
    min-height: 1.2em;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-arabic);
    cursor: none;
    user-select: none;
}

::selection {
    background: var(--accent-teal);
    color: var(--bg-primary);
}

::-webkit-scrollbar {
    display: none;
}

#cursor-tracker {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-teal);
    pointer-events: none;
    z-index: 10001;
    transition: transform 0.08s, width 0.2s, height 0.2s, background 0.2s;
    animation: cursorPulse 2s ease infinite;
}

#cursor-tracker.hovering {
    width: 18px;
    height: 18px;
    background: var(--accent-purple);
}

#viewport {
    width: 100%;
    height: 100vh;
    perspective: var(--perspective);
    position: relative;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.station {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
    transform: translateZ(-500px) rotateX(20deg);
    will-change: transform, opacity, filter;
    filter: blur(6px);
}

.station.active {
    opacity: 1;
    pointer-events: all;
    transform: translateZ(0) rotateX(0);
    filter: blur(0);
}

.station.exit-up {
    opacity: 0;
    transform: translateZ(-800px) rotateX(-30deg) translateY(-60px);
    filter: blur(8px);
}

.station.exit-down {
    opacity: 0;
    transform: translateZ(-800px) rotateX(30deg) translateY(60px);
    filter: blur(8px);
}

.station-content {
    text-align: center;
    max-width: 900px;
    padding: 2rem;
    width: 100%;
}

#station-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 1000;
}

#station-nav .dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    cursor: pointer;
    transition: all var(--speed-fast);
    opacity: 0.3;
}

#station-nav .dot.active {
    background: var(--accent-teal);
    height: 22px;
    opacity: 1;
    box-shadow: 0 0 12px rgba(42, 138, 138, 0.4);
}

#station-nav .dot:hover {
    opacity: 0.8;
    background: var(--accent-teal);
}

#greeting-text {
    font-size: clamp(2rem, 6vw, 4.5rem);
    color: var(--text-accent);
    font-family: var(--font-pixel);
    line-height: 1.5;
    min-height: 1.5em;
    direction: ltr;
}

#greeting-text.glitching {
    animation: glitchText 0.12s steps(2) infinite;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    opacity: 0.4;
    animation: bounceArrow 2s ease infinite;
}

.scroll-hint svg {
    display: block;
    margin: 0.5rem auto 0;
    opacity: 0.5;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.pixel-avatar {
    width: 150px;
    height: 150px;
    border: 3px solid var(--accent-teal);
    padding: 3px;
    background: var(--bg-secondary);
    transition: transform var(--speed-fast), border-color var(--speed-fast);
}

.pixel-avatar:hover {
    transform: scale(1.06);
    border-color: var(--accent-purple);
}

.avatar-scanline {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.avatar-scanline::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 30%;
    background: linear-gradient(transparent, rgba(42, 138, 138, 0.06), transparent);
    animation: scanMove 3s linear infinite;
}

#about .name-ar,
#about .name-en,
#about .title-en {
    opacity: 0;
}

#about.active .name-ar {
    animation: fadeSlideUp 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#about.active .name-en {
    animation: fadeSlideUp 0.9s 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#about.active .title-en {
    animation: fadeSlideUp 0.9s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.name-ar {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: var(--font-arabic);
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 0.3rem;
}

.name-en {
    font-size: clamp(0.55rem, 1.4vw, 0.8rem);
    font-family: var(--font-pixel);
    color: var(--accent-teal);
    margin-bottom: 1.8rem;
    letter-spacing: 4px;
}

.title-en {
    font-size: clamp(0.45rem, 1.1vw, 0.6rem);
    font-family: var(--font-pixel);
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "personal public public"
        "private poetry poetry"
        "insta insta snap";
    gap: 1.2rem;
    max-width: 780px;
    margin: 0 auto;
    padding: 1rem;
}

.link-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid rgba(200, 200, 220, 0.05);
    padding: 1.4rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--speed-fast) var(--ease-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    overflow: hidden;
    min-height: 130px;
    justify-content: center;
}

.link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.015));
    pointer-events: none;
}

.link-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    transform: scaleX(0);
    transition: transform var(--speed-fast);
}

.link-card:hover::after {
    transform: scaleX(1);
}

.link-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(200, 200, 220, 0.1);
}

.link-card .card-icon {
    width: 34px;
    height: 34px;
    transition: transform var(--speed-fast);
}

.link-card:hover .card-icon {
    transform: scale(1.15);
}

.link-card .card-label {
    font-family: var(--font-arabic);
    font-size: 0.82rem;
    font-weight: 400;
}

.link-card .card-handle {
    font-family: var(--font-pixel);
    font-size: 0.42rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.card-personal {
    grid-area: personal;
    border-color: rgba(58, 106, 154, 0.12);
}

.card-personal:hover {
    box-shadow: 0 8px 30px rgba(58, 106, 154, 0.12), inset 0 0 25px rgba(58, 106, 154, 0.04);
    border-color: rgba(58, 106, 154, 0.25);
}

.card-personal::after {
    background: var(--accent-blue);
}

.card-personal .card-icon {
    color: var(--accent-blue);
}

.card-public {
    grid-area: public;
    border-color: rgba(42, 138, 138, 0.12);
    flex-direction: row;
    justify-content: center;
    gap: 1.2rem;
}

.card-public:hover {
    box-shadow: 0 8px 30px rgba(42, 138, 138, 0.12), inset 0 0 25px rgba(42, 138, 138, 0.04);
    border-color: rgba(42, 138, 138, 0.25);
}

.card-public::after {
    background: var(--accent-teal);
}

.card-public .card-icon {
    color: var(--accent-teal);
}

.card-private {
    grid-area: private;
    border-color: rgba(106, 74, 154, 0.12);
    border-style: dashed;
}

.card-private:hover {
    box-shadow: 0 8px 30px rgba(106, 74, 154, 0.12), inset 0 0 25px rgba(106, 74, 154, 0.04);
    border-color: rgba(106, 74, 154, 0.25);
}

.card-private::after {
    background: var(--accent-purple);
}

.card-private .card-icon {
    color: var(--accent-purple);
}

.private-icon-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.private-lock {
    position: absolute;
    right: -10px;
    bottom: -6px;
    width: 16px;
    height: 16px;
    color: var(--accent-purple);
    filter: drop-shadow(0 0 4px rgba(106, 74, 154, 0.5));
}

.card-poetry {
    grid-area: poetry;
    border-color: rgba(154, 122, 58, 0.12);
    flex-direction: row;
    justify-content: center;
    gap: 1.2rem;
    border-width: 2px;
    border-image: linear-gradient(180deg, rgba(154, 122, 58, 0.2), rgba(154, 122, 58, 0.05)) 1;
}

.card-poetry:hover {
    box-shadow: 0 8px 30px rgba(154, 122, 58, 0.12), inset 0 0 25px rgba(154, 122, 58, 0.04);
}

.card-poetry::after {
    background: var(--accent-amber);
}

.card-poetry .card-icon {
    color: var(--accent-amber);
}

.card-insta {
    grid-area: insta;
    border-width: 2px;
    border-style: solid;
    border-image: linear-gradient(135deg, rgba(154, 58, 106, 0.25), rgba(200, 168, 50, 0.25)) 1;
}

.card-insta:hover {
    box-shadow: 0 8px 30px rgba(154, 58, 106, 0.12), inset 0 0 25px rgba(154, 58, 106, 0.04);
}

.card-insta::after {
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-yellow));
}

.card-insta .card-icon {
    color: var(--accent-pink);
}

.card-snap {
    grid-area: snap;
    border-color: rgba(200, 168, 50, 0.12);
}

.card-snap:hover {
    box-shadow: 0 8px 30px rgba(200, 168, 50, 0.12), inset 0 0 25px rgba(200, 168, 50, 0.04);
    border-color: rgba(200, 168, 50, 0.25);
}

.card-snap::after {
    background: var(--accent-yellow);
}

.card-snap .card-icon {
    color: var(--accent-yellow);
}

#links .link-card {
    opacity: 0;
    transform: translateY(35px);
}

#links.active .link-card {
    animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#links.active .card-personal {
    animation-delay: 0.08s;
}

#links.active .card-public {
    animation-delay: 0.18s;
}

#links.active .card-private {
    animation-delay: 0.28s;
}

#links.active .card-poetry {
    animation-delay: 0.38s;
}

#links.active .card-insta {
    animation-delay: 0.48s;
}

#links.active .card-snap {
    animation-delay: 0.58s;
}

#footer .station-content {
    opacity: 0.6;
}

#footer .footer-quote,
#footer .footer-line,
#footer .tech-stack,
#footer .stats-row,
#footer .footer-contact {
    opacity: 0;
}

#footer.active .footer-quote {
    animation: fadeSlideUp 1s 0.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#footer.active .footer-line {
    animation: fadeSlideUp 1s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#footer.active .tech-stack {
    animation: fadeSlideUp 1s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#footer.active .stats-row {
    animation: fadeSlideUp 1s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#footer.active .footer-contact {
    animation: fadeSlideUp 1s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.footer-quote {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 2.2;
    letter-spacing: 1px;
}

.footer-line {
    width: 40px;
    height: 2px;
    background: var(--accent-teal);
    margin: 0 auto 1.5rem;
    opacity: 0.4;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.tech-tag {
    font-family: var(--font-pixel);
    font-size: 0.38rem;
    color: var(--accent-teal);
    border: 1px solid rgba(42, 138, 138, 0.2);
    padding: 6px 12px;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.tech-tag:hover {
    border-color: rgba(42, 138, 138, 0.5);
    background: rgba(42, 138, 138, 0.06);
    box-shadow: 0 0 12px rgba(42, 138, 138, 0.1);
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.stat-num {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--text-accent);
}

.stat-label {
    font-family: var(--font-pixel);
    font-size: 0.3rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(200, 200, 220, 0.08);
}

.footer-contact {
    font-family: var(--font-pixel);
    font-size: 0.42rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.footer-contact a {
    color: var(--accent-teal);
    text-decoration: none;
    transition: color var(--speed-fast);
}

.footer-contact a:hover {
    color: var(--text-accent);
}

@media (max-width: 768px) {
    .links-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "personal public"
            "private poetry"
            "insta snap";
        gap: 0.8rem;
    }

    .card-public,
    .card-poetry {
        flex-direction: column;
    }

    #station-nav {
        right: 0.8rem;
    }

    .pixel-avatar {
        width: 110px;
        height: 110px;
    }

    #cursor-tracker {
        display: none;
    }

    html,
    body {
        cursor: auto;
    }

    .scroll-hint {
        bottom: 2rem;
    }

    .loading-bar-wrap {
        width: 200px;
        height: 14px;
    }

    .entry-name {
        font-size: 1rem;
    }

    .entry-sub {
        font-size: 0.35rem;
        letter-spacing: 3px;
    }

    .loading-pct {
        font-size: 0.33rem;
    }

    .entry-cta {
        font-size: 0.42rem;
    }

    h1 {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    .name-ar {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .name-en {
        font-size: 0.45rem;
    }

    .title-en {
        font-size: 0.35rem;
    }

    .footer-quote {
        font-size: 0.4rem;
        line-height: 2;
    }

    .tech-stack {
        gap: 0.4rem;
    }

    .tech-tag {
        font-size: 0.3rem;
        padding: 4px 8px;
    }

    .stats-row {
        gap: 1rem;
    }

    .stat-num {
        font-size: 0.55rem;
    }

    .stat-label {
        font-size: 0.25rem;
    }

    .footer-contact {
        font-size: 0.35rem;
    }

    #music-toggle {
        bottom: 1rem;
        left: 1rem;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .station {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4rem 0;
    }

    .links-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "personal"
            "public"
            "private"
            "poetry"
            "insta"
            "snap";
        gap: 0.8rem;
    }

    .station-content {
        padding: 1rem;
    }

    .pixel-avatar {
        width: 90px;
        height: 90px;
    }

    .loading-bar-wrap {
        width: 180px;
        height: 12px;
    }

    .entry-name {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }

    .name-ar {
        font-size: 1.2rem;
    }

    .name-en {
        font-size: 0.4rem;
        letter-spacing: 3px;
    }

    .title-en {
        font-size: 0.3rem;
        letter-spacing: 1px;
    }

    .stats-row {
        flex-direction: column;
        gap: 1.2rem;
    }

    .stat-divider {
        width: 30px;
        height: 1px;
    }

    .tech-tag {
        font-size: 0.28rem;
        padding: 4px 6px;
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }

    .link-card {
        padding: 1rem 1.5rem;
        flex-direction: row;
        justify-content: flex-start;
        min-height: 70px;
        text-align: left;
    }

    .card-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        margin-right: 1.2rem;
    }

    /* Override center alignment for the text inside the card */
    .link-card> :not(.card-icon):not(.private-icon-group) {
        margin: 0;
        text-align: left;
    }

    .card-title {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .card-handle {
        font-size: 0.35rem;
    }

    .private-icon-group {
        flex-direction: row;
        align-items: center;
        margin-right: 1.2rem;
    }

    #station-nav {
        right: 0.4rem;
        gap: 0.8rem;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}

@media (hover: none) and (pointer: coarse) {
    #cursor-tracker {
        display: none;
    }

    html,
    body {
        cursor: auto;
    }

    .link-card {
        transition: transform 0.3s ease;
    }

    .link-card:active {
        transform: scale(0.96);
    }

    .tech-tag:hover {
        border-color: rgba(42, 138, 138, 0.2);
        background: transparent;
        box-shadow: none;
    }
}