/* style.css - Fixed Header & Mobile Layout + Premium Animations */

/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== CSS Variables for Consistency ===== */
:root {
    --bg-primary: #000000;
    --bg-secondary: #050505;
    --bg-tertiary: #0a0a0a;
    --bg-card: #0f0f0f;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #888888;
    --text-dim: #666666;
    --accent-gold: #FFD500;
    --accent-gold-hover: #ffed4e;
    --accent-purple: #800080;
    --accent-purple-light: #a855f7;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-gold: rgba(255, 213, 0, 0.2);
    --border-gold-hover: rgba(255, 213, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 4px 20px rgba(255, 213, 0, 0.1);
    --shadow-gold-lg: 0 12px 40px rgba(255, 213, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden; /* prevent horizontal scroll on entire page */
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative; /* for any absolute children */
   -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}
/* ===== Selection Style ===== */
::selection {
    background: rgba(255, 213, 0, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(255, 213, 0, 0.3);
    color: var(--text-primary);
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 3px;
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* ===== Focus Styles for Accessibility ===== */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ===== Starfield Background ===== */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 1.5px;
    height: 1.5px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: starTwinkle 4s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ===== Header Navigation (fixed) ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-base), border-color var(--transition-base);
    overflow: visible; /* allow dropdown to show */
}

.header.scrolled {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid var(--border-default);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* prevent wrapping that could push hamburger off screen */
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0; /* prevent logo from shrinking */
}

.logo:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.logo-icon {
    width: 30px;
    height: 30px;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    overflow: hidden; /* prevent overflow if items too many */
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color var(--transition-base);
    position: relative;
    padding: 0.3rem 0;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent-gold);
    transition: width var(--transition-base);
    border-radius: 1px;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Language Switcher Button */
.lang-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.03em;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

/* Hide mobile language button on desktop, and desktop language button on mobile */
@media (min-width: 769px) {
    .mobile-lang {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-desktop .lang-btn {
        display: none; /* hide the lang button inside desktop nav on mobile */
    }
    .mobile-lang {
        display: block;
        margin-right: 0; /* right margin removed; will be handled in RTL separately */
    }
}

/* Notification System */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    transition: color var(--transition-base), transform var(--transition-fast);
    border-radius: 50%;
}

.notification-btn:hover {
    color: var(--accent-gold);
    transform: scale(1.1);
    animation: bellRing 0.4s ease;
}

/* Bell ring animation (triggered on hover as a playful effect) */
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-10deg); }
}

.notification-dropdown {
    position: absolute;
    top: 140%;
    right: -10px;
    width: 320px;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.notification-dropdown.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.notification-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-weight: 700;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
}

.notification-item {
    margin-bottom: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}

.notification-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notification-date {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
}

.notification-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Hamburger ===== */
.hamburger {
    display: none; /* hidden by default, shown on mobile */
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    flex-shrink: 0;
    margin-left: auto; /* push to the right only when visible, but we'll use flex in mobile-lang combo */
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.05);
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
    position: fixed;
    top: 68px; /* height of header */
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 2rem;
    transform: translateY(-120%);
    transition: transform var(--transition-slow) cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    border-bottom: 1px solid var(--border-subtle);
    max-width: 100vw;
    box-sizing: border-box;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-base), padding-left var(--transition-base);
    white-space: nowrap;
}

.mobile-link:hover {
    color: var(--accent-gold);
    padding-left: 8px;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 213, 0, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-brand {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: 0.8rem;
    /* Subtle fade-in on load */
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

/* ===== Typing Effect for Hero Title ===== */
.hero-title {
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: 0.25em;
    color: var(--accent-gold);
    line-height: 1;
    margin-bottom: 0.5rem;
    /* Typing animation setup */
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-gold); /* cursor */
    width: 0;
    animation: typing 3s steps(30, end) 0.5s forwards, blink-caret 0.75s step-end infinite;
    max-width: 100%; /* ensure it doesn't overflow */
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; } /* reveals full text width of parent */
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-gold); }
}

.hero-subtitle {
    margin-top: 1.2rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.03em;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1.5s forwards;
}

.hero-description {
    margin-top: 1.2rem;
    max-width: 480px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 0.8s ease 2s forwards;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2.5rem;
    padding: 0.9rem 2rem;
    border: 1.5px solid var(--accent-gold);
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.8s ease 2.5s forwards, pulseGlow 2s ease-in-out 3.5s infinite;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-gold);
    transition: left var(--transition-base);
    z-index: -1;
}

.cta-button:hover {
    color: var(--bg-primary);
}

.cta-button:hover::before {
    left: 0;
}

/* Pulsing glow for CTA */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 0, 0.3); }
    50% { box-shadow: 0 0 20px 5px rgba(255, 213, 0, 0.4); }
}

/* Fade-in-up animation used for hero elements */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-illustration {
    flex-shrink: 0;
}

.character-svg {
    width: 380px;
    filter: drop-shadow(0 0 30px rgba(255, 213, 0, 0.1));
    transition: filter var(--transition-slow);
    animation: float 6s ease-in-out infinite;
}

.character-svg:hover {
    filter: drop-shadow(0 0 50px rgba(255, 213, 0, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== Sections ===== */
.section {
    padding: 140px 2rem;
    position: relative;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 1.2rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-purple-light);
    border-radius: 1px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

.section-content p {
    margin-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.9;
}

.section-content strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.section-content em {
    color: var(--text-primary);
    font-style: italic;
}

/* ===== Feature Grids ===== */
.reason-grid,
.feature-grid,
.research-areas,
.vision-grid,
.features-grid-extended {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.reason-card,
.feature-item,
.research-area,
.vision-item {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Card top gradient line on hover */
.reason-card::before,
.feature-item::before,
.research-area::before,
.vision-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* Shimmer effect on hover */
.reason-card::after,
.feature-item::after,
.research-area::after,
.vision-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.08), transparent);
    transition: left 0.6s ease;
    transform: skewX(-20deg);
}

.reason-card:hover,
.feature-item:hover,
.research-area:hover,
.vision-item:hover {
    border-color: var(--border-gold-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold-lg);
}

.reason-card:hover::before,
.feature-item:hover::before,
.research-area:hover::before,
.vision-item:hover::before {
    opacity: 1;
}

.reason-card:hover::after,
.feature-item:hover::after,
.research-area:hover::after,
.vision-item:hover::after {
    left: 150%;
}

.reason-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-purple-light);
    margin-bottom: 0.8rem;
    letter-spacing: 0.05em;
}

.reason-card h3,
.feature-item h3,
.research-area h3,
.vision-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.reason-card p,
.feature-item p,
.research-area p,
.vision-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent-gold);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
    transition: transform 0.3s ease, border-color 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: #FFD500;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #ccc;
}

/* ===== Code Playground ===== */
.code-playground {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.playground-container {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.playground-container:focus-within {
    border-color: var(--border-gold);
    box-shadow: 0 0 30px rgba(255, 213, 0, 0.1);
}

.code-editor {
    background: #111111;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #0a0a0a;
    border-bottom: 1px solid var(--border-subtle);
}

.editor-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-card);
    color: var(--accent-gold);
    transform: rotate(5deg);
}

.code-textarea {
    width: 100%;
    min-height: 400px;
    padding: 24px;
    background: #111111;
    color: var(--text-secondary);
    border: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    tab-size: 4;
}

.code-textarea:focus {
    background: #141414;
}

.code-textarea::selection {
    background: rgba(255, 213, 0, 0.2);
}

.playground-controls {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: #0a0a0a;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.03em;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 213, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 10px 24px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 213, 0, 0.05);
}

.output-panel {
    background: #0a0a0a;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #0d0d0d;
    border-bottom: 1px solid var(--border-subtle);
}

.output-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.output-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.output-status.running {
    background: rgba(255, 213, 0, 0.15);
    color: var(--accent-gold);
}

.output-status.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.output-content {
    padding: 24px;
    min-height: 150px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== Feature Card Extended ===== */
.feature-card-extended {
    background: linear-gradient(145deg, #0a0a0a 0%, #141414 100%);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.feature-card-extended::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, transparent, var(--accent-gold), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card-extended:hover {
    border-color: var(--accent-gold);
    transform: translateY(-8px);
    box-shadow: var(--shadow-gold-lg);
}

.feature-card-extended:hover::after {
    opacity: 1;
}

.feature-icon-large {
    font-size: 3rem;
    margin-bottom: 1.2rem;
    transition: transform var(--transition-base);
}

.feature-card-extended:hover .feature-icon-large {
    transform: scale(1.1);
}

.feature-card-extended h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.feature-card-extended p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.feature-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-item {
    padding: 6px 14px;
    background: rgba(255, 213, 0, 0.08);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.stat-item:hover {
    background: rgba(255, 213, 0, 0.15);
    transform: scale(1.05);
}

/* ===== Syntax Showcase ===== */
.syntax-showcase {
    padding: 120px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.syntax-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.syntax-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
}

.syntax-card:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-gold);
    transform: translateY(-3px);
}

.syntax-card h4 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.syntax-card pre {
    background: #0d0d0d;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
}

.syntax-card code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== Code Block (general) ===== */
.code-block {
    background: var(--bg-tertiary);
    padding: 1.2rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 2rem 0;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-gold);
    line-height: 1.8;
}

/* ===== Community Section ===== */
.community-section {
    padding: 120px 0;
    background: var(--bg-primary);
}

.community-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.community-text h2 {
    font-size: 2.4rem;
    color: var(--accent-gold);
    margin-bottom: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.community-text p {
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.community-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-box {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.stat-box:hover {
    border-color: var(--border-gold);
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.community-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.community-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.community-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.05), transparent);
    transition: left 0.6s ease;
}

.community-link:hover {
    border-color: var(--accent-gold);
    transform: translateX(6px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-gold);
}

.community-link:hover::after {
    left: 100%;
}

.link-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.link-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===== Timeline ===== */
.timeline {
    margin-top: 2rem;
    position: relative;
    padding-left: 2rem;
    border-left: 1px solid var(--border-default);
}

.timeline-item {
    margin-bottom: 2.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.45rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    transition: transform var(--transition-fast);
}

.timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 12px var(--accent-gold);
}

.timeline-date {
    color: var(--accent-purple-light);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ===== Writings List ===== */
.writings-list {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.writing-item {
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    transition: all var(--transition-base);
    display: block;
    position: relative;
    overflow: hidden;
}

.writing-item:hover {
    border-color: var(--accent-gold);
    transform: translateX(4px);
    box-shadow: var(--shadow-gold);
    background: var(--bg-card-hover);
}

.writing-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.05), transparent);
    transition: left 0.5s ease;
}

.writing-item:hover::after {
    left: 100%;
}

.writing-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    letter-spacing: 0.03em;
}

.writing-category {
    color: var(--accent-purple-light);
    font-weight: 600;
}

.writing-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.writing-item p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.writing-item code {
    font-family: var(--font-mono);
    background: rgba(255, 213, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.82rem;
    color: var(--accent-gold);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    padding: 5rem 2rem 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    color: var(--accent-gold);
    margin-bottom: 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.8;
}

.footer-section a {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    font-size: 0.88rem;
    transition: color var(--transition-base), transform var(--transition-fast);
}

.footer-section a:hover {
    color: var(--accent-gold);
    transform: translateX(5px);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Scroll Animation ===== */
.animate-on-scroll {
    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);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.reason-grid.animate-on-scroll.visible .reason-card:nth-child(1) { transition-delay: 0.05s; }
.reason-grid.animate-on-scroll.visible .reason-card:nth-child(2) { transition-delay: 0.1s; }
.reason-grid.animate-on-scroll.visible .reason-card:nth-child(3) { transition-delay: 0.15s; }
.reason-grid.animate-on-scroll.visible .reason-card:nth-child(4) { transition-delay: 0.2s; }

/* ===== Smooth gradient divider ===== */
.section:not(.section-alt) + .section-alt,
.section-alt + .section:not(.section-alt) {
    border-top: 1px solid var(--border-subtle);
}

/* ===== RTL Support ===== */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .nav-desktop {
    flex-direction: row-reverse; /* reverse link order visually */
}

[dir="rtl"] .header-container {
    flex-direction: row-reverse; /* logo and hamburger/menu swap sides */
}

[dir="rtl"] .hamburger {
    margin-left: 0;
    margin-right: auto; /* hamburger on the left in RTL? Actually we want it on the right side. We'll adjust with order. */
}

/* Better RTL: set order for children */
[dir="rtl"] .logo {
    order: 0;
}

[dir="rtl"] .nav-desktop {
    order: 1;
}

[dir="rtl"] .hamburger,
[dir="rtl"] .mobile-lang {
    order: 2;
}

[dir="rtl"] .notification-wrapper {
    order: 3;
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 2rem;
    border-left: none;
    border-right: 1px solid var(--border-default);
}

[dir="rtl"] .timeline-item::before {
    left: auto;
    right: -2.45rem;
}

[dir="rtl"] .writing-item:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .community-link:hover {
    transform: translateX(-6px);
}

[dir="rtl"] .mobile-link:hover {
    padding-left: 0;
    padding-right: 8px;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .character-svg {
        width: 300px;
    }

    .community-content {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

@media (max-width: 768px) {
    .nav-desktop {
        display: none; /* hide desktop nav on mobile */
    }

    .hamburger {
        display: flex; /* show hamburger */
    }

    /* Layout for header on mobile: logo left, lang button + hamburger right */
    .header-container {
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .logo {
        flex-shrink: 0;
    }

    /* Group the lang button and hamburger together on the right */
    .mobile-lang {
        display: inline-block;
        order: 2;
        margin-left: auto; /* push to the right */
    }

    .hamburger {
        order: 3;
        margin-left: 0; /* already in the right group */
    }

    .notification-wrapper {
        display: none; /* optional: hide notification on mobile for simplicity */
    }

    .hero-brand {
        font-size: 1.2rem;
    }

    .section {
        padding: 100px 1.5rem;
    }

    .reason-grid,
    .feature-grid,
    .research-areas,
    .vision-grid,
    .features-grid-extended,
    .syntax-examples {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .community-stats {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .playground-controls {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Ensure mobile menu width not overflow */
    .mobile-menu {
        width: 100%;
        left: 0;
        right: 0;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero {
        padding: 0 1rem;
    }

    .section {
        padding: 70px 1rem;
    }

    .character-svg {
        width: 240px;
    }

    .notification-dropdown {
        width: 280px;
        right: -50px;
    }

    .header-container {
        padding: 0.8rem 1rem;
    }
}
