/* Base Reset & Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent: #00c8ff;
    --accent-secondary: #0080ff;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-bg: rgba(10, 10, 10, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #0a0a0a;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --header-bg: rgba(245, 245, 245, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .project-num {
    color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .preloader {
    background: var(--bg-primary);
}

body[data-theme="light"] .noise-overlay {
    opacity: 0.02;
}

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

html {
    /* Disable native smooth scroll - Lenis handles this */
    scroll-behavior: auto;
}

html.lenis, html.lenis body {
    height: auto;
}

body {
    font-family: 'Manrope', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: none;
}

[lang="ar"] body {
    font-family: 'Cairo', sans-serif;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

body:hover .cursor-dot,
body:hover .cursor-outline {
    opacity: 1;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, width 0.2s, height 0.2s;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader-text {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.5em;
    color: var(--text-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: transparent;
    transition: background var(--transition);
}

header.scrolled {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: var(--text-primary);
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color var(--transition);
}

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

.theme-controls {
    display: flex;
    gap: 1rem;
}

.theme-toggle,
.lang-toggle {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    cursor: none;
    transition: all var(--transition);
    font-family: inherit;
}

.theme-toggle:hover,
.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-content {
    z-index: 2;
}

.hero-tagline {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.hero-text-wrapper {
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.outline-text {
    -webkit-text-stroke: 1px var(--text-primary);
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    max-width: 400px;
}

.hero-sub p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Hero Visual - Canvas */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.canvas-date {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

#canvas {
    display: block;
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
}

.mode-indicator {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.5s ease;
    position: absolute;
    bottom: 12px;
    right: 15px;
    margin: 0;
    pointer-events: none;
}

.canvas-wrapper:hover .mode-indicator {
    opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-indicator .line {
    width: 60px;
    height: 1px;
    background: var(--accent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% { transform: scaleX(1); transform-origin: left; }
    50% { transform: scaleX(0.5); transform-origin: left; }
}

/* Section Base */
.section {
    padding: 8rem 0;
}

/* About / Philosophy Section */
.about-section {
    background: var(--bg-secondary);
}

.philosophy-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.section-header {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2rem;
}

.lead-text {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Pillars Grid */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
    text-align: left;
}

.pillar-item {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition);
}

.pillar-item:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.pillar-number {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 1rem;
}

.pillar-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.pillar-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.stats-wrapper {
    display: flex;
    gap: 4rem;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Horizontal Scroll Section */
.horizontal-section {
    overflow: hidden;
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.horizontal-scroll-wrapper {
    display: flex;
    flex-wrap: nowrap;
    width: fit-content;
    will-change: transform;
}

.h-panel {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2rem;
    box-sizing: border-box;
}

.intro-panel {
    background: var(--bg-primary);
}

.panel-content {
    text-align: center;
}

.giant-text {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.swipe-text {
    color: var(--text-secondary);
    margin-top: 2rem;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
}

.project-panel {
    background: var(--bg-secondary);
}

.project-card {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
}

.project-num {
    font-size: 6rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    margin-bottom: -3rem;
    position: relative;
    z-index: 1;
}

.project-visual {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.project-visual i {
    font-size: 4rem;
    color: var(--accent);
}

.project-details h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-details p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.btn-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.25rem;
    transition: all var(--transition);
}

.btn-link:hover {
    padding-bottom: 0.5rem;
}

/* Contact Section */
.contact-section {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-wrapper {
    padding: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.email-link {
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
    transition: all var(--transition);
}

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

/* Form Styles */
.minimal-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.input-group input:focus {
    border-color: var(--accent);
}

.input-group label {
    position: absolute;
    left: 0;
    top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
    transition: all var(--transition);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -0.75rem;
    font-size: 0.75rem;
    color: var(--accent);
}

.submit-btn {
    align-self: flex-start;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: none;
    transition: all var(--transition);
    font-family: inherit;
}

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

/* Footer */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.socials {
    display: flex;
    gap: 2rem;
}

.socials a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}

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

/* Reveal Animations */
.reveal-text {
    opacity: 0;
    transform: translateY(50px);
}

.reveal-text-delay {
    opacity: 0;
    transform: translateY(30px);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
    }

    .hero-sub {
        max-width: 100%;
        margin: 0 auto;
    }

    .pillars-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 4%;
    }

    .nav-links {
        display: none;
    }

    .hero {
        padding-top: 80px;
        min-height: auto;
        padding-bottom: 3rem;
    }

    .hero-container {
        gap: 2rem;
    }

    .hero-tagline {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-text-wrapper {
        margin-bottom: 1rem;
    }

    .hero-sub p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .section {
        padding: 4rem 0;
    }

    .section-header {
        margin-bottom: 1rem;
    }

    .lead-text {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .pillars-grid {
        gap: 1.5rem;
    }

    .pillar-item {
        padding: 1.5rem;
    }

    .stats-wrapper {
        gap: 2rem;
        margin-top: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .giant-text {
        font-size: 2rem;
    }

    .swipe-text {
        margin-top: 1rem;
        font-size: 0.8rem;
    }

    .h-panel {
        padding: 1rem;
    }

    .project-card {
        padding: 1rem;
    }

    .project-num {
        font-size: 3rem;
        margin-bottom: -1.5rem;
    }

    .project-visual {
        height: 200px;
        margin-bottom: 1.5rem;
    }

    .project-details h3 {
        font-size: 1.5rem;
    }

    .contact-grid {
        gap: 2rem;
    }

    .contact-text p {
        font-size: 1rem;
    }

    .email-link {
        font-size: 1.1rem;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    body {
        cursor: auto;
    }

    .theme-toggle,
    .lang-toggle,
    .submit-btn,
    .btn-link,
    .magnetic {
        cursor: pointer;
    }

    .scroll-indicator {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-tagline {
        font-size: 0.6rem;
        letter-spacing: 0.2em;
    }

    .lead-text {
        font-size: 1rem;
    }

    .pillar-item {
        padding: 1.25rem;
    }

    .pillar-item h3 {
        font-size: 1.1rem;
    }

    .pillar-item p {
        font-size: 0.85rem;
    }

    .giant-text {
        font-size: 1.6rem;
    }

    .project-visual {
        height: 150px;
    }

    .project-details h3 {
        font-size: 1.25rem;
    }

    .project-details p {
        font-size: 0.85rem;
    }

    header {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1rem;
    }

    .theme-toggle,
    .lang-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.65rem;
    }
}

/* RTL Support */
[dir="rtl"] .scroll-indicator {
    flex-direction: row-reverse;
}

[dir="rtl"] .swipe-text {
    direction: rtl;
}

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

[dir="rtl"] .hero-container {
    direction: rtl;
}

[dir="rtl"] .horizontal-section {
    direction: ltr;
}

[dir="rtl"] .horizontal-scroll-wrapper {
    direction: ltr;
    flex-direction: row-reverse;
}

[dir="rtl"] .panel-content {
    direction: rtl;
}

[dir="rtl"] .project-card,
[dir="rtl"] .project-details {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .pillars-grid {
    direction: rtl;
}

[dir="rtl"] .pillar-item {
    text-align: right;
}

[dir="rtl"] .project-card {
    text-align: right;
}

[dir="rtl"] .contact-grid {
    direction: rtl;
}

[dir="rtl"] .input-group label {
    left: auto;
    right: 0;
}

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

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