/* ==========================================================================
   Avraz — design system v2
   Dark-first, light theme via [data-theme="light"]. RTL-safe (logical props).
   Layered on Bootstrap 5.3 (grid, dropdown, utilities only).
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
    --font-sans: "Geist", "Vazirmatn", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Instrument Serif", "Vazirmatn", Georgia, serif;
    --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 28px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --nav-h: 76px;
    --container: 1200px;

    /* dark (default) */
    --bg: #09090b;
    --bg-2: #0e0e11;
    --surface: #121215;
    --surface-2: #18181c;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --text: #f4f4f5;
    --text-2: #a1a1aa;
    --text-3: #71717a;
    --accent: #ff6b3d;
    --accent-2: #ffb547;
    --accent-ink: #160a05;
    --accent-soft: rgba(255, 107, 61, .12);
    --accent-line: rgba(255, 107, 61, .35);
    --cool: #7c9cff;
    --ok: #34d399;
    --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
    --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .7);
    --glass: rgba(14, 14, 17, .72);
    --grid-dot: rgba(255, 255, 255, .07);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #fafaf9;
    --bg-2: #f4f3f1;
    --surface: #ffffff;
    --surface-2: #f7f6f4;
    --line: rgba(10, 10, 11, .08);
    --line-2: rgba(10, 10, 11, .16);
    --text: #0a0a0b;
    --text-2: #52525b;
    --text-3: #8a8a93;
    --accent: #e2531f;
    --accent-2: #f59e0b;
    --accent-ink: #ffffff;
    --accent-soft: rgba(226, 83, 31, .08);
    --accent-line: rgba(226, 83, 31, .3);
    --cool: #4f6bff;
    --ok: #059669;
    --shadow: 0 1px 2px rgba(10, 10, 11, .04), 0 18px 40px -22px rgba(10, 10, 11, .18);
    --shadow-lg: 0 40px 80px -36px rgba(10, 10, 11, .25);
    --glass: rgba(250, 250, 249, .78);
    --grid-dot: rgba(10, 10, 11, .07);
    color-scheme: light;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
[dir="rtl"] body { font-family: "Vazirmatn", var(--font-sans); }
::selection { background: var(--accent); color: var(--accent-ink); }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent); }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; letter-spacing: -.025em; line-height: 1.12; margin: 0 0 .5em; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main { min-height: 60vh; padding-top: var(--nav-h); }

/* Bootstrap bridge */
.container { max-width: var(--container); padding-inline: 20px; }
.text-muted { color: var(--text-3) !important; }
.dropdown-menu {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    padding: 6px; box-shadow: var(--shadow-lg); min-width: 180px;
}
.dropdown-item { color: var(--text-2); border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.dropdown-item:hover, .dropdown-item:focus, .dropdown-item.active { background: var(--accent-soft); color: var(--text); }

/* ---------- 3. Type helpers ---------- */
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mono { font-family: var(--font-mono); }
.display-1 { font-size: clamp(2.6rem, 6.2vw, 5.4rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }
.display-2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.06; }
.lead-lg { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--text-2); line-height: 1.7; max-width: 620px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---------- 4. Layout ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-sm { padding: clamp(48px, 7vw, 80px) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.sec-head { margin-bottom: clamp(36px, 5vw, 56px); max-width: 720px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -.04em; margin-bottom: .45em; }
.sec-head p { color: var(--text-2); font-size: 1.05rem; margin: 0; }
.sec-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 5vw, 52px); }
.sec-row .sec-head { margin-bottom: 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
    margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.sec-head.center .eyebrow::after { content: ""; width: 18px; height: 1px; background: currentColor; }

/* ---------- 5. Buttons ---------- */
.btn-x {
    --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: var(--line-2);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 48px; padding: 0 22px; border-radius: 999px;
    font-weight: 550; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap;
    background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd);
    cursor: pointer; position: relative; isolation: isolate; overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn-x:hover { color: var(--b-fg); transform: translateY(-2px); border-color: var(--line-2); }
.btn-x:active { transform: translateY(0); }
.btn-x i, .btn-x .arr { transition: transform .35s var(--ease); }
.btn-x:hover .arr { transform: translateX(4px); }
[dir="rtl"] .btn-x .arr { transform: scaleX(-1); }
[dir="rtl"] .btn-x:hover .arr { transform: scaleX(-1) translateX(4px); }
.btn-primary-x { --b-bg: var(--accent); --b-fg: var(--accent-ink); --b-bd: transparent; box-shadow: 0 10px 30px -10px var(--accent); }
.btn-primary-x::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad); opacity: 0; transition: opacity .35s var(--ease); }
.btn-primary-x:hover { box-shadow: 0 16px 40px -12px var(--accent); }
.btn-primary-x:hover::after { opacity: 1; }
.btn-ghost-x { --b-bg: transparent; }
.btn-ghost-x:hover { --b-bg: var(--surface-2); }
.btn-sm-x { height: 38px; padding: 0 16px; font-size: .86rem; }
.btn-lg-x { height: 56px; padding: 0 28px; font-size: 1rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; font-size: .92rem; color: var(--text); }
.link-arrow .arr { transition: transform .35s var(--ease); }
.link-arrow:hover .arr { transform: translateX(4px); }
[dir="rtl"] .link-arrow .arr { transform: scaleX(-1); }

/* ---------- 6. Chips / badges ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px; font-size: .76rem; font-weight: 500;
    color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line);
    white-space: nowrap;
}
.chip-accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.chip-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: relative; flex: none; }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- 7. Cards ---------- */
.card-x {
    position: relative; height: 100%;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; overflow: hidden;
    transition: transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease);
}
.card-x:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.card-x h3, .card-x h4, .card-x h5 { font-size: 1.15rem; letter-spacing: -.02em; margin-bottom: .55em; }
.card-x p { color: var(--text-2); font-size: .95rem; margin: 0; }

/* mouse-follow spotlight (js sets --mx/--my) */
.spot::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 45%);
    opacity: 0; transition: opacity .4s;
}
.spot:hover::before { opacity: 1; }
.spot > * { position: relative; z-index: 1; }

.icon-box {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.15rem; color: var(--accent);
    background: var(--accent-soft); border: 1px solid var(--accent-line); margin-bottom: 22px;
}

/* media card (projects / courses / blog) */
.media-card { display: flex; flex-direction: column; padding: 0; }
.media-card .media {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.media-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.media-card:hover .media img { transform: scale(1.05); }
.media-card .media .media-ph {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-family: var(--font-serif); font-style: italic; font-size: 3.4rem; color: var(--text-3);
    background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--surface-2);
}
.media-card .media .chip { position: absolute; inset-block-start: 14px; inset-inline-start: 14px; backdrop-filter: blur(8px); background: var(--glass); }
.media-card .body { padding: 24px 24px 8px; flex: 1; }
.media-card .foot { padding: 16px 24px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.media-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.media-card h3 { font-size: 1.2rem; }
.media-card .stretched { position: absolute; inset: 0; z-index: 2; }

/* ---------- 8. Header ---------- */
.site-nav {
    position: fixed; inset-inline: 0; top: 0; z-index: 1050; height: var(--nav-h);
    display: flex; align-items: center;
    transition: background .4s var(--ease), border-color .4s, backdrop-filter .4s;
    border-bottom: 1px solid transparent;
}
.site-nav.scrolled { background: var(--glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border-bottom-color: var(--line); }
.site-nav .inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.12rem; letter-spacing: -.03em; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: var(--grad); color: var(--accent-ink); font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; line-height: 1;
    box-shadow: 0 6px 20px -6px var(--accent);
}
.brand .dot { color: var(--accent); }
.nav-pill {
    display: flex; align-items: center; gap: 2px; padding: 5px; list-style: none; margin: 0;
    border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-pill a { display: block; padding: 8px 15px; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--text-2); transition: color .25s, background .25s; }
.nav-pill a:hover { color: var(--text); }
.nav-pill a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center;
    background: transparent; border: 1px solid var(--line); color: var(--text-2); cursor: pointer;
    transition: color .25s, border-color .25s, background .25s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
.lang-btn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; font-size: .82rem; font-weight: 600; font-family: var(--font-mono); text-transform: uppercase; }
.menu-btn { display: none; }

.mobile-sheet {
    position: fixed; inset: 0; z-index: 1040; background: var(--bg);
    padding: calc(var(--nav-h) + 16px) 24px 32px; display: flex; flex-direction: column; gap: 4px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
.mobile-sheet.open { opacity: 1; visibility: visible; transform: none; }
.mobile-sheet a.m-link { font-size: 1.9rem; font-weight: 600; letter-spacing: -.035em; padding: 8px 0; color: var(--text); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.mobile-sheet a.m-link.active { color: var(--accent); }
.mobile-sheet .m-foot { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
body.menu-open { overflow: hidden; }

@media (max-width: 991.98px) {
    .nav-pill, .nav-actions .hide-sm { display: none; }
    .menu-btn { display: inline-grid; }
}

/* ---------- 9. Hero ---------- */
.hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 clamp(56px, 7vw, 96px); overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg .grid {
    position: absolute; inset: -1px;
    background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 85%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 85%);
}
.hero-bg .blob { position: absolute; border-radius: 50%; will-change: transform; background: radial-gradient(circle, var(--c) 0%, transparent 68%); }
.hero-bg .b1 { --c: color-mix(in srgb, var(--accent) 34%, transparent); width: 900px; height: 900px; top: -480px; inset-inline-end: -320px; animation: drift 18s ease-in-out infinite alternate; }
.hero-bg .b2 { --c: color-mix(in srgb, var(--cool) 20%, transparent); width: 760px; height: 760px; top: -40px; inset-inline-start: -420px; animation: drift 22s ease-in-out infinite alternate-reverse; }
.hero-bg .b3 { --c: color-mix(in srgb, var(--accent-2) 16%, transparent); width: 620px; height: 620px; bottom: -380px; inset-inline-start: 30%; animation: drift 26s ease-in-out infinite alternate; }
[data-theme="light"] .hero-bg .b1 { --c: color-mix(in srgb, var(--accent) 16%, transparent); }
[data-theme="light"] .hero-bg .b2 { --c: color-mix(in srgb, var(--cool) 10%, transparent); }
[data-theme="light"] .hero-bg .b3 { --c: color-mix(in srgb, var(--accent-2) 10%, transparent); }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(40px, 30px, 0) scale(1.08); } }

.hero h1 { margin: 22px 0 22px; }
.hero h1 .serif { font-size: 1.04em; padding-inline-end: .05em; }
.rotator { display: inline-grid; vertical-align: bottom; }
.rotator > span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-inline-end: .06em; grid-area: 1 / 1; opacity: 0; transform: translateY(40%); filter: blur(6px); transition: opacity .6s var(--ease), transform .6s var(--ease), filter .6s var(--ease); white-space: nowrap; }
.rotator > span.on { opacity: 1; transform: none; filter: none; }
.rotator > span.off { opacity: 0; transform: translateY(-40%); filter: blur(6px); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.hero-stats { display: flex; gap: clamp(24px, 5vw, 56px); margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stat-num { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.stat-num .plus { color: var(--accent); }
.stat-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-top: 8px; }

/* code window */
.code-win {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line-2);
    box-shadow: var(--shadow-lg); backdrop-filter: blur(10px);
    transform: perspective(1400px) rotateY(-8deg) rotateX(4deg); transition: transform .8s var(--ease);
}
[dir="rtl"] .code-win { transform: perspective(1400px) rotateY(8deg) rotateX(4deg); }
.code-win:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }
.code-win .bar { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.code-win .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); display: block; }
.code-win .bar i:nth-child(1) { background: #ff5f57; } .code-win .bar i:nth-child(2) { background: #febc2e; } .code-win .bar i:nth-child(3) { background: #28c840; }
.code-win .bar span { margin-inline-start: auto; font-family: var(--font-mono); font-size: .72rem; color: var(--text-3); }
.code-win pre { margin: 0; padding: 22px 22px 26px; font-family: var(--font-mono); font-size: clamp(.7rem, .82vw, .82rem); line-height: 1.85; color: var(--text-2); direction: ltr; text-align: left; white-space: pre; overflow: hidden; }
.code-win .k { color: #c792ea; } .code-win .t { color: #82aaff; } .code-win .s { color: #c3e88d; } .code-win .c { color: var(--text-3); font-style: italic; } .code-win .f { color: var(--accent-2); }
[data-theme="light"] .code-win .k { color: #7c3aed; } [data-theme="light"] .code-win .t { color: #2563eb; } [data-theme="light"] .code-win .s { color: #15803d; } [data-theme="light"] .code-win .f { color: #c2410c; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--accent); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.float-chip {
    position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line-2);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow);
    font-size: .82rem; font-weight: 550; animation: bob 6s ease-in-out infinite;
}
.float-chip small { display: block; font-weight: 400; color: var(--text-3); font-size: .72rem; }
.float-chip .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fc-1 { inset-inline-start: -30px; bottom: -26px; }
.fc-2 { inset-inline-end: -22px; top: -22px; animation-delay: -3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- 10. Marquee ---------- */
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee var(--dur, 40s) linear infinite; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
.tech-pill { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tech-pill i { color: var(--accent); }
.logo-tile { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.logo-tile img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.logo-tile .letter { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; }
.logo-tile span { font-weight: 550; color: var(--text-2); }

/* ---------- 11. Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bento > * { grid-column: span 2; }
.bento > .wide { grid-column: span 4; }
.bento > .half { grid-column: span 3; }
.bento > .full { grid-column: span 6; }
@media (max-width: 991.98px) { .bento { grid-template-columns: repeat(2, 1fr); } .bento > *, .bento > .wide, .bento > .half { grid-column: span 1; } .bento > .wide, .bento > .full { grid-column: span 2; } }
@media (max-width: 575.98px) { .bento { grid-template-columns: 1fr; } .bento > *, .bento > .wide, .bento > .full, .bento > .half { grid-column: span 1; } }
.svc-num { position: absolute; inset-block-start: 24px; inset-inline-end: 26px; font-family: var(--font-mono); font-size: .75rem; color: var(--text-3); }

/* ---------- 12. Skills ---------- */
.skill { padding: 18px 20px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.skill-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 550; font-size: .95rem; }
.skill-top .pct { font-family: var(--font-mono); font-size: .78rem; color: var(--text-3); }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 1.4s var(--ease); }

/* ---------- 13. Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
@media (max-width: 991.98px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 28px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--font-mono); font-size: .78rem; color: var(--accent); display: block; margin-bottom: 36px; }
.step h4 { font-size: 1.1rem; }
.step p { color: var(--text-2); font-size: .93rem; margin: 0; }

/* ---------- 14. Testimonials ---------- */
.quote { display: flex; flex-direction: column; gap: 22px; }
.quote blockquote { margin: 0; font-size: 1.04rem; line-height: 1.7; color: var(--text); }
.quote .stars { color: var(--accent-2); font-size: .8rem; display: flex; gap: 3px; }
.who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; background: var(--grad); color: var(--accent-ink); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who b { display: block; font-weight: 600; font-size: .95rem; }
.who small { color: var(--text-3); font-size: .82rem; }

/* ---------- 15. CTA ---------- */
.cta-box {
    position: relative; border-radius: var(--radius-lg); padding: clamp(40px, 7vw, 84px) clamp(24px, 6vw, 72px);
    background: var(--surface); border: 1px solid var(--line-2); overflow: hidden; text-align: center; isolation: isolate;
}
.cta-box::before { content: ""; position: absolute; inset: -40%; z-index: -1; background: conic-gradient(from 180deg at 50% 50%, transparent 0deg, var(--accent-soft) 90deg, transparent 180deg, color-mix(in srgb, var(--cool) 14%, transparent) 270deg, transparent 360deg); animation: spin 18s linear infinite; }
.cta-box::after { content: ""; position: absolute; inset: 1px; z-index: -1; border-radius: inherit; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--surface) 70%, transparent), var(--surface) 70%); }
@keyframes spin { to { transform: rotate(1turn); } }
.cta-box h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -.045em; }
.cta-box p { color: var(--text-2); max-width: 560px; margin: 0 auto 32px; font-size: 1.06rem; }

/* ---------- 16. Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); letter-spacing: -.045em; margin-bottom: 16px; }
.page-hero p { color: var(--text-2); font-size: 1.1rem; max-width: 640px; margin: 0; }
.crumbs { display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 22px; }
.crumbs a { color: var(--text-3); } .crumbs a:hover { color: var(--accent); }

/* ---------- 17. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-size: .86rem; font-weight: 550; color: var(--text-2); }
.input, .field input, .field textarea, .field select, .form-control, .form-select {
    width: 100%; padding: 13px 16px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
    font: inherit; font-size: .95rem; transition: border-color .25s, box-shadow .25s, background .25s;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus, .form-control:focus, .form-select:focus {
    outline: none; border-color: var(--accent-line); background: var(--surface); color: var(--text);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.input::placeholder, .form-control::placeholder { color: var(--text-3); }
textarea.input, .field textarea { min-height: 150px; resize: vertical; }
.text-danger, .field-validation-error { color: #f87171 !important; font-size: .82rem; }

/* ---------- 18. Prose (blog / details) ---------- */
.prose { color: var(--text-2); font-size: 1.06rem; line-height: 1.85; max-width: 760px; }
.prose h2, .prose h3, .prose h4 { color: var(--text); margin: 2em 0 .6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius); margin: 2em 0; border: 1px solid var(--line); }
.prose pre, .prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.prose code { padding: 2px 6px; }
.prose pre { padding: 18px 20px; overflow: auto; direction: ltr; text-align: left; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose blockquote { border-inline-start: 3px solid var(--accent); padding-inline-start: 18px; margin-inline: 0; color: var(--text); font-style: italic; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }

/* ---------- 19. Misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.empty { text-align: center; padding: 72px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-3); }
.empty i { font-size: 2rem; margin-bottom: 14px; display: block; color: var(--text-3); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.filters a, .filters button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: .88rem; font-weight: 500; cursor: pointer; transition: all .25s; }
.filters a:hover, .filters button:hover { color: var(--text); border-color: var(--line-2); }
.filters .active { background: var(--text); color: var(--bg); border-color: var(--text); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 48px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-size: .9rem; }
.pager .active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .92rem; }
.kv dt { color: var(--text-3); font-weight: 400; } .kv dd { margin: 0; color: var(--text); font-weight: 550; }
.sticky-side { position: sticky; top: calc(var(--nav-h) + 24px); }

/* ---------- 20. Footer ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); background: var(--bg-2); overflow: hidden; padding-top: clamp(64px, 8vw, 96px); }
.site-footer .wordmark {
    font-size: clamp(4.5rem, 18vw, 15rem); font-weight: 700; letter-spacing: -.07em; line-height: .8;
    background: linear-gradient(180deg, var(--line-2), transparent 85%); -webkit-background-clip: text; background-clip: text; color: transparent;
    text-align: center; user-select: none; margin-top: 56px; transform: translateY(18%);
}
.foot-title { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 18px; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.foot-links a { color: var(--text-2); font-size: .94rem; }
.foot-links a:hover { color: var(--text); }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-2); transition: all .3s var(--ease); }
.socials a:hover { color: var(--accent-ink); background: var(--accent); border-color: transparent; transform: translateY(-3px); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0; border-top: 1px solid var(--line); margin-top: 56px; font-size: .84rem; color: var(--text-3); position: relative; z-index: 2; }

/* ---------- 21. Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* to-top + progress */
.scroll-progress { position: fixed; top: 0; inset-inline-start: 0; height: 2px; width: 100%; z-index: 1100; background: var(--grad); transform-origin: left; transform: scaleX(0); }
[dir="rtl"] .scroll-progress { transform-origin: right; }
.to-top { position: fixed; inset-inline-end: 22px; bottom: 22px; z-index: 1000; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .35s var(--ease); background: var(--surface); }
.to-top.show { opacity: 1; visibility: visible; transform: none; }

@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; }
    .code-win { transform: none; }
}

/* ---------- 22. Small screens ---------- */
@media (max-width: 575.98px) {
    .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
    .stat-label { font-size: .58rem; letter-spacing: .08em; }
    .hero-cta .btn-x { flex: 1 1 100%; }
    .cta-box .btn-x { width: 100%; }
}

/* RTL: directional arrows that aren't .arr also mirror */
[dir="rtl"] .fa-arrow-left:not(.arr), [dir="rtl"] .fa-arrow-right:not(.arr),
[dir="rtl"] .fa-chevron-left, [dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-angle-left, [dir="rtl"] .fa-angle-right { transform: scaleX(-1); }
