/* ================================================================
   PORTFOLIO v2 — ULTRA PREMIUM CSS
   Fonts loaded locally via assets/css/fonts.css
================================================================ */


/* ── TOKENS ─── */
:root {
    --bg: #0E1113;
    --bg2: #141719;
    --sur: rgba(255, 255, 255, 0.045);
    --sur2: rgba(255, 255, 255, 0.08);
    --brd: rgba(255, 255, 255, 0.09);
    --brd2: rgba(255, 255, 255, 0.20);
    --v: #9D866C;
    /* eye green  */
    --c: #C4956A;
    /* camel coat */
    --p: #A8D4B6;
    /* sage       */
    --g: #9D866C;
    --grd: linear-gradient(135deg, #9D866C, #C4956A);
    --t1: #F5F6F0;
    --t2: #9AA09A;
    --t3: #4A5250;
    --fh: 'Outfit', sans-serif;
    --fb: 'Inter', sans-serif;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --spr: cubic-bezier(.34, 1.56, .64, 1);
}

/* ── RESET ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--t2);
    font-family: var(--fb);
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

::placeholder {
    color: transparent;
}

::selection {
    background: rgba(139, 92, 246, .3);
    color: var(--t1);
}

/* ── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--grd);
    border-radius: 99px;
}

/* ── PRELOADER ─── */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .7s var(--ease), visibility .7s;
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.pre-ring {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--v);
    border-right-color: var(--c);
    animation: spin .9s linear infinite;
}

.pre-inner {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-bottom-color: var(--p);
    border-left-color: var(--g);
    animation: spin 1.3s linear infinite reverse;
}

.pre-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--grd);
    animation: prePulse .9s ease-in-out infinite alternate;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes prePulse {
    from {
        transform: scale(.8);
        opacity: .5;
    }

    to {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* ── SCROLL PROGRESS ─── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--grd);
    z-index: 9998;
    box-shadow: 0 0 10px rgba(62, 201, 122, .6);
    transition: width .12s;
}

/* ── ORBS ─── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(62, 201, 122, .22), transparent 70%);
    top: -250px;
    left: -250px;
    animation: orb1 22s ease-in-out infinite alternate;
}

.orb-2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(196, 149, 106, .2), transparent 70%);
    bottom: -200px;
    right: -200px;
    animation: orb2 28s ease-in-out infinite alternate;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(168, 212, 182, .14), transparent 70%);
    top: 40%;
    right: 25%;
    animation: orb3 18s ease-in-out infinite alternate;
}

@keyframes orb1 {
    to {
        transform: translate(180px, 130px) scale(1.1);
    }
}

@keyframes orb2 {
    to {
        transform: translate(-150px, -100px) scale(.85);
    }
}

@keyframes orb3 {
    to {
        transform: translate(60px, -140px) scale(1.15);
    }
}

/* ── NOISE ─── */
#noise {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── CANVAS ─── */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── CUSTOM CURSOR ─── */
#cursor-inner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--v);
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px rgba(139, 92, 246, .9);
    transition: width .2s, height .2s, background .3s;
}

#cursor-outer {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(139, 92, 246, .45);
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform .12s var(--ease), width .25s, height .25s;
}

body.hovering #cursor-inner {
    width: 14px;
    height: 14px;
    background: var(--c);
    box-shadow: 0 0 14px rgba(34, 211, 238, .8);
}

body.hovering #cursor-outer {
    width: 46px;
    height: 46px;
    border-color: rgba(34, 211, 238, .5);
}

/* ── GLASS ─── */
.glass-card {
    background: var(--sur);
    border: 1px solid var(--brd);
    border-radius: 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.glass-card-sm {
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--brd);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── ANIMATIONS ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

@keyframes ringDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes statusPing {
    0% {
        transform: scale(1);
        opacity: .8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ── REVEAL ─── */
.reveal-item {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-item:nth-child(2) {
    transition-delay: .06s
}

.reveal-item:nth-child(3) {
    transition-delay: .12s
}

.reveal-item:nth-child(4) {
    transition-delay: .18s
}

.reveal-item:nth-child(5) {
    transition-delay: .24s
}

.reveal-item:nth-child(6) {
    transition-delay: .30s
}

/* ── LAYOUT ─── */
.page-wrapper {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px 1fr 80px;
    gap: 20px;
    max-width: 1340px;
    margin: 0 auto;
    padding: 28px 20px;
    min-height: 100vh;
    align-items: start;
}

/* ── SIDEBAR ─── */
.profile-sidebar {
    position: sticky;
    top: 28px;
}

.profile-card {
    padding: 36px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grd);
}

/* Avatar */
.avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 22px;
    flex-shrink: 0;
}

.avatar-img-box {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(62, 201, 122, .35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .45), 0 0 0 4px rgba(62, 201, 122, .08);
}

.avatar-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.avatar-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: var(--t3);
}

.status-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 3;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--g);
    border: 2.5px solid var(--bg);
}

.ping {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--g);
    opacity: 0;
    animation: statusPing 1.8s ease-out infinite;
}

/* Name */
.profile-name {
    font-family: var(--fh);
    color: var(--t1);
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -.02em;
}

.role-wrap {
    margin-bottom: 18px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .3);
    color: #C4B5FD;
    padding: 5px 14px;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 500;
}

.caret {
    animation: blink .8s step-end infinite;
    color: var(--v);
}

/* Tags */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    margin-bottom: 20px;
}

.tag {
    font-size: .72rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--brd);
    color: var(--t2);
    transition: .25s var(--ease);
    cursor: default;
}

.tag:hover {
    border-color: var(--v);
    color: #C4B5FD;
    background: rgba(139, 92, 246, .1);
}

.sidebar-hr {
    width: 100%;
    height: 1px;
    background: var(--brd);
    margin-bottom: 20px;
}

/* Social */
.social-row {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.social-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--brd);
    color: var(--t2);
    font-size: .95rem;
    transition: .25s var(--ease);
    position: relative;
    overflow: hidden;
}

.social-btn:hover {
    background: var(--grd);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, .35);
}

/* Contact list */
.contact-list {
    width: 100%;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--brd);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 22px;
}

.cl-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--brd);
    text-align: left;
    transition: background .2s;
}

.cl-item:last-child {
    border-bottom: none;
}

.cl-item:hover {
    background: var(--sur2);
}

.cl-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--clr, #8B5CF6) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--clr, #8B5CF6) 35%, transparent);
    color: var(--clr, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
}

.cl-lbl {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    font-weight: 600;
}

.cl-val {
    display: block;
    color: var(--t1);
    font-size: .82rem;
    font-weight: 500;
    transition: color .2s;
}

.cl-val:hover {
    color: #C4B5FD;
}

/* CV Button */
.btn-cv {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--grd);
    color: #fff;
    font-family: var(--fh);
    font-weight: 700;
    font-size: .88rem;
    padding: 12px 26px;
    border-radius: 99px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 22px rgba(139, 92, 246, .35);
    transition: .25s var(--ease);
}



.btn-cv:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, .55);
}

/* ── CONTENT ─── */
.content-area {
    min-width: 0;
}

.content-section {
    display: none;
    animation: fadeUp .45s var(--ease);
}

.content-section.active {
    display: block;
}

.section-card {
    padding: 42px;
}

/* Section Header */
.section-chip {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .3);
    color: #C4B5FD;
    padding: 5px 14px;
    border-radius: 99px;
    margin-bottom: 18px;
}

.section-title {
    font-family: var(--fh);
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 900;
    color: var(--t1);
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-bottom: 0;
}

.grad-text {
    background: var(--grd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header {
    margin-bottom: 38px;
}

.sub-title {
    font-family: var(--fh);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--t1);
    margin: 40px 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-line {
    width: 30px;
    height: 3px;
    border-radius: 99px;
    background: var(--grd);
    flex-shrink: 0;
}

/* ── STATS ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--brd);
    border: 1px solid var(--brd);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 32px;
}

.stat-box {
    background: var(--sur);
    padding: 22px 14px;
    text-align: center;
    transition: background .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-box:hover {
    background: var(--sur2);
}

.stat-num {
    font-family: var(--fh);
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1;
}

.stat-plus {
    font-family: var(--fh);
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--grd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: -4px;
}

.stat-lbl {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--t3);
    font-weight: 600;
    margin-top: 5px;
}

.stat-sep {
    display: none;
}

/* ── BIO ─── */
.bio {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 6px;
}

.bio p {
    color: var(--t2);
    font-size: .95rem;
}

.hl {
    background: var(--grd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* ── TECH GRID ─── */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--brd);
    font-size: 1.6rem;
    color: var(--t2);
    transition: .25s var(--ease);
    cursor: default;
}

.tech-item span {
    font-size: .68rem;
    font-weight: 500;
    color: var(--t3);
}

.tech-item:hover {
    background: rgba(255, 255, 255, .07);
    border-color: var(--brd2);
    color: var(--t1);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

/* ── SERVICES ─── */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.service-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--brd);
    border-radius: 18px;
    padding: 26px 24px 24px;
    transition: .3s var(--ease);
    transform-style: preserve-3d;
    will-change: transform;
}

.service-card:hover {
    border-color: var(--brd2);
}

.sc-num {
    font-family: var(--fh);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    background: var(--grd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: .25;
    position: absolute;
    top: 16px;
    right: 20px;
    letter-spacing: -.04em;
}

.sc-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--ic, #8B5CF6);
    margin-bottom: 16px;
    background: color-mix(in srgb, var(--ic, #8B5CF6) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--ic, #8B5CF6) 30%, transparent);
    transition: background .3s;
}

.service-card:hover .sc-icon {
    background: color-mix(in srgb, var(--ic, #8B5CF6) 24%, transparent);
}

.service-card h4 {
    font-family: var(--fh);
    color: var(--t1);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.service-card p {
    font-size: .85rem;
    color: var(--t2);
    line-height: 1.65;
}

.sc-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at bottom left, var(--gc, #8B5CF6), transparent 65%);
    transition: opacity .35s;
}

.service-card:hover .sc-glow {
    opacity: .1;
}

/* ── RESUME ─── */
.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 8px;
}

.col-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.col-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--grd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .95rem;
}

.col-head h3 {
    font-family: var(--fh);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--t1);
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: linear-gradient(to bottom, var(--v), transparent);
}

.tl-item {
    position: relative;
    margin-bottom: 16px;
}

.tl-dot {
    position: absolute;
    left: -24px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--grd);
    border: 2.5px solid var(--bg);
    z-index: 1;
}

.tl-card {
    padding: 18px 20px;
    transition: .25s var(--ease);
}

.tl-card:hover {
    border-color: var(--brd2);
    transform: translateX(4px);
}

.tl-date {
    font-size: .75rem;
    color: var(--c);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tl-card h4 {
    font-family: var(--fh);
    font-size: .95rem;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 4px;
}

.tl-co {
    font-size: .8rem;
    color: var(--v);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.tl-card p {
    font-size: .82rem;
    color: var(--t2);
    line-height: 1.6;
    margin-bottom: 10px;
}

.tl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tl-tags span {
    font-size: .7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(139, 92, 246, .1);
    border: 1px solid rgba(139, 92, 246, .25);
    color: #C4B5FD;
}

/* Skills */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sk-row {
    display: grid;
    grid-template-columns: 155px 1fr 42px;
    gap: 12px;
    align-items: center;
}

.sk-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--t1);
}

.sk-track {
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .07);
    position: relative;
}

.sk-fill {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width 1.3s var(--ease);
    background: var(--bc, #8B5CF6);
    box-shadow: 0 0 12px color-mix(in srgb, var(--bc, #8B5CF6) 70%, transparent);
}

.sk-fill::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -1px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 8px 2px;
}

.sk-pct {
    font-size: .76rem;
    font-weight: 600;
    color: var(--t3);
    text-align: right;
}

/* ── PROJECTS ─── */
.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.f-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--t2);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--brd);
    transition: .25s var(--ease);
}

.f-btn:hover {
    border-color: var(--v);
    color: var(--t1);
}

.f-btn.active {
    background: var(--grd);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, .4);
}

.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.proj-card {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--brd);
    border-radius: 18px;
    overflow: hidden;
    transition: .3s var(--ease);
    transform-style: preserve-3d;
}

.proj-card:hover {
    border-color: var(--brd2);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .45);
}

.proj-card.hidden {
    display: none;
}

.proj-thumb {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.proj-pattern {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--pc, #8B5CF6);
    background: radial-gradient(circle at 30% 50%, color-mix(in srgb, var(--pc, #8B5CF6) 18%, transparent), var(--bg2));
    transition: transform .35s var(--ease);
}

.proj-card:hover .proj-pattern {
    transform: scale(1.08);
}

.proj-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 16, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transition: opacity .3s;
    backdrop-filter: blur(6px);
}

.proj-card:hover .proj-overlay {
    opacity: 1;
}

.proj-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .1);
    border: 1.5px solid rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 1rem;
    transition: .25s var(--ease);
}

.proj-btn:hover {
    background: var(--grd);
    border-color: transparent;
    transform: scale(1.1);
}

.proj-body {
    padding: 18px;
}

.proj-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.proj-cat {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    background: var(--grd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.proj-badge {
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(239, 168, 0, .12);
    border: 1px solid rgba(239, 168, 0, .25);
    color: #FCD34D;
}

.proj-body h4 {
    font-family: var(--fh);
    font-size: 1rem;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 6px;
}

.proj-body p {
    font-size: .82rem;
    color: var(--t2);
    line-height: 1.6;
    margin-bottom: 12px;
}

.proj-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.proj-stack span {
    font-size: .7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--brd);
    color: var(--t2);
}

/* ── CONTACT ─── */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 36px;
    align-items: start;
}

.c-info h3 {
    font-family: var(--fh);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 12px;
}

.c-info>p {
    font-size: .9rem;
    margin-bottom: 24px;
}

.avail-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--g);
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .25);
    padding: 6px 14px;
    border-radius: 99px;
}

.avail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--g);
    animation: prePulse 1.5s ease-in-out infinite alternate;
}

.c-cards {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.c-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    transition: .25s var(--ease);
}

.c-card:hover {
    border-color: var(--brd2);
    transform: translateX(5px);
}

.c-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ci, #8B5CF6);
    font-size: 1.1rem;
    background: color-mix(in srgb, var(--ci, #8B5CF6) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--ci, #8B5CF6) 30%, transparent);
}

.c-lbl {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--t3);
    font-weight: 600;
    margin-bottom: 3px;
}

.c-val {
    font-size: .85rem;
    font-weight: 500;
    color: var(--t1);
    transition: color .2s;
    display: block;
}

.c-val:hover {
    color: #C4B5FD;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.ff {
    position: relative;
}

.ff input,
.ff textarea {
    width: 100%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--brd);
    border-radius: 12px;
    padding: 16px 14px 8px;
    color: var(--t1);
    font-family: var(--fb);
    font-size: .9rem;
    outline: none;
    resize: none;
    transition: .25s var(--ease);
}

.ff textarea {
    min-height: 130px;
    padding-top: 22px;
}

.ff input:focus,
.ff textarea:focus {
    border-color: var(--v);
    background: rgba(139, 92, 246, .05);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}

.ff label {
    position: absolute;
    top: 13px;
    left: 14px;
    font-size: .85rem;
    color: var(--t3);
    pointer-events: none;
    transition: .25s var(--ease);
    font-weight: 400;
}

.ff input:not(:placeholder-shown)~label,
.ff input:focus~label,
.ff textarea:not(:placeholder-shown)~label,
.ff textarea:focus~label {
    top: 5px;
    font-size: .68rem;
    color: #C4B5FD;
    font-weight: 600;
    letter-spacing: .04em;
}

.ferr {
    display: none;
    font-size: .73rem;
    color: #F87171;
    margin-top: 5px;
    padding-left: 4px;
}

.ff.err .ferr {
    display: block;
}

.ff.err input,
.ff.err textarea {
    border-color: #F87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .1);
}

.btn-send {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    background: var(--grd);
    color: #fff;
    font-family: var(--fh);
    font-weight: 700;
    font-size: .95rem;
    padding: 14px 30px;
    border-radius: 99px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 22px rgba(139, 92, 246, .4);
    transition: .25s var(--ease);
}



.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, .6);
}

/* Magnetic helper removed for static design */

/* ── NAVIGATION ─── */
.main-nav {
    position: sticky;
    top: 28px;
    display: flex;
    flex-direction: column;
    background: var(--sur);
    border: 1px solid var(--brd);
    border-radius: 22px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow: hidden;
    height: fit-content;
}

.nav-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 18px 8px;
    color: var(--t3);
    font-size: .67rem;
    font-weight: 500;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--brd);
    border-radius: 0;
    cursor: pointer;
    transition: color .25s, background .25s;
    position: relative;
    overflow: hidden;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.5px;
    background: var(--grd);
    transform: scaleY(0);
    transition: transform .3s var(--ease);
    border-radius: 0 2px 2px 0;
}

.nav-item:hover {
    color: var(--t2);
    background: var(--sur2);
}

.nav-item.active {
    color: var(--t1);
    background: rgba(139, 92, 246, .08);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.ni-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--brd);
    transition: .25s var(--ease);
}

.nav-item.active .ni-box {
    background: var(--grd);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, .45);
}

/* ── TOAST ─── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(16, 185, 129, .15);
    border: 1px solid rgba(16, 185, 129, .3);
    color: #6EE7B7;
    padding: 13px 24px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .88rem;
    font-weight: 500;
    backdrop-filter: blur(20px);
    z-index: 999;
    transition: transform .4s var(--ease), opacity .4s;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── RESPONSIVE ─── */
@media (max-width:1200px) {
    .page-wrapper {
        grid-template-columns: 260px 1fr 80px;
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width:960px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        padding: 16px 16px 90px;
    }

    .profile-sidebar {
        position: static;
        order: 0;
    }

    .content-area {
        order: 1;
    }

    .main-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        flex-direction: row;
        width: 100%;
        height: auto;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--brd);
        background: rgba(5, 5, 16, .92);
        padding: 0 8px;
        z-index: 100;
        order: 2;
    }

    .nav-item {
        flex: 1;
        border-bottom: none;
        border-right: 1px solid var(--brd);
        padding: 12px 6px;
        border-radius: 0;
    }

    .nav-item:last-child {
        border-right: none;
    }

    .nav-item::before {
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        width: 100%;
        height: 2.5px;
        transform: scaleX(0);
        border-radius: 0;
    }

    .nav-item.active::before {
        transform: scaleX(1);
    }

    .resume-grid {
        grid-template-columns: 1fr;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-card {
        padding: 24px;
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width:600px) {

    .services-grid,
    .proj-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .sk-row {
        grid-template-columns: 110px 1fr 38px;
    }

    #cursor-inner,
    #cursor-outer {
        display: none;
    }
}

/* ================================================================
   RESPONSIVE — Full Breakpoint System
================================================================ */

/* ── 1340px: constrain layout ─── */
@media (max-width:1340px) {
    .page-wrapper {
        max-width: 100%;
    }
}

/* ── 1200px: large laptop ─── */
@media (max-width:1200px) {
    .page-wrapper {
        grid-template-columns: 260px 1fr 76px;
        gap: 16px;
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .section-title {
        font-size: 2.1rem;
    }
}

/* ── 1024px: small laptop / iPad landscape ─── */
@media (max-width:1024px) {
    .page-wrapper {
        grid-template-columns: 240px 1fr 70px;
        gap: 14px;
        padding: 20px 16px;
    }

    .profile-card {
        padding: 28px 20px;
    }

    .section-card {
        padding: 32px;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .resume-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .proj-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ── 960px: tablet portrait / fold – sidebar goes top, nav goes bottom ─── */
@media (max-width:960px) {

    /* Hide desktop cursor */
    #cursor-inner,
    #cursor-outer {
        display: none !important;
    }

    .page-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 16px;
        padding: 16px 14px 80px;
    }

    .profile-sidebar {
        position: static;
        order: 0;
        width: 100%;
    }

    .content-area {
        order: 1;
        min-width: 0;
    }

    /* Profile card: horizontal compact on tablet */
    .profile-card {
        flex-direction: row;
        align-items: flex-start;
        flex-wrap: wrap;
        text-align: left;
        gap: 0;
        padding: 24px 22px;
    }

    .avatar-wrapper {
        width: 100px;
        height: 100px;
        margin-right: 20px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .profile-text-wrap {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 4px;
    }

    .profile-name {
        font-size: 1.35rem;
        margin-bottom: 8px;
    }

    .role-wrap {
        margin-bottom: 12px;
    }

    .tag-cloud {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .sidebar-hr {
        margin: 18px 0;
        width: 100%;
    }

    .social-row {
        margin-bottom: 16px;
    }

    .contact-list {
        margin-bottom: 16px;
    }

    .btn-cv {
        align-self: flex-start;
    }

    /* Bottom navigation bar */
    .main-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 200;
        flex-direction: row;
        height: auto;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--brd);
        background: rgba(5, 5, 16, .95);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: safe-area-inset-bottom 8px 0;
        order: 2;
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        border-bottom: none;
        border-right: 1px solid var(--brd);
        border-radius: 0;
        padding: 10px 4px 12px;
        gap: 4px;
    }

    .nav-item:last-child {
        border-right: none;
    }

    .nav-item::before {
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        width: 100%;
        height: 2.5px;
        border-radius: 0;
        transform: scaleX(0);
    }

    .nav-item.active::before {
        transform: scaleX(1);
    }

    .nav-item span {
        font-size: .62rem;
    }

    .ni-box {
        width: 32px;
        height: 32px;
        font-size: .9rem;
    }

    /* Section */
    .section-card {
        padding: 24px 20px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .resume-grid {
        grid-template-columns: 1fr;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .proj-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .section-title {
        font-size: 1.9rem;
    }
}

/* ── 768px: tablet portrait ─── */
@media (max-width:768px) {
    .page-wrapper {
        padding: 12px 12px 76px;
    }

    /* Sidebar fully vertical again on smaller tablets */
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 28px 20px;
    }

    .avatar-wrapper {
        width: 110px;
        height: 110px;
        margin-right: 0;
        margin-bottom: 18px;
    }

    .tag-cloud {
        justify-content: center;
    }

    .social-row {
        justify-content: center;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .section-card {
        padding: 22px 18px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-num {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .resume-grid {
        grid-template-columns: 1fr;
    }

    .bio p {
        font-size: .9rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .proj-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .sk-row {
        grid-template-columns: 130px 1fr 40px;
    }

    .tl-card {
        padding: 14px 16px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ── 600px: large phone ─── */
@media (max-width:600px) {
    .page-wrapper {
        padding: 10px 10px 72px;
        gap: 12px;
    }

    .section-title {
        font-size: 1.55rem;
        line-height: 1.2;
    }

    .section-card {
        padding: 20px 16px;
    }

    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .tech-item {
        padding: 12px 6px;
        font-size: 1.3rem;
    }

    .tech-item span {
        font-size: .63rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .proj-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .resume-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-num {
        font-size: 1.8rem;
    }

    .sk-row {
        grid-template-columns: 100px 1fr 34px;
        gap: 8px;
    }

    .sk-name {
        font-size: .8rem;
    }

    .sk-pct {
        font-size: .72rem;
    }

    .filter-row {
        gap: 6px;
    }

    .f-btn {
        padding: 6px 12px;
        font-size: .78rem;
    }

    /* Sidebar compact */
    .profile-name {
        font-size: 1.2rem;
    }

    .avatar-wrapper {
        width: 95px;
        height: 95px;
    }

    .tag-cloud {
        gap: 5px;
    }

    .tag {
        font-size: .68rem;
        padding: 3px 8px;
    }

    .tl-card {
        padding: 12px 14px;
    }

    .tl-card h4 {
        font-size: .9rem;
    }

    .tl-card p {
        font-size: .8rem;
    }

    .btn-send {
        width: 100%;
        justify-content: center;
    }

    .c-cards {
        gap: 8px;
    }

    .nav-item span {
        display: none;
    }

    /* icon-only bottom nav on small phones */
    .nav-item {
        padding: 14px 4px;
    }

    .ni-box {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* ── 480px: average phone ─── */
@media (max-width:480px) {
    .section-title {
        font-size: 1.4rem;
    }

    .section-chip {
        font-size: .72rem;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        border-radius: 14px;
    }

    .stat-num {
        font-size: 1.6rem;
    }

    .stat-lbl {
        font-size: .68rem;
    }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .proj-thumb {
        height: 130px;
    }

    .proj-pattern {
        font-size: 2.8rem;
    }

    .sc-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .sc-num {
        font-size: 2.2rem;
    }

    .btn-cv {
        padding: 10px 20px;
        font-size: .82rem;
    }

    .sub-title {
        font-size: 1rem;
    }

    .timeline {
        padding-left: 18px;
    }

    .tl-dot {
        width: 10px;
        height: 10px;
        left: -18px;
    }

    .cl-item {
        padding: 10px 12px;
    }

    .cl-icon {
        width: 28px;
        height: 28px;
        font-size: .75rem;
    }

    .cl-val {
        font-size: .78rem;
    }

    .ff input,
    .ff textarea {
        font-size: .85rem;
    }
}

/* ── 380px: small phone ─── */
@media (max-width:380px) {
    .page-wrapper {
        padding: 8px 8px 68px;
    }

    .section-card {
        padding: 16px 13px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .tech-item {
        padding: 10px 4px;
        font-size: 1.15rem;
    }

    .avatar-wrapper {
        width: 85px;
        height: 85px;
    }

    .profile-name {
        font-size: 1.1rem;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .stat-num {
        font-size: 1.5rem;
    }

    .filter-row {
        gap: 5px;
    }

    .f-btn {
        padding: 5px 10px;
        font-size: .74rem;
    }

    .f-btn i {
        display: none;
    }

    .contact-form .btn-send {
        font-size: .88rem;
        padding: 12px 20px;
    }

    .toast {
        font-size: .82rem;
        padding: 10px 18px;
    }
}

/* ── Safe area for notched phones (iOS) ─── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .main-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    @media (max-width:960px) {
        .page-wrapper {
            padding-bottom: calc(72px + env(safe-area-inset-bottom));
        }
    }
}

/* ── Print ─── */
@media print {

    #preloader,
    #scroll-progress,
    .orb,
    #bg-canvas,
    #noise,
    #cursor-inner,
    #cursor-outer,
    .main-nav {
        display: none !important;
    }

    .page-wrapper {
        grid-template-columns: 200px 1fr;
    }

    .glass-card,
    .glass-card-sm {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ================================================================
   17. RTL (PERSIAN) SUPPORT
================================================================ */
[dir="rtl"] {
    --fh: 'Vazirmatn', sans-serif;
    --fb: 'Vazirmatn', sans-serif;
}

[dir="rtl"] .nav-item::before {
    left: auto;
    right: 0;
    border-radius: 2px 0 0 2px;
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 24px;
}

[dir="rtl"] .timeline::before {
    left: auto;
    right: 7px;
}

[dir="rtl"] .tl-dot {
    left: auto;
    right: -24px;
}

[dir="rtl"] .tl-card:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .c-card:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .cl-item {
    text-align: right;
}

@media (max-width: 960px) {

    [dir="rtl"] .profile-card,
    [dir="rtl"] .profile-text-wrap {
        text-align: right;
        align-items: flex-start;
    }

    [dir="rtl"] .avatar-wrapper {
        margin-right: 0;
        margin-left: 20px;
    }
}

/* ================================================================
   18. ARTICLE MODAL
================================================================ */

.article-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.article-modal.active {
    opacity: 1;
    visibility: visible;
}

.am-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.am-container {
    position: relative;
    width: 92%;
    max-width: 850px;
    margin: auto;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-modal.active .am-container {
    transform: translateY(0) scale(1);
}

.am-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.am-close:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: rotate(90deg) scale(1.05);
}

[dir="rtl"] .am-close {
    right: auto;
    left: 20px;
}

.am-thumb {
    width: 100%;
    height: 320px;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.am-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.am-thumb .bft-pattern {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.05);
}

.am-header {
    padding: 35px 40px 15px;
    flex-shrink: 0;
}

.am-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--fh);
}

.am-cat {
    background: rgba(139, 92, 246, 0.15);
    color: #d8b4fe;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.am-date,
.am-rt {
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: var(--text-h);
    line-height: 1.25;
    margin-bottom: 0;
    font-weight: 700;
}

.am-content {
    padding: 20px 40px 40px;
    overflow-y: visible;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-p);
    flex-grow: 1;
}

/* Custom Scrollbar for Modal content */
.article-modal::-webkit-scrollbar {
    width: 8px;
}

.article-modal::-webkit-scrollbar-track {
    background: transparent;
}

.article-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.article-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.am-content h1,
.am-content h2,
.am-content h3 {
    color: var(--text-h);
    margin: 30px 0 15px;
}

.am-content p {
    margin-bottom: 20px;
}

.am-content ul,
.am-content ol {
    margin: 0 0 20px 24px;
    padding: 0;
}

[dir="rtl"] .am-content ul,
[dir="rtl"] .am-content ol {
    margin: 0 24px 20px 0;
}

.am-content li {
    margin-bottom: 8px;
}

.am-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}

.am-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.am-content code {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.am-content pre code {
    background: transparent;
    padding: 0;
}

@media (max-width: 768px) {
    .am-header {
        padding: 30px 25px 15px;
    }

    .am-content {
        padding: 15px 25px 35px;
    }

    .am-title {
        font-size: 1.6rem;
    }

    .am-thumb {
        height: 220px;
    }
}