:root {
    /* Light Theme */
    --bg-color: #f2f2f7;
    --text-color: #1a1a1a;
    --nav-bg: rgba(242, 242, 247, 0.7);
    --border: rgba(0, 0, 0, 0.1);
    --cursor-color: #1a1a1a;
    --accent: #d4af37;
}

[data-theme="dark"] {
    --bg-color: #050505;
    --text-color: #ffffff;
    --nav-bg: rgba(5, 5, 5, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --cursor-color: #ffffff;
    --accent: #d4af37;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Cairo', sans-serif;
    overflow: hidden;
    cursor: default;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Cursor Elements completely disabled */
.cursor-dot, .cursor-outline {
    display: none !important;
}

a, button, .control-btn, .back-link, .brand-area {
    cursor: pointer;
}

/* Navbar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-nav.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
    z-index: 2;
}

.brand-svg {
    height: 20px;
    transition: filter 0.3s;
}

[data-theme="dark"] .brand-svg {
    filter: invert(1);
}

[data-theme="light"] .brand-svg {
    filter: invert(0);
}

.back-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

.back-link:hover {
    opacity: 0.6;
}

[dir="rtl"] .back-link i {
    transform: rotate(180deg);
}

/* Canvas Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    touch-action: none;
    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

/* Golden Architectural Blueprint Grid in Background (Luminous & Distinct) */
.grid-lines-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(217, 195, 140, 0.60) 1.5px, transparent 0),
        linear-gradient(to right, rgba(217, 195, 140, 0.20) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(217, 195, 140, 0.20) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: 0;
    opacity: 0.65;
    transition: opacity 0.3s ease;
}

[data-theme="light"] .grid-lines-overlay {
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(176, 141, 85, 0.65) 1.5px, transparent 0),
        linear-gradient(to right, rgba(176, 141, 85, 0.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(176, 141, 85, 0.22) 1px, transparent 1px);
    opacity: 0.60;
}

/* Floating Controls */
.controls-wrapper {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

[dir="rtl"] .controls-wrapper {
    right: auto;
    left: 32px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.control-btn:hover {
    transform: scale(1.05);
    background: var(--bg-color);
}

.light-icon { display: none; }
.dark-icon { display: block; }

[data-theme="dark"] .light-icon { display: block; }
[data-theme="dark"] .dark-icon { display: none; }

/* Navbar Index Button */
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    white-space: nowrap;
    z-index: 2;
}

.nav-index-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.25s ease;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

.nav-index-btn:hover {
    opacity: 0.65;
}

.index-btn-badge {
    color: var(--accent);
    font-weight: 800;
    font-size: 12px;
}

/* Real-time 3-Axes Live Coordinates (Command-Line Terminal Typography - Always LTR) */
.hud-axes-strip {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    pointer-events: none;
    user-select: none;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    white-space: nowrap;
    direction: ltr !important;
    unicode-bidi: isolate;
}

.axis-node {
    display: flex;
    align-items: center;
    gap: 4px;
    direction: ltr !important;
    unicode-bidi: isolate;
}

.axis-name {
    font-family: 'Share Tech Mono', monospace;
    color: #cbd5e1;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    opacity: 0.85;
    direction: ltr !important;
    unicode-bidi: isolate;
}

[data-theme="light"] .axis-name {
    color: #64748b;
}

.axis-number {
    font-family: 'Share Tech Mono', monospace;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.8px;
    font-variant-numeric: tabular-nums;
    direction: ltr !important;
    unicode-bidi: isolate;
}

[data-theme="light"] .axis-number {
    color: #0f172a;
}

.axis-pipe {
    color: rgba(203, 213, 225, 0.35);
    font-size: 12px;
    font-weight: 300;
    direction: ltr !important;
    unicode-bidi: isolate;
}

[data-theme="light"] .axis-pipe {
    color: rgba(100, 116, 139, 0.35);
}


/* Full-Screen Gaussian Blur Project Index Modal */
.project-index-fullscreen {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.78);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    display: none;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.35s;
    justify-content: center;
    align-items: center;
}

[data-theme="light"] .project-index-fullscreen {
    background: rgba(245, 245, 248, 0.82);
}

.project-index-fullscreen.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.index-fullscreen-container {
    width: 100%;
    height: 100%;
    max-width: 1440px;
    display: flex;
    flex-direction: column;
    padding: 32px 40px 40px;
    box-sizing: border-box;
}

.index-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.index-header-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.index-header-overline {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
}

.index-header-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-color);
}

.index-header-count {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.index-close-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(217, 195, 140, 0.1);
    border: 1px solid rgba(217, 195, 140, 0.3);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.index-close-btn:hover {
    background: var(--accent);
    color: #050505;
    transform: rotate(90deg) scale(1.08);
}

.index-cards-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 28px 4px 20px;
    box-sizing: border-box;
}

.index-cards-scroll-container::-webkit-scrollbar {
    width: 5px;
}

.index-cards-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(217, 195, 140, 0.35);
    border-radius: 3px;
}

/* Responsive Grid of Uniform Cards */
.index-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    width: 100%;
}

/* The Uniform Project Card */
.index-grid-card {
    display: flex;
    flex-direction: column;
    background: rgba(14, 14, 18, 0.72);
    border: 1px solid rgba(217, 195, 140, 0.22);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.35s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    position: relative;
}

[data-theme="light"] .index-grid-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(176, 141, 85, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.index-grid-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* Uniform Image Wrap */
.index-card-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    background: #000000;
}

.index-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.index-grid-card:hover .index-card-image-wrap img {
    transform: scale(1.08);
}

.index-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(217, 195, 140, 0.4);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
}

[dir="rtl"] .index-card-badge {
    right: auto;
    left: 10px;
}

/* Card Content */
.index-card-info {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.index-card-category {
    font-size: 10.5px;
    letter-spacing: 1.5px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.9;
}

.index-card-title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-color);
    margin: 2px 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.index-card-action {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.85;
    transition: opacity 0.25s, transform 0.25s;
}

[data-theme="light"] .index-card-action {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.index-grid-card:hover .index-card-action {
    opacity: 1;
}

.index-grid-card:hover .index-card-action i {
    transform: translateX(4px);
}

[dir="rtl"] .index-grid-card:hover .index-card-action i {
    transform: translateX(-4px);
}

/* Responsive Media Queries */
@media (max-width: 1100px) {
    .index-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (max-width: 992px) {
    /* Hide coordinates completely on tablets and mobile phones to prevent overlap with navbar controls */
    .hud-axes-strip {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .index-fullscreen-container {
        padding: 24px 20px 24px;
    }
    .index-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .index-header-title {
        font-size: 18px;
    }
    .index-card-title {
        font-size: 12.5px;
    }
    .index-card-btn-text {
        display: none;
    }
}

@media (max-width: 600px) {
    .top-nav {
        padding: 0 16px;
    }
    .nav-links {
        gap: 16px;
    }
    .nav-index-btn {
        font-size: 13px;
        gap: 6px;
    }
}

@media (max-width: 440px) {
    .index-fullscreen-container {
        padding: 16px 12px 16px;
    }
    .index-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .index-card-info {
        padding: 10px 12px;
    }
}

