/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
    color: #e0e0e0;
    background: #0a0a0a;
    overflow-x: hidden;
    text-transform: lowercase;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(102, 205, 170, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(102, 205, 170, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 90%, rgba(102, 205, 170, 0.015) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
    animation: warp 20s ease-in-out infinite;
}

@keyframes warp {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(2%, -1%) scale(1.02) rotate(0.3deg);
    }
    50% {
        transform: translate(-1%, 2%) scale(0.98) rotate(-0.3deg);
    }
    75% {
        transform: translate(1%, 1%) scale(1.01) rotate(0.2deg);
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            rgba(102, 205, 170, 0.01) 1px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* Webkit Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #66CDAA;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5ab896;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #66CDAA #0a0a0a;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Sections */
.section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Header */
header {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.favicon-icon {
    width: 2.5rem;
    height: 2.5rem;
    image-rendering: pixelated;
    filter: grayscale(100%) contrast(1.4) brightness(0.9);
    position: relative;
}

.favicon-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='6.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.favicon-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        transparent 1px,
        transparent 2px
    ),
    repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.15) 0px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    mix-blend-mode: multiply;
}

.subtitle {
    font-size: 1.2rem;
    color: #66CDAA;
    font-weight: 300;
}

/* Typing Animation */
#typing-name {
    display: inline-block;
}

.typing-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: #66CDAA;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Headings */
h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #66CDAA;
}

h2::before {
    content: "## ";
    color: #66CDAA;
    margin-right: 0.3rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

/* Text */
p {
    font-size: 1rem;
    color: #d0d0d0;
    margin-bottom: 0.8rem;
    max-width: 600px;
}

/* Lists */
ul {
    list-style: none;
    padding-left: 0;
}

ul li {
    font-size: 1rem;
    color: #d0d0d0;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

ul li::before {
    content: "❇";
    position: absolute;
    left: 0;
    color: #66CDAA;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

ul li:hover::before {
    transform: rotate(360deg) scale(1.2);
}

/* Links */
a {
    color: #66CDAA;
    text-decoration: none;
    border-bottom: 1px solid #66CDAA;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

.social-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-links li::before {
    content: "";
}

.social-links li {
    padding-left: 0;
}

/* Projects */
.project {
    margin-bottom: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #1a1a1a;
}

.project:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    padding: 2rem 0;
}

/* Flashlight Mode */
.flashlight-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(102, 205, 170, 0.1);
    border: 2px solid #66CDAA;
    color: #66CDAA;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.flashlight-btn:hover {
    background: rgba(102, 205, 170, 0.2);
    transform: scale(1.1);
}

.flashlight-btn.active {
    background: #66CDAA;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 205, 170, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(102, 205, 170, 0);
    }
}

.flashlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.98);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 9999;
}

.flashlight-overlay.active {
    opacity: 1;
    pointer-events: all;
    cursor: none;
}

/* Funky Letter Animations */
.chaos-text {
    display: inline-block;
    position: relative;
}

.chaos-letter {
    display: inline-block;
    position: relative;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    will-change: transform, opacity;
}

@keyframes float-away {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        transform: translateY(-80px) rotate(var(--float-rot));
        opacity: 1;
    }
}

.chaos-letter.float-away {
    animation: float-away 1.5s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .section {
        padding: 1.5rem 0;
    }
}
