:root {
    --bg-main: #050103;
    --bg-card: #0d0407;
    --accent: #ff003c;
    --accent-glow: rgba(255, 0, 60, 0.35);
    --accent-secondary: #ff5500;

    --text-main: #eceff4;
    --text-muted: #6b7280;
    --border: #260811;

    --font-code: 'Fira Code', 'Courier New', monospace;

    --max-width: 1100px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-code);
    line-height: 1.6;
    overflow-x: hidden;

    background-image: radial-gradient(600px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(255, 0, 60, 0.04) 0%,
            transparent 80%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#boot-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
}

.boot-content {
    font-family: var(--font-code);
    text-align: left;
}

.boot-line {
    color: var(--accent);
    font-size: 0.95rem;
    letter-spacing: 1px;
    opacity: 0;
    text-shadow: 0 0 8px var(--accent-glow);
    animation: boot-line-appear 0.3s ease forwards;
}

.boot-line:nth-child(1) {
    animation-delay: 0s;
}

.boot-line:nth-child(2) {
    animation-delay: 0.5s;
}

.boot-line:nth-child(3) {
    animation-delay: 1s;
}

.boot-bar {
    width: 220px;
    height: 3px;
    background-color: var(--border);
    overflow: hidden;
}

.boot-bar-fill {
    width: 0%;
    height: 100%;
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: boot-bar-load 1.5s ease forwards;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    z-index: 100000;
    transition: width 0.1s ease-out;
}

#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 46px;
    height: 46px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

#back-to-top svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 42px;
        height: 42px;
    }
}

.header-nav {
    border-bottom: 1px solid var(--border);
    background-color: rgba(5, 1, 3, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

.logo {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    font-size: 1.25rem;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-code);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active {
    text-shadow: 0 0 8px var(--accent-glow);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 5px var(--accent-glow);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(5, 1, 3, 0.98);
        border-left: 1px solid var(--border);
        display: flex;
        justify-content: center;
        align-items: center;
        transition: transform 0.4s ease, opacity 0.3s ease;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        z-index: 105;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .nav-links a {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background-color: var(--accent);
        box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: var(--accent);
        box-shadow: 0 0 8px rgba(255, 0, 60, 0.5);
    }
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 3rem;
}

.hero-section {
    padding: 5rem 0 3rem 0;
}

.hero-section h1 {
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    margin-bottom: 1rem;
    white-space: nowrap;
}

h1 span,
.hero-section h1 span {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow), 0 0 20px rgba(255, 0, 60, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
}

.hero-subtitle.typing::after {
    content: "▋";
    color: var(--accent);
    animation: cursor-blink 0.8s step-end infinite;
    margin-left: 2px;
}

.hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.profile-frame {
    position: relative;
    width: 280px;
    height: 280px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.profile-frame:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(20%) contrast(110%);
    transition: filter 0.3s ease;
}

.profile-frame:hover .profile-img {
    filter: grayscale(0%) contrast(115%);
    transform: scale(1.03);
}

.profile-telemetry {
    position: absolute;
    bottom: 8px;
    left: 12px;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: #00ffcc;
    z-index: 10;
    opacity: 0.8;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
        0 0 4px rgba(255, 255, 255, 0.9);

}

.overview-grid-wrapper,
.current-status-wrapper,
.project-wrapper,
.contact-row-wrapper {
    margin-bottom: 5rem;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-card,
.project-card,
.tech-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 0;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tech-card:hover,
.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.15);
    border-radius: 0 !important;
}

.card-title {
    color: var(--accent);
    font-family: var(--font-code);
    margin-bottom: 1rem;
}

.section-label {
    font-family: var(--font-code);
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-label::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.status-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: status-pulse 2s ease-in-out infinite;
}

.status-text {
    font-family: var(--font-code);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #10b981;
}

.status-detail {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.status-highlight {
    color: var(--text-main);
    font-weight: 500;
}

@keyframes status-pulse {

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

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

.error-page {
    min-height: calc(100vh - 4.5rem - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-content {
    max-width: 500px;
}

.error-code {
    font-family: var(--font-code);
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.error-content h1 {
    font-family: var(--font-code);
    font-size: 8rem;
    line-height: 1;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 1.5rem;
}

.error-message {
    font-family: var(--font-code);

    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.submit-btn {
    display: inline-block;
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    background-color: var(--accent);
    color: var(--bg-main);
    box-shadow: 0 0 15px var(--accent);
}

body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    opacity: 0.45;
}

body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 9998;
    pointer-events: none;
}

.bg-grid {
    position: fixed;
    top: -40px;
    left: -40px;
    width: calc(100% + 80px);
    height: calc(100% + 80px);
    background-image:
        linear-gradient(rgba(255, 0, 60, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 60, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    animation: grid-drift 60s linear infinite;
    pointer-events: none;
}

@keyframes grid-drift {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-40px, -40px);
    }
}

.easter-egg-active {
    animation: egg-flash 0.3s ease;
}

@keyframes egg-flash {

    0%,
    100% {
        filter: invert(0);
    }

    50% {
        filter: invert(1);
    }
}

.egg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.egg-modal.visible {
    opacity: 1;
    visibility: visible;
}

.egg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 1, 3, 0.9);
    backdrop-filter: blur(6px);
}

.egg-modal-content {
    position: relative;
    width: 90%;
    max-width: 720px;
    background-color: var(--bg-card);
    border: 1px solid var(--accent);
    box-shadow: 0 0 40px var(--accent-glow);
    padding: 1.5rem;
    z-index: 1;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.egg-modal.visible .egg-modal-content {
    transform: scale(1);
}

.egg-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.egg-modal-close:hover {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.egg-modal-label {
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 1px;
    text-shadow: 0 0 6px var(--accent-glow);
    margin-bottom: 1rem;
}

.egg-modal-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.egg-modal-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff0055;
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffcc, 0 2px #00ffcc;
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip-path: inset(20% 0 65% 0);
    }

    10% {
        clip-path: inset(50% 0 20% 0);
    }

    20% {
        clip-path: inset(5% 0 85% 0);
    }

    30% {
        clip-path: inset(70% 0 10% 0);
    }

    40% {
        clip-path: inset(35% 0 45% 0);
    }

    50% {
        clip-path: inset(80% 0 5% 0);
    }

    60% {
        clip-path: inset(10% 0 75% 0);
    }

    70% {
        clip-path: inset(60% 0 25% 0);
    }

    80% {
        clip-path: inset(2% 0 90% 0);
    }

    90% {
        clip-path: inset(90% 0 2% 0);
    }

    100% {
        clip-path: inset(25% 0 60% 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip-path: inset(60% 0 20% 0);
    }

    11% {
        clip-path: inset(5% 0 80% 0);
    }

    22% {
        clip-path: inset(85% 0 5% 0);
    }

    33% {
        clip-path: inset(45% 0 40% 0);
    }

    44% {
        clip-path: inset(15% 0 70% 0);
    }

    55% {
        clip-path: inset(75% 0 10% 0);
    }

    66% {
        clip-path: inset(30% 0 55% 0);
    }

    77% {
        clip-path: inset(90% 0 2% 0);
    }

    88% {
        clip-path: inset(8% 0 85% 0);
    }

    100% {
        clip-path: inset(95% 0 2% 0);
    }
}

@keyframes boot-line-appear {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

@keyframes cursor-blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes boot-bar-load {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 5rem;
    text-align: center;
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        white-space: normal;
        font-size: clamp(1.5rem, 5vw, 2.25rem);
    }

    .profile-frame {
        width: clamp(180px, 60vw, 240px);
        height: clamp(180px, 60vw, 240px);
    }

    .nav-links {
        gap: 1rem;
    }

    .error-content h1 {
        font-size: 5rem;
    }
}