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

:root {
    --bg: #f8f7f4;
    --text: #111827;
    --muted: #6b7280;
    --accent: #0d9488;
    --accent-dark: #0a7065;
    --panel-dark: #111827;
    --border: #e5e7eb;
    --white: #ffffff;
    --radius: 10px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── NAV ── */

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 247, 244, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 4rem;
}

.nav-name {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-links a {
    display: flex;
    align-items: center;
    color: var(--muted);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* ── BUTTONS ── */

.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--border);
    transform: translateY(-1px);
}

/* ── HOME: HERO ── */

.hero {
    background:
        linear-gradient(rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.58)),
        url(images/header.jpg) center 60% / cover no-repeat;
    padding: 4rem;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
    color: var(--white);
}

.hero h1 em {
    color: var(--accent);
    font-style: normal;
}

.hero .tagline {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.72);
    max-width: 480px;
    line-height: 1.6;
}

/* ── HOME: ABOUT ── */

.about {
    border-top: 1px solid var(--border);
    padding: 5rem 4rem;
}

.about .container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    margin-bottom: 4rem;
}

.about-text h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

.about-contact {
    padding-top: 2.5rem;
}

.about-contact p {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.about-contact a {
    display: block;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.about-contact a:hover {
    color: var(--accent);
}

/* ── HOME: SKILLS MARQUEE ── */

.marquee-section {
    margin-top: 1rem;
}

.marquee-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.marquee-wrapper {
    overflow: hidden;
    position: relative;
}

.marquee-wrapper::before,
.marquee-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), transparent);
}

.marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), transparent);
}

.marquee-track {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    animation: marquee 40s linear infinite;
    padding: 0.25rem 0;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.skill-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.45rem 1rem;
    white-space: nowrap;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}

.skill-chip:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.08);
}

.skill-chip img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.skill-chip span {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

/* ── HOME: EXPERIENCE TIMELINE ── */

.experience-section {
    margin-top: 3rem;
}

.timeline {
    position: relative;
    display: flex;
    padding-bottom: 10rem;
    overflow: visible;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border) 8%, var(--border) 92%, transparent);
}

.timeline-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.timeline-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.timeline-dot img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 50%;
}

.timeline-item:hover .timeline-dot,
.timeline-item.active .timeline-dot {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
    background: var(--white);
}

.timeline-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 0.6rem;
    gap: 0.1rem;
}

.timeline-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.timeline-year {
    font-size: 0.65rem;
    color: var(--muted);
}

.timeline-card {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    width: 180px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    z-index: 10;
    text-align: left;
}

.timeline-item:hover .timeline-card,
.timeline-item.active .timeline-card {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.timeline-card-role {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.timeline-card p {
    font-size: 0.77rem;
    color: var(--muted);
    line-height: 1.55;
}

.timeline-item:first-child .timeline-card {
    left: 0;
    transform: translateY(-6px);
}

.timeline-item:first-child:hover .timeline-card,
.timeline-item:first-child.active .timeline-card {
    transform: translateY(0);
}

.timeline-item:last-child .timeline-card {
    left: auto;
    right: 0;
    transform: translateY(-6px);
}

.timeline-item:last-child:hover .timeline-card,
.timeline-item:last-child.active .timeline-card {
    transform: translateY(0);
}

/* ── HOME: PROJECTS ── */

.projects {
    border-top: 1px solid var(--border);
    padding: 5rem 4rem;
}

.projects .container {
    max-width: 1200px;
    margin: 0 auto;
}

.projects-header {
    margin-bottom: 2.5rem;
}

.projects-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 0.5rem;
}

.projects-sub {
    margin-bottom: 3rem;
}

.project-col-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 200px;
    gap: 1.25rem;
}

.games-grid .project-card:nth-child(1) { grid-column: 1 / 5; grid-row: 1 / 3; }
.games-grid .project-card:nth-child(2) { grid-column: 5 / 7; grid-row: 1 / 2; }
.games-grid .project-card:nth-child(3) { grid-column: 5 / 7; grid-row: 2 / 3; }
.games-grid .project-card:nth-child(4) { grid-column: 1 / 3; grid-row: 3 / 4; }
.games-grid .project-card:nth-child(5) { grid-column: 1 / 3; grid-row: 4 / 5; }
.games-grid .project-card:nth-child(6) { grid-column: 3 / 7; grid-row: 3 / 5; }
.games-grid .project-card:nth-child(7) { grid-column: 1 / 4; grid-row: 5 / 6; }
.games-grid .project-card:nth-child(8) { grid-column: 4 / 7; grid-row: 5 / 6; }

.other-projects-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* Project cards */
.project-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    display: block;
}

.project-card img.card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0.82;
}

.project-card:hover img.card-bg {
    transform: scale(1.05);
    opacity: 0.65;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(
        to top,
        rgba(17, 24, 39, 0.97) 30%,
        rgba(17, 24, 39, 0.6) 65%,
        transparent
    );
}

.card-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.card-content h3 {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-desc {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s ease;
}

.card-action {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s ease;
}

.project-card:hover .card-desc {
    max-height: 80px;
    margin-top: 0.5rem;
}

.project-card:hover .card-action {
    max-height: 60px;
    margin-top: 1rem;
}

.card-action .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.82rem;
}

/* Game grid cards — height controlled by games-grid rows */
.project-card.game {}

/* Small cards */
.project-card.small {
    height: 250px;
}

/* ── FOOTER ── */

footer {
    background: var(--panel-dark);
    color: rgba(255, 255, 255, 0.45);
    padding: 1.75rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

footer a {
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--white);
}

footer svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

/* ── PROJECT PAGE ── */

.project-hero {
    padding: 3rem 4rem 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 2.25rem;
    transition: color 0.2s;
}

.project-back:hover {
    color: var(--text);
}

.project-back svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.project-title-area {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.project-title-area h1 {
    font-size: clamp(2.2rem, 5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

.project-links {
    display: flex;
    gap: 0.65rem;
    flex-shrink: 0;
    padding-bottom: 0.25rem;
}

.project-main {
    border-top: 1px solid var(--border);
    padding: 3rem 4rem;
}

.project-main .container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3.5rem;
    align-items: start;
}

.project-main .container.game-page {
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-media {
    position: sticky;
    top: 76px;
}

.screenshot-frame {
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel-dark);
    box-shadow: 0 4px 30px rgba(0,0,0,0.12);
}

.screenshot-frame img {
    width: 100%;
    display: block;
}

.extra-shots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.extra-thumb {
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel-dark);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.extra-thumb img {
    width: 100%;
    display: block;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.extra-thumb:hover img {
    opacity: 1;
}

/* Project details panel */
.project-details {
    padding-top: 0.25rem;
}

.project-details h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.1rem;
}

.project-details .description {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 1rem 0 2rem;
}

.detail-section {
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.detail-section h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tech-chip img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.detail-links {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* ── RESPONSIVE ── */

@media (max-width: 900px) {
    nav {
        padding: 0.9rem 1.5rem;
    }

    .hero {
        padding: 2.5rem 1.5rem;
    }

    .about,
    .projects {
        padding: 3rem 1.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-contact {
        padding-top: 0;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }

    .games-grid .project-card {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .other-projects-row {
        grid-template-columns: 1fr;
    }

    .card-desc,
    .card-action {
        max-height: none !important;
        margin-top: 0.5rem !important;
        overflow: visible !important;
    }

    .timeline {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 9rem;
    }

    .timeline-card {
        width: 160px;
    }

    footer {
        padding: 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .project-hero {
        padding: 2rem 1.5rem 1.5rem;
    }

    .project-main {
        padding: 2rem 1.5rem;
    }

    .project-main .container {
        grid-template-columns: 1fr;
    }

    .project-media {
        position: static;
    }

    .project-title-area {
        flex-direction: column;
        align-items: flex-start;
    }
}
