/* ==================== General Styles ==================== */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --highlight: #4da6ff;
    /* Light Blue */
    --highlight-hover: #80c1ff;
    --card-bg-dark: #1f1f1f;
    --card-bg-light: #4da6ff1a;
    --card-hover: #4da6ff33;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== Navigation ==================== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);

    /* Keep the nav visible while scrolling */
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    backdrop-filter: blur(4px);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--highlight);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    margin-left: 2rem;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--highlight);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--highlight);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Container */
.container {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 4rem;
    flex: 1;
}

/* ==================== Hero Section ==================== */
.hero {
    text-align: center;
    padding: 4rem 0;
    --delay: 0ms;
    animation: fadeIn 1.5s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero .highlight-text {
    color: var(--highlight);
    position: relative;
    display: inline-block;
}

/* The Typing Animation */
.typewriter {
    white-space: nowrap;
    overflow: hidden;
    margin: 0 auto;
    width: 0;
    /* Start hidden */
    animation: typing 2s steps(40, end) forwards, .75s step-end infinite;
}

.hero p {
    font-size: 1.25rem;
    /* max-width: 600px; */
    margin: 0 auto 2rem auto;
    color: #b0b0b0;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 2rem;
    border: 2px solid var(--highlight);
    border-radius: 5px;
    color: var(--highlight);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: var(--highlight);
    color: var(--bg-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(77, 166, 255, 0.4);
}

/* ==================== Highlights Section ==================== */
.highlights {
    padding: 4rem 0;
    animation: fadeIn 1.5s ease-out;
}

.highlights h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--highlight);
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-item {
    background: linear-gradient(135deg, var(--card-bg-dark) 0%, var(--card-bg-light) 100%);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid var(--highlight);
    transition: all 0.3s ease;
    text-align: center;
}

.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--card-hover);
    border-left-color: var(--accent);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.skill-item h3 {
    color: var(--highlight);
    margin-bottom: 1rem;
}

.skill-item p {
    color: var(--text-color);
    font-size: 0.95rem;
}


/* ==================== Portfolio Section ==================== */
.portfolio {
    padding: 2rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 2;
}

.portfolio a {
    color: var(--highlight);
    font-weight: bold;
}

#unity-container {
    /* Allow the Unity player to participate in normal document flow */
    position: relative;
    margin: 2rem 0;
    z-index: 1; /* keep below the nav (nav has z-index:1000) */
}

#unity-container.unity-desktop {
    /* Center inline within the container instead of absolute/fixed centering */
    margin: 2rem auto;
    position: relative;
    max-width: 100%;
}

#unity-container.unity-mobile {
    position: fixed;
    width: 100%;
    height: 100%
}

#unity-canvas {
    background: var(--bg-color);
    display: block;
    max-width: 100%;
    height: auto;
}

.unity-mobile #unity-canvas {
    width: 100%;
    height: 100%
}

#unity-loading-bar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none
}

#unity-logo {
    width: 154px;
    height: 130px;
    background: url('images/unity-logo-dark.png') no-repeat center
}

#unity-progress-bar-empty {
    width: 141px;
    height: 18px;
    margin-top: 10px;
    margin-left: 6.5px;
    background: url('images/progress-bar-empty-dark.png') no-repeat center
}

#unity-progress-bar-full {
    width: 0%;
    height: 18px;
    margin-top: 10px;
    background: url('images/progress-bar-full-dark.png') no-repeat center
}

#unity-footer {
    position: relative
}

.unity-mobile #unity-footer {
    display: none
}

#unity-logo-title-footer {
    float: left;
    width: 102px;
    height: 38px;
    background: url('images/unity-logo-title-footer.png') no-repeat center
}

#unity-build-title {
    float: right;
    margin-right: 10px;
    line-height: 38px;
    font-family: arial;
    font-size: 18px
}

#unity-fullscreen-button {
    cursor: pointer;
    float: right;
    width: 38px;
    height: 38px;
    background: url('images/fullscreen-button.png') no-repeat center
}

#unity-warning {
    position: absolute;
    left: 50%;
    top: 5%;
    transform: translate(-50%);
    background: white;
    padding: 10px;
    display: none
}



/* Game Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid #333;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--highlight);
}

.game-image {
    width: 100%;
    height: 200px;
    background-color: #2a2a2a;
    /* Placeholder for image */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 3rem;
}

.game-info {
    padding: 1.5rem;
}

.game-info h3 {
    color: var(--highlight);
    margin-bottom: 0.5rem;
}

/* Resume Section */
.resume-section {
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: 8px;
    border-left: 4px solid var(--highlight);
}

.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.job {
    margin-bottom: 2rem;
}

.job h3 {
    font-size: 1.4rem;
    color: #fff;
}

.job .company {
    color: var(--highlight);
    font-style: italic;
    margin-bottom: 0.5rem;
    display: block;
}

/* Scroll fade-in utility */
.fade-into-view {
    --delay: 0ms;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1200ms cubic-bezier(.2, .9, .2, 1) var(--delay),
        transform 1200ms cubic-bezier(.2, .9, .2, 1) var(--delay);
    will-change: opacity, transform;
}

.fade-into-view.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== Footer ==================== */
footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--card-bg);
    color: #777;
    margin-top: 4rem;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .resume-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for example */
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .fade-into-view {
        transition: none;
        transform: none;
        opacity: 1;
    }
}