/* =========================================================
   Sami Al-Najadat — Portfolio
   ========================================================= */

:root {
    --bg: #07080d;
    --bg-2: #0b0d15;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-2: rgba(255, 255, 255, 0.16);
    --text: #eef0f7;
    --muted: #9aa0b4;
    --dim: #646a80;

    --red: #ff3d5e;
    --violet: #8b5cf6;
    --cyan: #22d3ee;
    --green: #34d399;
    --grad: linear-gradient(120deg, var(--red) 0%, var(--violet) 50%, var(--cyan) 100%);

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
    --ease: cubic-bezier(.2, .8, .2, 1);

    --f-display: "Space Grotesk", "Cairo", system-ui, sans-serif;
    --f-body: "Inter", "Cairo", system-ui, sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, monospace;

    --nav-h: 72px;
}

html[lang="ar"] {
    --f-display: "Cairo", system-ui, sans-serif;
    --f-body: "Cairo", system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.is-loading {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

::selection {
    background: var(--violet);
    color: #fff;
}

.container {
    width: min(1180px, 100% - 32px);
    margin-inline: auto;
}

.mono {
    font-family: var(--f-mono);
}

.center {
    text-align: center;
    margin-top: 48px;
}

.grad-text {
    background: var(--grad);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradShift 6s linear infinite;
}

@keyframes gradShift {
    to {
        background-position: 200% center;
    }
}

/* ---------- Loader ---------- */
.loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 22px;
    transition: opacity .6s var(--ease), visibility .6s;
}

.loader.done {
    opacity: 0;
    visibility: hidden;
}

.loader__logo {
    width: 130px;
    animation: pulse 1.4s ease-in-out infinite;
}

.loader__bar {
    width: 160px;
    height: 3px;
    border-radius: 3px;
    background: var(--surface-2);
    overflow: hidden;
}

.loader__bar span {
    display: block;
    height: 100%;
    width: 40%;
    background: var(--grad);
    animation: load 1s ease-in-out infinite;
}

@keyframes load {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(260%);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: .6;
        transform: scale(.97);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------- Background layers ---------- */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(1000px 600px at 85% -10%, rgba(139, 92, 246, .18), transparent 60%),
        radial-gradient(800px 500px at -10% 30%, rgba(255, 61, 94, .12), transparent 60%),
        radial-gradient(900px 600px at 50% 120%, rgba(34, 211, 238, .10), transparent 60%),
        linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 64px 64px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
    opacity: .9;
}

.cursor-glow {
    position: fixed;
    width: 520px;
    height: 520px;
    left: 0;
    top: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, rgba(139, 92, 246, .14), transparent 65%);
    transform: translate(-50%, -50%);
    transition: opacity .3s;
    opacity: 0;
}

.scroll-progress {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 3px;
    width: 0;
    z-index: 200;
    background: var(--grad);
    box-shadow: 0 0 12px rgba(139, 92, 246, .8);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
    white-space: nowrap;
}

.btn--sm {
    padding: 10px 18px;
    font-size: 14px;
}

.btn--primary {
    background: var(--grad);
    background-size: 160% auto;
    color: #fff;
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, .7);
}

.btn--primary:hover {
    transform: translateY(-2px);
    background-position: right center;
    box-shadow: 0 16px 40px -12px rgba(255, 61, 94, .7);
}

.btn--ghost {
    background: var(--surface);
    border-color: var(--border-2);
    backdrop-filter: blur(8px);
}

.btn--ghost:hover {
    transform: translateY(-2px);
    border-color: var(--violet);
    background: rgba(139, 92, 246, .12);
}

.btn--wa {
    background: rgba(37, 211, 102, .12);
    border-color: rgba(37, 211, 102, .4);
    color: #5ff09a;
}

.btn--wa:hover {
    transform: translateY(-2px);
    background: rgba(37, 211, 102, .2);
}

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-h);
    transition: background .3s, border-color .3s, backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: rgba(7, 8, 13, .72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom-color: var(--border);
}

.nav__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav__brand img {
    height: 38px;
    width: auto;
}

.nav__links {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.nav__link {
    position: relative;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    transition: color .2s, background .2s;
}

.nav__link:hover {
    color: var(--text);
}

.nav__link.active {
    color: #fff;
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--border-2);
}

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

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .2s, background .2s;
}

.lang-btn:hover {
    border-color: var(--violet);
    background: rgba(139, 92, 246, .12);
}

#langLabel {
    font-family: "Cairo", var(--f-body);
}

html[lang="ar"] #langLabel {
    font-family: var(--f-body);
}

.burger {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
}

.burger span {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform .3s var(--ease), opacity .2s;
}

.burger span:nth-child(1) {
    top: 15px;
}

.burger span:nth-child(2) {
    top: 21px;
}

.burger span:nth-child(3) {
    top: 27px;
}

.burger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.burger.open span:nth-child(2) {
    opacity: 0;
}

.burger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow-x: clip;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 40px) 0 80px;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: 48px;
}

.hero__title {
    margin: 0 0 12px;
    font-family: var(--f-display);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.03em;
}

html[lang="ar"] .hero__title {
    letter-spacing: 0;
    line-height: 1.25;
}

.hero__hi {
    display: block;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 500;
    color: var(--muted);
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.hero__name {
    display: block;
    font-size: clamp(44px, 7.4vw, 92px);
    padding-bottom: .06em;
}

.nw {
    white-space: nowrap;
}

/* background-clip:text hides anything outside the box, e.g. the dots under ي */
html[lang="ar"] .hero__name {
    line-height: 1.35;
    padding-bottom: .3em;
    margin-bottom: -.15em;
}

.hero__role {
    margin: 0 0 22px;
    font-family: var(--f-mono);
    font-size: clamp(16px, 2.2vw, 22px);
    color: var(--cyan);
    min-height: 1.6em;
}

html[lang="ar"] .hero__role {
    font-family: "Cairo", var(--f-mono);
    font-weight: 600;
}

/* the </> brackets read backwards in RTL, so Arabic shows the bare role */
html[lang="ar"] .hero__role .mono {
    display: none;
}

.hero__role .mono {
    color: var(--dim);
}

.caret {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    margin-inline: 3px;
    background: var(--cyan);
    vertical-align: -0.18em;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero__desc {
    max-width: 560px;
    color: var(--muted);
    font-size: 17px;
    margin: 0 0 32px;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 36px;
}

.socials {
    display: flex;
    gap: 12px;
}

.socials a {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 18px;
    transition: transform .25s var(--ease), color .2s, border-color .2s, background .2s;
}

.socials a:hover {
    transform: translateY(-4px);
    color: #fff;
    border-color: var(--violet);
    background: rgba(139, 92, 246, .14);
}

.socials--sm a {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

/* avatar */
.hero__visual {
    display: grid;
    place-items: center;
}

.avatar {
    position: relative;
    width: min(440px, 100%);
    aspect-ratio: 1 / 1.12;
    display: grid;
    place-items: end center;
    transform-style: preserve-3d;
    transition: transform .2s ease-out;
}

.avatar__ring {
    position: absolute;
    inset: 4% 4% 6%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--red), var(--violet), var(--cyan), var(--red));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    animation: spin 12s linear infinite;
    opacity: .9;
}

.avatar__blob {
    position: absolute;
    inset: 10% 10% 12%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 61, 94, .55), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(34, 211, 238, .45), transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, .6), transparent 70%);
    filter: blur(8px);
    animation: morph 10s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes morph {

    0%,
    100% {
        border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%;
        transform: rotate(0);
    }

    50% {
        border-radius: 58% 42% 40% 60% / 42% 60% 40% 58%;
        transform: rotate(20deg);
    }
}

.avatar__img {
    position: relative;
    width: 78%;
    z-index: 2;
    /* fade the bottom and the hard-cropped right edge of the photo */
    -webkit-mask-image: linear-gradient(#000 78%, transparent), linear-gradient(to left, transparent, #000 16%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(#000 78%, transparent), linear-gradient(to left, transparent, #000 16%);
    mask-composite: intersect;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5));
}

.chip {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 14px;
    background: rgba(14, 16, 26, .78);
    border: 1px solid var(--border-2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}

.chip img {
    width: 20px;
    height: 20px;
}

.chip--1 {
    top: 12%;
    inset-inline-start: -4%;
}

.chip--2 {
    top: 6%;
    inset-inline-end: 0;
    animation-delay: -1.5s;
}

.chip--3 {
    top: 46%;
    inset-inline-end: -8%;
    animation-delay: -3s;
}

.chip--4 {
    top: 52%;
    inset-inline-start: -10%;
    animation-delay: -4.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-14px);
    }
}

.code-card {
    position: absolute;
    z-index: 4;
    bottom: 2%;
    inset-inline-end: -6%;
    padding: 12px 16px 14px;
    border-radius: 14px;
    background: rgba(11, 13, 21, .9);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    direction: ltr;
    text-align: left;
    animation: float 7s ease-in-out infinite -2s;
}

.code-card__dots {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.code-card__dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff5f57;
}

.code-card__dots i:nth-child(2) {
    background: #febc2e;
}

.code-card__dots i:nth-child(3) {
    background: #28c840;
}

.code-card pre {
    margin: 0;
    font-family: var(--f-mono);
    font-size: 12px;
    line-height: 1.7;
    color: #c9cde0;
}

.tk-k {
    color: #c792ea;
}

.tk-c {
    color: #ffcb6b;
}

.tk-v {
    color: #f07178;
}

.tk-s {
    color: #c3e88d;
}

.tk-n {
    color: #89ddff;
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    width: 26px;
    height: 42px;
    border-radius: 14px;
    border: 2px solid var(--border-2);
}

.scroll-hint span {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--text);
    animation: wheel 1.8s ease-in-out infinite;
}

@keyframes wheel {
    0% {
        opacity: 0;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--border);
    border: 1px solid var(--border);
}

.stat {
    padding: 30px 24px;
    background: var(--bg-2);
    text-align: center;
}

.stat__num {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(36px, 4.5vw, 52px);
    line-height: 1.1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat__label {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
}

/* ---------- Sections ---------- */
.section {
    padding: 120px 0 40px;
}

.section__head {
    text-align: center;
    margin-bottom: 56px;
}

.eyebrow {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--cyan);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, .25);
    background: rgba(34, 211, 238, .06);
}

html[lang="ar"] .eyebrow {
    letter-spacing: 0;
    font-family: "Cairo", var(--f-mono);
    font-weight: 700;
}

.section__title {
    margin: 18px 0 0;
    font-family: var(--f-display);
    font-size: clamp(32px, 4.6vw, 54px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

html[lang="ar"] .section__title {
    letter-spacing: 0;
    line-height: 1.35;
}

.section__sub {
    max-width: 560px;
    margin: 16px auto 0;
    color: var(--muted);
    font-size: 17px;
}

/* ---------- About ---------- */
.about {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 48px;
    align-items: start;
}

.about__text p {
    color: var(--muted);
    font-size: 17px;
    margin: 0 0 18px;
}

.about__text strong {
    color: var(--text);
    font-weight: 600;
}

.sectors {
    list-style: none;
    padding: 0;
    margin: 0 0 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.sectors li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    font-size: 14px;
    font-weight: 500;
    transition: border-color .2s, background .2s, transform .2s var(--ease);
}

.sectors li:hover {
    transform: translateY(-2px);
    border-color: var(--violet);
    background: rgba(139, 92, 246, .12);
}

.sectors li i {
    color: var(--cyan);
    font-size: 13px;
}

.sectors .sectors__more {
    border-style: dashed;
    color: var(--muted);
}

.ticks {
    list-style: none;
    padding: 0;
    margin: 26px 0 0;
    display: grid;
    gap: 12px;
}

.ticks li {
    position: relative;
    padding-inline-start: 34px;
    color: var(--text);
}

.ticks li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    position: absolute;
    inset-inline-start: 0;
    top: 3px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: var(--grad);
}

.services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.service,
.tl-item__card,
.c-card,
.form,
.skill-group,
.project {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .3s var(--ease), border-color .3s, background .3s, box-shadow .3s;
}

/* spotlight border that follows the cursor */
.tilt::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, .8), transparent 45%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.tilt:hover::after {
    opacity: 1;
}

.service {
    padding: 26px;
}

.service:hover {
    background: var(--surface-2);
    transform: translateY(-4px);
}

.service__icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 21px;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 61, 94, .9), rgba(139, 92, 246, .9));
    box-shadow: 0 10px 24px -10px rgba(139, 92, 246, .8);
    margin-bottom: 18px;
}

.service:nth-child(2) .service__icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, .9), rgba(34, 211, 238, .9));
}

.service:nth-child(3) .service__icon {
    background: linear-gradient(135deg, rgba(34, 211, 238, .9), rgba(52, 211, 153, .9));
}

.service:nth-child(4) .service__icon {
    background: linear-gradient(135deg, rgba(251, 146, 60, .95), rgba(255, 61, 94, .9));
}

.service h3 {
    margin: 0 0 8px;
    font-family: var(--f-display);
    font-size: 19px;
}

.service p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

/* ---------- Skills ---------- */
.skills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.skill-group {
    padding: 24px;
}

.skill-group:hover {
    background: var(--surface-2);
}

.skill-group__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.skill-group__head i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(139, 92, 246, .14);
    color: #b9a2ff;
}

.skill-group__head h3 {
    margin: 0;
    font-family: var(--f-display);
    font-size: 17px;
}

.skill-list {
    display: grid;
    gap: 10px;
}

.skill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 500;
    transition: border-color .2s, background .2s, transform .2s var(--ease);
}

.skill:hover {
    border-color: var(--border-2);
    background: rgba(255, 255, 255, .05);
    transform: translateX(4px);
}

html[dir="rtl"] .skill:hover {
    transform: translateX(-4px);
}

.skill img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.invert {
    filter: invert(1);
}

.marquee {
    margin-top: 70px;
    overflow: hidden;
    border-block: 1px solid var(--border);
    background: rgba(255, 255, 255, .015);
    padding: 22px 0;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    direction: ltr;
}

.marquee__track {
    display: flex;
    gap: 56px;
    width: max-content;
    animation: marquee 40s linear infinite;
}

.marquee:hover .marquee__track {
    animation-play-state: paused;
}

.marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--dim);
    white-space: nowrap;
    transition: color .2s;
}

.marquee__item:hover {
    color: var(--text);
}

.marquee__item img {
    width: 32px;
    height: 32px;
    filter: grayscale(1) brightness(1.4);
    opacity: .7;
    transition: filter .2s, opacity .2s;
}

.marquee__item:hover img {
    filter: none;
    opacity: 1;
}

.marquee__item img.invert {
    filter: invert(1) grayscale(1);
}

@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}

/* ---------- Timeline ---------- */
.timeline {
    position: relative;
    max-width: 820px;
    margin-inline: auto;
    display: grid;
    gap: 26px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    inset-inline-start: 23px;
    width: 2px;
    background: linear-gradient(var(--red), var(--violet), var(--cyan), transparent);
    opacity: .6;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 22px;
}

.tl-item__dot {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg-2);
    border: 2px solid var(--violet);
    color: #c4b2ff;
    box-shadow: 0 0 0 6px var(--bg), 0 0 24px rgba(139, 92, 246, .5);
}

.tl-item__card {
    padding: 24px 26px;
}

.tl-item__card:hover {
    background: var(--surface-2);
}

.tl-item__tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 61, 94, .12);
    color: #ff8aa0;
    border: 1px solid rgba(255, 61, 94, .3);
    margin-bottom: 12px;
}

.tl-item__tag--past {
    background: rgba(139, 92, 246, .12);
    color: #c4b2ff;
    border-color: rgba(139, 92, 246, .35);
}

.tl-item:first-child .tl-item__tag {
    background: rgba(52, 211, 153, .1);
    color: #8ff0c8;
    border-color: rgba(52, 211, 153, .35);
}

.tl-item__head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tl-item__head img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.tl-item h3 {
    margin: 0;
    font-family: var(--f-display);
    font-size: 20px;
}

.tl-item__org {
    margin: 2px 0 0;
    color: var(--cyan);
    font-weight: 500;
    font-size: 15px;
}

.tl-item__card>p:last-child:not(.tl-item__org) {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

/* ---------- Projects ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter {
    padding: 10px 20px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
}

.filter:hover {
    color: var(--text);
    border-color: var(--border-2);
}

.filter.active {
    color: #fff;
    border-color: transparent;
    background: var(--grad);
    box-shadow: 0 8px 24px -10px rgba(139, 92, 246, .8);
}

.projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.project {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -30px rgba(139, 92, 246, .55);
    border-color: var(--border-2);
}

.project.hide {
    display: none;
}

.project.pop {
    animation: popIn .45s var(--ease) both;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }
}

.project__cover {
    position: relative;
    height: 170px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--c1);
    isolation: isolate;
}

.project__cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, var(--c2), transparent 55%),
        radial-gradient(circle at 85% 80%, var(--c3), transparent 55%);
    transition: transform .6s var(--ease);
}

.project__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px;
    mask-image: linear-gradient(180deg, #000, transparent);
    -webkit-mask-image: linear-gradient(180deg, #000, transparent);
}

.project:hover .project__cover::before {
    transform: scale(1.25) rotate(8deg);
}

.project__icon {
    font-size: 54px;
    color: rgba(255, 255, 255, .95);
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .35));
    transition: transform .5s var(--ease);
}

.project:hover .project__icon {
    transform: scale(1.12) rotate(-6deg);
}

.project__badge {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(6px);
}

.project__year {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    font-family: var(--f-mono);
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
}

.project__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px;
}

.project__title {
    margin: 0 0 8px;
    font-family: var(--f-display);
    font-size: 20px;
}

.project__desc {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14.5px;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.tag {
    font-family: var(--f-mono);
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    color: #c8cbe0;
    direction: ltr;
}

.project__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    align-self: flex-start;
}

.project__link i:last-child {
    transition: transform .25s var(--ease);
}

.project__link:hover {
    color: var(--cyan);
}

.project__link:hover i:last-child {
    transform: translateX(4px);
}

html[dir="rtl"] .project__link i:last-child {
    transform: scaleX(-1);
}

html[dir="rtl"] .project__link:hover i:last-child {
    transform: scaleX(-1) translateX(4px);
}

/* ---------- Contact ---------- */
.contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.contact__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.c-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    min-width: 0;
}

.c-card:hover {
    background: var(--surface-2);
    transform: translateY(-3px);
}

.c-card:nth-child(1),
.c-card:nth-child(2) {
    grid-column: 1 / -1;
}

.c-card__icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
    color: #fff;
}

.c-card__icon--mail {
    background: linear-gradient(135deg, #ea4335, #ff3d5e);
}

.c-card__icon--phone {
    background: linear-gradient(135deg, var(--violet), #6366f1);
}

.c-card__icon--wa {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.c-card__icon--tg {
    background: linear-gradient(135deg, #2aabee, #229ed9);
}

.c-card__icon--in {
    background: linear-gradient(135deg, #0a66c2, #0077b5);
}

.c-card__icon--gh {
    background: linear-gradient(135deg, #333, #111);
    border: 1px solid var(--border-2);
}

.c-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.c-card__label {
    font-size: 12.5px;
    color: var(--dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

html[lang="ar"] .c-card__label {
    letter-spacing: 0;
}

.c-card__value {
    font-weight: 600;
    font-size: 15.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .c-card__value[dir="ltr"] {
    text-align: right;
}

a.c-card__value:hover {
    color: var(--cyan);
}

.c-card__go {
    color: var(--dim);
    font-size: 13px;
}

html[dir="rtl"] .c-card__go {
    transform: scaleX(-1);
}

.icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all .2s;
}

.icon-btn:hover {
    color: #fff;
    border-color: var(--violet);
    background: rgba(139, 92, 246, .15);
}

.form {
    padding: 30px;
}

.form h3 {
    margin: 0 0 22px;
    font-family: var(--f-display);
    font-size: 22px;
}

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .25);
    border: 1px solid var(--border-2);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    resize: vertical;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .2);
}

.field.invalid input,
.field.invalid textarea {
    border-color: var(--red);
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.form__note {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--dim);
}

.hp {
    display: none;
}

.btn:disabled {
    opacity: .75;
    cursor: progress;
    transform: none;
}

.field input::placeholder {
    color: var(--dim);
}

.form__body[hidden],
.form__done[hidden] {
    display: none;
}

.form__done {
    text-align: center;
    padding: 26px 6px 10px;
    animation: popIn .45s var(--ease) both;
}

.form__done-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 32px;
    color: #fff;
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 0 0 10px rgba(52, 211, 153, .12), 0 18px 40px -12px rgba(16, 185, 129, .8);
    animation: checkPop .6s var(--ease) .1s both;
}

@keyframes checkPop {
    from {
        opacity: 0;
        transform: scale(.4);
    }

    60% {
        transform: scale(1.08);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form .form__done h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.form__done p {
    max-width: 400px;
    margin: 0 auto;
    color: var(--muted);
}

.form__done .form__again-line {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
}

.form__again {
    padding: 0;
    border: 0;
    background: none;
    color: var(--cyan);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.form__again:hover {
    color: #fff;
}

.form__status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    animation: popIn .35s var(--ease) both;
}

.form__status[hidden] {
    display: none;
}

.form__status i {
    margin-top: 3px;
}

.form__status--err {
    background: rgba(255, 61, 94, .1);
    border: 1px solid rgba(255, 61, 94, .35);
    color: #ff9aad;
}

/* ---------- Footer ---------- */
.footer {
    margin-top: 100px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .015);
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 30px 0;
}

.footer__brand img {
    height: 36px;
    width: auto;
}

.footer__copy {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.footer__copy i {
    color: var(--red);
}

/* ---------- Misc ---------- */
.to-top {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    z-index: 90;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 12px 30px -10px rgba(139, 92, 246, .8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all .3s var(--ease);
}

.to-top.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.to-top:hover {
    transform: translateY(-3px);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 300;
    transform: translate(-50%, 30px);
    padding: 12px 20px;
    border-radius: 12px;
    background: #12141f;
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all .3s var(--ease);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast i {
    color: var(--green);
    margin-inline-end: 8px;
}

/* reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: var(--d, 0s);
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1260px) {
    .chip--3 {
        inset-inline-end: -2%;
    }

    .code-card {
        inset-inline-end: 0;
    }
}

@media (max-width: 1100px) {
    .skills {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .burger {
        display: block;
    }

    .nav__cta {
        display: none;
    }

    .nav__links {
        position: fixed;
        top: calc(var(--nav-h) - 4px);
        inset-inline: 16px;
        flex-direction: column;
        gap: 4px;
        padding: 12px;
        border-radius: 18px;
        background: rgba(11, 13, 21, .96);
        backdrop-filter: blur(16px);
        border-color: var(--border-2);
        box-shadow: var(--shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all .3s var(--ease);
    }

    .nav__links.open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav__link {
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 12px;
    }

    .hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 56px;
    }

    .hero__text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero__desc {
        margin-inline: auto;
    }

    .hero__cta,
    .socials {
        justify-content: center;
    }

    .hero__visual {
        order: -1;
    }

    .avatar {
        width: min(320px, 72vw);
    }

    .hero {
        padding-top: calc(var(--nav-h) + 16px);
    }

    .about {
        grid-template-columns: 1fr;
    }

    .scroll-hint {
        display: none;
    }
}

@media (max-width: 720px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding-top: 90px;
    }

    .services,
    .skills,
    .projects,
    .contact__cards,
    .form__row {
        grid-template-columns: 1fr;
    }

    .chip {
        font-size: 12px;
        padding: 7px 11px;
    }

    .chip--1 {
        inset-inline-start: 0;
    }

    .chip--3 {
        inset-inline-end: -2%;
    }

    .chip--4 {
        inset-inline-start: -2%;
    }

    .code-card {
        display: none;
    }

    .tl-item {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 14px;
    }

    .tl-item__dot {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .timeline::before {
        inset-inline-start: 19px;
    }

    .tl-item__card {
        padding: 20px;
        overflow-wrap: anywhere;
    }

    .tl-item__head img {
        width: 46px;
        height: 46px;
    }

    .footer__inner {
        flex-direction: column;
        text-align: center;
    }

    .form {
        padding: 22px;
    }

    .to-top {
        bottom: 16px;
        inset-inline-end: 16px;
    }
}

@media (max-width: 420px) {
    .lang-btn {
        padding: 9px 11px;
    }

    .hero__cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero__cta {
        width: 100%;
    }

    .stat {
        padding: 22px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

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