/* VARIABLES */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #bb86fc;
    --accent-dark: #3700b3;
    --border-color: #333;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-speed: 0.5s;
}

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

html {
    background: linear-gradient(
        135deg,
        #000000 0%,
        #1c1c1c 50%,
        #3700b3 100%
    );
    background-size: 300% 300%;
    animation: gradientShift 15s ease infinite;
    width: 100%;
    height: 100%;
}

body {
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 75% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* SPLASH SCREEN */
#splash {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.8s ease-out;
}

.typewriter-container {
    font-size: 2rem;
    font-family: monospace;
    color: var(--accent);
}

.cursor {
    animation: blink 1s infinite;
    color: var(--text-main);
}

@keyframes blink { 50% { opacity: 0; } }

/* NAVIGATION */
#burger-btn {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 200;
    background: var(--accent-dark);
    border: none;
    width: 50px; height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

#burger-btn:hover {
    background: var(--accent);
    transition: all 0.3s ease;
}

#burger-btn span {
    display: block;
    width: 25px; height: 3px;
    background: #fff;
    transition: all 0.3s ease;
    transform-origin: center;
}

#main-nav {
    position: fixed;
    top: 0; right: -300px;
    width: 300px; height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--accent);
    z-index: 150;
    transition: right 0.4s ease;
    padding: 80px 20px;
}
#main-nav.open { right: 0; }

.tree-menu {
    list-style: none;
    padding-left: 10px;
}

.tree-menu ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 10px;
    border-left: 1px solid var(--accent);
}

.tree-menu li {
    margin-bottom: 15px;
}
.tree-menu a {
    color: var(--text-main);
    text-decoration: none;
    transition: 0.2s;
}

.tree-menu a:hover {
    color: var(--accent);
}

.tree-label {
    color: var(--accent);
    font-weight: bold;
}

/* PAGE TRANSITIONS */
.page-section {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    
    /* Transition setup */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed);
    z-index: 1;
}

.page-section.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    z-index: 10;
}

/* HOME GRID (DESKTOP SCREEN) */
#home {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden; 
    padding: 80px 20px 10px;
    background: none;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    width: 100%;
    flex-grow: 1;
    margin-bottom: 10px;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.card h2 {
    font-size: 2.5rem;
    font-style: italic;
    border-bottom: 1px solid var(--accent);
    display: inline-block;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    align-self: center;
    flex-grow: 1;
    justify-content: space-between;
}

.logo-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle img {
    width: 80px;
}

.nav-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    justify-content: space-between;
}

.nav-item, .context-btn, .skills-btn, .flow-step {
    padding: 15px;
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
    font-size: 1.25rem;
}

.nav-item:hover, .context-btn:hover, .skills-btn:hover {
    background: var(--accent);
    color: #000;
}

.card-project {
    flex-grow: 1;
    justify-content: space-between;
    display: flex;
}

.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flow-step {
    width: 100%;
    background: rgba(55, 0, 179, 0.2); /* Tinted background */
    border-color: var(--accent);
    position: relative;
}

.flow-step:hover {
    background: var(--accent-dark);
}

.flow-arrow {
    color: var(--accent);
    font-size: 1.5rem;
}

.skills-btn {
    border-style: dashed;
    width: 100%;
    text-align: center;
}

.home-footer {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    padding-top: 5px;
}

/* CONTENT PAGES */
.page-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.content-container {
    background: #1e1e1e7b;
    padding: 30px;
    border-radius: 10px;
    min-height: 50vh;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    font-weight: bold;
    transition: all 0.3s ease;
}

/* STYLE EFFECTS */

.content-container h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--accent);
    letter-spacing: 0.5px;
    position: relative;
}

.content-container h2::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    margin-top: 8px;
    border-radius: 2px;
}

.content-container h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
}

.content-container .case-element {
    background: #242424;
    padding: 22px;
    border-radius: 14px;
    margin-bottom: 25px;

    border: 1px solid rgba(187, 134, 252, 0.15);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.45);

    transition: 
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.content-container .case-element:hover {
    transform: translateY(-5px);
    background: #2a2a2a;

    border-color: rgba(187, 134, 252, 0.35);

    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.6);
}

.content-container .comment {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-style: italic;
}

.content-container .paragraph {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 16px;
    text-indent: 30px;
}

.content-container ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.content-container ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
    color: var(--text-main);
    line-height: 1.6;
    font-size: 1.1rem;
}

.content-container ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-size: 1.1rem;
}

.content-container ol {
    padding-left: 20px;
    color: var(--text-main);
    line-height: 1.6;
}

.content-container ol li {
    margin-bottom: 10px;
    padding-left: 0.5em;
    font-size: 1.1rem;
}

.content-container ol li::marker {
    color: var(--accent);
    font-weight: 600;
}


.content-container img {
    width: 100%;
    max-width: min(800px, 80vw);
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 20px auto;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(1.05);
}

.content-container bold {
    font-weight: bold;
    color: var(--accent);
}

.content-container a {
    cursor: pointer;
    color: var(--accent);
    transition: all 0.3s ease;
    text-decoration: underline;
}

.content-container a:hover {
    color: var(--accent-dark);
    transition: all 0.3s ease;
}

/* RESPONSIVE MOBILE */

@media (min-width: 770px) {
    .page-section {
        padding-left: 15%;
        padding-right: 15%;
    }
}

@media (max-width: 770px) {
    html {
        overflow-y: hidden;
    }

    #home {
        height: 100dvh;
    }

    .grid-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }

    .card {
        height: 90vh;
        overflow-y: hidden;
    }

    .profile-header {
        margin: 10px;
    }

    .context-btn {
        margin-top: 10px;
    }

    .flowchart {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .page-section {
        overflow: hidden;
        padding: 60px 3px 3px;
    }

    .page-section h1 {
        margin-left: 10px;
    }
}