/* 
    Theme: Modern Editorial
    Vibe: Sophisticated, Clean, Academic yet Contemporary
    Fonts: 'Playfair Display' (Headers), 'Lato' (Body)
*/

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Noto+Kufi+Arabic:wght@300;400;700&display=swap');

/* --- RICHNESS UPGRADE --- */

/* 1. Parallax & Gradient Background */
body {
    background-color: var(--bg-color);
    background-image: url('../assets/texture.png'), linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(253, 245, 230, 0.8) 100%);
    background-blend-mode: multiply;
    background-attachment: fixed;
    /* Parallax feel */
    background-size: cover;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: -20% -10%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

body::before {
    background: radial-gradient(circle at 15% 10%, rgba(197, 160, 89, 0.18), transparent 45%),
        radial-gradient(circle at 85% 0%, rgba(109, 7, 26, 0.12), transparent 40%);
}

body::after {
    background: radial-gradient(circle at 20% 80%, rgba(109, 7, 26, 0.08), transparent 55%),
        radial-gradient(circle at 90% 70%, rgba(197, 160, 89, 0.14), transparent 45%);
}

/* 2. Luxurious Gradient Text */
/* 2. Luxurious Gradient Text */
.hero h1 {
    font-size: 5.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    line-height: 1.1;
    background: linear-gradient(45deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 5;
}

/* Fallback for browsers that might fail the gradient clip and show 'white over words' */
@supports not (background-clip: text) {
    .hero h1 {
        background: none;
        -webkit-text-fill-color: var(--text-primary);
        color: var(--text-primary);
    }
}

/* Video Overlay - Crisp White */
/* Video Overlay - Crisp White */
.video-overlay h2 {
    color: #fff !important;
    /* Force White override */
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
    /* Strong shadow */
    font-weight: 700;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* 3. Floating Animation for Profile Pic */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.about-img,
.bio-text img {
    animation: fadeInUp 1s ease-out forwards, float 6s ease-in-out infinite 1s;
    /* Float starts after fade */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    /* Deeper shadow */
    border: 4px solid #fff;
}

/* 4. Enhanced Card Interaction */
.work-card:hover,
.doc-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-hover);
    /* Burgundy shadow glow */
    border-color: var(--accent);
}

.doc-card {
    background: var(--surface) !important;
    /* Slightly transparent to show parchment texture */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-md);
}

.work-card h3,
.doc-card h3 {
    transition: color 0.3s ease;
}

.work-card:hover h3,
.doc-card:hover h3 {
    color: var(--accent);
}

/* --- END RICHNESS UPGRADE --- */


:root {
    --bg-color: #fdfbf7;
    /* Warmer cream */
    --text-primary: #2c1810;
    /* Darker, warmer brown-black */
    --text-secondary: #5d4037;
    --accent: #6d071a;
    /* Richer Burgundy */
    --gold: #c5a059;
    /* Muted Gold for "Wow" */
    --border-color: #e6e1d6;
    --surface: rgba(255, 255, 255, 0.92);
    --shadow-soft: 0 12px 28px rgba(44, 24, 16, 0.08);
    --shadow-hover: 0 18px 40px rgba(44, 24, 16, 0.12);
    --radius-lg: 14px;
    --radius-md: 10px;
    --accent-2: #a67c52;
    --paper: #f7f1e6;
    --paper-deep: #efe5d6;
    --shadow-strong: 0 26px 60px rgba(44, 24, 16, 0.16);

    --container-width: 1200px;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --font-arabic: 'Noto Kufi Arabic', sans-serif;

    --spacing-sm: 1rem;
    --spacing-md: 2.5rem;
    --spacing-lg: 6rem;
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body handled by Richness above */

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.05);
    /* Subtle depth for readability */
    word-wrap: break-word;
    /* Prevent overflow */
}

/* Fluid Typography for Headers */
h1 {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
}

h2 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h3 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid rgba(109, 7, 26, 0.5);
    outline-offset: 3px;
}

::selection {
    background: rgba(109, 7, 26, 0.18);
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-center {
    text-align: center;
}

.serif-italic {
    font-family: var(--font-heading);
    font-style: italic;
}

/* Header */
#header {
    padding: 1.2rem 0;
    /* More compact by default */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(253, 251, 247, 0.95);
    /* Opaque Parchment White with slight transparency */
    backdrop-filter: blur(10px);
    /* Premium feel */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

#header.scrolled {
    padding: 0.8rem 0;
    background: rgba(253, 251, 247, 0.98);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.header-spacer {
    height: 160px;
    width: 100%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
    position: relative;
    cursor: pointer;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active::after {
    width: 100%;
}

/* Hero */
.hero {
    min-height: 100vh;
    padding-top: 160px;
    /* Stronger offset to ensure NO overlap with header */
    padding-bottom: 80px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-color);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/hero-bg.jpg') no-repeat center center/cover;
    opacity: 0.15;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

/* Consolidated into top section */

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
    max-width: 600px;
    /* Ensure readability */
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 3rem;
    min-height: 60px;
    /* Prevent collapse on any device */
    border: 1px solid var(--text-primary);
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(44, 24, 16, 0.08);
}

.btn-primary {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
    box-shadow: 0 10px 24px rgba(44, 24, 16, 0.18);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(44, 24, 16, 0.14);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(109, 7, 26, 0.22);
}

/* About Section */
.section-padding {
    padding: var(--spacing-lg) 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-img-wrapper {
    position: relative;
}

.about-img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
    border-radius: 2px;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.about-content h2::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 0;
    width: 3rem;
    height: 2px;
    background: var(--accent);
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Works Preview */
.works-preview {
    background: rgba(0, 0, 0, 0.02);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.section-header h2 {
    font-size: 3rem;
}

.section-padding h2,
.section-header h2 {
    position: relative;
}

.section-padding h2::after,
.section-header h2::after {
    content: '';
    display: block;
    width: 88px;
    height: 3px;
    margin-top: 0.8rem;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent-2));
    border-radius: 999px;
    opacity: 0.7;
}

.work-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Standard Work Card (Books) */
.work-card {
    background: var(--surface);
    padding: 3rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    /* Soften edges slightly */
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.work-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}

.work-card:hover::before {
    opacity: 1;
}

.work-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.work-card:hover::after {
    transform: scaleX(1);
}

.work-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
}

.work-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.work-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Document Cards (for File Downloads) */
.doc-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    text-decoration: none;
    border-radius: var(--radius-md);
    position: relative;
}

.doc-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 60%);
    opacity: 0.7;
    pointer-events: none;
}

.doc-card:hover::before {
    opacity: 0.95;
}

.doc-card h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.doc-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gold);
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.download-pill {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Request Access Modal (shared) */
.request-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
}

.request-modal.active {
    display: flex;
}

.request-modal__panel {
    background: #fff;
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(109, 7, 26, 0.2);
    padding: 2rem;
}

.request-modal__panel h3 {
    margin-bottom: 0.5rem;
}

.request-modal__panel p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.request-modal__panel label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.request-modal__panel input,
.request-modal__panel textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
}

.request-modal__actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.request-modal__close {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .request-modal__panel {
        padding: 1.5rem;
    }
}

/* Video Section */
.video-section {
    position: relative;
    padding: 0;
    background: #000;
}

.video-container {
    width: 100%;
    height: 80vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    bottom: 10%;
    left: 5%;
    color: #fff;
    z-index: 10;
    max-width: 600px;
}

.video-overlay h2 {
    color: #fff;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Footer */
footer {
    background: var(--text-primary);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.footer-contact {
    color: rgba(255, 255, 255, 0.8);
    /* Make readable on dark bg */
}

.footer-contact a {
    color: #fff;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
}

.social-links a {
    color: #fff !important;
    /* Force white icons */
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--gold) !important;
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1,
.hero-subtitle,
.cta-group,
.about-content,
.work-card,
.video-overlay h2,
.section-padding h1,
.bio-text,
.doc-card {
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.hero h1 {
    animation-delay: 0.2s;
}

.hero-subtitle {
    animation-delay: 0.4s;
}

.cta-group {
    animation-delay: 0.6s;
}


/* --- RESPONSIVE DESIGN & COMPATIBILITY --- */

/* 1. Large Screens / TV (1440px+) */
@media (min-width: 1440px) {
    :root {
        --container-width: 1400px;
        /* Wider layout */
    }

    html {
        font-size: 18px;
        /* Scale up text */
    }

    .hero h1 {
        font-size: 6.5rem;
        /* Massive impact */
    }
}

/* 1b. Ultra-Wide Screens / Projectors (1800px+) */
@media (min-width: 1800px) {
    :root {
        --container-width: 1600px;
    }

    html {
        font-size: 19px;
    }

    .hero h1 {
        font-size: 7rem;
    }
}

/* 2. Tablets & Laptops (1024px and down) */
@media (max-width: 1024px) {
    :root {
        --container-width: 90%;
        --spacing-md: 2rem;
        --spacing-lg: 4rem;
    }

    .hero {
        padding: 140px 0 80px;
        height: auto;
        min-height: 80vh;
    }

    /* 2-Column Layout for Tablets */
    .work-cards,
    .about-grid,
    .books-grid,
    .downloads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .about-grid {
        gap: 3rem;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }
}

/* 3. Mobile Devices (768px and down) */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 4rem;
        /* Reduce vertical spacing */
    }

    /* Stack everything */
    .about-grid,
    .work-cards,
    .books-grid,
    .downloads-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Nav */
    /* Mobile Header Cleanup */
    #header {
        position: fixed;
        padding: 0.8rem 0;
    }

    nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .brand {
        font-size: 1.1rem;
    }

    .nav-links {
        flex-direction: row;
        gap: 0.8rem;
        width: auto;
    }

    .nav-links li {
        width: auto;
        padding: 0;
        border-bottom: none;
    }

    .nav-links a {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    /* Adjust page-level padding to account for fixed header on mobile */
    .header-spacer {
        height: 80px;
        /* Increased from 70px for full clearance */
    }

    .hero {
        padding-top: 110px;
        /* Increased from 100px */
        padding-bottom: 3rem;
    }

    .section-padding {
        padding: 4rem 0;
    }

    /* Hero adjustments */
    .hero {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .hero h1 {
        font-size: 2.8rem;
        /* readable but impactful */
        line-height: 1.2;
    }

    .header-spacer {
        height: 20px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Video section height */
    .video-container {
        height: 50vh;
    }

    .video-overlay h2 {
        font-size: 2rem;
    }

    .footer-logo {
        font-size: 1.5rem;
    }
}

/* 4. Small Mobile (480px and down) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .section-padding {
        padding: 3rem 0;
    }
}
