/* ============================================================
   ASHWIN SDK — Main Stylesheet
   Brutalist Retro-Gaming Portfolio
   Mobile-first responsive design
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── Scanline Overlay ──────────────────────────────────────── */
.scanline-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: var(--scanline-bg);
    opacity: var(--scanline-opacity);
}

/* ── Custom Cursor ─────────────────────────────────────────── */
.custom-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    display: none;
    transition: transform var(--dur-fast) var(--ease-snappy);
}

[data-cursor="on"] .custom-cursor {
    display: block;
}

[data-cursor="on"] {
    cursor: none;
}

[data-cursor="on"] a,
[data-cursor="on"] button {
    cursor: none;
}

.custom-cursor--magnetic {
    transform: translate(-50%, -50%) scale(1.3);
}

/* ── Scroll Progress Bar ──────────────────────────────────── */
.scroll-progress {
    position: fixed;
    left: 0;
    top: 0;
    width: 6px;
    height: 100vh;
    z-index: var(--z-nav);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--muted);
}

.scroll-progress__fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--neon);
    transition: height 100ms linear;
    image-rendering: pixelated;
}

.scroll-progress__segment {
    position: relative;
    flex: 1;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-progress__segment:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

.scroll-progress__dot {
    width: 6px;
    height: 6px;
    border: 1px solid var(--neon);
    background: transparent;
    display: block;
}

.scroll-progress__segment.active .scroll-progress__dot {
    background: var(--neon);
    box-shadow: 0 0 6px var(--neon);
}

@media (max-width: 767px) {
    .scroll-progress {
        display: none;
    }
}

/* ── Navigation ──────────────────────────────────────────── */
.nav {
    position: fixed;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: var(--z-nav);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    background: var(--ink);
    border: var(--border-w) solid var(--paper);
    padding: var(--space-xs) var(--space-sm);
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: var(--fw-bold);
    font-size: var(--fs-small);
}

.nav__logo {
    color: var(--neon);
    font-size: var(--fs-h3);
}

.nav__name {
    white-space: nowrap;
}

.nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xxs);
}

.nav__bar {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--paper);
    transition: transform var(--dur-normal) var(--ease-snappy),
        opacity var(--dur-normal) var(--ease-snappy);
}

.nav__hamburger[aria-expanded="true"] .nav__bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger[aria-expanded="true"] .nav__bar:nth-child(2) {
    opacity: 0;
}

.nav__hamburger[aria-expanded="true"] .nav__bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav__menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

.nav__link {
    color: var(--paper);
    text-decoration: none;
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    padding: var(--space-xxs) 0;
    position: relative;
    transition: color var(--dur-instant) var(--ease-snappy);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-instant) var(--ease-snappy);
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link[aria-current="page"] {
    color: var(--neon);
}

.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav__link:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .nav {
        top: 0;
        left: 0;
        right: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border: none;
        border-bottom: var(--border-w) solid var(--paper);
        padding: var(--space-xs) var(--space-sm);
    }

    .nav__hamburger {
        display: flex;
    }

    .nav__menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ink);
        border-bottom: var(--border-w) solid var(--paper);
        padding: var(--space-sm);
        gap: var(--space-xs);
    }

    .nav__menu.open {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .nav {
        left: var(--space-md);
    }
}

/* ── HUD ─────────────────────────────────────────────────── */
.hud {
    position: fixed;
    top: var(--space-sm);
    right: var(--space-sm);
    z-index: var(--z-hud);
}

.hud__toggle {
    background: var(--ink);
    border: var(--border-w) solid var(--neon);
    color: var(--neon);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur-fast) var(--ease-snappy);
}

.hud__toggle:hover {
    background: var(--dimmed);
}

.hud__toggle:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

.hud__panel {
    display: none;
    flex-direction: column;
    gap: var(--space-xs);
    background: var(--ink);
    border: var(--border-w) solid var(--neon);
    padding: var(--space-sm);
    margin-top: var(--space-xxs);
    min-width: 160px;
}

.hud__panel.open {
    display: flex;
}

.hud__group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
}

.hud__label {
    font-size: var(--fs-micro);
    color: var(--paper);
    font-weight: var(--fw-bold);
}

.hud__btn {
    background: var(--dimmed);
    border: 2px solid var(--neon);
    color: var(--neon);
    font-family: var(--font-mono);
    font-size: var(--fs-micro);
    padding: 2px 8px;
    cursor: pointer;
    min-width: 60px;
    text-align: center;
    transition: background var(--dur-fast) var(--ease-snappy);
}

.hud__btn:hover {
    background: rgba(0, 255, 102, 0.1);
}

.hud__btn:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

.hud__btn[aria-pressed="true"] {
    background: var(--neon);
    color: var(--ink);
}

@media (max-width: 767px) {
    .hud {
        top: auto;
        bottom: var(--space-sm);
    }
}

/* ── Loader ──────────────────────────────────────────────── */
.loader {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    transition: opacity var(--dur-reveal) var(--ease-snappy);
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader__cartridge {
    width: 120px;
    height: 80px;
    position: relative;
}

.loader__slot {
    width: 100%;
    height: 100%;
    border: var(--border-thick) solid var(--neon);
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cartridge-insert 0.6s var(--ease-snappy) forwards;
}

@keyframes cartridge-insert {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }

    60% {
        transform: translateY(2px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.loader__cart-body {
    width: 80%;
    height: 60%;
    border: 2px solid var(--neon);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader__cart-label {
    font-size: var(--fs-micro);
    color: var(--neon);
    font-weight: var(--fw-bold);
}

.loader__bar {
    width: 200px;
    height: 8px;
    border: 2px solid var(--neon);
    background: var(--muted);
    overflow: hidden;
}

.loader__bar-fill {
    height: 100%;
    width: 0%;
    background: var(--neon);
    image-rendering: pixelated;
    transition: width 100ms linear;
}

.loader__text {
    font-size: var(--fs-small);
    color: var(--neon);
}

/* ── Sections (scroll-snap) ──────────────────────────────── */
.section {
    min-height: 100vh;
    scroll-snap-align: start;
    padding: var(--space-section) var(--space-sm);
    display: flex;
    flex-direction: column;
    position: relative;
}

.section__header {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.section__tag {
    font-size: var(--fs-hero);
    color: var(--dimmed);
    font-weight: var(--fw-bold);
    line-height: 1;
    -webkit-text-stroke: 1px var(--neon);
}

.section__title {
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    color: var(--paper);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-section) var(--space-xl);
    }
}

@media (min-width: 1024px) {
    .section {
        padding: var(--space-section) calc(var(--space-xxl) + 40px);
    }
}

/* ── Hero Section ────────────────────────────────────────── */
.section--hero {
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero__title {
    font-size: var(--fs-hero);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--paper);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
    transform: translateY(12px);
    opacity: 0;
    animation: hero-enter var(--dur-reveal) var(--ease-snappy) 0.5s forwards;
}

.hero__subtitle {
    font-size: var(--fs-h2);
    color: var(--neon);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-sm);
    transform: translateY(12px);
    opacity: 0;
    animation: hero-enter var(--dur-reveal) var(--ease-snappy) 0.7s forwards;
}

.hero__accent {
    color: var(--paper);
}

.hero__tagline {
    font-size: var(--fs-body);
    color: var(--paper);
    opacity: 0.7;
    font-family: var(--font-sans);
    max-width: 500px;
    margin: 0 auto var(--space-lg);
    transform: translateY(12px);
    opacity: 0;
    animation: hero-enter var(--dur-reveal) var(--ease-snappy) 0.9s forwards;
}

@keyframes hero-enter {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* CTA Button */
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    background: var(--ink);
    color: var(--neon);
    border: var(--border-thick) solid var(--neon);
    font-family: var(--font-mono);
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: transform var(--dur-micro) var(--ease-snappy),
        box-shadow var(--dur-fast) var(--ease-snappy);
    text-decoration: none;
}

.cta-btn:active {
    transform: scale(0.96);
}

.cta-btn:hover {
    box-shadow: var(--shadow-neon);
}

.cta-btn:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 4px;
}

.cta-btn--sm {
    font-size: var(--fs-small);
    padding: var(--space-xs) var(--space-sm);
    border-width: var(--border-w);
}

.cta-btn__scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 102, 0.08) 2px,
            rgba(0, 255, 102, 0.08) 4px);
    opacity: 0;
    transition: opacity var(--dur-instant) var(--ease-snappy);
}

.cta-btn:hover .cta-btn__scanline {
    opacity: 1;
}

.hero__cta {
    transform: translateY(12px);
    opacity: 0;
    animation: hero-enter var(--dur-reveal) var(--ease-snappy) 1.1s forwards;
}

/* Hero grid decoration */
.hero__decoration {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hero__grid {
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 102, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 102, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Glitch effect (optional) */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch::before {
    color: var(--neon);
    z-index: -1;
    animation: glitch-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    color: var(--danger);
    z-index: -2;
    animation: glitch-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-1 {

    0%,
    95% {
        clip-path: inset(0);
        transform: none;
    }

    96% {
        clip-path: inset(20% 0 60% 0);
        transform: translateX(-3px);
    }

    97% {
        clip-path: inset(50% 0 10% 0);
        transform: translateX(3px);
    }

    98% {
        clip-path: inset(10% 0 70% 0);
        transform: translateX(-2px);
    }

    99% {
        clip-path: inset(40% 0 30% 0);
        transform: translateX(2px);
    }

    100% {
        clip-path: inset(0);
        transform: none;
    }
}

@keyframes glitch-2 {

    0%,
    95% {
        clip-path: inset(0);
        transform: none;
    }

    96% {
        clip-path: inset(60% 0 10% 0);
        transform: translateX(3px);
    }

    97% {
        clip-path: inset(10% 0 50% 0);
        transform: translateX(-3px);
    }

    98% {
        clip-path: inset(70% 0 10% 0);
        transform: translateX(2px);
    }

    99% {
        clip-path: inset(30% 0 40% 0);
        transform: translateX(-2px);
    }

    100% {
        clip-path: inset(0);
        transform: none;
    }
}

/* ── About Section ───────────────────────────────────────── */
.about__layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.about__intro {
    max-width: 600px;
}

.about__text {
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--space-sm);
    color: rgba(255, 255, 255, 0.85);
}

.about__roles {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
}

@media (min-width: 768px) {
    .about__layout {
        flex-direction: row;
    }

    .about__intro {
        flex: 1;
    }

    .about__roles {
        flex: 1;
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .about__roles {
        grid-template-columns: 1fr;
    }
}

/* Role Cards */
.role-card {
    perspective: 800px;
    cursor: pointer;
    outline: none;
    min-height: 160px;
}

.role-card__front,
.role-card__back {
    border: var(--border-w) solid var(--paper);
    padding: var(--space-sm);
    backface-visibility: hidden;
    transition: transform var(--dur-overlay) var(--ease-smooth);
    background: var(--ink);
}

.role-card__front {
    position: relative;
}

.role-card__back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    overflow-y: auto;
}

.role-card[aria-expanded="true"] .role-card__front {
    transform: rotateY(180deg);
}

.role-card[aria-expanded="true"] .role-card__back {
    transform: rotateY(0deg);
    position: relative;
}

.role-card:hover .role-card__front,
.role-card:focus-visible .role-card__front {
    border-color: var(--neon);
    box-shadow: var(--shadow-neon);
}

.role-card:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 2px;
}

.role-card__icon {
    font-size: var(--fs-h2);
    margin-bottom: var(--space-xs);
}

.role-card__title {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-xxs);
}

.role-card__sub {
    font-size: var(--fs-small);
    color: var(--neon);
    margin-bottom: var(--space-sm);
}

.role-card__xp {
    width: 100%;
}

.role-card__xp-bar {
    width: 100%;
    height: 8px;
    border: 1px solid var(--neon);
    background: var(--muted);
    overflow: hidden;
}

.role-card__xp-fill {
    height: 100%;
    width: 0%;
    background: var(--neon);
    transition: width 800ms var(--ease-snappy);
    image-rendering: pixelated;
}

.role-card__detail {
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--space-xs);
    color: rgba(255, 255, 255, 0.85);
}

.role-card__projects {
    list-style: none;
    padding: 0;
}

.role-card__projects li {
    font-size: var(--fs-small);
    color: var(--neon);
    padding: var(--space-xxs) 0;
    border-bottom: 1px solid var(--dimmed);
}

.role-card__projects li::before {
    content: '▸ ';
    color: var(--paper);
}

/* ── Skills Section ──────────────────────────────────────── */
.skills__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

@media (min-width: 768px) {
    .skills__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .skills__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.skill-card {
    border: var(--border-w) solid var(--paper);
    padding: var(--space-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    background: var(--ink);
    cursor: pointer;
    outline: none;
    transform: translateY(8px);
    opacity: 0;
    transition: transform var(--dur-normal) var(--ease-snappy),
        opacity var(--dur-normal) var(--ease-snappy),
        border-color var(--dur-fast) var(--ease-snappy),
        box-shadow var(--dur-fast) var(--ease-snappy);
}

.skill-card.visible {
    transform: translateY(0);
    opacity: 1;
}

.skill-card:hover,
.skill-card:focus-visible {
    border-color: var(--neon);
    box-shadow: var(--shadow-brutalist);
}

.skill-card:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 2px;
}

.skill-card__name {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
}

.skill-card__meter {
    position: relative;
    width: 80px;
    height: 80px;
}

.skill-card__ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.skill-card__ring-fill {
    transition: stroke-dashoffset 800ms var(--ease-snappy);
}

.skill-card__value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    color: var(--neon);
}

.skill-card__category {
    font-size: var(--fs-micro);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── Projects Section ────────────────────────────────────── */
.section--projects {
    scroll-snap-align: start;
}

.carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.carousel__track {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-md) var(--space-sm);
    scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
    display: none;
}

.carousel__arrow {
    background: var(--ink);
    border: var(--border-w) solid var(--neon);
    color: var(--neon);
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--dur-fast) var(--ease-snappy);
    display: none;
}

.carousel__arrow:hover {
    background: var(--dimmed);
}

.carousel__arrow:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .carousel__arrow {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Project Cards */
.project-card {
    scroll-snap-align: center;
    min-width: 280px;
    max-width: 340px;
    flex-shrink: 0;
    border: var(--border-w) solid var(--paper);
    background: var(--ink);
    display: flex;
    flex-direction: column;
    outline: none;
    transition: transform var(--dur-normal) var(--ease-snappy),
        border-color var(--dur-fast) var(--ease-snappy),
        box-shadow var(--dur-fast) var(--ease-snappy),
        opacity var(--dur-normal) var(--ease-snappy);
}

.project-card.center {
    transform: scale(1);
    border-color: var(--neon);
    box-shadow: var(--shadow-brutalist);
}

.project-card:not(.center) {
    transform: scale(0.92);
    opacity: 0.6;
}

.project-card:hover,
.project-card:focus-visible {
    border-color: var(--neon);
    box-shadow: var(--shadow-neon);
}

.project-card:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 4px;
}

.project-card__preview {
    position: relative;
    height: 180px;
    background: var(--muted);
    overflow: hidden;
    border-bottom: var(--border-w) solid var(--paper);
}

.project-card__thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.project-card__thumb-placeholder {
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    color: var(--dimmed);
    text-align: center;
    line-height: var(--lh-tight);
    letter-spacing: 0.1em;
}

.project-card__thumb--pixelated {
    filter: contrast(1.2) saturate(0);
    transition: filter 280ms var(--ease-snappy);
}

.project-card:hover .project-card__thumb--pixelated,
.project-card:focus-visible .project-card__thumb--pixelated,
.project-card.center .project-card__thumb--pixelated {
    filter: contrast(1) saturate(1);
}

.project-card__scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 102, 0.05) 2px,
            rgba(0, 255, 102, 0.05) 4px);
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-snappy);
    pointer-events: none;
}

.project-card:hover .project-card__scanline {
    opacity: 1;
    animation: scanline-scroll 0.5s linear infinite;
}

@keyframes scanline-scroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 4px;
    }
}

.project-card__info {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.project-card__badge {
    font-size: var(--fs-micro);
    color: var(--neon);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-card__title {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
}

.project-card__desc {
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.7);
    line-height: var(--lh-relaxed);
}

.project-card__cta {
    align-self: flex-start;
    margin-top: auto;
}

/* Project Card Gallery Strip */
.project-card__gallery {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px;
    border-bottom: var(--border-w) solid var(--paper);
    scrollbar-width: none;
}

.project-card__gallery::-webkit-scrollbar {
    display: none;
}

.project-card__gallery img {
    height: 48px;
    width: 72px;
    border: 1px solid var(--dimmed);
    flex-shrink: 0;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity var(--dur-fast) var(--ease-snappy),
        border-color var(--dur-fast) var(--ease-snappy);
}

.project-card__thumb img,
.project-card__gallery img,
.cs-design__preview img {
    cursor: zoom-in;
}

.image-lightbox__img {
    opacity: 0;
    transition: opacity 240ms ease-out, transform 180ms ease-out;
    transform: scale(0.98);
}

.image-lightbox[aria-hidden="false"] .image-lightbox__img {
    opacity: 1;
    transform: scale(1);
}

.project-card__gallery img:hover {
    opacity: 1;
    border-color: var(--neon);
}

/* Project Card Actions */
.project-card__actions {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap;
}

.project-card__live {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* Case Study Design Preview Grid */
.cs-design__preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.cs-design__preview img {
    width: 100%;
    height: auto;
    border: 2px solid var(--dimmed);
    transition: border-color var(--dur-fast);
}

.cs-design__preview img:hover {
    border-color: var(--neon);
}

/* ── Experience / Timeline Section ───────────────────────── */

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.image-lightbox[aria-hidden="false"] {
    display: flex;
}

.image-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.image-lightbox__container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px;
}

.image-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 4px solid var(--paper);
    background: #000;
}

.image-lightbox__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: 2px solid var(--paper);
    color: var(--paper);
    padding: 6px 8px;
    cursor: pointer;
    z-index: 2;
}

.image-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 2px solid var(--paper);
    color: var(--paper);
    padding: 8px 10px;
    cursor: pointer;
    z-index: 2;
}

.image-lightbox__nav--prev {
    left: 8px;
}

.image-lightbox__nav--next {
    right: 8px;
}

.image-lightbox__caption {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--fs-small);
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    z-index: 2;
}

.timeline {
    position: relative;
    padding-left: var(--space-lg);
}

.timeline__line {
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--neon);
}

.timeline__item {
    position: relative;
    margin-bottom: var(--space-xl);
    outline: none;
}

.timeline__dot {
    position: absolute;
    left: calc(-1 * var(--space-lg) + 4px);
    top: 8px;
    width: 14px;
    height: 14px;
    background: var(--ink);
    border: 3px solid var(--neon);
}

.timeline__item:hover .timeline__dot,
.timeline__item:focus-visible .timeline__dot {
    background: var(--neon);
    box-shadow: 0 0 10px var(--neon);
}

.timeline__card {
    border: var(--border-w) solid var(--paper);
    padding: var(--space-sm);
    background: var(--ink);
    transition: border-color var(--dur-fast) var(--ease-snappy),
        box-shadow var(--dur-fast) var(--ease-snappy);
}

.timeline__item:hover .timeline__card,
.timeline__item:focus-visible .timeline__card {
    border-color: var(--neon);
    box-shadow: var(--shadow-brutalist);
}

.timeline__item:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 4px;
}

.timeline__date {
    font-size: var(--fs-micro);
    color: var(--neon);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
}

.timeline__title {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    margin: var(--space-xxs) 0;
}

.timeline__org {
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: var(--space-sm);
}

.timeline__list {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-sm);
}

.timeline__list li {
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-xxs) 0;
    padding-left: var(--space-sm);
    position: relative;
    line-height: var(--lh-relaxed);
}

.timeline__list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon);
}

.timeline__skills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xxs);
}

.timeline__skill-tag {
    font-size: var(--fs-micro);
    border: 1px solid var(--neon);
    color: var(--neon);
    padding: 2px 8px;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .timeline {
        padding-left: var(--space-xxl);
    }

    .timeline__line {
        left: 26px;
    }

    .timeline__dot {
        left: calc(-1 * var(--space-xxl) + 20px);
    }
}

/* ── Contact Section ─────────────────────────────────────── */
.contact__layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.terminal {
    border: var(--border-thick) solid var(--neon);
    background: var(--muted);
    max-width: 600px;
    width: 100%;
}

.terminal__header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 2px solid var(--neon);
    background: var(--dimmed);
}

.terminal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal__dot--red {
    background: #FF5F56;
}

.terminal__dot--yellow {
    background: #FFBD2E;
}

.terminal__dot--green {
    background: var(--neon);
}

.terminal__title {
    font-size: var(--fs-micro);
    color: var(--neon);
    margin-left: var(--space-xs);
}

.terminal__body {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.terminal__line {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.terminal__line--full {
    align-items: flex-start;
}

.terminal__prompt {
    color: var(--neon);
    font-size: var(--fs-small);
    font-weight: var(--fw-bold);
    white-space: nowrap;
    min-width: 60px;
}

.terminal__input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--dimmed);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    padding: var(--space-xxs) 0;
    width: 100%;
    outline: none;
    transition: border-color var(--dur-fast) var(--ease-snappy);
}

.terminal__input:focus {
    border-color: var(--neon);
}

.terminal__input:focus-visible {
    outline: none;
    border-color: var(--neon);
    box-shadow: 0 2px 0 0 var(--neon);
}

.terminal__input--textarea {
    resize: vertical;
    min-height: 60px;
    border: 2px solid var(--dimmed);
    padding: var(--space-xxs);
}

.terminal__input--textarea:focus {
    border-color: var(--neon);
}

.terminal__submit {
    margin-top: var(--space-xs);
}

.terminal__status {
    font-size: var(--fs-small);
    color: var(--neon);
    min-height: 1.5em;
}

/* Contact tiles */
.contact__links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    max-width: 400px;
}

.contact__tile {
    border: var(--border-w) solid var(--paper);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xxs);
    text-decoration: none;
    color: var(--paper);
    transition: border-color var(--dur-fast) var(--ease-snappy),
        box-shadow var(--dur-fast) var(--ease-snappy),
        transform var(--dur-micro) var(--ease-snappy);
}

.contact__tile:hover,
.contact__tile:focus-visible {
    border-color: var(--neon);
    box-shadow: var(--shadow-brutalist);
    color: var(--neon);
}

.contact__tile:active {
    transform: scale(0.96);
}

.contact__tile:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 4px;
}

.contact__tile-icon {
    font-size: var(--fs-h2);
    line-height: 1;
}

.contact__tile-label {
    font-size: var(--fs-micro);
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
}

@media (min-width: 768px) {
    .contact__layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .contact__links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Game Section ────────────────────────────────────────── */
.game-launcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.game-launcher__desc {
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    color: rgba(255, 255, 255, 0.7);
    max-width: 500px;
}

.game-launcher__canvas {
    border: var(--border-thick) solid var(--neon);
    background: var(--muted);
    max-width: 100%;
    image-rendering: pixelated;
}

.game-launcher__score {
    font-size: var(--fs-h3);
    color: var(--neon);
    font-weight: var(--fw-bold);
}

/* ── Modal / Case Study ──────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-modal) var(--ease-smooth);
}

.modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.modal__container {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--ink);
    border: var(--border-heavy) solid var(--neon);
    margin: var(--space-sm);
    transform: scale(0.95);
    transition: transform var(--dur-modal) var(--ease-smooth);
}

.modal[aria-hidden="false"] .modal__container {
    transform: scale(1);
}

.modal__close {
    position: sticky;
    top: var(--space-xs);
    float: right;
    margin: var(--space-xs);
    background: var(--ink);
    border: 2px solid var(--neon);
    color: var(--neon);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1;
    transition: background var(--dur-fast) var(--ease-snappy);
}

.modal__close:hover {
    background: var(--dimmed);
}

.modal__close:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

.modal__content {
    padding: var(--space-lg);
}

/* Case Study Sections */
.cs-header {
    margin-bottom: var(--space-xl);
}

.cs-header__title {
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-xs);
}

.cs-header__meta {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.cs-header__role,
.cs-header__time {
    font-size: var(--fs-small);
    color: var(--neon);
    border: 1px solid var(--neon);
    padding: 2px 8px;
}

.cs-header__metrics {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cs-section {
    margin-bottom: var(--space-xl);
}

.cs-section__title {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    color: var(--neon);
    margin-bottom: var(--space-sm);
    border-bottom: 2px solid var(--neon);
    padding-bottom: var(--space-xxs);
}

.cs-problem__quote {
    border-left: var(--border-thick) solid var(--neon);
    padding: var(--space-sm);
    margin: var(--space-sm) 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-sans);
}

.cs-problem__text {
    font-family: var(--font-sans);
    line-height: var(--lh-relaxed);
    color: rgba(255, 255, 255, 0.8);
}

.cs-tech__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xxs);
    margin-bottom: var(--space-sm);
}

.cs-tech__code {
    background: var(--muted);
    border: 2px solid var(--dimmed);
    padding: var(--space-sm);
    overflow-x: auto;
    font-size: var(--fs-small);
    color: var(--neon);
    margin-top: var(--space-xs);
}

.cs-arch__diagram {
    border: 2px solid var(--dimmed);
    padding: var(--space-sm);
    text-align: center;
}

.cs-arch__diagram svg {
    max-width: 100%;
    height: auto;
}

.cs-challenges__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.cs-results__scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
}

.cs-links__actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    border-top: var(--border-w) solid var(--paper);
    padding: var(--space-md) var(--space-sm);
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    font-size: var(--fs-micro);
}

.footer__link {
    color: var(--paper);
    text-decoration: none;
    transition: color var(--dur-instant) var(--ease-snappy);
}

.footer__link:hover {
    color: var(--neon);
}

.footer__link:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 2px;
}

.footer__sep {
    color: var(--dimmed);
}

.footer__copy {
    color: rgba(255, 255, 255, 0.4);
}

/* ── Utility: Section Reveal ─────────────────────────────── */
.section-reveal {
    transform: translateY(12px);
    opacity: 0;
    transition: transform var(--dur-reveal) var(--ease-snappy),
        opacity var(--dur-reveal) var(--ease-snappy);
}

.section-reveal.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ── Reduced Motion Global ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }

    .hero__title,
    .hero__subtitle,
    .hero__tagline,
    .hero__cta {
        animation: none;
        transform: none;
        opacity: 1;
    }

    .glitch::before,
    .glitch::after {
        animation: none;
        display: none;
    }

    .skill-card {
        transform: none;
        opacity: 1;
    }

    .scanline-overlay {
        display: none;
    }
}

[data-reduce-motion="true"] {

    .hero__title,
    .hero__subtitle,
    .hero__tagline,
    .hero__cta {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .glitch::before,
    .glitch::after {
        animation: none !important;
        display: none !important;
    }

    .scanline-overlay {
        display: none !important;
    }

    .skill-card {
        transform: none !important;
        opacity: 1 !important;
    }
}