:root {
    --c-neon: #CCFF00;
    --c-pink: #FF005C;
    --c-blue: #2E86DE;
    --c-black: #000000;
    --c-white: #FFFFFF;
    --c-gray-light: #F0F0F0;
    --c-gray-dark: #121212;
    --c-gray-card: #1E1E1E;
    --bg-main: var(--c-gray-light);
    --bg-card: var(--c-white);
    --text-main: var(--c-black);
    --text-inv: var(--c-white);
    --border-color: var(--c-black);
    --shadow-color: var(--c-black);
    --accent-primary: var(--c-neon);
    --f-main: 'Syne', sans-serif;
    --f-wide: 'Unbounded', sans-serif;
    --border-thick: 3px solid var(--border-color);
    --shadow-hard: 8px 8px 0px var(--shadow-color);
    --shadow-hover: 12px 12px 0px var(--shadow-color);
    --radius-toy: 20px;
}

body.dark-mode {
    --bg-main: var(--c-gray-dark);
    --bg-card: var(--c-gray-card);
    --text-main: var(--c-white);
    --text-inv: var(--c-black);
    --border-color: var(--c-white);
    --shadow-color: var(--c-white);
    --accent-primary: var(--c-neon);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--f-main);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: -2;
    pointer-events: none;
}

.racing-stripe {
    position: fixed;
    top: 0;
    left: 10%;
    width: 20px;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            var(--c-white),
            var(--c-white) 10px,
            var(--c-blue) 10px,
            var(--c-blue) 20px);
    z-index: -1;
    transform: scaleY(0);
    transform-origin: top;
}

.cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #FFFFFF;
    border: none;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.cursor-ring {
    position: fixed;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--c-gray-dark);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    color: var(--c-neon);
    padding: 2rem;
}

.console-container {
    width: 100%;
    max-width: 600px;
}

#console-output {
    white-space: pre-wrap;
    line-height: 1.5;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
    pointer-events: none;
    user-select: none;
}

.hero>* {
    pointer-events: auto;
}

.sticker-badge {
    position: absolute;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 10px 20px;
    font-family: var(--f-wide);
    font-weight: 900;
    font-size: 0.8rem;
    transform: rotate(-15deg);
    border: 2px solid var(--border-color);
    box-shadow: 4px 4px 0px var(--shadow-color);
    opacity: 0;
}

.top-left {
    top: 40px;
    left: 40px;
    background: var(--c-pink);
}

.top-right {
    top: 40px;
    right: 40px;
    background: var(--c-blue);
    transform: rotate(15deg);
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.85;
    transform: skewY(-5deg);
}

.word {
    font-size: 10vw;
    font-weight: 800;
    -webkit-text-stroke: 3px var(--border-color);
    color: transparent;
    transition: color 0.1s;
    position: relative;
    opacity: 0;
}

.accent-neon {
    color: var(--c-neon);
    -webkit-text-stroke: 3px var(--border-color);
    text-shadow: 10px 10px 0px var(--shadow-color);
}

.letter {
    display: inline-block;
    transform-origin: center bottom;
}

@keyframes letter-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-8px) rotate(-2deg);
    }

    50% {
        transform: translateY(-4px) rotate(0deg);
    }

    75% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes letter-bounce {
    0% {
        transform: scale(1) rotate(0deg);
    }

    30% {
        transform: scale(1.3) rotate(-5deg);
    }

    50% {
        transform: scale(0.9) rotate(3deg);
    }

    70% {
        transform: scale(1.1) rotate(-2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.floating-toys {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.toy-shape {
    position: absolute;
    filter: drop-shadow(8px 8px 0px var(--shadow-color));
    transition: transform 0.3s ease;
    pointer-events: auto;
    opacity: 0;
}

.toy-shape.cursor-hover {
    transform: scale(1.3);
}

.cube-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    perspective: 1000px;
    z-index: 0;
    pointer-events: none;
}

.cube {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transform: scale(0);
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--c-neon);
    border: 4px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    color: var(--c-black);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    animation: color-cycle 4s infinite alternate;
}

.face.front {
    transform: translateZ(100px);
}

.face.back {
    transform: rotateY(180deg) translateZ(100px);
}

.face.right {
    transform: rotateY(90deg) translateZ(100px);
}

.face.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.face.top {
    transform: rotateX(90deg) translateZ(100px);
}

.face.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

@keyframes cube-spin {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }

    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

@keyframes color-cycle {
    0% {
        background: var(--c-neon);
    }

    33% {
        background: var(--c-pink);
    }

    66% {
        background: var(--c-blue);
    }

    100% {
        background: #FFD700;
    }
}

.shape-i {
    width: 80px;
    height: 200px;
    top: 10%;
    left: 8%;
}

.shape-j {
    width: 120px;
    height: 180px;
    top: 80%;
    left: 12%;
}

.shape-l {
    width: 120px;
    height: 180px;
    top: 15%;
    right: 12%;
}

.shape-o {
    width: 120px;
    height: 120px;
    bottom: 20%;
    right: 20%;
}

.shape-s {
    width: 180px;
    height: 120px;
    top: 45%;
    left: 3%;
}

.shape-t {
    width: 180px;
    height: 120px;
    bottom: 5%;
    left: 35%;
}

.shape-z {
    width: 180px;
    height: 120px;
    top: 5%;
    right: 35%;
}

.hero-socials-dock {
    display: flex;
    gap: 20px;
    margin-top: 50px;
    font-size: 0.9rem;
    opacity: 0;
    transform: skewY(-5deg);
    align-self: flex-end;
    margin-right: 10%;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    z-index: 1000;
    box-shadow: 4px 4px 0px var(--shadow-color);
    transition: transform 0.1s;
}

.theme-toggle:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--shadow-color);
}

body.dark-mode .theme-toggle {
    background: var(--c-gray-card);
    color: #FFFFFF !important;
    border-color: #FFFFFF;
}

body.dark-mode .theme-toggle svg {
    fill: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.toy-btn-social {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-main);
    text-decoration: none;
    border: var(--border-thick);
    border-radius: 50%;
    box-shadow: 4px 4px 0px var(--c-neon);
    transition: transform 0.1s;
    font-size: 0.9rem;
    padding: 10px;
}

.toy-btn-social svg {
    width: 100%;
    height: 100%;
    display: block;
}

.toy-btn-social:hover {
    transform: scale(1.2);
    background: var(--c-neon);
}

.toy-btn-social.tetris-t:hover {
    background: #A000F0;
    box-shadow: 4px 4px 0px #A000F0;
    color: var(--c-white);
}

.hero-cta-container {
    margin-top: 60px;
}

.btn-toy {
    display: inline-block;
    padding: 20px 40px;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--f-wide);
    font-weight: 900;
    font-size: 1.5rem;
    text-decoration: none;
    border: var(--border-thick);
    border-radius: 50px;
    box-shadow: var(--shadow-hard);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-toy:hover {
    transform: translate(-4px, -4px);
    box-shadow: var(--shadow-hover);
    background: var(--c-pink);
    color: var(--c-black);
}

.hero-footer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--c-black);
    color: var(--c-neon);
    padding: 15px 0;
    overflow: hidden;
    font-family: var(--f-wide);
    font-weight: 900;
    font-size: 1.2rem;
    border-top: 4px solid var(--c-neon);
    opacity: 0;
}

body.dark-mode .hero-footer-bar {
    background: var(--c-neon);
    color: var(--c-black);
    border-top: 4px solid var(--c-white);
}

.running-ticker {
    display: flex;
    width: max-content;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

.running-ticker span {
    flex-shrink: 0;
    padding-right: 20px;
    display: block;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.section-title {
    font-family: var(--f-wide);
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-main);
    -webkit-text-stroke: 2px var(--border-color);
    text-shadow: 6px 6px 0px var(--c-neon);
}

.projects {
    padding: 100px 20px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    perspective: 2000px;
}

.toy-card {
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-toy);
    padding: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 400px;
}

.toy-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.scroll-indicator {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--f-wide);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-main);
    animation: bounce-arrow 2s infinite ease-in-out;
    opacity: 0;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
}

@keyframes bounce-arrow {

    0%,
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        /* opacity: 1; - removed */
    }

    50% {
        transform: translateX(-50%) translateY(10px);
        /* opacity: 0.6; - removed */
    }
}

.card-yellow {
    background: var(--c-neon);
}

.card-pink {
    background: var(--c-pink);
    color: var(--c-white);
}

.card-blue {
    background: var(--c-blue);
    color: var(--c-white);
}

body.dark-mode .card-yellow {
    background: var(--c-gray-card);
    border-color: var(--c-neon);
    color: var(--c-neon);
}

body.dark-mode .card-pink {
    background: var(--c-gray-card);
    border-color: var(--c-pink);
    color: var(--c-pink);
}

body.dark-mode .card-blue {
    background: var(--c-gray-card);
    border-color: var(--c-blue);
    color: var(--c-blue);
}

body.dark-mode .tag {
    background: var(--text-main);
    color: var(--c-black);
}

body.dark-mode .card-yellow .tag {
    background: var(--c-neon);
    color: var(--c-black);
}

body.dark-mode .card-pink .tag {
    background: var(--c-pink);
    color: var(--c-white);
}

body.dark-mode .card-blue .tag {
    background: var(--c-blue);
    color: var(--c-white);
}

.card-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--f-wide);
    font-weight: 900;
    font-size: 1.5rem;
    border-bottom: 3px solid var(--border-color);
    padding-bottom: 10px;
}

.card-visual {
    flex-grow: 1;
    background: var(--c-black);
    border: var(--border-thick);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.glitch-block {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255, 255, 255, 0.2) 10px, rgba(255, 255, 255, 0.2) 20px);
}

.toy-title {
    font-size: 2.5rem;
    line-height: 0.9;
    font-weight: 800;
    margin-bottom: 15px;
}

.toy-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--text-main);
    color: var(--bg-card);
    padding: 5px 15px;
    border-radius: 20px;
    font-family: var(--f-wide);
    font-size: 0.8rem;
    font-weight: 700;
}

.card-pink .tag,
.card-blue .tag {
    background: var(--c-white);
    color: var(--c-black);
}

.footer {
    padding: 100px 20px;
    text-align: center;
    background: var(--c-black);
    color: var(--c-white);
}

.footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-email {
    font-family: var(--f-wide);
    font-size: 3vw;
    text-decoration: none;
    color: var(--c-white);
    font-weight: 900;
    transition: color 0.3s;
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-email:hover {
    color: var(--c-neon);
}

.email-text {
    -webkit-text-stroke: 1px var(--c-white);
    color: transparent;
    transition: all 0.3s;
}

.footer-email:hover .email-text {
    color: var(--c-neon);
    -webkit-text-stroke: 1px var(--c-neon);
    text-shadow: 4px 4px 0px var(--c-pink);
}

/* --- MOBILE RESPONSE --- */

@media (max-width: 768px) {

    /* Hero Adjustments */
    .word {
        font-size: 11vw;
        /* Smaller font size */
    }

    .hero-socials-dock {
        margin-right: 0;
        align-self: center;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 30px;
    }

    .toy-btn-social {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .racing-stripe {
        display: none;
    }

    .hero-title {
        transform: skewY(-5deg) scale(0.85);
    }

    /* 3D Cube adjustment for smaller screens */
    .cube-wrapper {
        transform: translate(-50%, -50%) scale(0.6);
    }

    /* Projects Section */
    .section-title {
        font-size: 1.8rem;
        word-wrap: break-word;
        padding: 0 10px;
        margin-bottom: 40px;
    }

    .projects {
        padding: 40px 10px;
    }

    .bento-grid {
        gap: 15px;
        grid-template-columns: 1fr;
    }

    .toy-card {
        min-height: auto;
        padding: 20px;
    }

    .toy-title {
        font-size: 1.8rem;
    }

    /* Footer */
    .footer-email {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 5px;
    }

    .footer {
        padding: 40px 20px;
    }

    /* Mobile Tetrominos */
    .shape-i {
        width: 40px;
        height: 100px;
    }

    .shape-j {
        width: 60px;
        height: 90px;
    }

    .shape-l {
        width: 60px;
        height: 90px;
    }

    .shape-o {
        width: 60px;
        height: 60px;
    }

    .shape-s {
        width: 90px;
        height: 60px;
    }

    .shape-t {
        width: 90px;
        height: 60px;
    }

    .shape-z {
        width: 90px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .word {
        font-size: 13.5vw;
        display: flex;
        /* Removes whitespace between inline-block letters */
        justify-content: center;
        white-space: nowrap;
        /* Forces one line */
        width: 100%;
    }

    .hero-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-socials-dock {
        margin-top: 20px;
        gap: 10px;
    }

    .toy-btn-social {
        width: 38px;
        height: 38px;
    }

    .running-ticker {
        font-size: 0.8rem;
    }

    .cube-wrapper {
        transform: translate(-50%, -50%) scale(0.45);
    }

    /* Adjust floating shapes to not cover text */
    .shape-i,
    .shape-j,
    .shape-l,
    .shape-o,
    .shape-s,
    .shape-t,
    .shape-z {
        transform: scale(0.5);
    }

    /* Card adjustments for very small screens */
    .toy-title {
        font-size: 1.5rem;
    }

    .card-header {
        font-size: 1.2rem;
    }
}

/* Touch Devices: Remove Custom Cursor */
@media (pointer: coarse) {
    .cursor {
        display: none !important;
    }

    * {
        cursor: auto !important;
    }

    /* Disable hover effects that stick */
    .toy-card:hover {
        transform: none;
    }

    .toy-btn-social:hover {
        transform: none;
        /* Keep background change for feedback but no scale */
    }
}