:root {
    --bg-color: #2b1f14;
    --text-primary: #f0e6d3;
    --text-secondary: #bfa888;
    --accent-primary: #e8a84c;
    --accent-secondary: #c07d35;
    --glass-bg: rgba(43, 31, 20, 0.7);
    --glass-border: rgba(232, 168, 76, 0.18);
    --card-radius: 8px;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
    --font-arabic: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;
    --transition-speed: 0.2s;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --grid-opacity: 0.04;
    --grid-size: 40px;
    --accent-rgb: 232, 168, 76;
}

[data-theme="dark"] {
    --bg-color: #1e150d;
    --text-primary: #f0e6d3;
    --text-secondary: #bfa888;
    --accent-primary: #e8a84c;
    --accent-secondary: #c07d35;
    --glass-bg: rgba(30, 21, 13, 0.7);
    --glass-border: rgba(232, 168, 76, 0.15);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --grid-opacity: 0.03;
    --grid-size: 40px;
}

[data-theme="light"] {
    --bg-color: #faf5ec;
    --text-primary: #3d2b16;
    --text-secondary: #7d6547;
    --accent-primary: #c8862e;
    --accent-secondary: #a06428;
    --glass-bg: rgba(250, 245, 236, 0.7);
    --glass-border: rgba(200, 134, 46, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --grid-opacity: 0.06;
    --grid-size: 40px;
    --accent-rgb: 200, 134, 46;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

[lang="ar"] body {
    direction: rtl;
    font-family: var(--font-arabic);
}

[data-theme="dark"] body {
    background-image: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 4rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 3rem;
    text-align: start;
    /* Updated to natural start alignment */
    display: block;
    margin-left: 0;
    margin-right: 0;
}




/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="dark"] header {
    background: rgba(10, 10, 10, 0.9);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    /* Ensure contents are centered */
    height: 100%;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

/* Hero Section */
/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding-top: 80px;
    text-align: center;
}

[lang="ar"] .hero {
    flex-direction: column;
    /* Keep column layout for RTL */
}

.hero-image-window {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: 1rem;
    order: -1;
}

.hero-image-window::after {
    content: "";
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    filter: blur(4px);
}

[data-theme="dark"] .hero-image-window::after {
    background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.35) 0%, transparent 70%);
}

.hero-image {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
    transform: translateY(40px);
    animation: heroRise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes heroRise {
    to {
        transform: translateY(0);
    }
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}


[data-theme="dark"] .hero-image {
    border-color: #333;
}

.hero-content {
    max-width: 600px;
    text-align: left;
    order: 1;
    /* Content on left (visually start) */
}

[lang="ar"] .hero-content {
    text-align: right;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--text-primary);
    color: white;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn {
    background-color: var(--accent-primary);
    color: var(--bg-color);
}

[data-theme="dark"] .btn:hover {
    background-color: color-mix(in srgb, var(--accent-primary) 70%, #000000);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 4px;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
    padding: 3rem;
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.025) 2px, rgba(0,0,0,0.025) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.025) 2px, rgba(0,0,0,0.025) 4px),
        linear-gradient(135deg, #c49a6c 0%, #a87b4e 20%, #c49a6c 40%, #96683a 60%, #b8895c 80%, #a07448 100%);
    border-radius: 4px;
    box-shadow:
        inset 0 3px 10px rgba(0, 0, 0, 0.35),
        inset 0 -2px 5px rgba(255, 255, 255, 0.08),
        0 6px 20px rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    border: 12px solid #5c3d1e;
    outline: 2px solid #3d2810;
    outline-offset: -14px;
}

.projects-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0,0,0,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(0,0,0,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.projects-grid > * {
    position: relative;
    z-index: 1;
}

.project-card {
    background: #faf6ee;
    border: 1px solid #e8e0d0;
    border-radius: 3px;
    padding: 1.5rem;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.35s ease;
    box-shadow:
        2px 3px 6px rgba(0, 0, 0, 0.25),
        1px 1px 2px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    perspective: 800px;
    transform-style: preserve-3d;
}

.project-card::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, #cc2929 60%, #8b0000);
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.project-card::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff, #ccc);
    z-index: 11;
    opacity: 0.6;
}

.project-card:hover {
    transform: rotateY(6deg) rotateX(2deg) translateY(-4px);
    box-shadow:
        8px 12px 24px rgba(0, 0, 0, 0.3),
        3px 4px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .project-card {
    background: #2a2118;
    border-color: #3d2f1e;
    box-shadow:
        2px 3px 6px rgba(0, 0, 0, 0.4),
        1px 1px 2px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .project-card:hover {
    box-shadow:
        8px 12px 24px rgba(0, 0, 0, 0.5),
        3px 4px 8px rgba(0, 0, 0, 0.3);
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.22rem 0.55rem;
    border: 1px dashed var(--glass-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .tag {
    color: var(--text-secondary);
}

.project-card:hover .tag {
    border-style: solid;
}

/* Contact */
.contact {
    background: #f9fafb;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="dark"] .contact {
    background: #0f0f0f;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.social-link {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.social-link:hover {
    color: var(--accent-primary);
}

/* Footer contact — visually identical to the home-page contact section */
footer {
    text-align: center;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    background: #ffffff;
}

footer .footer-contact {
    width: 100%;
    margin: 0;
    padding: 6rem 0;
    text-align: initial;
}

footer .footer-contact .container {
    width: 100%;
}

.footer-bottom {
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

[data-theme="dark"] footer {
    background: #0a0a0a;
}

/* Home page footer keeps the original standalone copyright layout. */
.home-page footer {
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.75rem;
        /* text-align: center; */
    }

    [lang="ar"] h2 {
        /* text-align: center; */
    }

    [lang="ar"] .hero {
        flex-direction: column;
        /* Mirror layout for RTL */
    }


    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.85);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 2rem;
        padding: 4rem 2rem;
        transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
    }

    [data-theme="dark"] .nav-links {
        background: rgba(10, 10, 10, 0.85);
    }

    [lang="ar"] .nav-links {
        right: auto;
        left: 0;
        transform: translateY(-100%);
    }

    .nav-links::before {
        content: "";
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
        pointer-events: none;
    }

    .nav-links::after {
        content: "";
        position: absolute;
        bottom: -30%;
        left: -30%;
        width: 80%;
        height: 80%;
        background: radial-gradient(circle, rgba(var(--accent-rgb), 0.05) 0%, transparent 70%);
        pointer-events: none;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    [lang="ar"] .nav-links.active {
        transform: translateY(0);
    }

    .nav-links a {
        font-size: 1.75rem;
        font-weight: 700;
        width: auto;
        justify-content: center;
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        color: var(--text-primary);
        position: relative;
        padding: 0.5rem 1rem;
        border-radius: 12px;
        height: 100px;
    }

    .nav-links a::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent), var(--accent-secondary, var(--accent)));
        border-radius: 2px;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        transform: translateX(-50%);
    }

    .nav-links a:hover::after {
        width: 60%;
    }

    .nav-links a:hover {
        color: var(--accent);
        background: rgba(var(--accent-rgb), 0.06);
    }

    .nav-links.active a {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* Staggered animation for links */
    .nav-links.active a:nth-child(1) {
        transition-delay: 0.15s;
    }

    .nav-links.active a:nth-child(2) {
        transition-delay: 0.25s;
    }

    .nav-links.active a:nth-child(3) {
        transition-delay: 0.35s;
    }

    .nav-links.active a:nth-child(4) {
        transition-delay: 0.45s;
    }

    .mobile-nav-buttons {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .mobile-nav-buttons button {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .nav-links.active .mobile-nav-buttons button:nth-child(1) {
        transition-delay: 0.6s;
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .nav-links.active .mobile-nav-buttons button:nth-child(2) {
        transition-delay: 0.7s;
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* Hero styles are now global, but we can adjust sizing for mobile if needed */
    .hero {
        min-height: 80vh;
        padding: 6rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        width: 300px;
        height: 300px;
    }

    [lang="ar"] .hero-content {
        text-align: center;
    }
}



.project-slider,
.slider-thumbnails {
    direction: ltr;
}

/* ============================================
   INVESTIGATOR THEME DESIGN ELEMENTS
   ============================================ */

/* Dark vignette overlay for moody atmosphere */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

[data-theme="light"] body::before {
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.15) 100%);
}

/* Typewriter-style section headings */
h2 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    padding-left: 1.5rem;
}

[lang="ar"] h2 {
    padding-left: 0;
    padding-right: 1.5rem;
}

h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 2px;
}

[lang="ar"] h2::before {
    left: auto;
    right: 0;
}

/* Case file style cards */
.card,
.project-card,
.post-card {
    position: relative;
}

/* Redacted text effect on hover for descriptions */
.hero-subtitle,
.section-description {
    position: relative;
}

/* Stamp effect for accents */
.btn-primary,
.btn[class*="primary"] {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn[class*="primary"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
}

/* Magnifying glass cursor on interactive elements */
a,
button,
.post-card,
.project-card {
    cursor: pointer;
}

/* Evidence tag style for labels */
.eyebrow,
.section-eyebrow,
.blog-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-primary);
    padding: 0.35rem 0.75rem;
    border: 1px dashed var(--accent-primary);
    border-radius: 2px;
    opacity: 0.9;
}

/* Dotted connection lines between sections */
section {
    position: relative;
}

/* Confidential watermark effect */
.hero::after {
    content: "CONFIDENTIAL";
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    opacity: 0.15;
    transform: rotate(-5deg);
    pointer-events: none;
    border: 1px solid var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
}

[lang="ar"] .hero::after {
    right: auto;
    left: 2rem;
    transform: rotate(5deg);
}

/* Typewriter cursor blink on hero title */
.hero h1::after {
    content: "|";
    color: var(--accent-primary);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Case number style for project cards */
.post-card::before {
    content: "CASE #" attr(data-case);
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    opacity: 0.5;
    z-index: 1;
}

[dir="rtl"] .post-card::before {
    right: auto;
    left: 0.75rem;
}

/* Fingerprint pattern overlay for header */
header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--accent-primary) 0px,
        var(--accent-primary) 8px,
        transparent 8px,
        transparent 12px,
        var(--glass-border) 12px,
        var(--glass-border) 20px,
        transparent 20px,
        transparent 24px
    );
    opacity: 0.4;
}

/* String/corkboard line connecting nav items */
.nav-links a {
    position: relative;
}

.nav-links a::before {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::before {
    width: 100%;
}

/* Redacted text effect */
.redacted {
    background: var(--text-primary);
    color: transparent;
    border-radius: 2px;
    padding: 0 0.25rem;
    user-select: none;
    transition: all 0.3s ease;
}

.redacted:hover {
    background: transparent;
    color: var(--text-primary);
}

/* Evidence marker for list items */
ul li::marker {
    content: "▸ ";
    color: var(--accent-primary);
}

[dir="rtl"] ul li::marker {
    content: "◂ ";
}

/* File folder tab style for section headers */
.section-header {
    position: relative;
    padding-top: 1.5rem;
}

.section-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 0 0 2px 2px;
}

/* Magnifying glass icon on search */
input[type="search"] {
    position: relative;
}

/* Stamp rotation on buttons */
.btn {
    transition: all 0.25s ease;
}

.btn:hover {
    transform: rotate(-1deg) scale(1.02);
}

/* Dossier-style info panels */
.info-panel,
.about-content,
.contact-info {
    position: relative;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    background: var(--glass-bg);
}

.info-panel::before,
.about-content::before,
.contact-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

/* Clipboard clip on cards */
.post-card::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 12px;
    background: linear-gradient(180deg, #8b8b8b, #6b6b6b);
    border-radius: 2px 2px 0 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Night mode toggle special styling */
#theme-toggle {
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

/* Classified stamp animation */
@keyframes stamp {
    0% { transform: scale(2) rotate(-15deg); opacity: 0; }
    50% { transform: scale(0.9) rotate(-5deg); opacity: 1; }
    100% { transform: scale(1) rotate(-5deg); opacity: 0.15; }
}

/* Subtle paper grain texture */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    opacity: 0.015;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero::after {
        font-size: 0.5rem;
        bottom: 1rem;
        right: 1rem;
    }

    h2 {
        padding-left: 1rem;
    }

    [lang="ar"] h2 {
        padding-right: 1rem;
    }
}

.project-slider {
    position: relative;
    margin-bottom: 1.5rem;
}

.slider-wrapper {
    overflow: hidden;
    border-radius: 8px;
}

.slider-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;

    transition:
        opacity 0.35s ease,
        transform 0.35s ease;

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

.slider-image.changing {
    opacity: .3;
    transform: scale(0.97);
}

.slider-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);

    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;

    cursor: pointer;

    background: rgba(0,0,0,.5);
    color: white;

    font-size: 18px;
    z-index: 10;
}

.slider-btn:hover{
    background: rgba(0,0,0,.8);
}

.slider-btn.prev{
    left:10px;
}

.slider-btn.next{
    right:10px;
}

.slider-thumbnails{
    margin-top:12px;
    display:flex;
    gap:8px;
    justify-content:center;
    flex-wrap:wrap;
}

.slider-thumb{
    width:55px;
    height:40px;

    object-fit:cover;

    border-radius:6px;

    cursor:pointer;

    opacity:.45;

    transition:all .25s ease;

    border:2px solid transparent;
}

.slider-thumb:hover{
    opacity:.8;
}

.slider-thumb.active{
    opacity:1;
    transform:scale(1.08);
    border-color:var(--accent-primary);
}

/* Projects page */
.projects-page { padding-top: 9rem; min-height: calc(100vh - 100px); }
.projects-page-heading { margin-bottom: 3rem; }
.projects-page-heading h1 { margin-bottom: .75rem; }
.projects-page-heading p { color: var(--text-secondary); font-size: 1.05rem; }
.projects-view-all { display:flex; justify-content:center; margin-top:3rem; }
.slider-image { cursor: zoom-in; }
body.image-viewer-open { overflow:hidden; }
.image-viewer { position:fixed; inset:0; z-index:3000; display:flex; align-items:center; justify-content:center; padding:5vh 5vw; background:rgba(0,0,0,.82); opacity:0; visibility:hidden; transition:opacity .2s ease,visibility .2s ease; }
.image-viewer.active { opacity:1; visibility:visible; }
.image-viewer-stage { width:80vw; height:80vh; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:10px; }
.image-viewer-stage img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; transform-origin:center center; user-select:none; touch-action:none; cursor:default; transition:transform .15s ease; will-change:transform; }
.image-viewer-stage img.is-zoomed { cursor:grab; }
.image-viewer-stage img.dragging { cursor:grabbing; transition:none; }
.image-viewer-toolbar { position:absolute; top:1.25rem; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:.5rem; padding:.45rem; border:1px solid rgba(255,255,255,.15); border-radius:10px; background:rgba(20,20,20,.8); backdrop-filter:blur(12px); color:white; z-index:2; }
.image-viewer-btn { width:38px; height:38px; display:grid; place-items:center; border:0; border-radius:7px; background:transparent; color:white; font-size:1.35rem; line-height:1; cursor:pointer; }
.image-viewer-btn:hover { background:rgba(255,255,255,.14); }
#image-zoom-level { min-width:52px; text-align:center; font-family:var(--font-mono); font-size:.85rem; }
.image-viewer-close { margin-left:.35rem; font-size:1.6rem; }
@media (max-width:768px) {
    .projects-page { padding-top:7rem; }
    .projects-page-heading { text-align:center; }
    .projects-grid { padding: 1rem; }
    .image-viewer { padding:4rem 1rem 1rem; }
    .image-viewer-stage { width:92vw; height:82vh; }
    .image-viewer-toolbar { top:.75rem; }
}

/* Focus viewer thumbnails */
.image-viewer {
    flex-direction: column;
    gap: 14px;
}

.image-viewer-stage {
    flex: 0 0 72vh;
    height: 72vh;
}

.image-viewer-thumbnails {
    width: min(80vw, 1000px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: rgba(20,20,20,.72);
    backdrop-filter: blur(12px);
    scrollbar-width: thin;
}

.image-viewer-thumb {
    flex: 0 0 auto;
    width: 78px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 7px;
    background: transparent;
    opacity: .55;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}

.image-viewer-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.image-viewer-thumb:hover {
    opacity: .9;
    transform: translateY(-2px);
}

.image-viewer-thumb.active {
    opacity: 1;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .image-viewer-stage {
        flex-basis: 67vh;
        height: 67vh;
    }

    .image-viewer-thumbnails {
        width: 92vw;
        justify-content: flex-start;
    }

    .image-viewer-thumb {
        width: 64px;
        height: 44px;
    }
}
