:root {
    --bg-0: #03050d;
    --bg-1: #070c1a;
    --bg-2: #0d1428;
    --cyan: #00d4ff;
    --violet: #8b5cf6;
    --green: #00ff88;
    --text: #e8eeff;
    --text-muted: #6b7a99;
    --border: rgba(0, 212, 255, 0.12);
    --border-hover: rgba(0, 212, 255, 0.4);
    --glow-cyan: rgba(0, 212, 255, 0.08);
    --glow-violet: rgba(139, 92, 246, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0 !important; }
html { scroll-behavior: smooth; }

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

/* ── NAV ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 4rem;
    transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
    border-bottom: 1px solid transparent;
}
nav.scrolled {
    background: rgba(3, 5, 13, 0.85);
    backdrop-filter: blur(24px);
    border-color: var(--border);
}
.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.18em;
    color: var(--text);
    text-decoration: none;
}
.nav-logo span { color: var(--cyan); }
.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}
.nav-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--cyan); }
.nav-cta {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    padding: 0.5rem 1.35rem;
    border-radius: 5px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.nav-cta:hover {
    background: var(--cyan);
    color: var(--bg-0);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.35);
}

/* ── HERO ── */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 9rem 2rem 6rem;
}
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 30%, transparent 100%);
    pointer-events: none;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}
.orb-1 {
    width: 550px; height: 550px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.13) 0%, transparent 70%);
    top: -120px; left: -180px;
}
.orb-2 {
    width: 650px; height: 650px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.11) 0%, transparent 70%);
    bottom: -140px; right: -220px;
}
.orb-3 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.055) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: orbpulse 5s ease-in-out infinite;
}
@keyframes orbpulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 212, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
    padding: 0.4rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: var(--cyan);
    text-transform: uppercase;
    margin-bottom: 2rem;
}
.hero-badge-dot {
    width: 6px; height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

h1.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(4.5rem, 11vw, 10rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}
h1.hero-title .line-solid {
    display: block;
    color: var(--text);
}
h1.hero-title .line-gradient {
    display: block;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 60%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 2.75rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: var(--bg-0);
    padding: 0.9rem 2.1rem;
    border-radius: 7px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 32px rgba(0, 212, 255, 0.2);
}
.btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 10px 44px rgba(0, 212, 255, 0.3);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    padding: 0.9rem 2.1rem;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.14);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.06);
}

.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.7;
}
.scroll-bar {
    width: 1px;
    height: 44px;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    animation: scrollpulse 1.8s ease-in-out infinite;
}
@keyframes scrollpulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50%       { transform: scaleY(0.4); opacity: 0.4; }
}

/* ── SHARED SECTION ── */
.section-wrap {
    padding: 8rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}
.section-divider { border-top: 1px solid var(--border); }
.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    color: var(--cyan);
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.section-label::before { content: '// '; opacity: 0.55; }
h2.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin-bottom: 1.5rem;
}
.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 580px;
    line-height: 1.82;
}

/* ── ABOUT ── */
.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 6rem;
    align-items: center;
}
.about-text .section-desc + .section-desc { margin-top: 1rem; }
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.stat-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.stat-card:hover {
    border-color: rgba(0, 212, 255, 0.35);
    transform: translateY(-5px);
    box-shadow: 0 16px 48px rgba(0, 212, 255, 0.08);
}
.stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.55rem;
}
.stat-label {
    font-size: 0.83rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
}

/* ── PROJECTS ── */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3.5rem;
    gap: 2rem;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.project-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2.25rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--glow-cyan), var(--glow-violet));
    opacity: 0;
    transition: opacity 0.35s;
    border-radius: 18px;
    pointer-events: none;
}
.project-card:hover {
    border-color: rgba(0, 212, 255, 0.38);
    transform: translateY(-7px);
    box-shadow: 0 24px 64px rgba(0, 212, 255, 0.1);
}
.project-card:hover::after { opacity: 1; }
.project-card > * { position: relative; z-index: 1; }

.project-icon {
    width: 52px; height: 52px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(139,92,246,0.1));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.6rem;
}
.project-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    color: var(--cyan);
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}
.project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.22rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}
.project-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 1.75rem;
}
.project-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cyan);
    text-decoration: none;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: gap 0.2s;
}
.project-link:hover { gap: 0.75rem; }

/* ── TEAM ── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 4rem;
}
.team-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.team-card:hover {
    border-color: rgba(0, 212, 255, 0.35);
    transform: translateY(-5px);
    box-shadow: 0 16px 48px rgba(139, 92, 246, 0.1);
}
.team-avatar {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--bg-0);
    margin: 0 auto 1.3rem;
}
.team-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.team-role {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}
.team-bio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}
.team-bio span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 0.25rem 0.6rem;
}
[data-theme="light"] .team-bio span {
    background: rgba(0, 136, 187, 0.07);
    border-color: rgba(0, 136, 187, 0.2);
}
.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── CONTACT ── */
.contact-inner {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}
.contact-inner h2 { margin-left: auto; margin-right: auto; }
.contact-inner .section-desc {
    max-width: 520px;
    margin: 0 auto;
}
.contact-form {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-input, .form-textarea {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0.9rem 1.25rem;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}
.form-textarea { resize: vertical; min-height: 148px; }
.form-submit {
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: var(--bg-0);
    padding: 1rem 2.5rem;
    border-radius: 9px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    align-self: center;
    min-width: 220px;
}
.form-submit:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(0, 212, 255, 0.28);
}

/* ── FOOTER ── */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}
.footer-logo span { color: var(--cyan); }
.footer-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

/* ── LIGHT THEME ── */
[data-theme="light"] {
    --bg-0: #f4f6ff;
    --bg-1: #eaedfa;
    --bg-2: #dde2f5;
    --cyan: #0088bb;
    --violet: #6d28d9;
    --text: #080e22;
    --text-muted: #525d7a;
    --border: rgba(0, 100, 200, 0.14);
    --border-hover: rgba(0, 136, 187, 0.45);
    --glow-cyan: rgba(0, 136, 187, 0.07);
    --glow-violet: rgba(109, 40, 217, 0.07);
}
[data-theme="light"] nav.scrolled {
    background: rgba(244, 246, 255, 0.9);
}
[data-theme="light"] #hero::before {
    background-image:
        linear-gradient(rgba(0, 100, 200, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 100, 200, 0.06) 1px, transparent 1px);
}
[data-theme="light"] .orb-1 {
    background: radial-gradient(circle, rgba(0, 136, 187, 0.18) 0%, transparent 70%);
}
[data-theme="light"] .orb-2 {
    background: radial-gradient(circle, rgba(109, 40, 217, 0.14) 0%, transparent 70%);
}
[data-theme="light"] .orb-3 {
    background: radial-gradient(circle, rgba(0, 136, 187, 0.1) 0%, transparent 70%);
}
[data-theme="light"] .hero-badge {
    background: rgba(0, 136, 187, 0.08);
    border-color: rgba(0, 136, 187, 0.25);
}
[data-theme="light"] .btn-primary {
    box-shadow: 0 0 32px rgba(0, 136, 187, 0.18);
}
[data-theme="light"] .btn-ghost {
    border-color: rgba(8, 14, 34, 0.18);
    color: var(--text);
}
[data-theme="light"] .hero-scroll { color: var(--text-muted); }
[data-theme="light"] .scroll-bar {
    background: linear-gradient(to bottom, var(--cyan), transparent);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    nav { padding: 1rem 1.5rem; }
    .nav-links { display: none; }
    .section-wrap { padding: 5rem 1.5rem; }
    .about-grid { grid-template-columns: 1fr; gap: 3rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .projects-header { flex-direction: column; align-items: flex-start; }
    .team-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    footer { flex-direction: column; gap: 1rem; text-align: center; padding: 2rem 1.5rem; }
}
@media (max-width: 540px) {
    .team-grid { grid-template-columns: 1fr; }
    h1.hero-title { font-size: 4rem; }
}
