/* ── reset & base ─────────────────────────────────────────────────── */

:root {
    color-scheme: dark;
    --bg: #0b0b10;
    --glass-bg: rgba(11, 11, 16, 0.72);
    --glass-bg-hi: rgba(18, 18, 28, 0.8);
    --border: rgba(255, 255, 255, 0.09);
    --border-hi: rgba(255, 255, 255, 0.18);
    --text: #eeeeee;
    --text-muted: rgba(238, 238, 238, 0.58);
    --accent: #7c6fe0;
    --accent-glow: rgba(124, 111, 224, 0.35);
    --blur: 20px;
    --card-radius: 20px;
}

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

html,
body {
    height: 100%;
}

body {
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* prevent horizontal scroll when cards animate in */
    overflow-x: hidden;
}

/* ── fullscreen fixed canvas wrapper (with vignette blur) ────────── */

.game-bg-wrapper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.game-bg-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(11, 11, 16, 0.25) 60%,
        rgba(11, 11, 16, 0.55) 78%,
        rgba(11, 11, 16, 0.88) 100%
    );
    /* subtle blur at the very edges via box-shadow */
    box-shadow: inset 0 0 80px 30px rgba(11, 11, 16, 0.5);
}

.game-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* crisp pixel art scaling */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* subtle dim so foreground pops */
    filter: brightness(0.78) blur(0.4px);
    cursor: crosshair;
    /* GPU-accelerated sub-cell panning */
    will-change: transform;
}

/* ── page content (scrollable layer on top of canvas) ────────────── */

.page-content {
    position: relative;
    z-index: 1;
    /* clicks only land on interactive children */
    pointer-events: none;
}

/* ── glass-morphism card base ────────────────────────────────────── */

.floating-card {
    pointer-events: all;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.floating-card:hover {
    border-color: var(--border-hi);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

/* ── hero section (first viewport, vertically centred) ───────────── */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.floating-panda {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12rem;
    color: linear-gradient(135deg, #ffffff 0%, #c8c0ff 100%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 8px 24px rgba(255, 107, 61, 0.3));
}

@keyframes float {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-20px);
    }
}

.hero-card {
    position: relative;
    z-index: 1;
    padding: 40px 10px 36px;
    width: clamp(320px, 50vw, 640px);
    text-align: center;
}

.hero-card h1 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin-bottom: 8px;
    /* subtle gradient text */
    background: linear-gradient(135deg, #ffffff 0%, #c8c0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-card .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    letter-spacing: 0.02em;
}

/* ── controls row ────────────────────────────────────────────────── */

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── controls section (below about card) ─────────────────────────── */

.controls-section {
    display: flex;
    justify-content: center;
    padding: 20px 24px 0;
    pointer-events: all;
}

.controls-section .controls-bar {
    position: static;
    transform: none;
    bottom: auto;
    left: auto;
}

/* ── controls bar (fixed bottom, pill-shaped) ────────────────────── */

.controls-bar {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    pointer-events: all;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── pill buttons ────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.13);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    line-height: 1;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.btn:hover,
.btn:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 16px rgba(124, 111, 224, 0.22);
    outline: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* active / toggled state — used for the Play/Pause button */
.btn--active {
    background: rgba(124, 111, 224, 0.3);
    border-color: rgba(124, 111, 224, 0.6);
    box-shadow: 0 0 20px rgba(124, 111, 224, 0.3);
}

.btn--active:hover,
.btn--active:focus-visible {
    background: rgba(124, 111, 224, 0.42);
    border-color: rgba(124, 111, 224, 0.8);
    box-shadow: 0 0 28px rgba(124, 111, 224, 0.45);
}

/* ── icon buttons (circular) ─────────────────────────────────────── */

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.13);
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
    font-family: inherit;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 16px rgba(124, 111, 224, 0.22);
    outline: none;
    transform: translateY(-2px);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon--active {
    background: rgba(124, 111, 224, 0.3);
    border-color: rgba(124, 111, 224, 0.6);
    box-shadow: 0 0 20px rgba(124, 111, 224, 0.3);
}

.btn-icon--active:hover,
.btn-icon--active:focus-visible {
    background: rgba(124, 111, 224, 0.42);
    border-color: rgba(124, 111, 224, 0.8);
    box-shadow: 0 0 28px rgba(124, 111, 224, 0.45);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: currentColor;
}

/* ── preset selector ─────────────────────────────────────────────── */

.preset-section {
    display: flex;
    justify-content: center;
    padding: 16px 240px 40px;
    pointer-events: all;
}

.preset-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.preset-btn {
    padding: 8px 20px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.preset-btn:hover,
.preset-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

.preset-btn--active {
    background: rgba(124, 111, 224, 0.25);
    border-color: rgba(124, 111, 224, 0.5);
    box-shadow: 0 0 12px rgba(124, 111, 224, 0.25);
}

.preset-btn--active:hover,
.preset-btn--active:focus-visible {
    background: rgba(124, 111, 224, 0.35);
    border-color: rgba(124, 111, 224, 0.7);
    box-shadow: 0 0 16px rgba(124, 111, 224, 0.35);
}

/* ── about section (scrolls in below hero) ───────────────────────── */

.about-wrapper {
    display: flex;
    justify-content: center;
    /* overlap slightly with hero to feel connected */
    margin-top: -40px;
    padding: 0 24px 80px;
}

.about-card {
    padding: 40px 44px;
    max-width: 560px;
    width: 100%;
}

.about-card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
}

.about-card p {
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 28px;
    font-size: 0.95rem;
}
.about-card .btn {
    /* left-aligned in the card */
    display: inline-flex;
}
/* ── skills section (scrolls in below hero) ───────────────────────── */

.skills-wrapper {
    display: none;
    justify-content: center;
    padding: 16px 24px 40px;
    pointer-events: all;
}

.skills-card {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.skills-card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
}

.skills-card p {
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 28px;
    font-size: 0.95rem;
}

/* ── footer ──────────────────────────────────────────────────────── */

.footer {
    pointer-events: all;
    text-align: center;
    padding: 28px 24px;
    font-size: 0.78rem;
    color: rgba(238, 238, 238, 0.25);
    letter-spacing: 0.01em;
}

/* ── scroll-indicator arrow (absolutely positioned in hero) ──────── */

.scroll-hint {
    position: absolute;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: all;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    animation: bounce 2.4s ease-in-out infinite;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}

.scroll-hint--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.scroll-hint svg {
    width: 24px;
    height: 24px;
    stroke: rgba(255, 255, 255, 0.6);
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-50%) translateY(8px);
        opacity: 1;
    }
}

/* ── "Built with Rust" watermark (fixed bottom-left) ─────────────── */

.rust-watermark {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 100px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: rgba(238, 238, 238, 0.45);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: inherit;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1;
    pointer-events: all;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.rust-watermark:hover,
.rust-watermark:focus-visible {
    color: rgba(238, 238, 238, 0.75);
    border-color: rgba(222, 110, 52, 0.45);
    box-shadow: 0 0 18px rgba(222, 110, 52, 0.2);
    outline: none;
}

.rust-watermark__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.rust-watermark__text {
    opacity: 0.85;
}

/* ── skill-badge rail (fixed right edge, infinite scroll) ────────── */

.skill-rail {
    position: fixed;
    top: 0;
    right: 0;
    width: 220px;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 12%,
        black 88%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 12%,
        black 88%,
        transparent 100%
    );
}

/* ── manual-scroll mode overrides ──────────────────────────────────── */

.skill-rail--manual {
    pointer-events: all;
    overflow: hidden auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );
}

/* thin custom scrollbar for manual mode */
.skill-rail--manual::-webkit-scrollbar {
    width: 4px;
}

.skill-rail--manual::-webkit-scrollbar-track {
    background: transparent;
}

.skill-rail--manual::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.skill-rail--manual::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar + scroll containment (merged to avoid split declarations) */
.skill-rail--manual {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ── toggle button (top-right of rail) ─────────────────────────────── */

.skill-rail__toggle {
    pointer-events: all;
    position: sticky;
    top: 8px;
    z-index: 3;
    margin: 8px 12px 4px auto;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    opacity: 0.45;
    transition:
        opacity 0.2s ease,
        transform 0.15s ease;
}

.skill-rail__toggle:hover,
.skill-rail__toggle:focus-visible {
    opacity: 1;
}

.skill-rail__toggle svg {
    width: 16px;
    height: 16px;
}

.skill-rail__track {
    display: flex;
    flex-direction: column;
    animation: scroll-badges 40s linear infinite;
    will-change: transform;
}

/* manual mode: stop animation on the track, add vertical breathing room */
.skill-rail--manual .skill-rail__track {
    animation: none;
    will-change: auto;
    padding-top: 8px;
    padding-bottom: 60px;
}

/* manual mode: hide every duplicated set after the first */
.skill-rail--manual .skill-rail__set:not(:first-child) {
    display: none;
}

.skill-rail__set {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 12px;
}

/* manual mode: add spacing between badges for readability */
.skill-rail--manual .skill-rail__set {
    gap: 4px;
}

@keyframes scroll-badges {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-16.667%);
    }
}

.skill-badge {
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    margin: 0;
    border-radius: 100px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
    max-width: 170px;
    overflow: hidden;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.skill-badge:hover,
.skill-badge:focus-visible {
    border-color: var(--badge-glow, rgba(124, 111, 224, 0.5));
    box-shadow: 0 0 14px var(--badge-glow, rgba(124, 111, 224, 0.25));
    transform: translateX(-4px);
    outline: none;
}

.skill-badge .badge-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
}

.skill-badge .badge-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.skill-badge__label {
    opacity: 0.88;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* pause scrolling on hover so users can click (auto mode only) */
.skill-rail:not(.skill-rail--manual):hover .skill-rail__track {
    animation-play-state: paused;
}

/* ── responsive ──────────────────────────────────────────────────── */
@media (max-height: 900px) {
    .floating-panda {
        top: 12%;
        font-size: 8rem;
    }
}
@media (max-width: 1000px) {
    .skill-rail {
        display: none;
    }

    .skills-wrapper {
        display: flex;
    }

    .floating-panda {
        top: 12%;
        font-size: 8rem;
    }
}

@media (max-width: 500px) {
    .hero-card {
        padding: 32px 24px 28px;
    }

    .hero-card h1 {
        font-size: 2rem;
    }

    .hero-card .subtitle {
        font-size: 0.875rem;
        /*font-size: 1.5;*/
        margin-bottom: 24px;
    }

    .about-wrapper {
        margin-top: -20px;
        padding: 0 16px 60px;
    }

    .about-card {
        padding: 28px 24px;
    }

    .skills-wrapper {
        margin-top: -20px;
        padding: 0 16px 60px;
    }

    .skills-card {
        padding: 28px 24px;
    }
    .controls {
        gap: 8px;
    }

    .controls-bar {
        bottom: 20px;
        gap: 6px;
        padding: 10px 16px;
    }

    .controls-section {
        padding: 16px 16px 0;
    }

    .preset-section {
        padding: 12px 16px 32px;
    }

    .preset-selector {
        gap: 6px;
        padding: 10px 16px;
    }

    .preset-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .skill-rail {
        width: 90px;
    }

    .skill-rail__toggle {
        width: 28px;
        height: 28px;
        margin: 6px 8px 2px auto;
    }

    .skill-rail__toggle svg {
        width: 14px;
        height: 14px;
    }

    .skill-badge {
        padding: 7px 12px;
        font-size: 0.75rem;
        max-width: 130px;
    }
}

@media (max-width: 500px) {
    .rust-watermark {
        bottom: 14px;
        left: 14px;
        padding: 8px 14px;
        font-size: 0.75rem;
        gap: 8px;
    }

    .rust-watermark__icon {
        width: 18px;
        height: 18px;
    }
}
