/* ═══════════════════════════════════════════
   RESET & ROOT
   ═══════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-card-h: #1a1a1a;
    --surface: #161616;
    --border: #1f1f1f;
    --text: #e8e8e8;
    --text-dim: #888888;
    --accent: #722f37;
    --accent-l: #8c3a44;
    --accent-glow: rgba(114, 47, 55, 0.35);
    --white: #ffffff;
    --font: "Inter", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--accent) var(--bg);
}

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

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 120px 0;
}

/* ═══════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s var(--transition),
        transform 0.7s var(--transition);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition:
        background var(--transition),
        backdrop-filter var(--transition),
        padding var(--transition);
}
.nav.scrolled {
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav__logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.nav__logo-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}
.nav__logo-sub {
    font-size: 0.72rem;
    font-family: var(--mono);
    color: var(--text-dim);
    letter-spacing: 0.02em;
}
.nav__links {
    display: flex;
    gap: 36px;
}
.nav__link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dim);
    position: relative;
    transition: color var(--transition);
}
.nav__link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition);
}
.nav__link:hover,
.nav__link:focus-visible {
    color: var(--white);
}
.nav__link:hover::after,
.nav__link:focus-visible::after {
    width: 100%;
}

/* Mobile toggle */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    z-index: 1001;
}
.nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition:
        transform var(--transition),
        opacity var(--transition);
}
.nav__toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav__toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav__toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .nav__toggle {
        display: flex;
    }
    .nav__links {
        position: fixed;
        inset: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        background: rgba(10, 10, 10, 0.96);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }
    .nav__links.open {
        opacity: 1;
        pointer-events: all;
    }
    .nav__link {
        font-size: 1.25rem;
    }
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 80px;
}
.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}
.hero__greeting {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-l);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.hero__name {
    font-size: clamp(2.5rem, 5.5vw, 4.2rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--white);
    margin-bottom: 16px;
}
.hero__headline {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 400;
    color: var(--text-dim);
    margin-bottom: 20px;
    max-width: 520px;
}
.hero__desc {
    font-size: 0.95rem;
    color: var(--text-dim);
    max-width: 480px;
    margin-bottom: 36px;
    line-height: 1.8;
}
.hero__age {
    color: var(--accent-l);
    font-weight: 700;
}
.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all var(--transition);
    letter-spacing: 0.01em;
}
.btn--primary {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn--primary:hover {
    background: var(--accent-l);
    box-shadow: 0 8px 32px var(--accent-glow);
    transform: translateY(-2px);
}
.btn--secondary {
    border: 1px solid var(--border);
    color: var(--text);
}
.btn--secondary:hover {
    border-color: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
}

/* Hero visual */
.hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero__image-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
}
.hero__image-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(40px);
    animation: pulse-glow 4s ease-in-out infinite alternate;
}
@keyframes pulse-glow {
    from {
        opacity: 0.5;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1.05);
    }
}
.hero__image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--border);
    transition: border-color var(--transition);
}
.hero__image:hover {
    border-color: var(--accent);
}

/* Scroll indicator */
.hero__scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}
.hero__scroll-line {
    display: block;
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scroll-down 2s ease-in-out infinite;
}
@keyframes scroll-down {
    0% {
        transform: scaleY(0);
        transform-origin: top;
        opacity: 1;
    }
    50% {
        transform: scaleY(1);
        transform-origin: top;
        opacity: 1;
    }
    51% {
        transform: scaleY(1);
        transform-origin: bottom;
        opacity: 1;
    }
    100% {
        transform: scaleY(0);
        transform-origin: bottom;
        opacity: 0;
    }
}

@media (max-width: 900px) {
    .hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 48px;
    }
    .hero__headline,
    .hero__desc {
        margin-left: auto;
        margin-right: auto;
    }
    .hero__actions {
        justify-content: center;
    }
    .hero__visual {
        order: -1;
    }
    .hero__image-wrapper {
        width: 220px;
        height: 220px;
    }
}

/* ═══════════════════════════════════════════
   SECTION SHARED
   ═══════════════════════════════════════════ */
.section__title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}
.section__title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
    margin-top: 12px;
}
.section__subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 48px;
    max-width: 520px;
}

/* ═══════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════ */
.about__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 60px;
    align-items: start;
}
.about__text p {
    margin-bottom: 20px;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.about__text strong {
    color: var(--white);
    font-weight: 600;
}
.about__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.about__stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition:
        border-color var(--transition),
        transform var(--transition);
}
.about__stat:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}
.about__stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-l);
    line-height: 1;
    margin-bottom: 6px;
}
.about__stat-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 768px) {
    .about__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* ═══════════════════════════════════════════
   SKILLS TABS — Glassmorphism nav bar
   ═══════════════════════════════════════════ */
.skills {
    border-top: 1px solid var(--border);
    padding-top: 80px;
}
.skills__tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    background: rgba(18, 18, 18, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 40px;
    overflow-x: auto;
    scrollbar-width: none;
}
.skills__tabs::-webkit-scrollbar {
    display: none;
}

.skills__tab {
    flex: 1 1 auto;
    padding: 11px 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    border: none;
    border-radius: 10px;
    background: transparent;
    position: relative;
    transition:
        color var(--transition),
        background var(--transition),
        box-shadow var(--transition);
    white-space: nowrap;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
}

/* Slim crimson indicator line at the bottom */
.skills__tab::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 50%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition:
        transform var(--transition),
        box-shadow var(--transition);
    transform-origin: center;
}

.skills__tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}
.skills__tab:hover::after {
    transform: translateX(-50%) scaleX(0.45);
}

.skills__tab.active {
    color: var(--white);
    background: rgba(114, 47, 55, 0.14);
    box-shadow:
        0 0 18px rgba(114, 47, 55, 0.32),
        0 0 6px rgba(114, 47, 55, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.skills__tab.active::after {
    transform: translateX(-50%) scaleX(1);
    box-shadow:
        0 0 10px rgba(114, 47, 55, 1),
        0 0 22px rgba(114, 47, 55, 0.55);
}

/* Panel transitions */
.skills__panel {
    display: none;
    animation: fadePanel 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.skills__panel.active {
    display: block;
}
@keyframes fadePanel {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   SKILL CARD GRID
   ═══════════════════════════════════════════ */
.skills__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
}

/* Card shell */
.skill-card {
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 12px;
    padding: 20px 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: default;
    transition:
        border-color 0.26s ease,
        transform 0.26s ease,
        box-shadow 0.26s ease;
}

/* Crimson top shimmer line, hidden by default */
.skill-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.26s ease;
}

.skill-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(114, 47, 55, 0.2),
        0 12px 36px rgba(114, 47, 55, 0.16),
        0 4px 10px rgba(0, 0, 0, 0.45);
}
.skill-card:hover::before {
    opacity: 1;
}

/* ── Icon wrapper ───────────────────────────────────────── */
.skill-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Devicon image — subtly desaturated, restores on hover */
.skill-card__icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: grayscale(20%) brightness(0.86) saturate(0.75);
    transition:
        filter 0.26s ease,
        transform 0.26s ease;
}
.skill-card:hover .skill-card__icon img {
    filter: grayscale(0%) brightness(1.1) saturate(1.1)
        drop-shadow(0 0 7px rgba(114, 47, 55, 0.38));
    transform: scale(1.1);
}

/* Inverted (inherently dark) logos: Express, GitHub, Flask, Django, Unity */
.skill-card--inv .skill-card__icon img {
    filter: invert(0.86) grayscale(18%) brightness(0.88);
}
.skill-card--inv:hover .skill-card__icon img {
    filter: invert(0.92) grayscale(0%) brightness(1.06)
        drop-shadow(0 0 7px rgba(114, 47, 55, 0.38));
}

/* Text fallback icon for skills without an official logo */
.skill-card__icon-text {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(114, 47, 55, 0.1);
    border: 1px solid rgba(114, 47, 55, 0.18);
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--accent-l);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition:
        background 0.26s ease,
        border-color 0.26s ease,
        color 0.26s ease;
}
.skill-card:hover .skill-card__icon-text {
    background: rgba(114, 47, 55, 0.22);
    border-color: rgba(114, 47, 55, 0.44);
    color: var(--white);
}

/* ── Name ─────────────────────────────────────────────── */
.skill-card__name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.01em;
    line-height: 1.3;
    word-break: break-word;
    hyphens: auto;
    transition: color 0.26s ease;
}
.skill-card:hover .skill-card__name {
    color: var(--white);
}

/* ── Mastery dots ─────────────────────────────────────── */
.skill-card__mastery {
    display: flex;
    gap: 4px;
    align-items: center;
}
.skill-card__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    transition:
        background 0.26s ease,
        transform 0.26s ease;
    flex-shrink: 0;
}

/* Unfilled (greyed) dots by mastery level */
.skill-card[data-level="4"] .skill-card__dot:nth-child(5) {
    background: var(--border);
    opacity: 0.45;
}
.skill-card[data-level="3"] .skill-card__dot:nth-child(n + 4) {
    background: var(--border);
    opacity: 0.45;
}
.skill-card[data-level="2"] .skill-card__dot:nth-child(n + 3) {
    background: var(--border);
    opacity: 0.45;
}
.skill-card[data-level="1"] .skill-card__dot:nth-child(n + 2) {
    background: var(--border);
    opacity: 0.45;
}

/* Dots subtly stretch on card hover */
.skill-card:hover .skill-card__dot {
    transform: scaleY(1.35);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .skills__grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 10px;
    }
    .skills__tab {
        padding: 10px 12px;
        font-size: 0.64rem;
        letter-spacing: 0.05em;
    }
}
@media (max-width: 380px) {
    .skills__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ═══════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════ */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.projects {
    border-top: 1px solid var(--border);
    padding-top: 80px;
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition:
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.project-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    word-break: break-word;
}
.project-card__icon {
    flex-shrink: 0;
    color: var(--text-dim);
}
.project-card__desc {
    font-size: 0.84rem;
    color: var(--text-dim);
    line-height: 1.65;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.project-card__lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
}
.project-card__lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}
.project-card__links {
    display: flex;
    gap: 12px;
}
.project-card__link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: color var(--transition);
}
.project-card__link:hover {
    color: var(--accent-l);
}

/* Skeleton loading */
.skeleton {
    pointer-events: none;
}
.skeleton__bar {
    height: 16px;
    background: var(--surface);
    border-radius: 8px;
    animation: shimmer 1.8s infinite;
}
.skeleton__bar.short {
    width: 60%;
}
@keyframes shimmer {
    0% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.15;
    }
    100% {
        opacity: 0.4;
    }
}

/* Error / empty state */
.projects__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.projects__empty a {
    color: var(--accent-l);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 480px) {
    .projects__grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════
   CONTACT HUB (Footer)
   ═══════════════════════════════════════════ */

/* Outer shell */
.footer {
    padding: 96px 0 48px;
    border-top: 1px solid var(--border);
    position: relative;
    background: radial-gradient(
        ellipse 70% 35% at 50% 0%,
        rgba(114, 47, 55, 0.055) 0%,
        transparent 70%
    );
}

/* ── Section header ───────────────────────────────────────── */
.contact-header {
    margin-bottom: 52px;
}
.contact-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 14px;
    background: linear-gradient(105deg, var(--white) 52%, var(--accent-l) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}
.contact-subtitle {
    font-size: 0.95rem;
    color: var(--text-dim);
    max-width: 460px;
    line-height: 1.78;
}

/* ── Dual-column grid ────────────────────────────────────── */
.contact-hub {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 26px;
    align-items: start;
    margin-bottom: 60px;
}
.contact-hub__left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Contact Cards ─────────────────────────────────────── */
.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: rgba(20, 20, 20, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition:
        border-color 0.28s ease,
        transform 0.28s ease,
        box-shadow 0.28s ease;
}
/* Radial crimson sweep on hover */
.contact-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at top left,
        rgba(114, 47, 55, 0.16) 0%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}
a.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(114, 47, 55, 0.22),
        0 16px 48px rgba(114, 47, 55, 0.11);
}
a.contact-card:hover::before {
    opacity: 1;
}
/* Icon wrapper */
.contact-card__icon-wrap {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(114, 47, 55, 0.1);
    border: 1px solid rgba(114, 47, 55, 0.2);
    border-radius: 10px;
    color: var(--accent-l);
    transition:
        background 0.28s ease,
        border-color 0.28s ease,
        color 0.28s ease;
}
a.contact-card:hover .contact-card__icon-wrap {
    background: rgba(114, 47, 55, 0.22);
    border-color: rgba(114, 47, 55, 0.48);
    color: var(--white);
}
/* Body text */
.contact-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    z-index: 1;
    min-width: 0;
}
.contact-card__label {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.contact-card__value {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.28s ease;
}
a.contact-card:hover .contact-card__value {
    color: var(--white);
}
/* Floating arrow */
.contact-card__arrow {
    font-size: 1.05rem;
    color: var(--text-dim);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition:
        transform 0.28s ease,
        color 0.28s ease;
}
a.contact-card:hover .contact-card__arrow {
    transform: translate(4px, -4px);
    color: var(--accent-l);
}
/* Social card variant — stacked */
.contact-card--socials {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 16px;
}
.contact-card--socials .contact-card__body {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ── Social rows ─────────────────────────────────────────── */
.social-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 1;
}
.social-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition:
        background 0.22s ease,
        transform 0.22s ease;
}
.social-row--active:hover {
    background: rgba(114, 47, 55, 0.1);
    transform: translateX(4px);
}
.social-row--soon {
    opacity: 0.38;
    cursor: not-allowed;
}
.social-row__icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-dim);
    transition: color 0.22s ease;
}
.social-row--active:hover .social-row__icon {
    color: var(--white);
}
.social-row__name {
    flex: 1;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.22s ease;
}
.social-row--active:hover .social-row__name {
    color: var(--white);
}
.social-row__arrow {
    font-size: 0.9rem;
    color: var(--text-dim);
    transition:
        transform 0.22s ease,
        color 0.22s ease;
}
.social-row--active:hover .social-row__arrow {
    transform: translate(3px, -3px);
    color: var(--accent-l);
}
.social-row__badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    flex-shrink: 0;
}

/* ── Form container ──────────────────────────────────────── */
.contact-form-wrap {
    background: rgba(20, 20, 20, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: border-color 0.28s ease;
}
.contact-form-wrap:focus-within {
    border-color: rgba(114, 47, 55, 0.35);
}

/* ── Form fields ────────────────────────────────────────── */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-form__group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.contact-form__label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}
.contact-form__input,
.contact-form__textarea {
    width: 100%;
    background: #161616;
    border: 1px solid #272727;
    border-radius: 10px;
    padding: 13px 16px;
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text);
    outline: none;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}
.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
    color: rgba(136, 136, 136, 0.4);
}
.contact-form__input:focus,
.contact-form__textarea:focus {
    border-color: #722f37;
    box-shadow:
        0 0 0 3px rgba(114, 47, 55, 0.14),
        0 0 18px rgba(114, 47, 55, 0.07);
}
.contact-form__textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.65;
}

/* ── Submit button — border-to-fill sweep ─────────────────── */
.contact-form__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 32px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--accent-l);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        color 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.28s ease;
}
.contact-form__btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-form__btn:hover {
    color: var(--white);
    box-shadow:
        0 0 0 1px rgba(114, 47, 55, 0.45),
        0 8px 28px rgba(114, 47, 55, 0.28);
    transform: translateY(-2px);
}
.contact-form__btn:hover::before,
.contact-form__btn:focus-visible::before {
    transform: scaleX(1);
}
.contact-form__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.contact-form__btn-text,
.contact-form__btn-icon {
    position: relative;
    z-index: 1;
}
.contact-form__btn-icon {
    transition: transform 0.28s ease;
}
.contact-form__btn:hover .contact-form__btn-icon {
    transform: translate(3px, -3px);
}
/* Success state */
.contact-form__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 52px 20px;
    text-align: center;
    color: var(--text-dim);
    animation: fadePanel 0.5s ease;
}
.contact-form__success svg {
    color: var(--accent-l);
}
.contact-form__success p {
    font-size: 0.95rem;
    line-height: 1.75;
}
.contact-form__success[hidden] {
    display: none;
}

/* ── Footer bottom row + identity badge ──────────────────── */
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 28px;
    text-align: center;
}
/* Developer identity: pill with portrait + name */
.footer-identity {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 20px;
    padding: 8px 20px 8px 8px;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition:
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}
.footer-identity:hover {
    border-color: rgba(114, 47, 55, 0.42);
    box-shadow:
        0 0 0 1px rgba(114, 47, 55, 0.14),
        0 8px 28px rgba(114, 47, 55, 0.09);
}
/* Circular portrait with crimson glow ring */
.footer-identity__portrait {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow:
        0 0 10px rgba(114, 47, 55, 0.5),
        0 0 24px rgba(114, 47, 55, 0.2);
    overflow: hidden;
    flex-shrink: 0;
    transition: box-shadow 0.28s ease;
}
.footer-identity:hover .footer-identity__portrait {
    box-shadow:
        0 0 16px rgba(114, 47, 55, 0.7),
        0 0 36px rgba(114, 47, 55, 0.32);
}
.footer-identity__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
/* Name text — Space Grotesk for a premium, modern feel */
.footer-identity__name {
    font-family: "Space Grotesk", var(--font);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(100deg, var(--white) 38%, var(--accent-l) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}
.footer__copy {
    font-size: 0.78rem;
    color: var(--text-dim);
    opacity: 0.55;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .contact-hub {
        grid-template-columns: 1fr;
        margin-bottom: 48px;
    }
    .contact-header {
        margin-bottom: 40px;
    }
}
@media (max-width: 480px) {
    .footer {
        padding: 72px 0 40px;
    }
    .contact-form-wrap {
        padding: 24px 18px;
    }
    .footer-identity {
        flex-direction: column;
        border-radius: var(--radius);
        padding: 16px;
        gap: 10px;
    }
}

/* ═══════════════════════════════════════════
   LOAD MORE BUTTON
   ═══════════════════════════════════════════ */
.projects__load-more {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

/* Card entrance animation for dynamically added cards */
.card--enter {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.5s ease var(--card-delay, 0ms),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) var(--card-delay, 0ms);
}
.card--enter.card--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
   GITHUB ACTIVITY CHART
   ═══════════════════════════════════════════ */
.github-activity {
    padding-top: 80px;
    padding-bottom: 40px;
    border-top: 1px solid var(--border);
}
.github-activity-chart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    transition: border-color var(--transition);
}
.github-activity-chart:hover {
    border-color: var(--accent);
}
.github-activity-chart__heading {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}
.github-activity-chart__heading::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
    margin: 10px auto 0;
}
.github-activity-chart__sub {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 36px;
    margin-top: 8px;
}
.github-activity-chart__images {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}
.github-activity-chart__img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    flex: 1 1 280px;
    max-width: 495px;
}
.github-activity-chart__graph {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    width: 100%;
}

@media (max-width: 640px) {
    .github-activity-chart {
        padding: 32px 20px;
    }
    .github-activity-chart__images {
        flex-direction: column;
        align-items: center;
    }
    .github-activity-chart__img {
        flex: none;
        width: 100%;
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════
   GITHUB TROPHIES
   ═══════════════════════════════════════════ */
.github-trophies {
    margin-top: 40px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.github-trophies__heading {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}
.github-trophies__img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════
   OPEN SOURCE IMPACT
   ═══════════════════════════════════════════ */
.oss-impact {
    padding-top: 80px;
    padding-bottom: 40px;
    border-top: 1px solid var(--border);
}

/* Grid */
.oss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Card shell — the entire card is a native <a> link */
.oss-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

/* Crimson radial glow — fades in on hover */
.oss-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at top right,
        rgba(114, 47, 55, 0.18) 0%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
    border-radius: inherit;
}

.oss-card:hover {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1px rgba(114, 47, 55, 0.28),
        0 24px 56px rgba(114, 47, 55, 0.14);
    transform: translateY(-5px);
}
.oss-card:hover::before {
    opacity: 1;
}

/* Arrow — absolute top-right, animates on hover */
.oss-card__arrow {
    position: absolute;
    top: 22px;
    right: 22px;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-dim);
    transition:
        transform var(--transition),
        color var(--transition);
    z-index: 1;
    /* Use a slightly bolder font for the glyph */
    font-weight: 300;
}
.oss-card:hover .oss-card__arrow {
    transform: translate(4px, -4px);
    color: var(--accent-l);
}

/* Card body */
.oss-card__body {
    /* Pull text away from the arrow */
    padding-right: 28px;
    flex: 1;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.oss-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
    margin-bottom: 5px;
}
.oss-card__subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-l);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
.oss-card__desc {
    font-size: 0.84rem;
    color: var(--text-dim);
    line-height: 1.72;
}

/* Footer row — language tag + contributor badge */
.oss-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}
.oss-card__tag {
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 9px;
    letter-spacing: 0.02em;
}
.oss-card__badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-l);
    background: rgba(114, 47, 55, 0.1);
    border: 1px solid rgba(114, 47, 55, 0.24);
    border-radius: 4px;
    padding: 3px 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 480px) {
    .oss-grid {
        grid-template-columns: 1fr;
    }
}

/* OSS card — skeleton loading state */
.oss-card--skel {
    pointer-events: none;
    cursor: default;
    /* Override hover transforms so skeletons stay still */
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--border) !important;
}
.oss-skel {
    background: var(--surface);
    border-radius: 6px;
    animation: shimmer 1.8s ease-in-out infinite;
    margin-bottom: 10px;
}
.oss-skel--title {
    height: 18px;
    width: 55%;
}
.oss-skel--sub {
    height: 11px;
    width: 38%;
    margin-bottom: 18px;
}
.oss-skel--body {
    height: 11px;
    width: 100%;
}
.oss-skel--body.short {
    width: 70%;
    margin-bottom: 0;
}

/* OSS badge — state colour variants */
/* Merged: crimson (same as base .oss-card__badge, explicit for clarity) */
.oss-card__badge--merged {
    color: var(--accent-l);
    background: rgba(114, 47, 55, 0.1);
    border-color: rgba(114, 47, 55, 0.24);
}
/* Open: emerald */
.oss-card__badge--open {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.22);
}
/* Closed without merge: muted */
.oss-card__badge--closed {
    color: var(--text-dim);
    background: var(--surface);
    border-color: var(--border);
}

/* OSS empty / error state */
.oss-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.7;
}
.oss-empty a {
    color: var(--accent-l);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition);
}
.oss-empty a:hover {
    color: var(--white);
}

/* ═══════════════════════════════════════════
   SELECTION & FOCUS
   ═══════════════════════════════════════════ */
::selection {
    background: var(--accent);
    color: var(--white);
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ═══════════════════════════════════════════
   CV PAGE — Screen View (Dark Mode)
   ═══════════════════════════════════════════ */

/* ── Base ───────────────────────────────────────────── */
.cv-page {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}
/* Switch to Arabic typeface for RTL mode */
[dir="rtl"].cv-page,
[dir="rtl"] .cv-page {
    font-family: "Tajawal", system-ui, sans-serif;
}

/* ── Actions Bar ─────────────────────────────────────── */
.cv-actions {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 32px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cv-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.22s ease;
    white-space: nowrap;
}
.cv-back-link:hover {
    color: var(--white);
}
/* Flip the chevron for RTL */
[dir="rtl"] .cv-back-link svg {
    transform: scaleX(-1);
}

/* ── Language Toggle Capsule ─────────────────────────── */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(22, 22, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    flex-shrink: 0;
}
.lang-toggle__btn {
    padding: 6px 16px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition:
        background 0.22s ease,
        color 0.22s ease,
        box-shadow 0.22s ease;
    font-family: inherit;
}
.lang-toggle__btn--active {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 0 12px rgba(114, 47, 55, 0.45);
}
.lang-toggle__btn:not(.lang-toggle__btn--active):hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
}
.lang-toggle__sep {
    display: block;
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* ── Download / Print Button ───────────────────────────── */
.cv-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent-l);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    transition:
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}
.cv-download-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.cv-download-btn:hover {
    color: var(--white);
    box-shadow:
        0 0 0 1px rgba(114, 47, 55, 0.4),
        0 6px 20px rgba(114, 47, 55, 0.22);
    transform: translateY(-1px);
}
.cv-download-btn:hover::before {
    transform: scaleX(1);
}
.cv-download-btn span,
.cv-download-btn svg {
    position: relative;
    z-index: 1;
}

/* ── CV Document Card ───────────────────────────────────────── */
.cv-document {
    max-width: 860px;
    margin: 40px auto 80px;
    padding: 52px 60px;
    background: #111111;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 32px 80px rgba(0, 0, 0, 0.55);
    /* Smooth opacity fade during language swap */
    transition: opacity 0.18s ease;
}
.cv-document.cv-lang-fade {
    opacity: 0;
    pointer-events: none;
}

/* ── CV Header ───────────────────────────────────────────── */
.cv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 28px;
    font-style: normal;
}
[dir="rtl"] .cv-header {
    flex-direction: row-reverse;
}
.cv-name {
    font-size: clamp(1.9rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 6px;
}
.cv-headline {
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--accent-l);
    letter-spacing: 0.01em;
}
.cv-header__contact {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-end;
    flex-shrink: 0;
}
[dir="rtl"] .cv-header__contact {
    align-items: flex-start;
}
.cv-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.79rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.cv-contact-item:is(a):hover {
    color: var(--accent-l);
}
.cv-contact-item svg {
    flex-shrink: 0;
}

/* ── Velvet Rule ─────────────────────────────────────────── */
.cv-rule {
    width: 100%;
    height: 2px;
    margin-bottom: 36px;
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        rgba(114, 47, 55, 0.35) 55%,
        transparent 100%
    );
    border-radius: 2px;
}
[dir="rtl"] .cv-rule {
    background: linear-gradient(
        270deg,
        var(--accent) 0%,
        rgba(114, 47, 55, 0.35) 55%,
        transparent 100%
    );
}

/* ── CV Sections ─────────────────────────────────────────── */
.cv-section {
    margin-bottom: 34px;
}
.cv-section__heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--accent-l);
    padding-bottom: 9px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
[dir="rtl"] .cv-section__heading {
    text-align: right;
}

/* ── Professional Summary ──────────────────────────────── */
.cv-summary {
    font-size: 0.89rem;
    color: var(--text-dim);
    line-height: 1.85;
}
[dir="rtl"] .cv-summary {
    text-align: right;
}

/* ── Skills Grid ──────────────────────────────────────────── */
.cv-skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 40px;
}
.cv-skill-group__cat {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}
.cv-skill-group__items {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.7;
}
[dir="rtl"] .cv-skills-grid {
    direction: rtl;
}
[dir="rtl"] .cv-skill-group__cat,
[dir="rtl"] .cv-skill-group__items {
    text-align: right;
}

/* ── Experience / Education Entries ───────────────────────── */
.cv-entry {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}
.cv-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.cv-entry__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}
[dir="rtl"] .cv-entry__row {
    flex-direction: row-reverse;
}
.cv-entry__title {
    font-size: 0.91rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2px;
    line-height: 1.35;
}
.cv-entry__org {
    font-size: 0.77rem;
    font-weight: 500;
    color: var(--accent-l);
}
.cv-entry__date {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    font-family: var(--mono);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 9px;
    flex-shrink: 0;
    align-self: flex-start;
}
/* Bullet list */
.cv-entry__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cv-entry__list li {
    font-size: 0.83rem;
    color: var(--text-dim);
    line-height: 1.7;
    padding-left: 18px;
    position: relative;
}
.cv-entry__list li::before {
    content: "\25B8"; /* ▸ */
    position: absolute;
    left: 0;
    top: 1px;
    color: var(--accent);
    font-size: 0.68rem;
}
[dir="rtl"] .cv-entry__list li {
    padding-left: 0;
    padding-right: 18px;
    text-align: right;
}
[dir="rtl"] .cv-entry__list li::before {
    left: auto;
    right: 0;
}
.cv-entry__desc {
    font-size: 0.83rem;
    color: var(--text-dim);
    line-height: 1.7;
}
[dir="rtl"] .cv-entry__desc {
    text-align: right;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SECTION SEPARATION & LAYOUT
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .github-activity {
        padding-top: 60px;
    }
    .oss-impact {
        padding-top: 60px;
    }
    .github-activity-chart {
        padding: 36px 28px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }
    .github-activity {
        padding-top: 48px;
    }
    .oss-impact {
        padding-top: 48px;
    }
    .skills {
        padding-top: 48px;
    }
    .projects {
        padding-top: 48px;
    }
    .section__title {
        font-size: clamp(1.5rem, 3.5vw, 2rem);
    }
    .section__subtitle {
        margin-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 60px 0;
    }
    .github-activity {
        padding-top: 36px;
    }
    .oss-impact {
        padding-top: 36px;
    }
    .skills {
        padding-top: 36px;
    }
    .projects {
        padding-top: 36px;
    }
    .section__title {
        font-size: clamp(1.3rem, 5vw, 1.6rem);
    }
}

/* ── CV Responsive ───────────────────────────────────────── */
@media (max-width: 760px) {
    .cv-actions {
        padding: 10px 16px;
        gap: 10px;
    }
    .cv-back-link span {
        display: none; /* icon only on small screens */
    }
    .cv-document {
        margin: 20px 12px 60px;
        padding: 32px 24px;
    }
    .cv-header {
        flex-direction: column;
        gap: 20px;
    }
    [dir="rtl"] .cv-header {
        flex-direction: column;
    }
    .cv-header__contact {
        align-items: flex-start;
    }
    .cv-skills-grid {
        grid-template-columns: 1fr;
    }
    .cv-entry__row {
        flex-direction: column;
        gap: 6px;
    }
    [dir="rtl"] .cv-entry__row {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════
   PREMIUM INTERACTIVE ANIMATIONS
   ═══════════════════════════════════════════ */

/* 1. Canvas Particles Background */
.hero {
    overflow: hidden;
}
.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
}
.hero__inner {
    position: relative;
    z-index: 1;
}

/* 2. Hero Background Spotlight */
.hero::before {
    content: "";
    position: absolute;
    top: var(--hero-mouse-y, -1000px);
    left: var(--hero-mouse-x, -1000px);
    width: 600px;
    height: 600px;
    background: radial-gradient(
        circle,
        rgba(114, 47, 55, 0.09) 0%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
    transition: opacity 0.5s ease;
    opacity: 0;
}
.hero:hover::before {
    opacity: 1;
}

/* 3. Staggered Cinematic Text Reveal */
.reveal-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible .reveal-word {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--word-idx) * 45ms);
}
@media (prefers-reduced-motion: reduce) {
    .reveal-word {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* 4. Mouse Glow Spotlight on Cards */
.skill-card,
.project-card,
.oss-card {
    position: relative;
    overflow: hidden;
}
.skill-card::after,
.project-card::after,
.oss-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        250px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
        rgba(114, 47, 55, 0.15),
        transparent 80%
    );
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.4s ease;
}
.skill-card:hover::after,
.project-card:hover::after,
.oss-card:hover::after {
    opacity: 1;
}

/* 5. 3D Perspective Card Tilt */
.skills__grid,
#github-projects,
.oss-grid {
    perspective: 1200px;
}
.skill-card,
.project-card,
.oss-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.22s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.26s ease,
                box-shadow 0.26s ease;
}
/* Lift inner details of cards in 3D perspective space on hover */
.skill-card > *,
.project-card > *,
.oss-card > * {
    transform: translateZ(12px);
    transition: transform 0.22s ease;
}

/* 6. Magnetic Buttons styling */
.btn {
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
                background var(--transition),
                box-shadow var(--transition);
}

/* 7. Interactive SVG Logo */
.nav__logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}
.nav__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.nav__logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.logo-hex {
    stroke: var(--border);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: rgba(17, 17, 17, 0.4);
    transition: stroke var(--transition), fill var(--transition);
}
.nav__logo:hover .logo-hex {
    stroke: var(--accent);
    fill: rgba(114, 47, 55, 0.08);
}
.logo-core {
    fill: var(--accent-l);
    transform-origin: 50px 55px;
    animation: core-glow 2.5s ease-in-out infinite alternate;
}
.logo-bracket-left,
.logo-bracket-right {
    stroke: var(--text-dim);
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: stroke var(--transition), transform var(--transition);
}
.logo-bracket-left {
    transform-origin: 30px 55px;
}
.logo-bracket-right {
    transform-origin: 70px 55px;
}
.nav__logo:hover .logo-bracket-left {
    stroke: var(--white);
    transform: translateX(-3px);
}
.nav__logo:hover .logo-bracket-right {
    stroke: var(--white);
    transform: translateX(3px);
}
.logo-orbit {
    fill: var(--white);
    transform-origin: 50px 55px;
    animation: orbit-rotate 4.5s linear infinite;
    filter: drop-shadow(0 0 3px var(--accent-l));
}

@keyframes core-glow {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
        fill: var(--accent);
    }
    100% {
        transform: scale(1.1);
        opacity: 1;
        fill: var(--accent-l);
        filter: drop-shadow(0 0 6px var(--accent-l));
    }
}
@keyframes orbit-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════
   CV PAGE — @media print (Clean White A4)
   ═══════════════════════════════════════════ */
@media print {
    /* ── Page setup ────────────────────────────────────────── */
    @page {
        size: A4;
        margin: 18mm 15mm;
    }

    /* ── Kill the dark UI chrome ───────────────────────────── */
    .no-print,
    .cv-actions {
        display: none !important;
    }

    /* ── White canvas ───────────────────────────────────────── */
    html,
    body,
    .cv-page {
        background: #ffffff !important;
        color: #1a1a1a !important;
    }

    /* Flatten the document card — no shadows, no rounding */
    .cv-document {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* ── Typography — crisp charcoal on white ────────────────── */
    .cv-name {
        color: #0d0d0d !important;
        font-size: 22pt !important;
    }
    .cv-headline {
        color: #722f37 !important;
        font-size: 10pt !important;
    }
    .cv-contact-item {
        color: #444444 !important;
        font-size: 8.5pt !important;
    }
    .cv-contact-item svg path,
    .cv-contact-item svg rect,
    .cv-contact-item svg polyline,
    .cv-contact-item svg circle {
        stroke: #555555 !important;
        fill: #555555 !important;
    }

    /* ── Velvet rule stays as a thin crimson line ──────────────── */
    .cv-rule {
        background: #722f37 !important;
        height: 1.5px !important;
        margin-bottom: 22pt !important;
    }

    /* ── Section headings ────────────────────────────────────── */
    .cv-section__heading {
        color: #722f37 !important;
        border-bottom-color: #e0e0e0 !important;
        font-size: 7.5pt !important;
    }

    /* ── Summary ───────────────────────────────────────────── */
    .cv-summary {
        color: #333333 !important;
        font-size: 9pt !important;
        line-height: 1.7 !important;
    }

    /* ── Skills ─────────────────────────────────────────────── */
    .cv-skill-group__cat {
        color: #0d0d0d !important;
        font-size: 8pt !important;
    }
    .cv-skill-group__items {
        color: #444444 !important;
        font-size: 8.5pt !important;
    }

    /* ── Entries ────────────────────────────────────────────── */
    .cv-entry {
        border-bottom-color: #e8e8e8 !important;
    }
    .cv-entry__title {
        color: #0d0d0d !important;
        font-size: 9.5pt !important;
    }
    .cv-entry__org {
        color: #722f37 !important;
        font-size: 8.5pt !important;
    }
    .cv-entry__date {
        color: #555555 !important;
        background: #f5f5f5 !important;
        border-color: #dddddd !important;
        font-size: 7.5pt !important;
    }
    .cv-entry__list li {
        color: #333333 !important;
        font-size: 8.5pt !important;
        line-height: 1.65 !important;
    }
    .cv-entry__list li::before {
        color: #722f37 !important;
    }
    .cv-entry__desc {
        color: #444444 !important;
        font-size: 8.5pt !important;
    }

    /* ── Page-break management ───────────────────────────────── */
    .cv-header {
        page-break-after: avoid;
    }
    .cv-section {
        page-break-inside: avoid;
    }
    .cv-entry {
        page-break-inside: avoid;
    }
    .cv-section__heading {
        page-break-after: avoid;
    }
    /* Force color printing — required by Chrome/Edge */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ═══════════════════════════════════════════
   LANGUAGE TOGGLE BUTTON
   ═══════════════════════════════════════════ */
.nav__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition:
        color var(--transition),
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
    white-space: nowrap;
}

.lang-toggle-btn:hover {
    color: var(--white);
    border-color: var(--accent);
    background: rgba(114, 47, 55, 0.1);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: translateY(-1px);
}

.lang-toggle-btn__globe {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity var(--transition), transform var(--transition);
}
.lang-toggle-btn:hover .lang-toggle-btn__globe {
    opacity: 1;
}

/* Spin animation on click */
@keyframes lang-spin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(0.85); }
    100% { transform: rotate(360deg) scale(1); }
}
.lang-btn--spinning .lang-toggle-btn__globe {
    animation: lang-spin 0.4s ease;
}

/* ═══════════════════════════════════════════
   RTL / ARABIC LANGUAGE SUPPORT
   ═══════════════════════════════════════════ */

/* Arabic font family */
[lang="ar"] body,
[dir="rtl"] body {
    font-family: "Tajawal", "Inter", system-ui, -apple-system, sans-serif;
    line-height: 1.9;
}

/* Flip nav underline from left→right to right→left */
[dir="rtl"] .nav__link::after {
    left: auto;
    right: 0;
}

/* Flip section title underline */
[dir="rtl"] .section__title::after {
    margin-right: 0;
}

/* Hero grid: image comes first in RTL (on right side in RTL = visually left) */
[dir="rtl"] .hero__inner {
    direction: rtl;
}

/* About grid direction */
[dir="rtl"] .about__grid {
    direction: rtl;
}

/* Skills tabs */
[dir="rtl"] .skills__tabs {
    direction: rtl;
}

/* Skill tab indicator: flip from left to right */
[dir="rtl"] .skills__tab::after {
    left: auto;
    right: 50%;
    transform: translateX(50%) scaleX(0);
    transform-origin: center;
}
[dir="rtl"] .skills__tab:hover::after {
    transform: translateX(50%) scaleX(0.45);
}
[dir="rtl"] .skills__tab.active::after {
    transform: translateX(50%) scaleX(1);
}

/* Contact hub and form */
[dir="rtl"] .contact-hub {
    direction: rtl;
}
[dir="rtl"] .contact-form__label {
    text-align: right;
}
[dir="rtl"] .contact-form__input,
[dir="rtl"] .contact-form__textarea {
    text-align: right;
    direction: rtl;
}

/* Footer identity */
[dir="rtl"] .footer-bottom {
    direction: rtl;
}

/* Social rows */
[dir="rtl"] .social-row {
    direction: rtl;
}

/* OSS cards from JS */
[dir="rtl"] .oss-grid {
    direction: rtl;
}
[dir="rtl"] .oss-card {
    text-align: right;
}

/* Projects grid from JS */
[dir="rtl"] .projects__grid {
    direction: rtl;
}
[dir="rtl"] .project-card {
    text-align: right;
}

/* GitHub activity chart heading */
[dir="rtl"] .github-activity-chart {
    text-align: center;
}

/* Mobile nav in RTL */
@media (max-width: 768px) {
    [dir="rtl"] .nav__links {
        direction: rtl;
    }
}
