:root {
    --bg: #06080c;
    --accent: #5b8dee;
    --accent-games: #00e07a;
    --text: #f2f2f2;
    --muted: #7a8596;
    --card-bg: rgba(255,255,255,0.03);
    --border: rgba(255,255,255,0.07);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="games"] {
    --accent: var(--accent-games);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

.wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── NAV ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6,8,12,0.8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo img {
    height: 46px;
    filter: invert(1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.2rem;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.25s;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    cursor: pointer;
}

.lang-opt { transition: color 0.2s; }
.lang-opt.active { color: var(--accent); }
.lang-opt:hover { color: var(--text); }
.lang-sep { opacity: 0.3; }

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: border-color 0.25s;
}

.theme-toggle:hover { border-color: rgba(255,255,255,0.18); }

.tgl-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.tgl-track {
    width: 30px;
    height: 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    position: relative;
}

.tgl-knob {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: left 0.3s var(--ease), background 0.4s;
}

[data-theme="games"] .tgl-knob {
    left: 17px;
    background: var(--accent);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    padding: 1.2rem 2rem 1.6rem;
    border-top: 1px solid var(--border);
}

.mobile-nav.open { display: block; }

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.mobile-nav a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s;
}

.mobile-nav a:hover { color: var(--accent); }

/* ── BUTTONS ── */
.btn-fill {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.4s;
}

.btn-fill:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(91,141,238,0.35);
}

[data-theme="games"] .btn-fill:hover {
    box-shadow: 0 10px 30px rgba(0,224,122,0.3);
}

.btn-line {
    display: inline-block;
    padding: 0.85rem 2rem;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 100px;
    transition: border-color 0.25s, background 0.25s;
}

.btn-line:hover {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.04);
}

/* ── REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.reveal.on {
    opacity: 1;
    transform: none;
}

/* ── HERO ── */
.hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91,141,238,0.12) 0%, transparent 65%);
    pointer-events: none;
    transition: background 0.5s;
}

[data-theme="games"] .hero::after {
    background: radial-gradient(circle, rgba(0,224,122,0.1) 0%, transparent 65%);
}

.hero-wrap {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.4rem;
    transition: color 0.4s;
}

h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(2.8rem, 5.5vw, 5.2rem);
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -0.03em;
    margin-bottom: 1.8rem;
}

h1 em {
    font-style: italic;
    font-family: 'Instrument Serif', serif;
    color: var(--accent);
    transition: color 0.4s;
    font-weight: 400;
}

h2 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(2rem, 4vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: 1.2rem;
}

h2 em {
    font-style: italic;
    font-family: 'Instrument Serif', serif;
    color: var(--accent);
    transition: color 0.4s;
    font-weight: 400;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 500px;
    margin-bottom: 2.5rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pro-title { display: block; }
.games-title { display: none; }
[data-theme="games"] .pro-title { display: none; }
[data-theme="games"] .games-title { display: block; }

.hero-img img {
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    filter: grayscale(100%);
    transition: filter 0.6s var(--ease);
    border-radius: 24px;
}

.hero-img img:hover { filter: grayscale(0%); }

[data-theme="games"] .hero-img img {
    filter: grayscale(0%) drop-shadow(0 0 36px rgba(0,224,122,0.3));
}

/* ── ABOUT ── */
.about {
    padding: 7rem 0;
    border-top: 1px solid var(--border);
}

.about-wrap {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.8;
    margin-top: 0.5rem;
    max-width: 560px;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.stat strong {
    display: block;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    transition: color 0.4s;
}

.stat span {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.35rem;
    display: block;
}

/* ── SKILLS ── */
.skills {
    padding: 7rem 0;
    border-top: 1px solid var(--border);
}

.skills-head {
    margin-bottom: 3.5rem;
}

.skills-head p {
    font-size: 1rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: border-color 0.3s, transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.skill-card:hover {
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-6px);
    box-shadow: 0 18px 50px rgba(0,0,0,0.3);
}

.skill-icon {
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 1.4rem;
    transition: color 0.4s;
}

.skill-card h3 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.skill-card p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ── PORTFOLIO ── */
.portfolio {
    padding: 7rem 0;
    border-top: 1px solid var(--border);
}

.portfolio h2 {
    margin-bottom: 3rem;
}

[data-theme="pro"] .games-projects { display: none; }
[data-theme="games"] .pro-projects { display: none; }

.pro-projects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.proj-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.3s, transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.proj-card:hover {
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-6px);
    box-shadow: 0 18px 50px rgba(0,0,0,0.3);
}

.proj-tag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    transition: color 0.4s;
}

.proj-card h3 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.proj-card p {
    font-size: 0.9rem;
    color: var(--muted);
    flex: 1;
    line-height: 1.7;
}

.proj-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 0.5rem;
    transition: color 0.25s;
    align-self: flex-start;
}

.proj-link:hover { color: var(--accent); }

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.game-frame {
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.4s var(--ease);
}

.game-frame:hover {
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-4px);
}

.game-frame iframe { display: block; }

/* ── CONTACT ── */
.contact {
    padding: 7rem 0;
    border-top: 1px solid var(--border);
}

.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 5rem;
    align-items: start;
}

.contact-text p {
    font-size: 1rem;
    color: var(--muted);
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    line-height: 1.75;
}

.socials {
    display: flex;
    gap: 1.4rem;
}

.socials a {
    font-size: 1.4rem;
    color: var(--muted);
    transition: color 0.25s, transform 0.3s;
}

.socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s, background 0.25s;
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.05);
}

.contact-form .btn-fill { align-self: flex-start; }

/* ── FOOTER ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
}

.footer-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-logo {
    height: 30px;
    filter: invert(1);
    opacity: 0.4;
}

.footer p {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .hero-wrap { grid-template-columns: 1fr; text-align: center; }
    .hero-copy { display: flex; flex-direction: column; align-items: center; }
    .hero-desc { max-width: 100%; }
    .hero-img img { max-width: 380px; margin: 0 auto; }
    .about-wrap { grid-template-columns: 1fr; gap: 3rem; }
    .about-stats { flex-direction: row; gap: 3rem; }
    .contact-wrap { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .nav-links, .nav-right { display: none; }
    .hamburger { display: block; }
    .skills-grid { grid-template-columns: 1fr; }
    .pro-projects { grid-template-columns: 1fr; }
    .games-grid { grid-template-columns: 1fr; }
    .footer-wrap { flex-direction: column; text-align: center; }
    h1 { font-size: 2.6rem; }
    h2 { font-size: 2rem; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-fill, .btn-line { width: 100%; text-align: center; }
    .about-stats { flex-direction: column; gap: 2rem; }
    .wrap { padding: 0 1.25rem; }
    .hero, .about, .skills, .portfolio, .contact { padding: 5rem 0; }
}
