:root {
    --primary: #5b5bff;
    --secondary: #2a2ab8;
    --accent: #e53935;
    --cyan: #c5d4ff;
    --purple: #b44cff;
    --indigo: #2f2fc4;
    --green: #86efac;
    --bg-dark: #1c1c22;
    --bg-darker: #121214;
    --bg-card: #23232d;
    --bg-hover: #2e2e3a;
    --border: #3a3a4a;
    --text-primary: #f3f4f8;
    --text-secondary: #c8cdd8;
    --text-muted: #9aa3b8;
    --gradient-1: linear-gradient(135deg, #2a2ab8 0%, #b44cff 52%, #c5d4ff 100%);
    --gradient-2: linear-gradient(135deg, #5b5bff 0%, #b44cff 50%, #e53935 100%);
    --primary-rgb: 91, 91, 255;
    --purple-rgb: 180, 76, 255;
    --cyan-rgb: 197, 212, 255;
    --accent-rgb: 229, 57, 53;
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: "Tajawal", sans-serif;
    --font-code: "Fira Code", "Tajawal", sans-serif;
}

[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-darker: #f8f9fa;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f5;
    --border: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    color-scheme: light;
}

[dir="rtl"] { direction: rtl; text-align: right; }
[dir="ltr"] { direction: ltr; text-align: left; }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; font-size: 16px; color-scheme: dark; }
html, body {
    font-family: var(--font-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-darker);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid var(--bg-darker); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
::-webkit-scrollbar-corner { background: var(--bg-darker); }
body {
    font-weight: 500;
    background: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background var(--transition-fast), color var(--transition-fast);
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 800;
}
button, input, select, textarea {
    font-family: inherit;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }

.loader-screen {
    position: fixed; inset: 0; background: var(--bg-darker);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; transition: opacity 0.5s, visibility 0.5s;
}
.loader-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { text-align: center; }
.loader-code-text {
    font-family: var(--font-code);
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 2rem;
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}
.loader-code-text .code-line { display: block; margin: 0.4rem 0; opacity: 0; transform: translateY(16px); animation: fadeInUp 0.5s ease forwards; }
.loader-code-text .code-line[data-line="1"] { animation-delay: 0.1s; }
.loader-code-text .code-line[data-line="2"] { animation-delay: 0.25s; }
.loader-code-text .code-line[data-line="3"] { animation-delay: 0.4s; }
.loader-code-text .code-line[data-line="4"] { animation-delay: 0.55s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
.loader-spinner { width: 56px; height: 56px; border: 3px solid var(--border); border-top-color: var(--primary); border-right-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; margin: 1.5rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-progress-wrapper { width: 200px; height: 4px; background: var(--border); border-radius: 2px; margin: 1.5rem auto; overflow: hidden; }
.loader-progress-bar { height: 100%; background: var(--gradient-1); width: 0; animation: progress 1.6s ease forwards; }
@keyframes progress { to { width: 100%; } }
.loader-percentage { font-family: var(--font-code); color: var(--primary); }

.main-header {
    position: fixed; top: 0; left: 0; width: 100%;
    background: transparent;
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    overflow: visible;
}
.main-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 20, 0.62);
    backdrop-filter: blur(20px);
    z-index: 0;
    pointer-events: none;
}
[data-theme="light"] .main-header::before { background: rgba(255, 255, 255, 0.88); }
.main-header.scrolled::before { box-shadow: var(--shadow-md); }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0.85rem 1.4rem; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; position: relative; z-index: 1; }
.brand-logo { font-family: var(--font-code); font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 0.25rem; text-decoration: none; flex-shrink: 0; z-index: 2; }
.brand-logo.has-image { gap: 0; }
.brand-logo-img {
    display: block;
    height: 40px;
    width: auto;
    max-width: min(200px, 46vw);
    object-fit: contain;
    object-position: center;
}
.brand-logo.is-footer .brand-logo-img {
    height: 48px;
    max-width: 220px;
}
.loader-brand-logo {
    max-width: 200px;
    margin: 0 auto 1.4rem;
}
.loader-brand-logo img {
    width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: contain;
}
.brand-hero-logo {
    max-width: min(420px, 92%);
    margin: 0 0 0.35rem;
}
.brand-hero-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 110px;
    object-fit: contain;
    object-position: inline-start;
    filter: drop-shadow(0 10px 28px rgba(90, 90, 255, 0.28));
}
.logo-bracket { color: var(--primary); }
.logo-text { color: var(--primary); }
.logo-b { color: var(--purple); }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
    min-width: 0;
}
.nav-menu-head { display: none; }
.nav-links { display: flex; gap: 0.25rem; align-items: center; flex: 1; min-width: 0; }
.nav-text { white-space: nowrap; }
.nav-tools { display: flex; gap: 0.45rem; align-items: center; flex-shrink: 0; margin-inline-start: auto; }
.nav-overlay { display: none; }
.nav-link { display: flex; align-items: center; gap: 0.45rem; color: var(--text-secondary); text-decoration: none; font-weight: 700; padding: 0.5rem 0.85rem; border-radius: 8px; position: relative; transition: color var(--transition-fast); }
.nav-link::before { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: var(--gradient-1); transition: width var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::before { width: 70%; }
.nav-item { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
.nav-item.has-mega { position: static; }
.nav-item.has-mega:hover::after,
.nav-item.has-mega:focus-within::after,
.nav-item.has-mega.is-open::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 100%;
    height: 18px;
}
.nav-caret {
    display: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 0.35rem;
    cursor: pointer;
}
.nav-dropdown {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 260px;
    padding-top: 0.7rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 1200;
}
.nav-dropdown.is-mega {
    inset-inline: 0;
    min-width: 0;
}
.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown,
.nav-item.is-open > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}
.nav-dropdown-inner {
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    backdrop-filter: blur(22px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}
.dropdown-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.85rem;
}
.dropdown-head strong { font-size: 0.95rem; }
.dropdown-head a { color: var(--primary); font-size: 0.82rem; font-weight: 800; text-decoration: none; }
.dropdown-list { display: flex; flex-direction: column; gap: 0.25rem; }
.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
}
.dropdown-link i { color: var(--primary); width: 1.1rem; text-align: center; }
.dropdown-link span { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.dropdown-link small { font-weight: 500; color: var(--text-muted); line-height: 1.45; }
.dropdown-link:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--text-primary); }
.dropdown-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.dropdown-chip {
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}
.dropdown-chip:hover { border-color: var(--primary); color: var(--primary); }
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.65rem;
    max-height: min(52vh, 380px);
    overflow: auto;
}
.dropdown-tile {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-darker) 55%, transparent);
    text-decoration: none;
    color: inherit;
    min-height: 64px;
}
.dropdown-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.dropdown-tile-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: transparent;
    flex-shrink: 0;
}
.dropdown-tile-copy { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dropdown-tile-copy strong {
    font-size: 0.88rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dropdown-tile-copy em { font-style: normal; color: var(--accent); font-size: 0.75rem; font-family: var(--font-code); }
.dropdown-empty { color: var(--text-muted); font-size: 0.9rem; }
.site-search {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    min-width: 0;
}
.site-search-input {
    width: 148px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}
.site-search-input::placeholder { color: var(--text-muted); }
.site-search:focus-within { border-color: var(--primary); }
.site-search-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.site-search-btn:hover { color: var(--primary); }
.dropdown-names {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.15rem;
    max-height: min(52vh, 380px);
    overflow: auto;
}
.search-page-form {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}
.search-page-form .form-input { flex: 1; min-width: 220px; }
.search-group-title { font-size: 1.15rem; margin: 1.6rem 0 0.7rem; color: var(--primary); }
.search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.4rem; }
.lang-toggle, .theme-toggle, .menu-toggle {
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary);
    padding: 0.5rem 0.75rem; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 0.35rem;
    min-height: 40px;
}
.lang-toggle:hover, .theme-toggle:hover, .menu-toggle:hover, .nav-menu-close:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle { width: 40px; justify-content: center; padding: 0.5rem; }
.currency-select { display: flex; align-items: center; }
.currency-select-input {
    appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-code);
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 4.4rem;
    min-height: 40px;
}
.currency-select-input:hover, .currency-select-input:focus {
    border-color: var(--primary);
    color: var(--primary);
    outline: none;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    padding: 0.55rem;
    margin-inline-start: auto;
    z-index: 2;
}
.menu-toggle span { width: 18px; height: 2px; background: var(--text-primary); transition: var(--transition); display: block; }
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-menu-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.site-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.site-aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.42;
    animation: auroraDrift 22s ease-in-out infinite alternate;
}
.aurora-1 { width: 52vw; height: 52vw; top: -18%; inset-inline-end: -12%; background: #2a2ab8; }
.aurora-2 { width: 46vw; height: 46vw; bottom: -20%; inset-inline-start: -14%; background: #b44cff; animation-delay: -8s; }
.aurora-3 { width: 28vw; height: 28vw; top: 42%; inset-inline-start: 38%; background: #e53935; opacity: 0.18; animation-delay: -14s; }
@keyframes auroraDrift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-7%, 9%, 0) scale(1.18); }
}
.site-backdrop .code-grid-bg { opacity: 0.08; }
.site-backdrop .floating-particles { position: absolute; inset: 0; }
[data-theme="light"] .site-aurora { opacity: 0.16; }
[data-theme="light"] .site-backdrop .code-grid-bg { opacity: 0.04; }
@media (prefers-reduced-motion: reduce) {
    .site-aurora, .code-grid-bg, .particle { animation: none !important; }
}

.main-content { position: relative; z-index: 1; margin-top: 78px; min-height: calc(100vh - 78px); }
.flash-success { max-width: 1400px; margin: 1rem auto 0; padding: 0.9rem 2rem; background: rgba(134, 239, 172, 0.12); border: 1px solid var(--green); color: var(--green); border-radius: 12px; }

.hero-section { min-height: calc(100vh - 78px); display: flex; align-items: center; position: relative; overflow: hidden; padding: 4rem 0 6rem; }
.code-grid-bg {
    position: absolute; inset: 0; opacity: 0.05;
    background-image: linear-gradient(var(--primary) 1px, transparent 1px), linear-gradient(90deg, var(--primary) 1px, transparent 1px);
    background-size: 50px 50px; animation: gridMove 20s linear infinite;
}
@keyframes gridMove { to { transform: translate(50px, 50px); } }
.floating-particles { position: absolute; inset: 0; overflow: hidden; }
.particle { position: absolute; font-family: var(--font-code); font-size: 1.4rem; color: var(--primary); opacity: 0.12; animation: float 14s infinite ease-in-out; }
@keyframes float {
    0%, 100% { transform: translateY(80vh) rotate(0deg); opacity: 0; }
    50% { transform: translateY(-40px) rotate(180deg); opacity: 0.18; }
}
.hero-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.hero-content { text-align: start; }
.hero-greeting {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    padding: 0.28rem 0.8rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}
.brand-hero {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    margin: 0 0 0.2rem;
    line-height: 1.1;
}
.brand-hero-mark {
    font-family: var(--font-code);
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 18px rgba(var(--primary-rgb), 0.45);
}
.brand-hero-name {
    font-family: var(--font-primary);
    font-size: clamp(2.7rem, 7vw, 5.1rem);
    font-weight: 900;
    background: linear-gradient(105deg, #2a2ab8 0%, #5b5bff 25%, #b44cff 52%, #e8edff 76%, #2a2ab8 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: brandShine 6s ease infinite;
    filter: drop-shadow(0 10px 28px rgba(90, 90, 255, 0.32));
}
@keyframes brandShine {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}
.brand-hero-sub {
    display: inline-block;
    font-family: var(--font-primary);
    font-size: clamp(1.35rem, 3.1vw, 2.05rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.15rem 0 1.5rem;
    letter-spacing: 0.01em;
}
.brand-hero-sub::after {
    content: "";
    display: block;
    width: 5.2rem;
    height: 5px;
    margin-top: 0.7rem;
    border-radius: 99px;
    background: var(--gradient-1);
    box-shadow: 0 0 16px rgba(var(--purple-rgb), 0.45);
}
.hero-description { color: var(--text-secondary); font-size: 1.12rem; max-width: 36rem; margin-bottom: 2rem; line-height: 1.9; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.9rem 1.6rem; border-radius: 12px; font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; font-size: 1rem; }
.btn-primary { background: var(--gradient-1); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3); }
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; }
.hero-social { display: flex; gap: 0.8rem; }
.social-icon { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; color: var(--text-secondary); text-decoration: none; }
.social-icon:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }

.hero-image-wrapper { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.tech-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; max-width: 34rem; }
.tech-pill {
    background: color-mix(in srgb, var(--bg-card) 80%, transparent);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.hero-image-container { position: relative; width: min(380px, 100%); aspect-ratio: 1; }
.profile-image-glow { position: absolute; inset: -12%; background: radial-gradient(circle, rgba(var(--primary-rgb), 0.25) 0%, transparent 70%); border-radius: 50%; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: 0.8; } }
.profile-image-frame { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 4px solid var(--primary); overflow: hidden; background: var(--bg-card); box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.25); }
.profile-image, .profile-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.profile-placeholder { font-size: 5rem; color: var(--primary); opacity: 0.35; }
.stack-detail {
    max-width: 28rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.floating-badge { position: absolute; background: color-mix(in srgb, var(--bg-card) 86%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 16px; padding: 0.85rem 1.1rem; display: flex; align-items: center; gap: 0.8rem; min-width: 200px; animation: floatBadge 3s ease-in-out infinite; z-index: 2; transition: opacity 0.25s ease, transform 0.25s ease; }
.floating-badge.is-hidden { opacity: 0; pointer-events: none; transform: scale(0.92); }
.floating-badge i, .tech-mark { font-size: 1.6rem; color: var(--primary); flex-shrink: 0; }
.tech-mark {
    font-family: var(--font-code);
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid var(--primary);
    border-radius: 7px;
    padding: 0.28rem 0.4rem;
    line-height: 1;
}
.badge-title { display: block; font-weight: 800; }
.badge-libs { display: block; font-size: 0.75rem; color: var(--text-muted); }
.badge-1 { top: 6%; inset-inline-end: -14%; }
.badge-2 { bottom: 8%; inset-inline-end: -16%; animation-delay: 0.8s; }
.badge-3 { top: 42%; inset-inline-start: -18%; animation-delay: 1.6s; }
.badge-4 { bottom: 12%; inset-inline-start: -16%; animation-delay: 2.2s; }
@keyframes floatBadge { 50% { transform: translateY(-14px); } }
.skills-section .filter-row { margin-bottom: 1.6rem; }
.skill-category.is-hidden { display: none; }

.scroll-indicator { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.85rem; z-index: 1; }
.scroll-mouse { width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px; display: flex; justify-content: center; padding-top: 6px; }
.scroll-wheel { width: 4px; height: 9px; background: var(--primary); border-radius: 2px; animation: scrollWheel 2s infinite; }
@keyframes scrollWheel { to { transform: translateY(16px); opacity: 0; } }

.section { padding: 4.5rem 0; scroll-margin-top: 90px; position: relative; }
.section-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 2.4rem;
}
.section-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: var(--cyan);
    font-weight: 700;
}
.section-title {
    font-family: var(--font-primary);
    font-size: clamp(1.85rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
}
.title-text { color: var(--text-primary); }
.section-accent {
    width: 4.2rem;
    height: 4px;
    border-radius: 99px;
    background: var(--gradient-1);
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.45);
}
.page-lead { color: var(--text-secondary); max-width: 40rem; margin-top: -1.2rem; margin-bottom: 2.5rem; }

.about-content, .contact-content { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.about-text, .prose-dark { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.9; }
.prose-dark p { margin-top: 1rem; }
.prose-dark a { color: var(--primary); }
.about-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 1.35rem;
}
.stat-item {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 0.65rem 0.35rem 0.55rem;
    background: color-mix(in srgb, var(--bg-card) 78%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    opacity: 0;
    animation: statReveal 0.55s ease forwards;
    animation-delay: var(--stat-delay, 0ms);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.stat-item::before {
    content: "";
    position: absolute;
    inset-inline: 22%;
    top: 0;
    height: 2px;
    border-radius: 99px;
    background: var(--gradient-1);
    opacity: 0.85;
}
.stat-item::after { display: none; }
.stat-item:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.16);
}
.stat-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.28rem;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: transparent;
    border: 0;
    box-shadow: none;
    position: relative;
    z-index: 1;
}
.stat-item:hover .stat-icon {
    animation: statIconPulse 0.6s ease;
}
.stat-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.08rem;
    position: relative;
    z-index: 1;
    line-height: 1;
}
.stat-number {
    font-family: var(--font-code);
    font-size: 1.05rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-suffix {
    font-family: var(--font-code);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--purple);
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    margin-top: 0.12rem;
    position: relative;
    z-index: 1;
    line-height: 1.25;
}
@keyframes statReveal {
    to { opacity: 1; }
}
@keyframes statIconPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.12) rotate(-6deg); }
    100% { transform: scale(1); }
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.service-card {
    position: relative;
    overflow: hidden;
    padding: 1.45rem 1.2rem 1.3rem;
    background: color-mix(in srgb, var(--bg-card) 80%, transparent);
    border: 1px solid var(--border);
    border-radius: 18px;
    opacity: 0;
    animation: serviceReveal 0.7s ease forwards;
    animation-delay: var(--service-delay, 0ms);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.service-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    box-shadow: 0 16px 36px rgba(var(--primary-rgb), 0.16);
}
.service-icon-wrap {
    width: 72px;
    height: 72px;
    margin-bottom: 1rem;
    position: relative;
    display: grid;
    place-items: center;
}
.service-orbit {
    position: absolute;
    inset: 0;
    border: 1px dashed color-mix(in srgb, var(--primary) 55%, transparent);
    border-radius: 50%;
    animation: serviceSpin 7s linear infinite;
}
.service-orbit.is-reverse {
    inset: 8px;
    border-style: solid;
    border-width: 1px 1px 1px 0;
    border-color: color-mix(in srgb, var(--purple) 70%, transparent) transparent transparent transparent;
    animation-duration: 4.5s;
    animation-direction: reverse;
}
.service-spark {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
    animation: serviceSpark 7s linear infinite;
}
.service-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: transparent;
    border: 0;
    box-shadow: none;
    animation: serviceFloat 2.6s ease-in-out infinite;
    z-index: 1;
}
.service-card:hover .service-icon {
    animation: serviceIconPulse 0.7s ease;
}
.service-card h3 {
    font-size: 1.08rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}
.service-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.75;
}
@keyframes serviceReveal {
    to { opacity: 1; }
}
@keyframes serviceSpin {
    to { transform: rotate(360deg); }
}
@keyframes serviceFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes serviceIconPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.12) rotate(8deg); }
    100% { transform: scale(1); }
}
@keyframes serviceSpark {
    0% { transform: rotate(0deg) translateX(32px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(32px) rotate(-360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .service-orbit, .service-spark, .service-icon { animation: none; }
}
html[dir="rtl"] .code-window,
html[dir="rtl"] .loader-code-text {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}
.code-window {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.code-window-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: color-mix(in srgb, var(--bg-darker) 70%, transparent);
    border-bottom: 1px solid var(--border);
}
.code-dots { display: flex; gap: 0.35rem; }
.code-dots span { width: 10px; height: 10px; border-radius: 50%; display: block; background: #e53935; }
.code-dots span:nth-child(2) { background: #fbbc05; }
.code-dots span:nth-child(3) { background: #34a853; }
.code-filename { font-family: var(--font-code); font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.02em; }
.code-block {
    margin: 0;
    padding: 1.1rem 0;
    font-family: var(--font-code);
    font-size: 0.88rem;
    line-height: 1.85;
    overflow-x: auto;
}
.code-row {
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    gap: 0.85rem;
    padding: 0 1.1rem;
    min-width: max-content;
}
.code-row:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.code-ln { color: var(--text-muted); opacity: 0.55; text-align: right; user-select: none; }
.code-src { white-space: pre; }
.code-keyword { color: #c084fc; }
.code-variable { color: #67e8f9; }
.code-operator { color: #a5b4fc; }
.code-brace, .code-bracket { color: #fbbf24; }
.code-property { color: #7dd3fc; }
.code-string { color: #fb7185; }
.code-comma, .code-semicolon { color: var(--text-muted); }

.skills-grid, .projects-grid, .posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.skill-category, .project-card, .post-card, .contact-item, .timeline-content {
    background: color-mix(in srgb, var(--bg-card) 78%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.skill-category { padding: 2rem; }
.category-title { font-family: var(--font-primary); color: var(--primary); margin-bottom: 1.5rem; font-weight: 800; }
.skill-items { display: flex; flex-direction: column; gap: 1.3rem; }
.skill-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-family: var(--font-primary); }
.skill-name { color: var(--cyan); }
.skill-percent { color: var(--primary); }
.skill-bar { height: 10px; background: var(--bg-darker); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.skill-progress { height: 100%; width: 0; background: var(--gradient-1); border-radius: 6px; }

.timeline { position: relative; padding-inline-start: 1.5rem; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 2px; background: var(--gradient-1); }
.timeline-item { position: relative; padding-bottom: 2rem; padding-inline-start: 2.2rem; }
.timeline-marker { position: absolute; inset-inline-start: -0.45rem; top: 0.3rem; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 16px var(--primary); }
.timeline-content { padding: 1.6rem; }
.timeline-content:hover { border-color: var(--primary); }
.timeline-year { font-family: var(--font-code); color: var(--primary); font-size: 0.9rem; }
.timeline-badge { display: inline-block; background: var(--gradient-1); color: #fff; padding: 0.2rem 0.7rem; border-radius: 20px; font-size: 0.75rem; margin-inline-start: 0.6rem; }
.timeline-title { font-family: var(--font-primary); color: var(--cyan); margin: 0.5rem 0; font-weight: 800; }
.timeline-company { color: var(--purple); margin-bottom: 0.7rem; }
.timeline-description { color: var(--text-secondary); }
.timeline-tags, .project-tags, .filter-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }

lord-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    overflow: visible;
    opacity: 1;
}
.nav-link lord-icon,
.dropdown-link lord-icon,
.footer-list lord-icon,
.btn lord-icon,
.site-search-btn lord-icon,
.lang-toggle lord-icon {
    pointer-events: none;
}
.dropdown-link lord-icon { width: 22px; height: 22px; }
.footer-list a,
.footer-list > li > span {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}
.product-meta lord-icon { flex-shrink: 0; margin-top: 0.1rem; }

.method-timeline-shell {
    position: relative;
    max-width: 820px;
    margin-inline: auto;
}
.method-timeline {
    overflow: visible;
    padding-block: 0.2rem;
    padding-inline-start: 0.2rem;
}
.method-timeline-inner {
    position: relative;
    padding: 0.35rem 0 0.2rem;
}
.method-timeline-inner::before {
    content: "";
    position: absolute;
    inset-inline-start: 27px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--border) 80%, var(--primary));
}
.method-line-progress {
    position: absolute;
    inset-inline-start: 27px;
    top: 18px;
    width: 2px;
    height: 48px;
    border-radius: 99px;
    background: var(--gradient-1);
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.45);
    z-index: 1;
    transition: height 0.25s ease;
}
.method-item {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 1.15rem;
    opacity: 1;
    transform: none;
}
.method-item:last-child { padding-bottom: 0.2rem; }
.method-item.is-inview {
    opacity: 1;
    transform: none;
}
.method-marker {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.method-marker-orb {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.method-item.is-inview .method-marker-orb {
    animation: methodPulse 1.1s ease;
}
.method-item.is-ongoing .method-marker-orb {
    box-shadow: none;
}
.method-card {
    position: relative;
    padding: 1rem 1.05rem 0.95rem;
    background: color-mix(in srgb, var(--bg-card) 80%, transparent);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.method-card::before {
    content: "";
    position: absolute;
    inset-inline: 16%;
    top: 0;
    height: 2px;
    border-radius: 99px;
    background: var(--gradient-1);
}
.method-item.is-inview .method-card {
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.08);
}
.method-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.16);
}
.method-num {
    font-family: var(--font-code);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
}
.method-badge {
    position: absolute;
    top: 0.7rem;
    inset-inline-end: 0.75rem;
    background: var(--gradient-1);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
}
.method-card h3 {
    font-size: 1.02rem;
    margin: 0 0 0.18rem;
    color: var(--text-primary);
}
.method-item.is-ongoing .method-card h3 {
    padding-inline-end: 3.4rem;
}
.method-kicker {
    color: var(--purple);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.method-text {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.65;
}
.method-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.65rem;
}
.method-tags .tag {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
}
@keyframes methodPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .method-item, .method-item.is-inview .method-marker-orb { animation: none; transition: none; opacity: 1; transform: none; }
}
.tag, .filter-chip { background: var(--bg-darker); color: var(--primary); padding: 0.28rem 0.7rem; border-radius: 6px; font-size: 0.8rem; border: 1px solid var(--border); text-decoration: none; cursor: pointer; }
button.filter-chip { appearance: none; }
.filter-chip.active { background: var(--gradient-1); color: #fff; border-color: transparent; }

.project-card, .post-card { overflow: hidden; text-decoration: none; color: inherit; display: block; transition: transform var(--transition), border-color var(--transition); }
.project-card:hover, .post-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.project-image { height: 180px; background: var(--bg-darker); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--primary); opacity: 0.85; position: relative; overflow: hidden; }
.project-image img { width: 100%; height: 100%; object-fit: cover; }
.project-content, .post-card { padding: 1.5rem; }
.post-card { padding: 1.6rem; }
.project-title, .post-card h2 {
    font-family: var(--font-primary);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.6rem;
    line-height: 1.45;
}
.project-description, .post-card p {
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--text-secondary);
}
.meta-row { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.8rem; }

.contact-info { display: flex; flex-direction: column; gap: 1rem; }
.contact-item { display: flex; gap: 1rem; padding: 1.3rem; }
.contact-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; box-shadow: none; color: var(--primary); flex-shrink: 0; }
.contact-label { color: var(--text-muted); font-family: var(--font-primary); font-size: 0.85rem; }
.contact-value { color: var(--primary); font-weight: 700; text-decoration: none; display: block; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-input, .form-input:focus {
    width: 100%; padding: 0.95rem 1rem; background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 12px; color: var(--text-primary); font-family: var(--font-primary); font-size: 1rem; outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12); }
.form-textarea { min-height: 140px; resize: vertical; }
.form-error { color: #f87171; font-size: 0.85rem; margin-top: 0.3rem; }
.choice-list { display: flex; flex-direction: column; gap: 0.55rem; }
.choice-item { display: flex; align-items: center; gap: 0.6rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem; cursor: pointer; }
.choice-item:hover { border-color: var(--primary); }
.form-input[type="file"] { padding: 0.7rem; }
select.form-input { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%), linear-gradient(135deg, var(--primary) 50%, transparent 50%); background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px); background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
html[dir="rtl"] select.form-input { background-position: 18px calc(50% - 3px), 12px calc(50% - 3px); }
.quote-context {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
}
.quote-context strong { display: block; color: var(--text-primary); }
.quote-context span { color: var(--purple); font-size: 0.88rem; font-weight: 700; }
.site-toasts {
    position: fixed;
    inset-inline-end: 1.1rem;
    bottom: 1.1rem;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: min(360px, calc(100vw - 1.6rem));
    pointer-events: none;
}
.site-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: start;
    padding: 0.9rem 0.95rem;
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.site-toast.is-visible { opacity: 1; transform: none; }
.site-toast.is-success { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); }
.site-toast.is-error { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.site-toast.is-warning { border-color: color-mix(in srgb, var(--purple) 55%, var(--border)); }
.site-toast strong { display: block; color: var(--text-primary); font-size: 0.92rem; margin-bottom: 0.15rem; }
.site-toast p { margin: 0; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.55; }
.site-toast-close {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.site-toast-close:hover { color: var(--text-primary); }
.btn-submit { align-self: flex-start; }

.main-footer { position: relative; z-index: 1; background: color-mix(in srgb, var(--bg-card) 82%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border); padding: 3rem 0 1.4rem; margin-top: 3rem; }
.footer-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.9fr 1fr auto; gap: 2.4rem; align-items: start; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.footer-brand .brand-logo { margin-bottom: 0.2rem; }
.footer-tagline { color: var(--text-muted); margin-top: 0.9rem; max-width: 28rem; line-height: 1.85; }
.footer-heading { font-size: 0.95rem; font-weight: 800; margin-bottom: 1rem; color: var(--text-primary); }
.footer-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer-list a, .footer-list > li > span { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--text-secondary); text-decoration: none; flex-wrap: wrap; }
.footer-list a:hover { color: var(--primary); }
.footer-list i { width: 1.1rem; color: var(--primary); text-align: center; }
.footer-list small { color: var(--text-muted); font-size: 0.78rem; }
.footer-social-wrap { min-width: 180px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.footer-social-link { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 50%; color: var(--text-secondary); text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s; }
.footer-social-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }
.footer-social-link.is-whatsapp:hover { background: #25d366; border-color: #25d366; }
.footer-social-link.is-telegram:hover { background: #229ed9; border-color: #229ed9; }
.footer-social-link.is-instagram:hover { background: #e1306c; border-color: #e1306c; }
.footer-social-link.is-linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.footer-social-link.is-twitter:hover { background: #111; border-color: #111; }
.footer-social-link.is-facebook:hover { background: #1877f2; border-color: #1877f2; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 1.4rem; }
.footer-text { color: var(--text-muted); }

.lab-filters { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: -1rem 0 1.8rem; }
.lab-filter { color: var(--text-secondary); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 0.4rem 0.95rem; background: var(--bg-card); font-weight: 700; font-size: 0.9rem; }
.lab-filter:hover, .lab-filter.is-active { color: #fff; border-color: transparent; background: var(--gradient-1); }
.lab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3rem; }
@media (max-width: 1100px) {
    .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .menu-toggle { display: flex; z-index: 1101; }
    .nav-menu-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.85rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu-head strong { font-size: 1.15rem; }
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(8, 8, 14, 0.55);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        z-index: 1190;
    }
    .nav-overlay.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-menu {
        position: fixed;
        top: 0;
        bottom: 0;
        inset-inline-end: auto;
        inset-inline-start: -110%;
        width: min(400px, 88vw);
        height: 100dvh;
        max-height: 100dvh;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1.15rem 1.1rem 1.4rem;
        background: var(--bg-card);
        border-inline-end: 1px solid var(--border);
        box-shadow: 0 0 48px rgba(0, 0, 0, 0.35);
        z-index: 1200;
        transform: none;
        transition: inset-inline-start 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        flex: none;
        pointer-events: auto;
    }
    .nav-menu.active,
    html[dir="rtl"] .nav-menu.active,
    html[dir="ltr"] .nav-menu.active {
        inset-inline-start: 0;
        transform: none;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        flex: 1;
        padding: 0.6rem 0 1rem;
    }
    .nav-item, .nav-item.has-mega { position: relative; width: 100%; }
    .nav-link { flex: 1; padding: 0.75rem 0.85rem; }
    .nav-link::before { display: none; }
    .nav-caret { display: inline-flex; }
    .nav-dropdown {
        position: static;
        min-width: 0;
        width: 100%;
        padding-top: 0.35rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: none;
        display: none;
    }
    .nav-item.is-open > .nav-dropdown {
        display: block;
        pointer-events: auto;
    }
    .nav-dropdown-inner { box-shadow: none; padding: 0.75rem; }
    .dropdown-grid, .dropdown-names { grid-template-columns: 1fr; max-height: none; }
    .nav-tools {
        margin: 0;
        flex-wrap: wrap;
        padding-top: 0.9rem;
        border-top: 1px solid var(--border);
        width: 100%;
    }
    .nav-tools .site-search { flex: 1 1 100%; }
    .nav-tools .site-search-input { width: 100%; }
    .nav-tools .lang-toggle,
    .nav-tools .theme-toggle,
    .nav-tools .currency-select-input { flex: 1 1 auto; justify-content: center; }
    body.nav-open { overflow: hidden; }
}
.lab-grid-compact { margin-top: 1rem; }
.lab-card { display: block; overflow: hidden; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--bg-card) 82%, transparent); border: 1px solid var(--border); border-radius: 16px; transition: transform var(--transition), border-color var(--transition); }
.lab-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.lab-card-preview { height: 190px; overflow: hidden; background: #0b0b14; position: relative; border-bottom: 1px solid var(--border); }
.lab-card-preview img, .lab-card-preview iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
.lab-card-preview iframe { width: 200%; height: 380px; transform: scale(0.5); transform-origin: top left; }
.lab-card-body { padding: 1.1rem 1.2rem 1.3rem; }
.lab-card-body h2 { font-size: 1.15rem; margin: 0.45rem 0 0.4rem; }
.lab-card-body p { color: var(--text-muted); }
.lab-show-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.lab-show-head .section-header { margin-bottom: 0.6rem; }
.lab-show-head .page-lead { margin: 0.4rem 0 1.4rem; }
.lab-show-head .back-link { margin: 0 0 0.8rem; }
.lab-keywords { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.15rem 0 1.35rem; }
.lab-keywords .tag { cursor: default; }
.lab-copy { max-width: 46rem; margin: 2.2rem 0 0; }
.lab-copy h2 { color: var(--text-primary); font-size: 1.35rem; margin: 0 0 0.4rem; }
.lab-copy code { font-family: var(--font-code); font-size: 0.86em; direction: ltr; unicode-bidi: isolate; color: #c5d4ff; }
.lab-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 72vh; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--bg-card) 88%, transparent); }
.lab-stage[data-layout="code"] { grid-template-columns: 1fr; }
.lab-stage[data-layout="code"] .lab-preview-wrap { display: none; }
.lab-stage[data-layout="preview"] { grid-template-columns: 1fr; }
.lab-stage[data-layout="preview"] .lab-editor { display: none; }
.lab-editor, .lab-preview-wrap { min-width: 0; display: flex; flex-direction: column; }
.lab-editor { border-inline-end: 1px solid var(--border); }
.lab-toolbar, .lab-preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-darker) 70%, transparent); flex-wrap: wrap; }
.lab-tabs, .lab-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.lab-tab, .lab-tool { border: 1px solid var(--border); background: transparent; color: var(--text-secondary); border-radius: 8px; padding: 0.35rem 0.7rem; cursor: pointer; font-family: var(--font-code); font-size: 0.78rem; }
.lab-tab.is-active, .lab-tool:hover { color: #fff; border-color: var(--primary); background: color-mix(in srgb, var(--primary) 22%, transparent); }
.lab-panes { flex: 1; min-height: 420px; position: relative; }
.lab-code { display: none; width: 100%; height: 100%; min-height: 420px; resize: none; border: 0; outline: none; padding: 1rem 1.1rem; background: transparent; color: #e5e7eb; font-family: var(--font-code); font-size: 0.86rem; line-height: 1.7; direction: ltr; text-align: left; unicode-bidi: isolate; color-scheme: dark; scrollbar-width: thin; scrollbar-color: #3a3a4a #121214; }
.lab-code::-webkit-scrollbar { width: 10px; height: 10px; }
.lab-code::-webkit-scrollbar-track { background: #121214; }
.lab-code::-webkit-scrollbar-thumb { background: #3a3a4a; border-radius: 999px; border: 2px solid #121214; }
.lab-code::-webkit-scrollbar-thumb:hover { background: #5b5bff; }
.lab-code::-webkit-scrollbar-corner { background: #121214; }
.lab-code.is-active { display: block; }
.lab-preview { flex: 1; width: 100%; min-height: 420px; border: 0; background: #0b0b14; color-scheme: dark; }
.lab-related-title { margin: 2.4rem 0 0; font-size: 1.3rem; }

.faq-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 52rem; }
.faq-item { background: color-mix(in srgb, var(--bg-card) 82%, transparent); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; scroll-margin-top: 88px; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; padding: 1.05rem 1.2rem; font-weight: 800; color: var(--text-primary); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary i { color: var(--primary); transition: transform 0.2s ease; }
.faq-item[open] summary i { transform: rotate(180deg); }
.faq-item[open] { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.faq-answer { padding: 0 1.2rem 1.15rem; color: var(--text-secondary); line-height: 1.9; }
.faq-answer p { margin-top: 0.6rem; }
.faq-answer a { color: var(--primary); font-weight: 700; }

.empty-note { color: var(--text-muted); }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-wrap { max-width: 48rem; margin: 0 auto; }
.article-body, .prose-dark, .faq-answer, .about-text {
    font-family: var(--font-primary);
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.95;
}
.article-body h2, .prose-dark h2 { font-family: var(--font-primary); color: var(--text-primary); font-size: 1.5rem; margin-top: 2rem; }
.article-body p, .prose-dark p { margin-top: 1rem; }
.article-body a, .prose-dark a { color: var(--primary); }
.article-body ul, .prose-dark ul { margin-top: 1rem; padding-inline-start: 1.4rem; }
.article-body code, .article-body pre, .prose-dark code, .prose-dark pre {
    font-family: var(--font-code);
}
.back-link { display: inline-flex; margin-top: 2rem; color: var(--primary); font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--cyan); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.product-cover { width: 100%; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); }
.product-cover-fallback { height: 280px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; font-size: 3rem; color: var(--primary); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 0.8rem; }
.gallery-grid img { height: 96px; width: 100%; object-fit: cover; border-radius: 10px; }
.product-price { font-family: var(--font-code); font-size: 1.6rem; color: var(--cyan); font-weight: 800; }
.product-release { margin-top: 1.6rem; padding: 1.3rem 1.35rem 1.4rem; background: color-mix(in srgb, var(--bg-card) 78%, transparent); border: 1px solid var(--border); border-radius: 18px; }
.product-release-title { font-size: 1.15rem; margin: 0 0 1rem; }
.product-meta { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.product-meta li { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.7rem 0.8rem; background: color-mix(in srgb, var(--bg-darker) 55%, transparent); border: 1px solid var(--border); border-radius: 12px; }
.product-meta i { color: var(--primary); width: 1.1rem; margin-top: 0.2rem; text-align: center; }
.product-meta small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.product-meta strong { color: var(--text-primary); font-family: var(--font-primary); font-size: 0.95rem; }
.product-release-block { margin-top: 1.1rem; }
.product-release-block h3 { font-size: 0.92rem; margin-bottom: 0.35rem; color: var(--cyan); }
.product-release-block p { color: var(--text-secondary); line-height: 1.85; white-space: pre-line; }
.product-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }
.testimonial-card { background: color-mix(in srgb, var(--bg-card) 78%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem; }
.quote-stars { color: var(--accent); letter-spacing: 0.1em; }
.testimonial-person { display: flex; align-items: center; gap: 0.8rem; margin-top: 1.2rem; }
.voice-review {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1rem 0 0.2rem;
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-darker) 72%, transparent);
    border: 1px solid var(--border);
}
.voice-review audio { display: none; }
.voice-play {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gradient-1);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px color-mix(in srgb, var(--primary) 35%, transparent);
}
.voice-play:hover { filter: brightness(1.08); }
.voice-review.is-playing .voice-play { background: #e53935; box-shadow: 0 0 16px color-mix(in srgb, #e53935 40%, transparent); }
.voice-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 18px;
    flex-shrink: 0;
}
.voice-wave span {
    width: 2px;
    height: 6px;
    border-radius: 2px;
    background: var(--primary);
    opacity: 0.45;
}
.voice-review.is-playing .voice-wave span {
    animation: voicePulse 0.9s ease-in-out infinite;
}
.voice-wave span:nth-child(2) { animation-delay: 0.08s; }
.voice-wave span:nth-child(3) { animation-delay: 0.16s; }
.voice-wave span:nth-child(4) { animation-delay: 0.24s; }
.voice-wave span:nth-child(5) { animation-delay: 0.32s; }
.voice-wave span:nth-child(6) { animation-delay: 0.12s; }
.voice-wave span:nth-child(7) { animation-delay: 0.2s; }
.voice-wave span:nth-child(8) { animation-delay: 0.28s; }
.voice-wave span:nth-child(9) { animation-delay: 0.04s; }
.voice-wave span:nth-child(10) { animation-delay: 0.36s; }
@keyframes voicePulse {
    0%, 100% { height: 5px; opacity: 0.4; }
    50% { height: 16px; opacity: 1; }
}
.voice-track {
    flex: 1;
    height: 6px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--border) 80%, transparent);
    cursor: pointer;
    overflow: hidden;
}
.voice-progress {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #b44cff, #5b5bff);
}
.voice-time {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 2.4rem;
    text-align: end;
}
.avatar, .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--bg-darker); color: var(--primary); font-weight: 800; border: 1px solid var(--border); }
.section-cta { background: color-mix(in srgb, var(--bg-card) 78%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 20px; padding: 3rem 2rem; text-align: center; }
.section-cta h2 { font-family: var(--font-primary); font-size: 1.8rem; margin-bottom: 0.6rem; }
.section-cta p { color: var(--text-secondary); max-width: 36rem; margin: 0 auto 1.5rem; }
.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin-top: 2rem; }
.pagination li a, .pagination li span { display: inline-flex; min-width: 40px; justify-content: center; padding: 0.45rem 0.8rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); text-decoration: none; background: var(--bg-card); }
.pagination .active span { background: var(--gradient-1); color: #fff; border-color: transparent; }
.block-hero { position: relative; overflow: hidden; padding: 5rem 2rem; text-align: center; background: var(--bg-darker); }
.block-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.28; }
.block-hero-inner { position: relative; max-width: 52rem; margin: 0 auto; }
.block-hero h1 { font-family: var(--font-primary); font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 0.8rem; }
.block-hero p { color: var(--text-secondary); font-size: 1.1rem; }
.block-section { max-width: 1400px; margin: 0 auto; padding: 3rem 2rem; }
.block-heading { font-family: var(--font-primary); text-align: center; font-size: 1.8rem; margin-bottom: 2rem; color: var(--primary); }
.block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }
.feature-card h3 { color: var(--cyan); margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); }
.block-cta { margin: 2rem; padding: 3rem 2rem; text-align: center; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border); }
.block-cta h2 { font-family: var(--font-primary); font-size: 1.8rem; margin-bottom: 0.6rem; }
.block-cta p { color: var(--text-secondary); margin-bottom: 1.2rem; }
.block-image { max-width: 56rem; margin: 0 auto; padding: 2rem; }
.block-image img { width: 100%; border-radius: 16px; border: 1px solid var(--border); }
.block-image figcaption { text-align: center; color: var(--text-muted); margin-top: 0.6rem; }
.block-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.2rem; max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }
.block-stat { text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem; }
.block-stat .value { font-family: var(--font-code); font-size: 2rem; color: var(--primary); font-weight: 800; }
.block-stat .label { color: var(--text-muted); }
.section-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-toolbar .section-header { margin-bottom: 0; flex: 1; }
.section-toolbar a { color: var(--primary); font-weight: 700; text-decoration: none; }
.pagination .disabled span { opacity: 0.4; }

.products-showcase .section-title,
.products-showcase .section-title .title-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 18px rgba(var(--primary-rgb), 0.35));
}
.showcase-lead {
    max-width: 40rem;
    margin: -1.2rem 0 1.6rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
}
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.showcase-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0.95rem;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    backdrop-filter: blur(16px);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.showcase-card:hover {
    transform: translateY(-6px);
    border-color: var(--purple);
    box-shadow: 0 14px 32px rgba(var(--purple-rgb), 0.2);
}
.showcase-card.is-featured {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}
.showcase-index {
    position: absolute;
    top: 0.7rem;
    inset-inline-end: 0.75rem;
    font-family: var(--font-code);
    color: #fff;
    font-weight: 800;
    font-size: 0.72rem;
    z-index: 1;
    opacity: 0.8;
}
.showcase-card-media {
    height: 92px;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: var(--primary);
    overflow: hidden;
    background: transparent;
    border-radius: 14px;
}
.showcase-card:nth-child(3n+2) .showcase-card-media,
.showcase-card:nth-child(3n) .showcase-card-media {
    background: transparent;
}
.showcase-card-media:has(img) {
    background: var(--bg-darker);
}
.showcase-card-media img { width: 100%; height: 100%; object-fit: cover; }
.showcase-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    padding-inline-end: 0.4rem;
}
.showcase-card p {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.showcase-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.75rem;
}
.showcase-price {
    color: var(--accent);
    font-family: var(--font-code);
    font-size: 0.82rem;
    font-weight: 800;
}
.showcase-more {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary);
}

@media (max-width: 1024px) {
    .hero-container, .about-content, .contact-content, .product-detail { grid-template-columns: 1fr; }
    .product-meta { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-image-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        aspect-ratio: auto;
        width: 100%;
        max-width: 520px;
    }
    .profile-image-glow { display: none; }
    .profile-image-frame {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(220px, 58%);
        aspect-ratio: 1;
    }
    .floating-badge { position: static; animation: none; min-width: 0; width: 100%; }
    .floating-badge.is-hidden { display: none; transform: none; }
    .section-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
    .section-toolbar .section-header { margin-bottom: 0; flex: 1; min-width: 240px; }
}
@media (max-width: 768px) {
    .nav-item, .nav-item.has-mega { position: relative; width: 100%; }
    .nav-link { flex: 1; }
    .nav-caret { display: inline-flex; }
    .dropdown-grid { grid-template-columns: 1fr; max-height: none; }
    .dropdown-names { grid-template-columns: 1fr; max-height: none; }
    .brand-hero-name { font-size: 2.5rem; }
    .brand-hero-sub { font-size: 1.25rem; }
    .about-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .services-grid { grid-template-columns: 1fr; }
    .hero-buttons .btn { width: 100%; justify-content: center; }
    .showcase-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
    .lab-grid { grid-template-columns: 1fr; }
    .lab-stage, .lab-stage[data-layout="split"] { grid-template-columns: 1fr; min-height: 0; }
    .lab-editor { border-inline-end: 0; border-bottom: 1px solid var(--border); }
}

/* Product media: retain the full image at every aspect ratio. */
.product-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.product-detail > *, .product-media, .app-gallery { min-width: 0; }
.product-cover { object-fit: contain; max-height: 540px; background: var(--bg-card); }
.project-image img { object-fit: contain; }
.app-gallery { width: 100%; }
.app-gallery-cover { display: grid; place-items: center; position: relative; padding: 12px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg-card); overflow: hidden; }
.app-gallery-cover img { display: block; width: 100%; height: auto; max-height: 480px; object-fit: contain; border-radius: 14px; }
.app-gallery-zoom { position: absolute; bottom: 22px; inset-inline-end: 22px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #111827b3; }
.app-gallery-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.app-gallery-heading h2 { margin: 0 0 4px; font-size: 1rem; }
.app-gallery-heading span { color: var(--text-secondary); font-size: .78rem; }
.app-gallery-controls { display: flex; gap: 6px; flex-shrink: 0; }
.app-gallery-controls[hidden] { display: none; }
.app-gallery-controls button { border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); border-radius: 10px; min-width: 38px; height: 38px; padding: 0 10px; cursor: pointer; font: inherit; font-size: .8rem; }
.app-gallery-controls button:hover { border-color: var(--primary); }
.app-gallery-track { display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; padding: 4px 2px 16px; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; scroll-snap-type: x proximity; }
.app-gallery-slide { position: relative; display: grid; place-items: center; flex: 0 0 auto; height: clamp(260px, 27vw, 360px); aspect-ratio: var(--frame-ratio, .56); max-width: 90%; padding: 9px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-card); overflow: hidden; scroll-snap-align: start; transition: border-color .2s; }
.app-gallery-slide:hover { border-color: var(--primary); }
.app-gallery-slide img { width: 100%; height: 100%; min-height: 0; object-fit: contain; border-radius: 12px; }
.app-gallery-number { position: absolute; bottom: 15px; left: 15px; color: #fff; background: #111827bf; border-radius: 7px; padding: 2px 7px; font-size: .7rem; }
.app-gallery a:focus-visible, .app-gallery button:focus-visible, .app-gallery-track:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.app-gallery-dialog { width: min(1100px, 94vw); max-width: 94vw; height: min(850px, 92dvh); max-height: 92dvh; margin: auto; padding: 48px 16px 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-darker); }
.app-gallery-dialog::backdrop { background: #070812e6; backdrop-filter: blur(8px); }
.app-gallery-dialog img { width: 100%; height: 100%; object-fit: contain; }
.app-gallery-close { position: absolute; top: 8px; right: 12px; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-card); color: var(--text-primary); font-size: 25px; cursor: pointer; }
@media (max-width: 900px) { .product-detail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .app-gallery-cover { padding: 7px; border-radius: 18px; } .app-gallery-heading { flex-wrap: wrap; } .app-gallery-slide { height: 290px; } }
@media (prefers-reduced-motion: reduce) { .app-gallery-slide { transition: none; } }

/* Let content shrink inside grid/flex layouts instead of widening the page. */
.hero-container > *, .about-content > *, .contact-content > *,
.footer-grid > *, .hero-image-container > *, .projects-grid > *,
.posts-grid > *, .skills-grid > *, .services-grid > *, .showcase-grid > * {
    min-width: 0;
}
.skills-grid, .projects-grid, .posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.block-grid, .search-results {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.code-window { min-width: 0; max-width: 100%; }
.code-block { max-width: 100%; }
.project-title, .project-description, .article-body, .prose-dark,
.contact-content, .footer-list, .product-release, .post-card {
    overflow-wrap: anywhere;
}
.article-body iframe, .prose-dark iframe, video { max-width: 100%; }
@media (max-width: 768px) {
    .hero-container, .about-content, .contact-content, .footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero-container, .section-container, .footer-container {
        padding-inline: clamp(1rem, 4vw, 2rem);
    }
    .block-section { padding-inline: 1rem; }
    .section-toolbar .section-header { min-width: 0; flex-basis: 100%; }
    .search-page-form .form-input { min-width: 0; width: 100%; }
    .hero-image-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .floating-badge { padding: .65rem; gap: .5rem; }
    .badge-content { min-width: 0; overflow-wrap: anywhere; }
    .code-window-bar { flex-wrap: wrap; }
}
