/* ==========================================================================
   Rehmat Ullah — Portfolio
   Hand-written design system. No build step required.
   Sections: 1.Tokens 2.Reset 3.Layout 4.Components 5.Sections 6.Motion 7.Responsive
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
    /* surfaces */
    --bg:            #05070d;
    --bg-soft:       #080c16;
    --surface:       rgba(255, 255, 255, .028);
    --surface-hover: rgba(255, 255, 255, .055);
    --border:        rgba(255, 255, 255, .075);
    --border-strong: rgba(255, 255, 255, .14);

    /* text */
    --text:    #e9edf7;
    --text-dim:#9aa4bd;
    --text-mut:#6b7594;

    /* accents */
    --emerald: #34d399;
    --violet:  #a78bfa;
    --amber:   #fbbf24;
    --sky:     #38bdf8;
    --rose:    #fb7185;

    --accent:      var(--emerald);
    --accent-2:    var(--violet);
    --accent-glow: rgba(52, 211, 153, .28);

    /* type */
    --font-sans: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, monospace;

    /* metrics */
    --max:      1180px;
    --radius:   16px;
    --radius-sm:10px;
    --radius-lg:24px;
    --nav-h:    68px;

    --shadow:    0 18px 50px -18px rgba(0, 0, 0, .75);
    --shadow-lg: 0 32px 80px -28px rgba(0, 0, 0, .85);

    --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

::selection { background: var(--accent); color: #04120c; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    border-radius: 99px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- 3. LAYOUT ---------- */
.wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: 24px;
}

.section { padding: 104px 0; position: relative; }
.section--tight { padding: 72px 0; }

/* ambient background */
.bg-fx {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}
.bg-fx::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
}
.orb--1 { width: 520px; height: 520px; top: -180px;  left: -140px; background: rgba(52, 211, 153, .20); }
.orb--2 { width: 460px; height: 460px; top: 18%;     right: -180px; background: rgba(167, 139, 250, .17); }
.orb--3 { width: 560px; height: 560px; bottom: -8%;  left: 28%;    background: rgba(56, 189, 248, .10); }

/* ---------- 4. COMPONENTS ---------- */

/* -- buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 24px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: .2px;
    white-space: nowrap;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease),
                background .25s var(--ease), border-color .25s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: linear-gradient(135deg, var(--emerald), #22c9a0);
    color: #04140e;
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn--primary:hover { box-shadow: 0 18px 40px -12px var(--accent-glow); }

.btn--ghost {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    backdrop-filter: blur(10px);
}
.btn--ghost:hover { background: var(--surface-hover); border-color: rgba(52, 211, 153, .45); }

.btn--sm { padding: 9px 17px; font-size: 13px; }

/* -- pill / badge -- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-dim);
    backdrop-filter: blur(8px);
}
.pill--live { color: var(--emerald); border-color: rgba(52, 211, 153, .3); }

.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: pulse 2.4s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); }
    70%  { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.tag {
    display: inline-block;
    padding: 4.5px 11px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-dim);
    letter-spacing: .2px;
}

/* -- card -- */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(12px);
    transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
    overflow: hidden;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--surface-hover);
}
/* cursor-follow sheen (JS sets --mx/--my) */
.card--glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
                rgba(52, 211, 153, .09), transparent 62%);
    opacity: 0;
    transition: opacity .35s var(--ease);
    pointer-events: none;
}
.card--glow:hover::before { opacity: 1; }

/* -- section heading -- */
.head { margin-bottom: 56px; max-width: 720px; }
.head__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.head__eyebrow::before {
    content: '';
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.head__title {
    font-size: clamp(30px, 4.4vw, 46px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -1.1px;
}
.head__sub {
    margin-top: 15px;
    color: var(--text-dim);
    font-size: 16.5px;
    line-height: 1.7;
}
.head--center { margin-inline: auto; text-align: center; }
.head--center .head__eyebrow::before { display: none; }

.grad {
    background: linear-gradient(115deg, var(--emerald) 5%, var(--sky) 48%, var(--violet) 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- 5. SECTIONS ---------- */

/* -- NAV -- */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}
.nav.is-stuck {
    background: rgba(5, 7, 13, .78);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom-color: var(--border);
}
.nav__inner {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.nav__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    letter-spacing: -.3px;
    font-size: 16px;
}
.nav__mark {
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    color: #04140e;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.5px;
    box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.nav__word { display: inline-flex; align-items: baseline; }
.nav__tld  { color: var(--text-mut); font-weight: 500; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link {
    position: relative;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    transition: color .2s, background .2s;
}
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.nav__cta { display: flex; align-items: center; gap: 10px; }

.nav__burger {
    display: none;
    width: 42px; height: 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    place-items: center;
}
.nav__burger span {
    display: block;
    width: 17px; height: 1.8px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s;
}
.nav__burger span + span { margin-top: 4.5px; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6.3px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6.3px) rotate(-45deg); }

.nav__mobile {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    background: rgba(5, 7, 13, .97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px 26px;
    display: none;
    flex-direction: column;
    gap: 3px;
    z-index: 99;
}
.nav__mobile.is-open { display: flex; animation: slideDown .32s var(--ease); }
.nav__mobile a {
    padding: 13px 14px;
    border-radius: 11px;
    color: var(--text-dim);
    font-weight: 500;
    transition: background .2s, color .2s;
}
.nav__mobile a:hover { background: var(--surface); color: var(--text); }
.nav__mobile .btn { margin-top: 12px; justify-content: center; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- HERO -- */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 56px) 0 72px;
    position: relative;
}
.hero__grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 64px;
    align-items: center;
    width: 100%;
}
.hero__title {
    font-size: clamp(38px, 6.6vw, 72px);
    line-height: 1.04;
    font-weight: 700;
    letter-spacing: -2.4px;
    margin: 22px 0 6px;
}
.hero__role {
    font-size: clamp(19px, 2.6vw, 27px);
    font-weight: 600;
    color: var(--text-dim);
    min-height: 1.5em;
    letter-spacing: -.4px;
}
.hero__role .type { color: var(--accent); }
.hero__role .caret {
    display: inline-block;
    width: 2.5px;
    height: 1.05em;
    background: var(--accent);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero__lead {
    margin-top: 22px;
    max-width: 540px;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-dim);
}
.hero__actions {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
}
.hero__socials {
    margin-top: 34px;
    display: flex;
    align-items: center;
    gap: 11px;
}
.hero__socials .sep {
    width: 1px; height: 22px;
    background: var(--border);
    margin-right: 4px;
}
.iconbtn {
    width: 42px; height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-dim);
    transition: color .25s, border-color .25s, transform .25s var(--ease), background .25s;
}
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn:hover {
    color: var(--accent);
    border-color: rgba(52, 211, 153, .45);
    background: var(--surface-hover);
    transform: translateY(-3px);
}

/* code window */
.codewin {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(165deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
    overflow: hidden;
}
.codewin__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .02);
}
.codewin__bar i {
    width: 11px; height: 11px;
    border-radius: 50%;
    display: block;
}
.codewin__bar i:nth-child(1) { background: #ff5f57; }
.codewin__bar i:nth-child(2) { background: #febc2e; }
.codewin__bar i:nth-child(3) { background: #28c840; }
.codewin__bar em {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-style: normal;
    color: var(--text-mut);
}
.codewin__body {
    padding: 22px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.95;
    overflow-x: auto;
}
.codewin__body .ln { color: var(--text-mut); user-select: none; display: inline-block; width: 22px; }
.c-key { color: #c084fc; }
.c-fn  { color: #60a5fa; }
.c-str { color: #34d399; }
.c-num { color: #fbbf24; }
.c-cm  { color: #5b6479; font-style: italic; }
.c-var { color: #e9edf7; }

/* avatar */
.avatar-wrap {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 26px;
    aspect-ratio: 1;
}
.avatar-wrap::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--emerald), var(--sky), var(--violet), var(--emerald));
    filter: blur(28px);
    opacity: .3;
    z-index: -1;
    animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 0%;
    border: 2px solid var(--border-strong);
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(52, 211, 153, .18), rgba(167, 139, 250, .18));
    font-size: 68px;
    font-weight: 800;
    letter-spacing: -3px;
    color: var(--text);
}

/* -- STATS -- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 68px;
}
.stat {
    text-align: center;
    padding: 26px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(10px);
    transition: border-color .3s, transform .3s var(--ease);
}
.stat:hover { border-color: rgba(52, 211, 153, .35); transform: translateY(-3px); }
.stat__v {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1.4px;
    background: linear-gradient(135deg, var(--emerald), var(--sky));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat__l {
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--text-mut);
    letter-spacing: .3px;
}

/* -- ABOUT -- */
.about {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 56px;
    align-items: start;
}
.about__text p { color: var(--text-dim); font-size: 16.5px; line-height: 1.85; }
.about__text p + p { margin-top: 18px; }

.facts { display: grid; gap: 12px; }
.fact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .25s, background .25s;
}
.fact:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.fact__ico {
    width: 36px; height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(52, 211, 153, .1);
    color: var(--accent);
}
.fact__ico svg { width: 17px; height: 17px; }
.fact__k { display: block; font-size: 11.5px; color: var(--text-mut); letter-spacing: .5px; text-transform: uppercase; }
.fact__v { display: block; font-size: 14.5px; font-weight: 600; }

.edu {
    margin-top: 26px;
    padding: 20px;
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.edu h4 { font-size: 15.5px; font-weight: 600; }
.edu p  { font-size: 14px; color: var(--text-dim); margin-top: 3px; }
.edu span { font-family: var(--font-mono); font-size: 12px; color: var(--text-mut); }

/* -- STACK -- */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.stack-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.stack-card__ico {
    width: 38px; height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(52, 211, 153, .16), rgba(167, 139, 250, .13));
    color: var(--accent);
}
.stack-card__ico svg { width: 18px; height: 18px; }
.stack-card__head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }

.skill + .skill { margin-top: 15px; }
.skill__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 7px;
}
.skill__name { font-size: 14px; font-weight: 500; }
.skill__pct { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mut); }
.skill__bar {
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .06);
    overflow: hidden;
}
.skill__fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--emerald), var(--sky));
    transition: width 1.15s var(--ease);
    box-shadow: 0 0 12px -2px var(--accent-glow);
}

/* -- SERVICES -- */
.svc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.svc__ico {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(52, 211, 153, .16), rgba(167, 139, 250, .13));
    border: 1px solid var(--border);
    color: var(--accent);
    margin-bottom: 18px;
    transition: transform .35s var(--ease);
}
.svc__ico svg { width: 21px; height: 21px; }
.card:hover .svc__ico { transform: scale(1.08) rotate(-4deg); }
.svc h3 { font-size: 17px; font-weight: 650; letter-spacing: -.3px; margin-bottom: 9px; }
.svc p  { font-size: 14.5px; color: var(--text-dim); line-height: 1.72; }

/* -- EXPERIENCE -- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 1.5px;
    background: linear-gradient(180deg, var(--accent), var(--violet), transparent);
    opacity: .45;
}
.tl-item { position: relative; }
.tl-item + .tl-item { margin-top: 26px; }
.tl-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 30px;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-strong);
    transition: border-color .3s, box-shadow .3s;
}
.tl-item--current::before {
    border-color: var(--accent);
    box-shadow: 0 0 0 5px rgba(52, 211, 153, .12);
}
.tl-item:hover::before { border-color: var(--accent); }

.tl__top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.tl__company { font-size: 19px; font-weight: 680; letter-spacing: -.4px; }
.tl__period {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-mut);
    white-space: nowrap;
}
.tl__role {
    font-size: 14.5px;
    color: var(--accent);
    font-weight: 550;
    margin-bottom: 16px;
}
.tl__points li {
    position: relative;
    padding-left: 20px;
    font-size: 14.5px;
    color: var(--text-dim);
    line-height: 1.7;
}
.tl__points li + li { margin-top: 8px; }
.tl__points li::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 10px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .65;
}
.tl__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }

/* -- PROJECTS -- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 34px;
}
.filter {
    padding: 8.5px 18px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dim);
    transition: all .25s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #04140e;
    font-weight: 600;
}

.proj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.proj { display: flex; flex-direction: column; padding: 0; }
.proj.is-hidden { display: none; }
.proj--wide { grid-column: span 3; }

.proj__visual {
    position: relative;
    aspect-ratio: 16 / 8.2;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(150deg, rgba(52, 211, 153, .14), rgba(5, 7, 13, .2) 55%);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.proj[data-accent="violet"]  .proj__visual { background: linear-gradient(150deg, rgba(167, 139, 250, .16), rgba(5, 7, 13, .2) 55%); }
.proj[data-accent="amber"]   .proj__visual { background: linear-gradient(150deg, rgba(251, 191, 36, .14),  rgba(5, 7, 13, .2) 55%); }
.proj[data-accent="sky"]     .proj__visual { background: linear-gradient(150deg, rgba(56, 189, 248, .14),  rgba(5, 7, 13, .2) 55%); }
.proj[data-accent="rose"]    .proj__visual { background: linear-gradient(150deg, rgba(251, 113, 133, .14), rgba(5, 7, 13, .2) 55%); }

.proj__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
}
.proj__mono {
    position: relative;
    font-family: var(--font-mono);
    font-size: clamp(19px, 2.3vw, 27px);
    font-weight: 700;
    letter-spacing: -1px;
    color: rgba(255, 255, 255, .92);
    text-align: center;
    padding: 0 20px;
    transition: transform .5s var(--ease);
}
.proj:hover .proj__mono { transform: scale(1.05); }
.proj__mono small {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-mut);
    margin-top: 8px;
}
.proj__badge {
    position: absolute;
    top: 14px; left: 14px;
    padding: 4.5px 11px;
    border-radius: 99px;
    background: rgba(5, 7, 13, .72);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    color: var(--text-dim);
}
.proj__live {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(5, 7, 13, .72);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    color: var(--text-dim);
    transition: color .25s, border-color .25s, transform .25s var(--ease);
}
.proj__live svg { width: 14px; height: 14px; }
.proj:hover .proj__live { color: var(--accent); border-color: rgba(52, 211, 153, .5); transform: rotate(45deg); }

.proj__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.proj__title {
    font-size: 18.5px;
    font-weight: 680;
    letter-spacing: -.4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.proj__tagline { font-size: 13px; color: var(--accent); margin-top: 3px; font-weight: 500; }
.proj__desc { font-size: 14.5px; color: var(--text-dim); line-height: 1.72; margin-top: 13px; }
.proj__points { margin-top: 15px; }
.proj__points li {
    position: relative;
    padding-left: 18px;
    font-size: 13.5px;
    color: var(--text-mut);
    line-height: 1.65;
}
.proj__points li + li { margin-top: 5px; }
.proj__points li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: .7;
}
.proj__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 20px; }

.proj--wide .proj__body { padding: 30px; }
.proj--wide .proj__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.proj--wide .proj__visual { border-bottom: 0; border-right: 1px solid var(--border); aspect-ratio: auto; min-height: 300px; }

/* -- PROCESS -- */
.process {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.step { position: relative; }
.step__n {
    font-family: var(--font-mono);
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 14px;
}
.card:hover .step__n {
    background: linear-gradient(180deg, var(--emerald), rgba(52, 211, 153, .25));
    -webkit-background-clip: text;
    background-clip: text;
}
.step h3 { font-size: 16.5px; font-weight: 650; margin-bottom: 8px; letter-spacing: -.3px; }
.step p  { font-size: 14px; color: var(--text-dim); line-height: 1.68; }

/* -- CONTACT -- */
.contact-box {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse 70% 100% at 50% 0%, rgba(52, 211, 153, .1), transparent 62%),
        var(--surface);
    padding: 68px 40px;
    text-align: center;
    overflow: hidden;
    backdrop-filter: blur(14px);
}
.contact-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, #000, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, #000, transparent 75%);
    pointer-events: none;
}
.contact-box > * { position: relative; }
.contact-box h2 {
    font-size: clamp(28px, 4.6vw, 46px);
    font-weight: 700;
    letter-spacing: -1.4px;
    line-height: 1.12;
    margin: 18px 0 16px;
}
.contact-box p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--text-dim);
    font-size: 16.5px;
    line-height: 1.7;
}
.contact-actions {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    justify-content: center;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 22px;
}
.ccard {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.ccard:hover {
    transform: translateY(-3px);
    border-color: rgba(52, 211, 153, .4);
    background: var(--surface-hover);
}
.ccard__ico {
    width: 44px; height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(52, 211, 153, .1);
    color: var(--accent);
}
.ccard__ico svg { width: 19px; height: 19px; }
.ccard__k { display: block; font-size: 11.5px; color: var(--text-mut); letter-spacing: .5px; text-transform: uppercase; }
.ccard__v { display: block; font-size: 14.5px; font-weight: 600; word-break: break-word; }

/* -- FOOTER -- */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 40px;
}
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.footer p { font-size: 13.5px; color: var(--text-mut); }
.footer__made { font-family: var(--font-mono); font-size: 12px; }
.footer__made b { color: var(--accent); font-weight: 500; }

/* -- back to top -- */
.totop {
    position: fixed;
    right: 24px; bottom: 24px;
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid var(--border-strong);
    background: rgba(5, 7, 13, .85);
    backdrop-filter: blur(12px);
    color: var(--text-dim);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: all .35s var(--ease);
}
.totop.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.totop:hover { color: var(--accent); border-color: rgba(52, 211, 153, .5); }
.totop svg { width: 17px; height: 17px; }

/* scroll progress */
.progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--emerald), var(--sky), var(--violet));
    z-index: 101;
    transition: width .1s linear;
}

/* ---------- 6. MOTION ---------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .75s var(--ease), transform .75s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- 7. RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .hero__grid  { grid-template-columns: 1fr; gap: 48px; }
    .hero__visual{ order: -1; max-width: 460px; margin-inline: auto; width: 100%; }
    .about       { grid-template-columns: 1fr; gap: 40px; }
    .svc-grid    { grid-template-columns: repeat(2, 1fr); }
    .proj-grid   { grid-template-columns: repeat(2, 1fr); }
    .proj--wide  { grid-column: span 2; }
    .process     { grid-template-columns: repeat(2, 1fr); }
    .contact-cards { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .nav__links  { display: none; }
    .nav__cta .btn { display: none; }
    .nav__burger { display: grid; }
    .proj--wide .proj__grid { grid-template-columns: 1fr; }
    .proj--wide .proj__visual { border-right: 0; border-bottom: 1px solid var(--border); min-height: 220px; }
}

@media (max-width: 720px) {
    .section       { padding: 76px 0; }
    .wrap          { padding-inline: 18px; }
    .stats         { grid-template-columns: repeat(2, 1fr); }
    .stack-grid    { grid-template-columns: 1fr; }
    .svc-grid      { grid-template-columns: 1fr; }
    .proj-grid     { grid-template-columns: 1fr; }
    .proj--wide    { grid-column: span 1; }
    .contact-box   { padding: 48px 22px; }
    .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
    .timeline      { padding-left: 26px; }
    .tl-item::before { left: -26px; }
    .card          { padding: 22px; }
    .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr; }
    .codewin__body { font-size: 11.5px; }
}

/* print — clean output, like a resume */
@media print {
    .bg-fx, .nav, .totop, .progress, .filters, .hero__socials { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .stat, .fact { border-color: #ddd; background: #fff; }
    .grad, .stat__v { -webkit-text-fill-color: #000; color: #000; }
}
