/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #e4e4e7;
    line-height: 1.6;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font-family: inherit; border: none; outline: none; }

/* ── Utilities ─────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.reveal { opacity: 0; transform: translateY(40px); }

/* ── Subtle grid background ────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ── Gradient orb (ambient) ────────────────────────────────── */
.orb {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}
.orb--1 { top: -200px; right: -200px; background: #6366f1; }
.orb--2 { bottom: -200px; left: -200px; background: #06b6d4; }

/* ── Navigation ────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 24px;
    transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled {
    background: rgba(10,10,15,.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.nav__logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}
.nav__logo span { color: #6366f1; }
.nav__links { display: flex; gap: 32px; list-style: none; }
.nav__links a {
    font-size: .875rem;
    font-weight: 500;
    color: #71717a;
    transition: color .25s;
    position: relative;
}
.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #6366f1;
    transition: width .3s;
}
.nav__links a:hover, .nav__links a.active { color: #e4e4e7; }
.nav__links a.active::after { width: 100%; }

/* Hamburger */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}
.nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #e4e4e7;
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .nav__toggle { display: flex; }
    .nav__links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10,10,15,.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 100px 40px;
        gap: 28px;
        transition: right .35s cubic-bezier(.4,0,.2,1);
    }
    .nav__links.open { right: 0; }
    .nav__links a { font-size: 1.1rem; }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    z-index: 1;
}
.hero__content { max-width: 740px; }
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid rgba(99,102,241,.3);
    border-radius: 100px;
    font-size: .8rem;
    font-weight: 500;
    color: #818cf8;
    margin-bottom: 32px;
    background: rgba(99,102,241,.06);
}
.hero__badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}
.hero__title {
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 24px;
    line-height: 1.08;
}
.hero__greeting {
    display: block;
    font-size: clamp(.9rem, 2vw, 1.15rem);
    font-weight: 400;
    color: #52525b;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.hero__name {
    display: block;
    font-size: clamp(2rem, 5.8vw, 4rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.06;
    background: linear-gradient(90deg,
        #6366f1 0%,
        #06b6d4 28%,
        #8b5cf6 56%,
        #f472b6 78%,
        #6366f1 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: name-gradient-flow 5s linear infinite;
    position: relative;
    cursor: default;
    width: fit-content;
}
.hero__name::before,
.hero__name::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-text-fill-color: transparent;
    background: none;
    opacity: 0;
    pointer-events: none;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}
.hero__name::before {
    -webkit-text-fill-color: #06b6d4;
    clip-path: polygon(0 18%, 100% 18%, 100% 44%, 0 44%);
}
.hero__name::after {
    -webkit-text-fill-color: #f472b6;
    clip-path: polygon(0 58%, 100% 58%, 100% 78%, 0 78%);
}
.hero__name.glitching::before {
    opacity: .88;
    animation: glitch-slice-top .38s steps(4) forwards;
}
.hero__name.glitching::after {
    opacity: .88;
    animation: glitch-slice-bot .38s steps(4) forwards;
}
.glitch-cursor {
    position: absolute;
    right: -0.55em;
    top: 0;
    color: #6366f1;
    -webkit-text-fill-color: #6366f1;
    background: none;
    font-size: 1em;
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: normal;
    animation: blink-cursor .55s step-end infinite;
    pointer-events: none;
}
@keyframes name-gradient-flow {
    0%   { background-position: 0% center; }
    100% { background-position: 220% center; }
}
@keyframes glitch-slice-top {
    0%   { transform: translate(-5px, 0) skewX(-2deg); opacity: .88; }
    25%  { transform: translate(5px, 1px) skewX(1.5deg); }
    50%  { transform: translate(-4px,-1px) skewX(-1deg); }
    75%  { transform: translate(3px, 0) skewX(.5deg); }
    100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes glitch-slice-bot {
    0%   { transform: translate(5px, 0) skewX(2deg); opacity: .88; }
    25%  { transform: translate(-5px,-1px) skewX(-1.5deg); }
    50%  { transform: translate(4px, 1px) skewX(1deg); }
    75%  { transform: translate(-3px, 0) skewX(-.5deg); }
    100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
/* keep .gradient for other uses */
.hero__title .gradient {
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #a1a1aa;
    max-width: 560px;
    margin-bottom: 40px;
    line-height: 1.7;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 4px 24px rgba(99,102,241,.3);
}
.btn--primary:hover { box-shadow: 0 8px 32px rgba(99,102,241,.4); }
.btn--ghost {
    background: transparent;
    color: #e4e4e7;
    border: 1px solid rgba(255,255,255,.12);
}
.btn--ghost:hover { border-color: rgba(255,255,255,.25); }

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #52525b;
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.hero__scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, #6366f1, transparent);
    animation: scroll-line 2s infinite;
}
@keyframes scroll-line {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── Section shared ────────────────────────────────────────── */
.section {
    position: relative;
    padding: 120px 0;
    z-index: 1;
}
.section__header {
    text-align: center;
    margin-bottom: 72px;
}
.section__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 16px;
}
.section__title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fafafa;
    margin-bottom: 16px;
}
.section__desc {
    font-size: 1.05rem;
    color: #71717a;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}
.divider {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    margin: 0 auto 20px;
    border-radius: 2px;
}

/* ── Services ──────────────────────────────────────────────── */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.service-card {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    padding: 36px 32px;
    transition: transform .35s cubic-bezier(.4,0,.2,1), border-color .35s, box-shadow .35s;
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,.4), transparent);
    opacity: 0;
    transition: opacity .35s;
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99,102,241,.2);
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.service-card:hover::before { opacity: 1; }
.service-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(99,102,241,.1);
    color: #818cf8;
    margin-bottom: 24px;
}
.service-card__icon svg { width: 24px; height: 24px; }
.service-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fafafa;
    margin-bottom: 12px;
}
.service-card__desc {
    font-size: .925rem;
    color: #71717a;
    line-height: 1.65;
}

@media (max-width: 480px) {
    .services__grid { grid-template-columns: 1fr; }
}

/* ── Work / Portfolio ──────────────────────────────────────── */
.work__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.project-card {
    position: relative;
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    padding: 40px 36px;
    overflow: hidden;
    transition: transform .35s cubic-bezier(.4,0,.2,1), border-color .35s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 280px;
}
.project-card__glow {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .12;
    transition: opacity .4s;
}
.project-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.1); }
.project-card:hover .project-card__glow { opacity: .22; }
.project-card__cat {
    font-family: 'JetBrains Mono', monospace;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 12px;
}
.project-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 12px;
    letter-spacing: -.01em;
}
.project-card__desc {
    font-size: .925rem;
    color: #71717a;
    line-height: 1.6;
}
.project-card__arrow {
    position: absolute;
    top: 36px;
    right: 36px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #71717a;
    transition: color .3s, border-color .3s, transform .3s;
}
.project-card:hover .project-card__arrow {
    color: #e4e4e7;
    border-color: rgba(255,255,255,.25);
    transform: translate(2px, -2px);
}
.project-card__arrow svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
    .work__grid { grid-template-columns: 1fr; }
}

/* ── About ─────────────────────────────────────────────────── */
.about__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}
.about__text h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 20px;
    letter-spacing: -.01em;
}
.about__text p {
    color: #a1a1aa;
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: .975rem;
}
.about__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
.stat {
    text-align: center;
    padding: 32px 20px;
    border-radius: 16px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
}
.stat__number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -.02em;
    line-height: 1;
    margin-bottom: 8px;
}
.stat__number span { color: #6366f1; }
.stat__label {
    font-size: .85rem;
    color: #71717a;
    font-weight: 500;
}

@media (max-width: 768px) {
    .about__inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

/* ── Contact ───────────────────────────────────────────────── */
.contact__inner {
    max-width: 640px;
    margin: 0 auto;
}
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 480px) {
    .form__row { grid-template-columns: 1fr; }
}
.form__group {
    position: relative;
}
.form__input, .form__textarea {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    color: #e4e4e7;
    font-size: .925rem;
    transition: border-color .3s, box-shadow .3s;
}
.form__input::placeholder, .form__textarea::placeholder {
    color: #52525b;
}
.form__input:focus, .form__textarea:focus {
    border-color: rgba(99,102,241,.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.form__textarea {
    resize: vertical;
    min-height: 140px;
}
.form__label {
    position: absolute;
    top: -9px;
    left: 16px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6366f1;
    background: #0a0a0f;
    padding: 0 6px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s, transform .25s;
}
.form__input:focus ~ .form__label,
.form__input:not(:placeholder-shown) ~ .form__label,
.form__textarea:focus ~ .form__label,
.form__textarea:not(:placeholder-shown) ~ .form__label {
    opacity: 1;
    transform: translateY(0);
}
.btn--submit {
    align-self: flex-start;
    padding: 16px 48px;
}
.form__status {
    font-size: .875rem;
    margin-top: 8px;
    opacity: 0;
    transition: opacity .3s;
}
.form__status.visible { opacity: 1; }
.form__status.success { color: #34d399; }
.form__status.error { color: #f87171; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: #131318;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: translateY(30px) scale(.96);
    transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}
.modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    color: #71717a;
    cursor: pointer;
    transition: color .25s;
    padding: 4px;
}
.modal__close:hover { color: #e4e4e7; }
.modal__close svg { width: 20px; height: 20px; }
.modal h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 8px;
}
.modal p {
    color: #71717a;
    margin-bottom: 28px;
    font-size: .925rem;
}
.modal .form__group { margin-bottom: 16px; }
.modal .btn { width: 100%; justify-content: center; }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 40px 0;
}
.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.footer__copy {
    font-size: .85rem;
    color: #52525b;
}
.footer__links {
    display: flex;
    gap: 24px;
    list-style: none;
}
.footer__links a {
    font-size: .85rem;
    color: #52525b;
    transition: color .25s;
}
.footer__links a:hover { color: #e4e4e7; }

/* ── Cursor follower ───────────────────────────────────────── */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(99,102,241,.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .25s, height .25s, border-color .25s;
}
.cursor.hover {
    width: 48px;
    height: 48px;
    border-color: rgba(99,102,241,.6);
}
@media (hover: none) {
    .cursor { display: none; }
}

/* ── Page loader ───────────────────────────────────────────── */
.loader {
    position: fixed;
    inset: 0;
    background: #0a0a0f;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader__bar {
    width: 120px;
    height: 2px;
    background: rgba(255,255,255,.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.loader__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    border-radius: 2px;
}
