* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --accent: #6366f1;
    --accent-text: #a5b4fc;
}
body.light {
    --bg: #f4f4f5;
    --surface: #ffffff;
    --text: #18181b;
    --text-muted: #71717a;
    --accent: #6366f1;
    --accent-text: #4f46e5;
}
body.light header > nav { background: rgba(244,244,245,0.9); }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: #fff; }

header > nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: rgba(15, 17, 23, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    padding: 1rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
}
nav .logo { font-size: 1.3rem; font-weight: 700; color: var(--accent-text); }
nav ul { list-style: none; display: flex; gap: 2rem; }
nav ul a { color: var(--text-muted); transition: color 0.2s; min-height: 44px; display: flex; align-items: center; }
nav ul a:hover { color: var(--text); }

#theme-toggle {
    background: none;
    border: 1px solid rgba(99,102,241,.3);
    border-radius: 8px;
    padding: .45rem .5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color .2s;
    display: flex;
    align-items: center;
    line-height: 0;
}
.icon-hidden { display: none; }

.hero {
    min-height: 100vh;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    padding: 2rem;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}
.hero h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 1rem; }
.hero h1 span { color: var(--accent-text); }
.hero p { font-size: 1.2rem; color: var(--text-muted); max-width: 600px; }

section { padding: 5rem 2rem; max-width: 1000px; margin: 0 auto; }
section h2 {
    font-size: 2rem; margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.about-content { color: var(--text-muted); font-size: 1.05rem; }

.proj-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 1rem; }
@media (max-width: 768px) { .proj-list { grid-template-columns: 1fr; } }
.proj-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    overflow: hidden;
}
.proj-card-body { padding: 1.5rem 1.75rem 1.75rem; }
.proj-card-body h3 { color: var(--accent-text); font-size: 1.1rem; margin-bottom: 0.4rem; }
.proj-card-body p  { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; }
.proj-badge {
    display: inline-block;
    font-size: 0.72rem; font-weight: 700;
    padding: 0.15rem 0.55rem; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}
.badge-alt  { background: rgba(99,102,241,0.15); color: var(--accent-text); }
.badge-form { background: rgba(52,211,153,0.12); color: #34d399; }
.proj-tags  { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.proj-tag {
    background: var(--bg);
    border: 1px solid rgba(99,102,241,0.18);
    color: var(--text-muted);
    font-size: 0.78rem; padding: 0.15rem 0.55rem; border-radius: 5px;
}
.img-slider-wrap { position: relative; }
.img-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.img-track::-webkit-scrollbar { display: none; }
.img-track img {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: block; width: 100%; height: auto;
}
.img-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(15,17,23,0.6); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem; line-height: 1;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.img-arrow:hover { background: rgba(99,102,241,0.7); }
.img-arrow-prev { left: 0.6rem; }
.img-arrow-next { right: 0.6rem; }
.img-dots {
    display: flex; justify-content: center; gap: 0.25rem;
    padding: 0.55rem; background: var(--surface);
    border-top: 1px solid rgba(99,102,241,0.08);
}
.img-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted); border: none; cursor: pointer;
    padding: 12px; background-clip: content-box;
    transition: background-color 0.2s;
}
.img-dot.active { background-color: var(--accent-text); }
.img-theatre-btn {
    position: absolute; bottom: 0.6rem; right: 0.6rem;
    background: rgba(15,17,23,0.6); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; width: 30px; height: 30px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.img-theatre-btn:hover { background: rgba(99,102,241,0.7); }
.theatre-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 200;
    background: var(--bg);
    flex-direction: column;
    overflow: hidden;
}
.theatre-overlay.open { display: flex; }
.theatre-topbar {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 0.45rem 0.75rem; flex-shrink: 0;
    border-bottom: 1px solid rgba(99,102,241,0.12);
}
.theatre-close {
    background: none; border: 1px solid rgba(128,128,128,0.3);
    color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%;
    font-size: 1.1rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.2s;
}
.theatre-close:hover { background: rgba(248,113,113,0.15); color: #f87171; border-color: #f87171; }
.theatre-img-wrap {
    position: relative; flex: 1; min-height: 0;
    display: flex; align-items: stretch;
}
.theatre-track {
    display: flex; flex: 1;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.theatre-track::-webkit-scrollbar { display: none; }
.theatre-track img {
    flex: 0 0 100%; scroll-snap-align: start;
    display: block; width: 100%; height: 100%;
    object-fit: contain;
    background: var(--bg);
}
.theatre-bottom {
    flex-shrink: 0;
    padding: 0.55rem 1.25rem 0.65rem;
    border-top: 1px solid rgba(99,102,241,0.12);
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.theatre-bottom-left { display: flex; flex-direction: column; gap: 0.15rem; }
.theatre-title { color: var(--accent-text); font-weight: 700; font-size: 0.95rem; }
.theatre-desc  { color: var(--text-muted); font-size: 0.8rem; }
.theatre-dots {
    display: flex; gap: 0.25rem; align-items: center; margin-left: auto;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.skill-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    text-align: center;
}
.skill-card .icons { display: flex; justify-content: center; gap: 0.6rem; margin-bottom: 0.8rem; flex-wrap: wrap; align-items: center; }
.skill-card .icons i { font-size: 2rem; }
.skill-card .icons img { width: 2rem; height: 2rem; object-fit: contain; }
.skill-card h3 { color: var(--accent-text); margin-bottom: 0.3rem; font-size: 1rem; }
.skill-card p { color: var(--text-muted); font-size: 0.85rem; }

.contact-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.contact-links a {
    background: var(--surface);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: border-color 0.2s, transform 0.2s;
    color: var(--accent-text);
    min-height: 44px; display: flex; align-items: center;
}
.contact-links a:hover { border-color: var(--accent-text); transform: translateY(-2px); color: #fff; }

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    nav ul { gap: 1rem; }
    section { padding: 3rem 1.5rem; }
}
