/* ===================================
   CREATIVE CHAOS PORTFOLIO - STYLES
   Black & White + Glitch Effects
   =================================== */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Monochrome Palette */
    --black: #000000;
    --white: #FFFFFF;
    --grey-900: #0A0A0A;
    --grey-800: #171717;
    --grey-700: #262626;
    --grey-600: #404040;
    --grey-500: #525252;
    --grey-400: #A3A3A3;
    --grey-300: #D4D4D4;
    --grey-200: #E5E5E5;
    --grey-100: #F5F5F5;
    --grey-50: #FAFAFA;

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Archivo', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 8rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--grey-900);
    color: var(--grey-100);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* --- Custom Scrollbar (Theme Matched) --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--grey-900);
    border-left: 1px solid var(--grey-800);
}

::-webkit-scrollbar-thumb {
    background: var(--grey-600);
    border-radius: 5px;
    border: 2px solid var(--grey-900);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--grey-400);
}

::-webkit-scrollbar-thumb:active {
    background: var(--white);
}

::-webkit-scrollbar-corner {
    background: var(--grey-900);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--grey-600) var(--grey-900);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scanlines,
    .glitch-text::before,
    .glitch-text::after {
        display: none;
    }

    body {
        cursor: auto;
    }
}

/* --- Custom Cursor --- */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease, height 0.15s ease, background 0.15s ease;
    mix-blend-mode: difference;
    will-change: left, top;
}

.cursor.hovering {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
}

.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.4;
    transform: translate(-50%, -50%);
    will-change: left, top;
}

/* --- Scanlines Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9990;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.03) 0px,
            rgba(0, 0, 0, 0.03) 1px,
            transparent 1px,
            transparent 2px);
    animation: scanlines-move 8s linear infinite;
}

@keyframes scanlines-move {
    0% {
        background-position: 0 0;
    }

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

/* --- Screen Flash (Jump Scare) --- */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    pointer-events: none;
    z-index: 9995;
    opacity: 0;
    transition: opacity 0.05s ease;
}

.screen-flash.active {
    opacity: 1;
    animation: flash-effect 0.15s ease-out;
}

@keyframes flash-effect {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* --- Screen Shake --- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(-5px) rotate(-0.5deg);
    }

    20% {
        transform: translateX(5px) rotate(0.5deg);
    }

    30% {
        transform: translateX(-5px) rotate(-0.5deg);
    }

    40% {
        transform: translateX(5px) rotate(0.5deg);
    }

    50% {
        transform: translateX(-3px);
    }

    60% {
        transform: translateX(3px);
    }

    70% {
        transform: translateX(-2px);
    }

    80% {
        transform: translateX(2px);
    }

    90% {
        transform: translateX(-1px);
    }
}

body.shaking {
    animation: shake 0.3s ease-out;
}

/* --- Glitch Text Effect --- */
.glitch-text {
    position: relative;
    display: inline-block;
}

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

.glitch-text::before {
    color: var(--white);
    animation: glitch-1 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translateX(-2px);
}

.glitch-text::after {
    color: var(--grey-400);
    animation: glitch-2 2s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translateX(2px);
}

@keyframes glitch-1 {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-3px) skewX(-2deg);
    }

    40% {
        transform: translateX(3px);
    }

    60% {
        transform: translateX(-2px) skewX(1deg);
    }

    80% {
        transform: translateX(1px);
    }
}

@keyframes glitch-2 {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(3px) skewX(2deg);
    }

    40% {
        transform: translateX(-3px);
    }

    60% {
        transform: translateX(2px) skewX(-1deg);
    }

    80% {
        transform: translateX(-1px);
    }
}

.glitch-text:hover::before,
.glitch-text:hover::after {
    animation-duration: 0.2s;
}

/* --- Text Scramble (for JS) --- */
.scramble-text {
    display: inline-block;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: var(--space-lg);
    left: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--grey-800);
    border-radius: 8px;
    z-index: 100;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--white);
}

.nav-logo a {
    color: inherit;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--grey-400);
    text-decoration: none;
    letter-spacing: 0.05em;
    position: relative;
    transition: color var(--transition-normal);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--white);
    transition: width var(--transition-normal);
}

.nav-link:hover {
    color: var(--white);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav-menu span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--white);
    transition: var(--transition-normal);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--grey-900);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition-normal);
}

.mobile-link:hover {
    color: var(--grey-400);
    transform: translateX(20px);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    overflow: hidden;
}

.hero-content {
    max-width: 1000px;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    color: var(--grey-400);
    margin-bottom: var(--space-md);
    opacity: 0;
    animation: fade-in 1s ease 0.3s forwards;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 15vw, 12rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: var(--white);
    margin-bottom: var(--space-lg);
}

.hero-line {
    display: block;
    opacity: 0;
    animation: slide-up 0.8s ease forwards;
}

.hero-line:nth-child(1) {
    animation-delay: 0.5s;
}

.hero-line:nth-child(2) {
    animation-delay: 0.7s;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--grey-300);
    margin-bottom: var(--space-xl);
    opacity: 0;
    animation: fade-in 1s ease 1s forwards;
}

.typing-text {
    color: var(--white);
    font-weight: 500;
}

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

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fade-in 1s ease 1.2s forwards;
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--grey-500);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--grey-500), transparent);
    animation: scroll-pulse 2s ease infinite;
}

@keyframes scroll-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scaleY(1);
    }

    50% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

.hidden-message {
    position: absolute;
    bottom: 20%;
    right: 10%;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--white);
    color: var(--black);
}

.btn-primary:hover {
    background: var(--grey-200);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--grey-600);
}

.btn-secondary:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.shake-on-click:active {
    animation: btn-shake 0.3s ease;
}

@keyframes btn-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

/* --- Sections --- */
.section {
    padding: var(--space-2xl) var(--space-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: var(--space-xl);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: var(--space-md);
}

.bento-card {
    background: var(--grey-800);
    border: 1px solid var(--grey-700);
    border-radius: 12px;
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    opacity: 0;
    transform: translateY(20px);
}

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

.bento-card:hover {
    border-color: var(--grey-500);
    transform: translateY(-5px);
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-medium {
    grid-column: span 2;
}

.bento-small {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.bento-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--white);
}

.bento-card p {
    color: var(--grey-400);
    font-size: 0.95rem;
}

.bento-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.bento-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--grey-500);
    letter-spacing: 0.1em;
    margin-top: var(--space-sm);
}

.floating-eye {
    position: absolute;
    bottom: var(--space-lg);
    right: var(--space-lg);
    font-size: 3rem;
    transition: transform 0.1s ease;
}

.philosophy-text {
    font-style: italic;
    font-size: 1.1rem;
}

/* Hover Reveal Card */
.hover-reveal {
    perspective: 1000px;
}

.reveal-front,
.reveal-back {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-normal);
}

.reveal-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    color: var(--black);
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0;
    transform: rotateY(180deg);
}

.hover-reveal:hover .reveal-front {
    opacity: 0;
    transform: rotateY(180deg);
}

.hover-reveal:hover .reveal-back {
    opacity: 1;
    transform: rotateY(0);
}

/* Magnetic Effect Class */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- Projects Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.project-card {
    background: var(--grey-800);
    border: 1px solid var(--grey-700);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-normal);
    opacity: 0;
    transform: translateY(30px);
}

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

.project-card:hover {
    border-color: var(--grey-500);
    transform: translateY(-10px) scale(1.02);
}

.project-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--grey-700), var(--grey-900));
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-icon {
    font-size: 4rem;
    filter: grayscale(1);
    transition: var(--transition-normal);
}

.project-card:hover .project-icon {
    transform: scale(1.2);
    filter: grayscale(0);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.project-overlay span {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: var(--white);
    border: 1px solid var(--white);
    padding: var(--space-sm) var(--space-md);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--white);
}

.project-desc {
    font-size: 0.9rem;
    color: var(--grey-400);
    margin-bottom: var(--space-md);
}

.project-tags {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--grey-700);
    border-radius: 4px;
    color: var(--grey-300);
}

/* --- Skills Section --- */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.skill-category {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

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

.skill-heading {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--grey-400);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--grey-700);
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.skill-bar {
    position: relative;
}

.skill-name {
    display: block;
    font-size: 0.95rem;
    color: var(--grey-200);
    margin-bottom: var(--space-sm);
}

.skill-progress {
    height: 4px;
    background: var(--grey-700);
    border-radius: 2px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--white);
    width: 0;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
}

.skill-bar.animated .skill-fill {
    width: var(--skill-level, 0%);
}

/* Malfunction effect */
.skill-fill.malfunction {
    animation: malfunction 3s infinite;
}

@keyframes malfunction {

    0%,
    100% {
        opacity: 1;
    }

    45% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    55% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    72% {
        opacity: 0.5;
    }

    74% {
        opacity: 1;
    }
}

/* Glitch bar */
.skill-fill.glitch-bar {
    animation: glitch-bar 2s infinite;
    background: linear-gradient(90deg, var(--white) 50%, var(--grey-400) 50%);
    background-size: 10px 100%;
}

@keyframes glitch-bar {

    0%,
    100% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(-2px);
    }

    20% {
        transform: translateX(2px);
    }

    30% {
        transform: translateX(-1px);
    }
}

/* Overflow effect */
.skill-fill.overflow {
    width: 150% !important;
    background: linear-gradient(90deg, var(--white), var(--grey-400));
}

/* --- Contact Section --- */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

.contact-intro {
    font-size: 1.5rem;
    color: var(--grey-300);
    margin-bottom: var(--space-md);
}

.contact-cta {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.hover-secret {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed var(--grey-500);
}

.hover-secret::after {
    content: attr(data-secret);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    color: var(--black);
    padding: var(--space-sm) var(--space-md);
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.hover-secret:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    padding-top: var(--space-lg);
    background: var(--grey-800);
    border: 1px solid var(--grey-700);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-normal);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-group label {
    position: absolute;
    top: 50%;
    left: var(--space-md);
    transform: translateY(-50%);
    color: var(--grey-500);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    pointer-events: none;
}

.form-group textarea~label {
    top: var(--space-lg);
    transform: translateY(0);
}

.form-group input:focus~label,
.form-group input:not(:placeholder-shown)~label,
.form-group textarea:focus~label,
.form-group textarea:not(:placeholder-shown)~label {
    top: var(--space-sm);
    font-size: 0.7rem;
    color: var(--grey-400);
}

/* Social Links */
.contact-social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: var(--grey-800);
    border: 1px solid var(--grey-700);
    border-radius: 50%;
    color: var(--grey-400);
    transition: all var(--transition-normal);
}

.social-link:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--black);
    transform: translateY(-5px);
}

.social-icon {
    width: 22px;
    height: 22px;
}

/* --- Footer --- */
.footer {
    padding: var(--space-xl) var(--space-lg);
    border-top: 1px solid var(--grey-800);
}

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

.footer-text {
    font-size: 0.9rem;
    color: var(--grey-500);
}

.footer-secret {
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.footer:hover .footer-secret {
    opacity: 1;
}

.footer-easter {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--grey-600);
    letter-spacing: 0.1em;
}

/* --- Secret Modal --- */
.secret-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.secret-modal.active {
    opacity: 1;
    visibility: visible;
}

.secret-content {
    text-align: center;
    padding: var(--space-2xl);
    animation: secret-appear 0.5s ease;
}

@keyframes secret-appear {
    from {
        transform: scale(0.5) rotate(-10deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.secret-content h2 {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.secret-content p {
    font-size: 1.2rem;
    color: var(--grey-300);
    margin-bottom: var(--space-md);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-menu {
        display: flex;
    }

    .nav {
        left: var(--space-md);
        right: var(--space-md);
        top: var(--space-md);
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 6rem);
    }

    .section {
        padding: var(--space-xl) var(--space-md);
    }

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

    .bento-large,
    .bento-medium {
        grid-column: span 1;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    body {
        cursor: auto;
    }

    .cursor,
    .cursor-trail {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .contact-cta {
        font-size: 1.8rem;
    }
}

/* --- Utility Classes --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Quake-Style Dropdown Terminal --- */
.terminal-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    max-height: 400px;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 2px solid #00ff00;
    z-index: 9998;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 30px rgba(0, 255, 0, 0.2),
        0 10px 60px rgba(0, 0, 0, 0.5);
    cursor: none;
    /* Allow custom cursor to show */
}

.terminal-dropdown.active {
    transform: translateY(0);
}

.terminal-dropdown .terminal-header {
    flex-shrink: 0;
}

.terminal-dropdown .terminal-body {
    flex: 1;
    min-height: 0;
}


.terminal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.terminal-btn.close {
    background: #ff5f56;
}

.terminal-btn.close:hover {
    background: #ff3b30;
}

.terminal-btn.minimize {
    background: #ffbd2e;
}

.terminal-btn.maximize {
    background: #27ca40;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #00ff00;
    letter-spacing: 0.05em;
}

.terminal-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    color: #00ff00;
    background: #0a0a0a;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-output .line {
    margin-bottom: 4px;
}

.terminal-output .prompt {
    color: #00ff00;
}

.terminal-output .command {
    color: #ffffff;
}

.terminal-output .output {
    color: #00aa00;
}

.terminal-output .error {
    color: #ff5555;
}

.terminal-output .info {
    color: #55ffff;
}

.terminal-output .success {
    color: #55ff55;
}

.terminal-output .warning {
    color: #ffff55;
}

.terminal-output .ascii-art {
    color: #00ff00;
    font-size: 0.7rem;
    line-height: 1.2;
}

.terminal-output .stats-box {
    border: 1px solid #00ff00;
    padding: 8px 12px;
    margin: 8px 0;
    display: inline-block;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.terminal-prompt {
    color: #00ff00;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    caret-color: #00ff00;
}

.terminal-input::selection {
    background: #00ff00;
    color: #000000;
}

/* Terminal cursor blink */
.terminal-input-line::after {
    content: '';
    width: 8px;
    height: 16px;
    background: #00ff00;
    animation: terminal-cursor-blink 1s step-end infinite;
}

@keyframes terminal-cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* CRT effect on terminal */
.terminal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

/* Glow effect for text */
.terminal-overlay .glow {
    text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 768px) {

    /* Hero - fix spacing and layout */
    body {
        padding: 2rem;
    }

    .hero {
        min-height: 100vh;
        padding: 80px 1rem 2rem 1rem;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-subtitle {
        font-size: 0.7rem;
        letter-spacing: 0.2em;
        margin-bottom: 0.5rem;
    }

    .hero-title {
        font-size: 6rem;
        line-height: 1;
        margin-bottom: 1rem;
    }

    .hero-line {
        display: block;
    }

    .hero-tagline {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 280px;
    }

    .hero-cta .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }

    /* Bento Grid */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-card {
        padding: 1.5rem;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Skills */
    .skills-container {
        grid-template-columns: 1fr;
    }

    .skill-category {
        padding: 1.5rem;
    }

    /* Contact */
    .contact-social {
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-link {
        width: 45px;
        height: 45px;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    /* Terminal Dropdown */
    .terminal-dropdown {
        height: 60vh;
        max-height: 350px;
    }

    .terminal-body {
        font-size: 0.75rem;
        padding: 12px;
    }

    .terminal-header {
        padding: 8px 12px;
    }

    .terminal-title {
        font-size: 0.7rem;
    }

    .terminal-input {
        font-size: 0.8rem;
    }

    .terminal-prompt {
        font-size: 0.75rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 2.5rem;
    }

    /* Nav */
    .nav-links {
        display: none;
    }

    .nav-menu {
        display: flex;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .bento-number {
        font-size: 2.5rem;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .terminal-dropdown {
        height: 50vh;
        max-height: 300px;
    }

    .terminal-body {
        font-size: 0.7rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.85rem;
    }
}