/* Apple-Inspired Premium Design System */

:root {
    /* Colors - Apple's refined palette */
    --bg-color: #000000;
    --surface-color: #161617;
    --surface-elevated: #1d1d1f;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --accent-color: #0071e3;
    --accent-hover: #0077ed;
    --accent-gradient: linear-gradient(135deg, #0071e3 0%, #00c4ff 100%);
    --border-color: rgba(255, 255, 255, 0.1);
    --overlay: rgba(0, 0, 0, 0.72);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 48px;
    --spacing-xl: 80px;
    --spacing-xxl: 120px;

    /* Radii */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;
    --radius-pill: 980px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.4);

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);

}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.47059;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography Scale */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

h1 {
    font-size: clamp(48px, 7vw, 96px);
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -0.025em;
}

h3 {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h4 {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
}

p {
    line-height: 1.58824;
    font-weight: 400;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--accent-hover);
}

.nav-btn,
.language-toggle,
.home-btn,
.hamburger-menu {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Glassmorphism effect */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    /* Border and shadow */
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 15px 0 rgba(31, 38, 135, 0.25),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);

    /* Typography */
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-decoration: none;

    /* Interaction */
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
    position: relative;
}

.nav-btn:hover,
.language-toggle:hover,
.home-btn:hover,
.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    color: white;
    box-shadow:
        0 6px 20px 0 rgba(31, 38, 135, 0.35),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

/* Active/pressed effect */
.nav-btn:active,
.language-toggle:active,
.home-btn:active,
.hamburger-menu:active {
    transform: scale(0.98);
}

/* =========================================
   Navigation Container
   ========================================= */

.top-nav-container {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    direction: ltr !important;
    /* Force LTR for consistent positioning */
}

.nav-left,
.nav-right {
    display: flex;
    gap: 12px;
    align-items: center;
    pointer-events: auto;
    position: relative;
    direction: ltr !important;
}

.nav-right .home-btn {
    position: relative;
    z-index: 1;
}

/* =========================================
   Hamburger Menu Specific
   ========================================= */

.hamburger-menu {
    position: relative;
    z-index: 5;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: visible;
    transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.2s ease;
}

.hamburger-menu.open {
    transform: none;
}

.hamburger-icon {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 6;
}

.hamburger-panel {
    position: absolute;
    left: auto;
    right: -1px;
    top: -1px;
    bottom: auto;
    width: 220px;
    padding: 56px 0 8px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    transform: translateZ(0) scale(0);
    -webkit-transform: translateZ(0) scale(0);
    transform-origin: right 48px;
    border-radius: var(--radius-lg);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.3s ease;
    z-index: 4;
}

.hamburger-menu.open .hamburger-panel {
    transform: translateZ(0) scale(1);
    -webkit-transform: translateZ(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

[dir="rtl"] .hamburger-panel {
    left: auto;
    right: -1px;
    transform-origin: right 48px;
    border-radius: var(--radius-lg);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

/* Hamburger lines */
.hamburger-icon span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.hamburger-menu.open .hamburger-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.open .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.open .hamburger-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   Navigation Menu Dropdown
   ========================================= */

.nav-menu {
    width: 100%;
    padding: 2px 0 4px;
}

.nav-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

html[dir="rtl"] .nav-menu a {
    text-align: right;
}

.nav-menu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu a.active {
    color: var(--accent-color);
}

.bento-card,
.project-banner {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 15px 0 rgba(31, 38, 135, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bento-card:hover,
.project-banner:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}


.view-all-btn,
.btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;

    /* Same glassmorphism */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);

    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover,
.btn:hover,
.btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* =========================================
   Voting Buttons
   ========================================= */

.vote-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;

    /* Same glassmorphism */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 980px;
    border: 1px solid rgba(255, 255, 255, 0.15);

    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.vote-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.4);
}

/* =========================================
   Visitor Counter Badge
   ========================================= */

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 24px;

    /* Same glassmorphism */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);

    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    cursor: default;
}

.visitor-counter:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px) translateZ(0);
    -webkit-transform: translateY(-2px) translateZ(0);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* =========================================
   Badges (Primary, Secondary, etc.)
   ========================================= */

.badge,
.meta-tag {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;

    /* Same glassmorphism */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 15px 0 rgba(31, 38, 135, 0.25),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);

    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.badge:hover,
.meta-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.badge.primary {
    background: rgba(0, 113, 227, 0.2);
    color: var(--accent-color);
    border-color: rgba(0, 113, 227, 0.3);
}

.badge.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

.badge.solid {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: none;
}

.badge.solid:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* =========================================
   RTL Support
   ========================================= */

[dir="rtl"] .vote-btn {
    flex-direction: row-reverse;
}

/* =========================================
   Responsive Design
   ========================================= */

@media (max-width: 768px) {
    .top-nav-container {
        top: 16px;
        left: 16px;
        right: 16px;
    }

    .nav-btn,
    .language-toggle,
    .home-btn,
    .hamburger-menu {
        width: 44px;
        height: 44px;
        font-size: 12px;
    }

    .nav-left,
    .nav-right {
        gap: 8px;
    }

    .hamburger-icon span {
        width: 18px;
    }

    .hamburger-icon {
        height: 44px;
    }

    .hamburger-panel {
        width: 200px;
        transform-origin: right 44px;
        padding-top: 52px;
    }

    [dir="rtl"] .hamburger-panel {
        transform-origin: right 44px;
    }
}

html:not([dir="rtl"]) .hamburger-menu.open+.home-btn,
html:not([dir="rtl"]) .hamburger-menu.open~.home-btn {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 480px) {

    .view-all-btn,
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .vote-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    position: relative;
    background: radial-gradient(ellipse at center, rgba(0, 113, 227, 0.05) 0%, transparent 70%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.hero h1 {
    font-size: clamp(48px, 7vw, 96px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(180deg, #ffffff 0%, #a8a8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.hero p.subtitle {
    font-size: clamp(21px, 3vw, 28px);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
    line-height: 1.38105;
    letter-spacing: -0.008em;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
    opacity: 0;
}

.hero .meta-info {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
}

/* Meta Tags - Liquid Glass Design */
.hero .meta-tag {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;

    /* Liquid Glass Effect */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 15px 0 rgba(31, 38, 135, 0.25),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);

    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.hero .meta-tag::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hero .meta-tag:hover::before {
    width: 200px;
    height: 200px;
}

.hero .meta-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px 0 rgba(31, 38, 135, 0.35),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Navigation */
.nav-sticky {
    position: sticky;
    top: 20px;
    z-index: 100;
    margin: 0 auto var(--spacing-xl);
    max-width: 980px;
    background: var(--overlay);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-pill);
    padding: 8px 12px;
    border: 0.5px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.nav-sticky:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.nav-sticky ul {
    display: flex;
    list-style: none;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.nav-sticky a {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: var(--transition-base);
    display: block;
    letter-spacing: 0.01em;
}

.nav-sticky a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md) var(--spacing-xxl);
}

/* Section */
.section {
    margin-bottom: var(--spacing-xxl);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section-header {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.section-header h2 {
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.025em;
}

.section-header p {
    font-size: clamp(19px, 2vw, 24px);
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

.section-icon {
    font-size: 42px;
    margin-left: var(--spacing-sm);
    vertical-align: middle;
}

.section-content {
    font-size: 19px;
    color: var(--text-secondary);
    line-height: 1.58824;
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Cards and Grid Layouts */
.bento-grid {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    display: block;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.015em;
}

.card-desc {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.47059;
}

/* Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 0.5px solid var(--border-color);
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.card h4 {
    font-size: 21px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.card p,
.card ul {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.47059;
}

.card ul {
    list-style: none;
    padding: 0;
}

.card ul li {
    padding: 6px 0;
    position: relative;
    padding-right: 20px;
}

.card ul li::before {
    content: '→';
    position: absolute;
    right: 0;
    color: var(--accent-color);
    font-weight: 600;
}

/* Info Boxes */
.info-box,
.highlight-box,
.warning-box {
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    border: 0.5px solid;
    backdrop-filter: blur(10px);
}

.info-box {
    background: rgba(0, 113, 227, 0.08);
    border-color: rgba(0, 113, 227, 0.3);
}

.highlight-box {
    background: rgba(52, 199, 89, 0.08);
    border-color: rgba(52, 199, 89, 0.3);
}

.warning-box {
    background: rgba(255, 159, 10, 0.08);
    border-color: rgba(255, 159, 10, 0.3);
}

.info-box h4,
.highlight-box h4,
.warning-box h4 {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

/* Stats and Metrics */
.stat-big {
    font-size: clamp(56px, 8vw, 80px);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    letter-spacing: -0.04em;
}

.stat-label {
    font-size: 19px;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: var(--spacing-sm);
}

.metric-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 0.5px solid var(--border-color);
    text-align: center;
    transition: var(--transition-smooth);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.metric-card h4 {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card .value {
    font-size: clamp(36px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin: var(--spacing-sm) 0;
    letter-spacing: -0.02em;
}

.metric-card p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 8px;
    margin-top: var(--spacing-md);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--spacing-lg) 0;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 0.5px solid var(--border-color);
}

th {
    text-align: right;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: var(--spacing-md);
    color: var(--text-primary);
    font-weight: 400;
    font-size: 17px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Code Blocks */
.code-block {
    background: #000000;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.3;
}

.code-block pre {
    font-family: "SF Mono", "Fira Code", "Monaco", monospace;
    color: #d6deeb;
    font-size: 14px;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
}

.code-snippet {
    font-family: "SF Mono", "Fira Code", monospace;
    background: #000;
    border: 0.5px solid var(--border-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: #d6deeb;
    font-size: 14px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

code {
    font-family: "SF Mono", "Fira Code", monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-primary);
}

/* Timeline */
.timeline {
    position: relative;
    padding: var(--spacing-md) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    right: var(--spacing-md);
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
            transparent,
            var(--accent-color) 20%,
            var(--accent-color) 80%,
            transparent);
}

.timeline-item {
    position: relative;
    padding: var(--spacing-md);
    padding-right: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--border-color);
    transition: var(--transition-smooth);
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 2px solid var(--bg-color);
    box-shadow: 0 0 0 4px var(--surface-elevated);
}

.timeline-item:hover {
    transform: translateX(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.timeline-item h4 {
    font-size: 21px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.timeline-item p {
    font-size: 17px;
    color: var(--text-secondary);
}

/* Quote */
.quote {
    background: var(--surface-elevated);
    border-right: 4px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    font-size: 19px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.58824;
    position: relative;
}

.quote::before {
    content: '"';
    font-size: 72px;
    color: var(--accent-color);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    right: var(--spacing-md);
    font-family: Georgia, serif;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge.primary {
    background: rgba(0, 113, 227, 0.15);
    color: var(--accent-color);
}

.badge.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.badge.gray {
    background: rgba(142, 142, 147, 0.15);
    color: var(--text-secondary);
}

/* Nav Section (Table of Contents) */
.nav-section {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    border: 0.5px solid var(--border-color);
}

.nav-section h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.nav-section ul {
    list-style: none;
    padding: 0;
}

.nav-section li {
    margin: var(--spacing-sm) 0;
}

.nav-section a {
    display: block;
    padding: var(--spacing-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    font-weight: 500;
}

.nav-section a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-4px);
}

/* Footer */
.footer {
    background: var(--surface-elevated);
    border-top: 0.5px solid var(--border-color);
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    margin-top: var(--spacing-xxl);
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-base);
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.footer-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.footer-socials {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.social-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    font-size: 18px;
}

.social-btn:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.copyright {
    margin-top: var(--spacing-md);
    opacity: 0.6;
    font-size: 12px;
}

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    margin-top: var(--spacing-sm);
    transition: var(--transition-base);
}

.visitor-counter:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    text-align: center;
    letter-spacing: -0.022em;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-color);
    border-radius: 6px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-elevated);
}

/* Selection */
::selection {
    background: rgba(0, 113, 227, 0.3);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1068px) {
    .container {
        padding: 0 var(--spacing-md) var(--spacing-xl);
    }

    .bento-card.large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 32px;
        --spacing-xl: 56px;
        --spacing-xxl: 80px;
    }

    .hero {
        padding: var(--spacing-lg) var(--spacing-md);
        min-height: 80vh;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero p.subtitle {
        font-size: 19px;
    }

    .nav-sticky {
        display: none;
    }

    .section-header h2 {
        font-size: 32px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        right: var(--spacing-sm);
    }

    .timeline-item {
        padding-right: var(--spacing-lg);
    }

    .language-toggle {
        top: 16px;
        left: 16px;
        font-size: 11px;
        padding: 6px 16px;
    }

    table {
        font-size: 15px;
    }

    th,
    td {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .hero .meta-info {
        flex-direction: column;
        align-items: center;
    }

    .hero .meta-tag {
        width: 100%;
        text-align: center;
    }

    .stat-big {
        font-size: 48px;
    }

    .code-block,
    .code-snippet {
        font-size: 12px;
        padding: var(--spacing-md);
    }
}

/* Print Styles */
@media print {

    .language-toggle,
    .nav-sticky {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }

    .hero {
        min-height: auto;
        padding: var(--spacing-lg);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (already dark, but for completeness) */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--bg-color);
        color: var(--text-primary);
    }
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Smooth Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* RTL Fix: Keep language toggle on visual left */
/* Removed as it's now handled by the forced LTR top-nav-container */

/* =========================================
   CV Page Styles
   ========================================= */

.cv-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.cv-page h1 {
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(180deg, #ffffff 0%, #a8a8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cv-page .contact {
    font-size: 17px;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
    line-height: 1.7;
}

.cv-page .contact a {
    color: var(--accent-color);
}

.cv-page .contact a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.cv-page h2 {
    font-size: clamp(24px, 4vw, 32px);
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-xs);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-sm);
}

.cv-page ul {
    padding-left: var(--spacing-md);
    margin: var(--spacing-sm) 0;
    color: var(--text-secondary);
}

.cv-page li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
}

.cv-page .project-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 19px;
}

.cv-page .italic {
    font-style: italic;
    color: var(--text-tertiary);
}

.cv-page .strong {
    font-weight: 600;
    color: var(--text-primary);
}

.cv-page .summary {
    font-size: 17px;
    margin-bottom: var(--spacing-lg);
    text-align: justify;
    color: var(--text-secondary);
    line-height: 1.7;
}

.cv-page p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.cv-footer {
    margin-top: var(--spacing-xl);
    font-size: 15px;
    color: var(--text-tertiary);
    text-align: center;
}

/* Page Counter Styling */
.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    cursor: default;
}

.visitor-counter:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px) translateZ(0);
    -webkit-transform: translateY(-2px) translateZ(0);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

#hitCount {
    color: var(--accent-color);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.visitor-counter img {
    height: 20px;
    filter: saturate(0.8) brightness(1.2);
}

/* =========================================
   Voting System
   ========================================= */

.voting-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    padding: 20px;
    animation: fadeIn 1s ease 0.5s both;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 980px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.vote-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.4);
}

.vote-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.vote-btn:active svg {
    transform: scale(1.2);
}

.vote-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

.vote-count:empty,
.vote-count[data-count="0"] {
    display: none;
}

[dir="rtl"] .vote-btn {
    flex-direction: row-reverse;
}

html:not([dir="rtl"]) .quote {
    border-right: none;
    border-left: 4px solid var(--accent-color);
}

html:not([dir="rtl"]) .quote::before {
    right: auto;
    left: var(--spacing-md);
}

html:not([dir="rtl"]) .timeline::before {
    right: auto;
    left: var(--spacing-md);
}

html:not([dir="rtl"]) .timeline-item {
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.video-card {
    overflow: hidden;
    position: relative;
    z-index: 1;
    transform: translateZ(0);
}

.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.6;
    mix-blend-mode: overlay;
    pointer-events: none;
    border-radius: inherit;
    /* Force clipping in Safari */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
    z-index: -1;
    pointer-events: none;
}

html:not([dir="rtl"]) .card ul li {
    padding-right: 0;
    padding-left: 20px;
}

html:not([dir="rtl"]) .card ul li::before {
    right: auto;
    left: 0;
}

html:not([dir="rtl"]) th {
    text-align: left;
}