:root {
    --bg-color: #171717;
    --card-bg: #171717;
    --text-color: #FFFFFF;
    --text-secondary: #FFFFFF;
    --accent-color: #BE0030;
    --accent-hover: #BE0030;
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.3s ease;
}

/* Language Toggle Visibility */
body.lang-pt-active .lang-eng {
    display: none !important;
}

body.lang-eng-active .lang-pt {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #2b000b 0%, var(--bg-color) 45%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.logo-img {
    height: 130px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(190, 0, 48, 0.4));
}

.logo h1,
.logo h2 {
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.logo h2 {
    flex-grow: 1;
}

.logo h2::after {
    content: '';
    height: 1px;
    opacity: 0.5;
    /* Visual equivalent of 0.5px */
    flex-grow: 1;
    background: linear-gradient(90deg, var(--accent-color), transparent 85%);
    margin-left: 20px;
}

/* Symmetrical Lines and Centering for Header specifically */
header .logo {
    justify-content: center;
}

header .logo::before,
header .logo::after {
    content: '';
    height: 1px;
    opacity: 0.5;
    flex-grow: 1;
}

header .logo::before {
    background: linear-gradient(-90deg, var(--accent-color), transparent 85%);
    margin-right: 15px;
}

header .logo::after {
    background: linear-gradient(90deg, var(--accent-color), transparent 85%);
    margin-left: 15px;
}

.headline-hover {
    position: relative;
    display: inline-block;
    transition: text-shadow 0.3s ease, color 0.3s ease;
    cursor: default;
}

.headline-hover:hover {
    text-shadow: 0 0 8px rgba(190, 0, 48, 0.8), 2px 2px 2px rgba(0, 0, 0, 0.8);
}

.disintegrate-particle {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    animation: disintegrate-anim 0.8s forwards ease-out;
}

@keyframes disintegrate-anim {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.2) rotate(var(--rot));
    }
}

.logo .accent {
    color: var(--accent-color);
}

/* About Me Section */
.about-me {
    margin-bottom: 50px;
    padding: 30px;
    background-color: var(--card-bg);

    /* Burnt Torn Parchment Edges via Clip-Path */
    clip-path: polygon(0% 2%, 2% 0%, 5% 3%, 8% 0%, 12% 2%, 15% 0%, 18% 3%, 21% 0%, 25% 1%, 29% 0%, 33% 2%, 36% 0%, 40% 3%, 44% 0%, 48% 2%, 52% 0%, 55% 2%, 58% 0%, 62% 3%, 65% 0%, 69% 2%, 72% 0%, 75% 3%, 79% 0%, 82% 2%, 86% 0%, 89% 3%, 92% 0%, 96% 2%, 98% 0%, 100% 2%,
            100% 98%, 98% 100%, 95% 97%, 92% 100%, 88% 98%, 85% 100%, 82% 97%, 79% 100%, 75% 99%, 71% 100%, 67% 98%, 64% 100%, 60% 97%, 56% 100%, 52% 98%, 48% 100%, 45% 98%, 42% 100%, 38% 97%, 35% 100%, 31% 98%, 28% 100%, 25% 97%, 21% 100%, 18% 98%, 14% 100%, 11% 97%, 8% 100%, 4% 98%, 2% 100%, 0% 98%);
}

.about-me .logo {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 6px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.toggle-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #FFFFFF;
}

.about-content>p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

.lang-content p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

.lang-toggles {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--accent-color);
    font-weight: 600;
}

.lang-separator {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.5;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* Editions Section */
.editions {
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 12px;

    /* Burnt Torn Parchment Edges via Clip-Path */
    clip-path: polygon(0% 2%, 2% 0%, 5% 3%, 8% 0%, 12% 2%, 15% 0%, 18% 3%, 21% 0%, 25% 1%, 29% 0%, 33% 2%, 36% 0%, 40% 3%, 44% 0%, 48% 2%, 52% 0%, 55% 2%, 58% 0%, 62% 3%, 65% 0%, 69% 2%, 72% 0%, 75% 3%, 79% 0%, 82% 2%, 86% 0%, 89% 3%, 92% 0%, 96% 2%, 98% 0%, 100% 2%,
            100% 98%, 98% 100%, 95% 97%, 92% 100%, 88% 98%, 85% 100%, 82% 97%, 79% 100%, 75% 99%, 71% 100%, 67% 98%, 64% 100%, 60% 97%, 56% 100%, 52% 98%, 48% 100%, 45% 98%, 42% 100%, 38% 97%, 35% 100%, 31% 98%, 28% 100%, 25% 97%, 21% 100%, 18% 98%, 14% 100%, 11% 97%, 8% 100%, 4% 98%, 2% 100%, 0% 98%);
}

.editions .logo {
    margin-bottom: 25px;
}

.skill-item h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.skill-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.category-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #FFFFFF;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}

.video-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-card:hover {
    transform: scale(1.03) translateY(-8px);
    box-shadow: 0 15px 40px rgba(190, 0, 48, 0.3), 0 0 20px rgba(190, 0, 48, 0.2);
    border-color: var(--accent-color);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    background: #171717;
}

.video-wrapper iframe,
.placeholder-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.placeholder-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #171717;
    color: var(--text-secondary);
    font-weight: 600;
}

.video-info {
    padding: 20px;
}

.video-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.tag {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 800;
}

/* Cinematic Footer */
.cinematic-footer {
    padding-bottom: 60px;
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 60px;
    margin: 0 auto;
    background-color: var(--card-bg);

    /* Book Background Image with Dark Overlay and Mask Feather */
    /* Using a gradient that fades to the background color on the edges to simulate a mask feather without affecting text */
    background-image: linear-gradient(to right, var(--card-bg) 0%, transparent 15%, transparent 85%, var(--card-bg) 100%), linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('book-bg.jpg');
    background-size: cover;
    background-position: center calc(50% + 130px);

    /* Burnt Torn Parchment Edges via Clip-Path WITHOUT Inset Glow */
    clip-path: polygon(0% 2%, 2% 0%, 5% 3%, 8% 0%, 12% 2%, 15% 0%, 18% 3%, 21% 0%, 25% 1%, 29% 0%, 33% 2%, 36% 0%, 40% 3%, 44% 0%, 48% 2%, 52% 0%, 55% 2%, 58% 0%, 62% 3%, 65% 0%, 69% 2%, 72% 0%, 75% 3%, 79% 0%, 82% 2%, 86% 0%, 89% 3%, 92% 0%, 96% 2%, 98% 0%, 100% 2%,
            100% 98%, 98% 100%, 95% 97%, 92% 100%, 88% 98%, 85% 100%, 82% 97%, 79% 100%, 75% 99%, 71% 100%, 67% 98%, 64% 100%, 60% 97%, 56% 100%, 52% 98%, 48% 100%, 45% 98%, 42% 100%, 38% 97%, 35% 100%, 31% 98%, 28% 100%, 25% 97%, 21% 100%, 18% 98%, 14% 100%, 11% 97%, 8% 100%, 4% 98%, 2% 100%, 0% 98%);
}

@keyframes footer-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(190, 0, 48, 0.3));
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(190, 0, 48, 0.9));
        opacity: 1;
        transform: scale(1.05);
    }
}

.footer-logo {
    height: 40px;
    width: auto;
    animation: footer-glow 4s ease-in-out infinite;
}

.gothic-quote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 500;
    font-size: 1.4rem;
    color: var(--text-secondary);
    line-height: 1.6;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Contact Links & Interaction */
.contact-link {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
    font-family: var(--font-main);
    font-size: 1rem;
}

.contact-link:hover,
.discord-wrapper:hover .contact-link,
.discord-btn:hover {
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
}

.contact-separator {
    color: var(--text-secondary);
    opacity: 0.3;
}

.discord-wrapper {
    position: relative;
    display: inline-block;
}

.discord-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.discord-tooltip {
    display: none;
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #111;
    border: 1px solid var(--accent-color);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    box-shadow: 0 5px 15px rgba(190, 0, 48, 0.2);
    white-space: nowrap;
    z-index: 20;
    animation: fadeIn 0.2s ease-out forwards;
}

.discord-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--accent-color) transparent transparent transparent;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Footer Quote Container */
.quote-container {
    background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 15%, rgba(0, 0, 0, 0.85) 85%, transparent 100%);
    padding: 25px 40px;
    border-radius: 4px;
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: center;
        padding-top: 15px;
    }

    .logo {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .logo h1,
    .logo h2 {
        font-size: 1.8rem;
    }

    .logo-img {
        height: 90px;
    }

    nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding-bottom: 10px;
    }

    .filter-btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .video-card {
        margin-bottom: 15px;
    }

    .about-me {
        padding: 20px 15px;
        margin-bottom: 30px;
    }

    .about-me .logo {
        flex-direction: row;
        justify-content: space-between;
    }

    .about-me .logo h2 {
        font-size: 1.4rem;
    }

    .lang-toggles {
        justify-content: center !important;
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .about-content>p,
    .lang-content p {
        font-size: 1rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .editions .logo {
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 25px;
    }

    .editions .logo h2 {
        font-size: 1.4rem;
        flex-grow: 1;
        /* Resetting flex growth to keep lines intact */
    }

    .quote-container {
        padding: 20px 15px;
        background: rgba(0, 0, 0, 0.8);
        /* Solid overlay for smaller screens to ensure readability */
    }

    .gothic-quote {
        font-size: 1.1rem;
    }

    .footer-content {
        padding: 40px 20px;
        background-image: linear-gradient(to right, var(--card-bg) 0%, transparent 15%, transparent 85%, var(--card-bg) 100%), linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('book-bg.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    50% {
        transform: translateY(50vh) translateX(20px) rotate(180deg);
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(110vh) translateX(-20px) rotate(360deg);
        opacity: 0;
    }
}

.bg-particle {
    position: fixed;
    top: -50px;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    animation-name: fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}