:root {
    --primary-color: #00f3ff;
    --secondary-color: #bd00ff;
    --bg-color: #0a0a1a;
    --bg-dark: #050510;
    --text-color: #e0e6ed;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-glow-primary: 0 0 10px #00f3ff, 0 0 20px #00f3ff;
    --neon-glow-secondary: 0 0 10px #bd00ff, 0 0 20px #bd00ff;
    --scanline-color: rgba(0, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

html {
    scroll-padding-top: 80px;
    color-scheme: dark;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Cyber Grain Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

h1,
h2,
h3,
h4 {
    text-wrap: balance;
}

/* Background Effects */
/* Scanline Animation */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(0deg,
            rgba(0, 243, 255, 0) 0%,
            rgba(0, 243, 255, 0.02) 50%,
            rgba(0, 243, 255, 0) 100%);
    opacity: 0.1;
    z-index: 9998;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100vh);
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999;
    border-bottom: 1px solid var(--glass-border);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .line {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

@media screen and (max-width: 768px) {
    .hamburger {
        display: block;
        z-index: 1001;
        /* Above mobile menu */
    }

    .hamburger.active .line:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active .line:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .line:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-color);
    letter-spacing: 2px;
}

.logo .dot {
    color: var(--primary-color);
    text-shadow: var(--neon-glow-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--primary-color);
    overflow: hidden;
    width: 0;
    transition: width 0.3s ease-in-out;
    border-right: 2px solid var(--primary-color);
}

.nav-links a:hover::before {
    width: 100%;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    padding: 0 10%;
    gap: 4rem;
}

.hero-content {
    z-index: 2;
    text-align: left;
    max-width: 800px;
    /* Increased to avoid cutting off the subtitle */
    flex: 1;
}

.glitch-text {
    font-family: 'Orbitron', sans-serif;
    position: relative;
    color: var(--text-color);
}

.hero-content h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: 5px;
    margin-bottom: 1rem;
    text-shadow: var(--neon-glow-primary);
}

.main-title {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1rem;
    color: #8892b0;
    font-family: 'Roboto Mono', monospace;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    width: 59ch;
    /* Added 1ch safety margin */
    max-width: 100%;
    display: inline-block;
    padding-right: 8px;
    /* Spacing for the cursor */
    /* 58 characters text + safety margin */
    animation: typing 3.5s steps(59, end) forwards, blink-caret .75s step-end infinite;
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 59ch
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--primary-color)
    }
}

/* Cyber Button */
.cta-container {
    margin-top: 3rem;
}

.cyber-btn {
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    border: 1px solid var(--primary-color);
    background: transparent;
    overflow: hidden;
    transition: 0.3s;
    clip-path: polygon(10% 0%, 100% 0%, 100% 70%, 90% 100%, 0% 100%, 0% 30%);
}

.cyber-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px var(--primary-color);
    transform: scale(1.05);
}

.cyber-btn::before {
    content: "INICIAR SISTEMA";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-101%);
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.2, 1);
}

.cyber-btn:hover::before {
    transform: translateX(0);
}

.cyber-btn__tag {
    position: absolute;
    right: 5px;
    bottom: 5px;
    font-size: 0.6rem;
    opacity: 0.7;
}

/* Profile Image (Hero) */
.profile-image-container {
    width: 300px;
    /* Reduced to match image resolution better */
    height: 300px;
    position: relative;
    z-index: 5;
    border-radius: 50%;
    padding: 6px;
    background: transparent;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
    transform: none;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.25);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-image-container:hover {
    box-shadow: 0 0 60px rgba(0, 243, 255, 0.3);
}

/* Cards & Glassmorphism */
.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    padding: 2rem;
    border-radius: 5px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1),
        inset 0 0 20px rgba(0, 243, 255, 0.05);
}

.glass-panel:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 243, 255, 0.2),
        inset 0 0 20px rgba(0, 243, 255, 0.1);
    border-color: var(--primary-color);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Focus on the face */
    border-radius: 50%;
    filter: grayscale(10%) contrast(1.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.profile-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 20px var(--primary-color);
    animation: pulse-glow 3s infinite;
    pointer-events: none;
}

@keyframes pulse-glow {
    0% {
        box-shadow: inset 0 0 10px var(--primary-color);
        opacity: 0.5;
    }

    50% {
        box-shadow: inset 0 0 30px var(--primary-color), 0 0 10px var(--primary-color);
        opacity: 1;
    }

    100% {
        box-shadow: inset 0 0 10px var(--primary-color);
        opacity: 0.5;
    }
}

/* Sections General */
.section {
    padding: 100px 10%;
    min-height: 80vh;
    position: relative;
}

/* Responsive Hero */
@media screen and (max-width: 900px) {
    .hero-section {
        flex-direction: column-reverse;
        /* Image on top, text below */
        justify-content: center;
        text-align: center;
        padding-top: 120px;
        gap: 2rem;
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        text-align: center;
        margin-top: 2rem;
        max-width: 100%;
    }

    .profile-image-container {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }

    .subtitle {
        white-space: normal;
        border-right: none;
        animation: none;
        width: 100%;
        font-size: 1rem;
    }

    .main-title {
        font-size: 3rem;
    }
}

/* Resources Section */
.resources-intro {
    margin-bottom: 3rem;
}

.highlight-panel {
    border-left: 5px solid var(--secondary-color);
}

.highlight-panel h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-family: 'Orbitron', sans-serif;
}

.highlight-panel p {
    margin-bottom: 1.5rem;
}

.cyber-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cyber-link:hover {
    text-shadow: 0 0 10px var(--primary-color);
    transform: translateX(5px);
}

.subsection-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-color);
    margin: 3rem 0 2rem;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.subsection-title::after {
    content: '';
    display: block;
    width: 50%;
    height: 2px;
    background: var(--primary-color);
    margin: 10px auto 0;
}

/* Resources Section */
.ebooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.ebook-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    /* Prevents text overflow breaking grid */
}

.ebook-cover {
    height: 300px;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
}

.ebook-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ebook-card:hover .ebook-cover img {
    transform: scale(1.1);
}

.ebook-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ebook-info h4 {
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    min-height: 40px;
}

.ebook-info p {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.download-btn {
    margin-top: auto;
    background: var(--primary-color);
    color: var(--bg-dark);
    text-align: center;
    padding: 10px;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 0.8rem;
    transition: 0.3s;
    clip-path: polygon(10% 0%, 100% 0%, 100% 70%, 90% 100%, 0% 100%, 0% 30%);
}

.download-btn:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--primary-color);
}

/* Lectures Section */
.lectures-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.lecture-category {
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 5px;
    border: 1px solid var(--glass-border);
}

.category-header {
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tech-list {
    list-style: none;
    margin-top: 1rem;
}

.tech-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    position: relative;
    padding-left: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s;
}

.tech-list li:hover {
    color: var(--primary-color);
    padding-left: 35px;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.05), transparent);
}

.tech-list li:hover::before {
    transform: translateX(5px);
    color: var(--primary-color);
}

.tech-list li strong {
    color: var(--primary-color);
    font-weight: 700;
}

@media screen and (max-width: 900px) {
    .lectures-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@keyframes glitch-anim {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item.right {
        left: 0%;
    }

    .main-title {
        font-size: 3rem;
    }

    .navbar {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 2rem;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.active {
        display: flex;
    }
}