@font-face {
    font-family: 'Daken';
    src: url('../../fonts/Daken-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #000000;
    --primary-color: #f1c40f;
    /* Gold/Yellow */
    --accent-color: #d4ac0d;
    --text-spacing: 0.1em;
    --text-color: #ffffff;
    /* For regular text */
    --text-muted: #cccccc;
    /* For history text */
    --bg-overlay: rgba(0, 0, 0, 0.94);
    --bg-alt: #050505;
    --grid-border: #333333;
    --input-bg: #111111;
    --sidebar-grad: rgba(0, 0, 0, 0.95);
    --nav-bg: rgba(10, 10, 10, 0.4);
    --nav-link: #ffffff;
    --footer-text: #000000;
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        linear-gradient(var(--bg-overlay), var(--bg-overlay)),
        url('https://syrian.zone/syid/materials/pattern.svg');
    background-repeat: repeat;
    background-size: 400px;
    background-attachment: fixed;
    color: var(--primary-color);
    font-family: 'Daken', serif;
    direction: rtl;
    line-height: 1.4;
    /* transition: background-color 0.5s ease; Removed to not conflict with circle */
}

/* Theme Transition Circle */
.theme-circle {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: transparent;
    z-index: 999;
    pointer-events: none;
    clip-path: circle(0px at center);
}

.theme-circle.expanding {
    transition: clip-path 0.8s ease-out;
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(241, 196, 15, 0.2);
    /* We might keep this or use primary */
    border-radius: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;
}

.nav-logo {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.glass-nav a {
    color: var(--nav-link);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

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

/* Container */
.main-wrapper {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

/* Sections */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
    position: relative;
}

/* Hero Section */
.hero {
    height: 150vh;
}

@media (max-width: 768px) {
    .hero {
        height: 100vh;
        /* Reduced height on mobile */
    }

    .hero-sticky {
        height: 100vh;
        align-items: flex-start;
        /* Move letter up */
        padding-top: 15vh;
    }
}

.hero-zoom-outer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-zoom-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s linear;
}

.hero-letter {
    font-size: min(40vw, 400px);
    line-height: 1;
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.8;
}

/* Poem Section */
.poem-section {
    height: 200vh;
    /* Long scroll for widening effect */
    background-color: var(--bg-alt);
    /* transition: background-color 0.5s ease; */
}

@media (max-width: 768px) {
    .poem-section {
        height: 120vh;
        /* Reduced height on mobile */
    }
}

.poem-container {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 1000px;
}

.poem-line {
    font-size: clamp(1.5rem, 6vw, 4.5rem);
    margin-bottom: 20px;
    white-space: nowrap;
    transition: letter-spacing 0.1s linear, transform 0.1s linear;
    letter-spacing: var(--text-spacing);
    padding: 0 10px;
}

.tashkeel {
    color: var(--accent-color);
    opacity: 0.8;
}

/* History Content */
.history-content {
    background-image:
        linear-gradient(var(--bg-overlay), var(--bg-overlay)),
        url('https://syrian.zone/syid/materials/pattern.svg');
    background-repeat: repeat;
    background-size: 400px;
    background-attachment: fixed;
    position: relative;
    border-top: 1px solid rgba(241, 196, 15, 0.1);
    border-bottom: 1px solid rgba(241, 196, 15, 0.1);
}

.history-text {
    max-width: 900px;
    font-size: 1.4rem;
    line-height: 1.8;
    text-align: justify;
    margin: 0 auto;
    color: var(--text-muted);
    /* Slightly dimmed for "Regular" look */
}

.history-text p {
    margin-bottom: 30px;
}

/* Artistic Beauty Section */
.art-beauty {
    overflow: hidden;
}

.beauty-words {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin: 50px 0;
}

.word {
    font-size: 5rem;
    opacity: 0.3;
    transform: translateY(100px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* 3D Sphere Section */
.sphere-section {
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

.sphere-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    perspective: 1000px;
    /* Optional for deep 3D illusion */
}

/* TagCloud Items injected by the library */
.tagcloud {
    font-family: 'Daken', serif;
    font-weight: bold;
    color: var(--primary-color) !important;
    /* Force primary color dynamically */
    transition: color 0.5s ease;
}

.tagcloud--item {
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tagcloud--item:hover {
    color: #fff !important;
    /* Stand out entirely on hover */
    text-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--primary-color);
}

/* Middle Letter Highlight */
.middle-highlight-section {
    padding: 130px 17px;
    background-color: var(--bg-color);
    /* transition: background-color 0.5s ease; */
}

.word-display {
    font-size: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    /* More default distance */
}

.segment.side {
    transition: transform 0.1s linear, opacity 0.1s linear;
    display: inline-block;
}

.segment.center {
    color: var(--primary-color);
    font-size: 1.1em;
    display: inline-block;
    transition: transform 0.1s linear;
    z-index: 2;
    /* Ensure it stays above side letters if they overlap */
}

/* Variable Font Section */
.vf-section {
    height: 250vh;
    background: var(--bg-alt);
    position: relative;
}
.vf-sticky {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.vf-letter {
    font-size: min(60vw, 600px);
    line-height: 1;
    color: var(--primary-color);
    transition: font-variation-settings 0.1s linear, font-weight 0.1s linear;
}
.vf-controls {
    margin-top: 20px;
    font-size: 1.2rem;
    color: var(--text-color);
    display: flex;
    gap: 30px;
}

/* Wave Section */
.wave-section {
    padding: 100px 20px;
    background: var(--bg-color);
}
.wave-text {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: clamp(3rem, 10vw, 8rem);
}
.wave-text span {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Readability Section */
.readability-section {
    background: var(--bg-alt);
    padding: 100px 20px;
}
.readability-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: justify;
    line-height: 1.6;
    font-size: 1.5rem;
    transition: line-height 0.1s linear, max-width 0.1s linear;
    color: var(--text-color);
}

/* Contrast Section */
.contrast-section {
    padding: 100px 20px;
}
.contrast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 90%;
    max-width: 1200px;
}
.contrast-box {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    border-radius: 12px;
    padding: 20px;
}
.contrast-box span {
    font-family: 'CurrentShowcaseFont' !important;
}
.c-white { background: #ffffff; color: #000000; }
.c-dark { background: #111111; color: #ffffff; }
.c-grad { background: linear-gradient(135deg, #f1c40f, #e67e22); color: #ffffff; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.c-pattern {
    background: #000;
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--primary-color);
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 800px;
}

.char-box {
    border: 1px solid var(--grid-border);
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.char-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    transform: scale(1.2) scaleX(1.15);
    /* Grow and Widen */
    cursor: pointer;
    background: rgba(241, 196, 15, 0.05);
}

/* Type Tester */
.tester-container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
}

#tester-input {
    width: 100%;
    height: 250px;
    background: var(--input-bg);
    border: 2px solid var(--grid-border);
    color: var(--primary-color);
    font-family: 'Daken', serif;
    font-size: 20px;
    padding: 30px;
    resize: vertical;
    text-align: center;
    border-radius: 8px;
    outline: none;
}

#tester-input:focus {
    border-color: var(--primary-color);
}

.tester-controls {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 1.2rem;
    color: var(--text-color);
}

input[type=range] {
    width: 300px;
    accent-color: var(--primary-color);
}

/* Showcase Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 90%;
    max-width: 1200px;
}

.detail-card {
    border: 2px solid var(--primary-color);
    padding: 40px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.detail-card:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.detail-card h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* Historical Motif */
.motif {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Footer */
footer {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--primary-color);
    color: var(--footer-text);
    font-weight: bold;
    font-size: 1.2rem;
    /* transition: background-color 0.5s ease, color 0.5s ease; */
}

/* Scroll Animation classes */
.fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.fade-up.active {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation Icons */
.icon-btn {
    background: none;
    border: none;
    color: var(--nav-link);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 5px;
}

.icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Sidebar Options */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    max-width: 80vw;
    height: 100%;
    background-color: var(--bg-alt);
    background-image:
        linear-gradient(var(--sidebar-grad), var(--sidebar-grad)),
        url('https://syrian.zone/syid/materials/pattern.svg');
    background-size: 300px;
    border-left: 1px solid rgba(241, 196, 15, 0.2);
    z-index: 1002;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.8);
}

.sidebar.open {
    right: 0;
}

.close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s, transform 0.3s;
}

.close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.sidebar-content {
    padding: 80px 30px;
    overflow-y: auto;
}

.sidebar-logo {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.sidebar-subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    text-align: right;
}

.sidebar-links {
    list-style: none;
    margin-bottom: 40px;
    text-align: right;
}

.sidebar-links li {
    margin-bottom: 15px;
}

.sidebar-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s, padding-right 0.3s;
    display: block;
}

.sidebar-links a:hover,
.sidebar-links a.active {
    color: var(--primary-color);
    padding-right: 15px;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .poem-line {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hero-letter {
        font-size: 50vw;
    }

    .poem-line {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .intro h1 {
        font-size: 3.5rem !important;
    }

    .intro p {
        font-size: 1.4rem !important;
    }

    .detail-card h3 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    section {
        padding: 50px 15px;
    }

    .hero-letter {
        font-size: 60vw;
    }

    .poem-line {
        font-size: 1.4rem;
        white-space: normal;
        /* Allow wrapping on very small screens */
    }

    .intro h1 {
        font-size: 2.5rem !important;
    }

    .intro p {
        font-size: 1.1rem !important;
    }

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