:root {
    /* Rich, warm color palette inspired by Islamic art - Dark Theme */
    --bg-primary: #0f0e0d;
    --bg-secondary: #1a1614;
    --bg-tertiary: #2a2420;

    --text-primary: #f5ebe0;
    --text-secondary: #d4c5b3;
    --text-tertiary: #a89984;

    --accent-gold: #d4af37;
    --accent-teal: #2a9d8f;
    --accent-copper: #c1666b;
    --accent-warm: #e9c46a;

    --glow-gold: rgba(212, 175, 55, 0.3);
    --glow-teal: rgba(42, 157, 143, 0.2);

    --nav-bg: rgba(15, 14, 13, 0.95);
    --pattern-opacity: 0.15;
}

/* Light Theme - Parchment/Manuscript style */
[data-theme="light"] {
    --bg-primary: #f5ebe0;
    --bg-secondary: #ebe0d0;
    --bg-tertiary: #ddd0be;

    --text-primary: #2c1810;
    --text-secondary: #4a3728;
    --text-tertiary: #6b5344;

    --accent-gold: #8b6914;
    --accent-teal: #1a6b62;
    --accent-copper: #8b3a3d;
    --accent-warm: #a67c00;

    --glow-gold: rgba(139, 105, 20, 0.2);
    --glow-teal: rgba(26, 107, 98, 0.15);

    --nav-bg: rgba(245, 235, 224, 0.95);
    --pattern-opacity: 0.08;
}

/* Sepia Theme - Old manuscript feel */
[data-theme="sepia"] {
    --bg-primary: #f4ecd8;
    --bg-secondary: #e8dcc4;
    --bg-tertiary: #d9ccb0;

    --text-primary: #3d2914;
    --text-secondary: #5c4a32;
    --text-tertiary: #7a6548;

    --accent-gold: #996515;
    --accent-teal: #2d7a6f;
    --accent-copper: #9e4a4d;
    --accent-warm: #b8860b;

    --glow-gold: rgba(153, 101, 21, 0.25);
    --glow-teal: rgba(45, 122, 111, 0.2);

    --nav-bg: rgba(244, 236, 216, 0.95);
    --pattern-opacity: 0.1;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background: linear-gradient(180deg, var(--nav-bg) 0%, transparent 100%);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--accent-gold);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent-gold);
    transform: rotate(15deg);
}

.theme-toggle:hover .theme-icon {
    color: var(--bg-primary);
}

.theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    color: var(--accent-gold);
    transition: all 0.3s ease;
}

.theme-icon.sun {
    opacity: 0;
}

.theme-icon.moon {
    opacity: 1;
}

[data-theme="light"] .theme-icon.sun,
[data-theme="sepia"] .theme-icon.sun {
    opacity: 1;
}

[data-theme="light"] .theme-icon.moon,
[data-theme="sepia"] .theme-icon.moon {
    opacity: 0;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Scheherazade New', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-logo:hover {
    text-shadow: 0 0 20px var(--glow-gold);
}

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

.nav-links a {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

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

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

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

/* Grain texture overlay - static */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    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='4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    /* animation removed for performance */
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* Pattern Background */
.pattern-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 1;
}

.pattern-path {
    animation: pulse-pattern 8s ease-in-out infinite;
}

@keyframes pulse-pattern {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.floating-ornament {
    position: absolute;
    font-size: 3rem;
    color: var(--accent-gold);
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.ornament-1 {
    top: 15%;
    right: 10%;
    animation-delay: 0s;
}

.ornament-2 {
    top: 60%;
    left: 15%;
    animation-delay: -7s;
}

.ornament-3 {
    bottom: 20%;
    right: 20%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1200px;
}

.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.arabic-large {
    font-family: 'Scheherazade New', serif;
    font-size: clamp(5rem, 15vw, 12rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-warm) 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.02em;
    line-height: 1;
    animation: shimmer 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px var(--glow-gold));
}

@keyframes shimmer {
    0%, 100% { filter: drop-shadow(0 0 30px var(--glow-gold)) brightness(1); }
    50% { filter: drop-shadow(0 0 50px var(--glow-gold)) brightness(1.2); }
}

.subtitle-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: lowercase;
}

.hero-subtitle {
    font-family: 'Amiri', serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.translation {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-style: italic;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--accent-gold), transparent);
    opacity: 0.5;
}

.scroll-line {
    width: 100%;
    height: 20px;
    background: var(--accent-gold);
    animation: scroll-move 2s ease-in-out infinite;
}

@keyframes scroll-move {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(40px); }
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.arabic-heading {
    font-family: 'Scheherazade New', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-weight: 600;
}

.heading-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--text-tertiary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 300;
}

.section-hint {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.7;
}

/* Calligraphy Section */
.calligraphy-section {
    position: relative;
    padding: 8rem 2rem;
    z-index: 2;
}

.calligraphy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.calli-card {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.calli-card:hover {
    transform: scale(1.05) rotate(1deg);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
}

.calli-card:hover .card-glow {
    opacity: 1;
}

.calli-card.playing {
    border-color: var(--accent-teal);
    box-shadow: 0 0 40px var(--glow-teal);
}

.calli-card.playing .sound-wave {
    opacity: 1;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--glow-gold) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.calli-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.arabic-showcase {
    font-family: 'Scheherazade New', serif;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.calli-card:hover .arabic-showcase {
    transform: scale(1.1);
    text-shadow: 0 0 30px var(--glow-gold);
}

.meaning {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: var(--text-tertiary);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    font-style: italic;
}

.transliteration {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    opacity: 0.6;
    margin-top: 0.25rem;
}

/* Sound Wave Animation */
.sound-wave {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sound-wave span {
    width: 3px;
    height: 20px;
    background: var(--accent-teal);
    border-radius: 2px;
    animation: wave 0.5s ease-in-out infinite;
}

.sound-wave span:nth-child(1) { animation-delay: 0s; }
.sound-wave span:nth-child(2) { animation-delay: 0.1s; }
.sound-wave span:nth-child(3) { animation-delay: 0.2s; }
.sound-wave span:nth-child(4) { animation-delay: 0.1s; }
.sound-wave span:nth-child(5) { animation-delay: 0s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Proverbs Section */
.proverbs-section {
    position: relative;
    padding: 8rem 2rem;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 20%, var(--bg-secondary) 80%, transparent 100%);
}

.proverbs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.proverb-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    padding: 2.5rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.proverb-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'Scheherazade New', serif;
    font-size: 5rem;
    color: var(--accent-gold);
    opacity: 0.1;
    line-height: 1;
}

.proverb-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(212, 175, 55, 0.2);
}

.proverb-arabic {
    font-family: 'Scheherazade New', serif;
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.proverb-translation {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.proverb-meaning {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-tertiary);
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

@media (max-width: 768px) {
    .proverbs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .proverb-card {
        padding: 1.5rem;
    }

    .proverb-arabic {
        font-size: 1.4rem;
    }
}

/* Poetry Section */
.poetry-section {
    position: relative;
    padding: 8rem 2rem;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 20%, var(--bg-secondary) 80%, transparent 100%);
}

.poetry-explorer {
    max-width: 1200px;
    margin: 0 auto;
}

.poet-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.poet-btn {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.poet-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.poet-btn.active {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

.poems-container {
    position: relative;
    min-height: 500px;
}

.poem-display {
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.poem-display.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.poetry-card {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 4rem;
    border-radius: 2px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poetry-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(212, 175, 55, 0.2);
}

.geometric-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-gold);
}

.corner-tl {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.corner-br {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.poet-portrait {
    text-align: center;
    margin-bottom: 2rem;
}

.portrait-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    font-family: 'Scheherazade New', serif;
    font-size: 2.5rem;
    color: var(--accent-gold);
    background: var(--bg-secondary);
}

.poem {
    text-align: center;
    border: none;
    margin-bottom: 3rem;
}

.verse {
    font-family: 'Amiri', serif;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.verse-divider {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin: 1.5rem 0;
    opacity: 0.5;
}

.poem-author {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-top: 2rem;
    font-style: normal;
}

.poem-translation {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.poem-translation p {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-style: italic;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.poem-translation footer {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--accent-warm);
    margin-top: 1.5rem;
}

/* Heritage Section */
.heritage-section {
    position: relative;
    padding: 8rem 2rem;
    z-index: 2;
}

/* Script Gallery */
.script-gallery {
    max-width: 1400px;
    margin: 0 auto 6rem;
    text-align: center;
}

.gallery-title {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gallery-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 3rem;
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.script-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.15);
    padding: 2.5rem 2rem;
    border-radius: 4px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.script-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(212, 175, 55, 0.2);
}

.script-sample {
    font-family: 'Scheherazade New', serif;
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.script-card:hover .script-sample {
    transform: scale(1.1);
    text-shadow: 0 0 20px var(--glow-gold);
}

.thuluth-style {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.diwani-style {
    font-style: italic;
    transform: skewX(-5deg);
}

.kufi-style {
    font-family: 'Noto Naskh Arabic', serif;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.script-name {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.script-name-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--accent-warm);
    font-style: italic;
    margin-bottom: 1rem;
}

.script-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* Timeline */
.heritage-timeline {
    max-width: 900px;
    margin: 0 auto 6rem;
    text-align: center;
}

.timeline-title {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 4rem;
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-gold), transparent);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
    text-align: right;
}

.timeline-item:nth-child(even) {
    text-align: left;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--accent-gold);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 20px var(--glow-gold);
}

.timeline-content {
    width: 45%;
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
    border-color: var(--accent-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.timeline-year {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: var(--accent-gold);
    letter-spacing: 0.1em;
}

.timeline-content h4 {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.timeline-content p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.feature-title-ar {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-title-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.feature-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 350px;
    margin: 0 auto;
}

/* Dialects Section */
.dialects-section {
    position: relative;
    padding: 8rem 2rem;
    z-index: 2;
}

.dialects-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

.map-container {
    position: sticky;
    top: 120px;
}

.dialect-map {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.dialect-map .region {
    fill: var(--bg-tertiary);
    stroke: var(--accent-gold);
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dialect-map .region:hover {
    fill: var(--accent-gold);
    filter: drop-shadow(0 0 15px var(--glow-gold));
}

.dialect-map .region.active {
    fill: var(--accent-gold);
    filter: drop-shadow(0 0 20px var(--glow-gold));
}

.dialect-map .region-label {
    font-family: 'Amiri', serif;
    font-size: 14px;
    fill: var(--text-primary);
    text-anchor: middle;
    pointer-events: none;
    transition: fill 0.3s ease;
}

.dialect-map .region:hover + .region-label,
.dialect-map .region.active + .region-label {
    fill: var(--bg-primary);
}

.dialect-info {
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 2.5rem;
    min-height: 400px;
}

.dialect-default {
    text-align: center;
    padding: 3rem;
}

.dialect-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.dialect-default h3 {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dialect-default p {
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-tertiary);
    font-style: italic;
}

.dialect-content {
    display: none;
}

.dialect-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dialect-name {
    font-family: 'Scheherazade New', serif;
    font-size: 2.2rem;
    color: var(--accent-gold);
    margin-bottom: 0.25rem;
}

.dialect-name-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.dialect-countries {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.dialect-speakers {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--accent-teal);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.dialect-features {
    margin-bottom: 1.5rem;
}

.dialect-features h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

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

.dialect-features li {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
    padding-right: 1.5rem;
    position: relative;
}

.dialect-features li::before {
    content: '◆';
    position: absolute;
    right: 0;
    color: var(--accent-gold);
    font-size: 0.6rem;
}

.dialect-examples {
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: 1.5rem;
}

.example-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-item:hover {
    background: var(--accent-gold);
}

.example-item:hover .example-arabic,
.example-item:hover .example-meaning {
    color: var(--bg-primary);
}

.example-arabic {
    font-family: 'Scheherazade New', serif;
    font-size: 1.5rem;
    color: var(--accent-gold);
    transition: color 0.3s ease;
}

.example-meaning {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    color: var(--text-tertiary);
    text-align: left;
    transition: color 0.3s ease;
}

.dialect-note {
    max-width: 800px;
    margin: 4rem auto 0;
    text-align: center;
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    border: 1px solid rgba(42, 157, 143, 0.3);
    border-radius: 8px;
}

.dialect-note p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 900px) {
    .dialects-container {
        grid-template-columns: 1fr;
    }

    .map-container {
        position: relative;
        top: 0;
    }

    .dialect-info {
        min-height: auto;
    }
}

/* Alphabet Section */
.alphabet-section {
    position: relative;
    padding: 8rem 2rem;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 20%, var(--bg-secondary) 80%, transparent 100%);
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.letter-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-card:hover {
    border-color: var(--accent-gold);
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    z-index: 10;
}

.letter-card:active {
    transform: scale(0.95);
}

.letter-arabic {
    font-family: 'Scheherazade New', serif;
    font-size: 2.5rem;
    color: var(--accent-gold);
    transition: all 0.3s ease;
}

.letter-card:hover .letter-arabic {
    transform: scale(1.2);
    text-shadow: 0 0 20px var(--glow-gold);
}

.letter-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Letter Modal */
.letter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.letter-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.letter-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--text-tertiary);
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.modal-letter-display {
    font-family: 'Scheherazade New', serif;
    font-size: 8rem;
    color: var(--accent-gold);
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px var(--glow-gold);
}

.modal-letter-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.letter-forms {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.form-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.form-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.form-arabic {
    font-family: 'Scheherazade New', serif;
    font-size: 2rem;
    color: var(--accent-warm);
}

.play-sound-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent-gold);
    border: none;
    color: var(--bg-primary);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.play-sound-btn:hover {
    background: var(--accent-warm);
    transform: scale(1.05);
}

.sound-icon {
    font-size: 1.3rem;
}

/* Quote Section */
.quote-section {
    position: relative;
    padding: 10rem 2rem;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, rgba(42, 157, 143, 0.05) 50%, transparent 100%);
}

.quote-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: 4rem;
}

.quote-mark {
    font-family: 'Cormorant Garamond', serif;
    font-size: 10rem;
    color: var(--accent-gold);
    opacity: 0.2;
    line-height: 0;
    margin-bottom: 2rem;
}

.large-quote {
    border: none;
}

.quote-ar {
    font-family: 'Amiri', serif;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-weight: 400;
}

.quote-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--text-tertiary);
    font-style: italic;
    line-height: 1.8;
}

/* Footer */
.footer {
    position: relative;
    padding: 6rem 2rem 4rem;
    z-index: 2;
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 100%);
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-text-ar {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.footer-text-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-tertiary);
    font-style: italic;
    letter-spacing: 0.15em;
}

.footer-ornament {
    opacity: 0.5;
}

/* Reveal Animations */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Cursor */
.custom-cursor {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.15s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.active {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.5);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .poetry-card {
        padding: 2rem;
    }

    .calligraphy-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .calli-card {
        aspect-ratio: 1;
    }

    .arabic-showcase {
        font-size: 2.5rem;
    }

    .scripts-grid {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd) {
        flex-direction: column;
        text-align: center;
    }

    .timeline-content {
        width: 100%;
        margin-left: 50px;
    }

    .timeline-marker {
        left: 20px;
    }

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

    .alphabet-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .letter-card {
        padding: 0.5rem;
    }

    .letter-arabic {
        font-size: 1.8rem;
    }

    .letter-forms {
        grid-template-columns: repeat(2, 1fr);
    }

    .quote-container {
        padding: 2rem;
    }

    .poet-selector {
        gap: 0.5rem;
    }

    .poet-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-warm);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
