* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #050914;
    --ink-deep: #0b1330;
    --pearl: #efe7d6;
    --moonlight: #e5e7eb;
    --steel: #9ea3b8;
    --gold: #c9a769;
    --gold-dim: rgba(201, 167, 105, 0.35);
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Base / cosmic backdrop (home page — deep navy galaxy) ---------- */

body {
    position: relative;
    background-color: #020408;
    background-image:
        /* Vignette to deepen the corners */
        radial-gradient(ellipse 115% 115% at 50% 50%, transparent 15%, rgba(1, 2, 5, 0.85) 82%),
        /* Very faint cool ambient bloom toward upper-left where the band sits */
        radial-gradient(ellipse 55% 42% at 28% 16%, rgba(60, 85, 130, 0.05), transparent 62%),
        /* Very faint warm tone opposite for balance */
        radial-gradient(ellipse 60% 45% at 85% 90%, rgba(30, 40, 68, 0.03), transparent 65%);
    background-attachment: fixed;
    color: var(--moonlight);
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Per-page accent themes (set via body class on the detail pages) */
body.theme-arabic    { --accent: #c9a769; --accent-soft: rgba(201, 167, 105, 0.28); }
body.theme-paintings { --accent: #a98fd2; --accent-soft: rgba(169, 143, 210, 0.28); }
body.theme-farm      { --accent: #8fae7a; --accent-soft: rgba(143, 174, 122, 0.28); }
body.theme-dress     { --accent: #7f9bd4; --accent-soft: rgba(127, 155, 212, 0.28); }

/* Each detail page gets its own deep-space nebula tint — pure CSS, no images needed */
body.theme-arabic {
    background-image:
        radial-gradient(ellipse 65% 38% at 50% -8%, rgba(201, 167, 105, 0.16), transparent 62%),
        radial-gradient(ellipse 50% 32% at 88% 78%, rgba(150, 116, 60, 0.12), transparent 60%),
        radial-gradient(ellipse 55% 35% at 88% 18%, rgba(201, 167, 105, 0.05), transparent 60%),
        radial-gradient(ellipse 110% 110% at 50% 50%, transparent 25%, rgba(1, 2, 6, 0.55) 80%);
    background-attachment: fixed;
}

body.theme-paintings {
    background-image:
        radial-gradient(ellipse 65% 40% at 18% -6%, rgba(169, 143, 210, 0.20), transparent 62%),
        radial-gradient(ellipse 55% 38% at 92% 82%, rgba(90, 70, 160, 0.14), transparent 60%),
        radial-gradient(ellipse 60% 35% at 50% 10%, rgba(122, 104, 200, 0.10), transparent 60%),
        radial-gradient(ellipse 110% 110% at 50% 50%, transparent 25%, rgba(1, 2, 6, 0.55) 80%);
    background-attachment: fixed;
}

body.theme-farm {
    background-image:
        radial-gradient(ellipse 60% 38% at 82% -6%, rgba(143, 174, 122, 0.16), transparent 62%),
        radial-gradient(ellipse 55% 34% at 8% 88%, rgba(60, 90, 55, 0.18), transparent 60%),
        radial-gradient(ellipse 55% 30% at 50% 12%, rgba(90, 120, 80, 0.08), transparent 60%),
        radial-gradient(ellipse 110% 110% at 50% 50%, transparent 25%, rgba(1, 2, 6, 0.55) 80%);
    background-attachment: fixed;
}

body.theme-dress {
    background-image:
        radial-gradient(ellipse 65% 38% at 78% -6%, rgba(127, 155, 212, 0.18), transparent 62%),
        radial-gradient(ellipse 55% 34% at 12% 84%, rgba(60, 80, 130, 0.15), transparent 60%),
        radial-gradient(ellipse 55% 30% at 50% 12%, rgba(90, 100, 170, 0.08), transparent 60%),
        radial-gradient(ellipse 110% 110% at 50% 50%, transparent 25%, rgba(1, 2, 6, 0.55) 80%);
    background-attachment: fixed;
}

/* ---------- Starfield layer 1: dense multi-size stars ---------- */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
    background-image:
        /* === Bright stars (layer A) === */
        radial-gradient(1.4px 1.4px at 18% 14%, rgba(255,255,255,0.85), transparent 50%),
        radial-gradient(1.2px 1.2px at 62% 8%, rgba(255,255,255,0.75), transparent 50%),
        radial-gradient(1.5px 1.5px at 88% 32%, rgba(255,255,255,0.9), transparent 50%),
        radial-gradient(1.3px 1.3px at 42% 48%, rgba(255,255,255,0.7), transparent 50%),
        radial-gradient(1.1px 1.1px at 72% 72%, rgba(255,255,255,0.6), transparent 50%),
        radial-gradient(1.4px 1.4px at 28% 85%, rgba(255,255,255,0.8), transparent 50%),
        radial-gradient(1.2px 1.2px at 95% 68%, rgba(255,255,255,0.65), transparent 50%),
        radial-gradient(1.6px 1.6px at 8% 55%, rgba(255,255,255,0.92), transparent 50%),
        /* === Medium stars (layer B) === */
        radial-gradient(1px 1px at 35% 28%, rgba(255,255,255,0.55), transparent 50%),
        radial-gradient(0.9px 0.9px at 82% 52%, rgba(255,255,255,0.45), transparent 50%),
        radial-gradient(1px 1px at 15% 42%, rgba(255,255,255,0.5), transparent 50%),
        radial-gradient(0.8px 0.8px at 55% 88%, rgba(255,255,255,0.4), transparent 50%),
        radial-gradient(1px 1px at 48% 18%, rgba(255,255,255,0.52), transparent 50%),
        radial-gradient(0.9px 0.9px at 75% 35%, rgba(255,255,255,0.48), transparent 50%),
        /* === Dim stars (layer C) === */
        radial-gradient(0.7px 0.7px at 5% 92%, rgba(255,255,255,0.3), transparent 50%),
        radial-gradient(0.6px 0.6px at 25% 62%, rgba(255,255,255,0.22), transparent 50%),
        radial-gradient(0.7px 0.7px at 68% 22%, rgba(255,255,255,0.28), transparent 50%),
        radial-gradient(0.5px 0.5px at 92% 82%, rgba(255,255,255,0.2), transparent 50%),
        radial-gradient(0.6px 0.6px at 38% 75%, rgba(255,255,255,0.25), transparent 50%),
        radial-gradient(0.7px 0.7px at 58% 58%, rgba(255,255,255,0.28), transparent 50%);
    background-size:
        /* Bright — varied tiles to break repetition */
        320px 340px, 380px 290px, 290px 360px, 350px 310px,
        310px 380px, 360px 270px, 270px 350px, 340px 320px,
        /* Medium */
        220px 250px, 260px 230px, 240px 270px, 280px 220px,
        250px 260px, 270px 240px,
        /* Dim */
        180px 200px, 210px 190px, 190px 210px, 200px 180px,
        215px 205px, 195px 215px;
    background-repeat: repeat;
    transform: translateY(var(--sky-shift, 0px));
    transition: transform 0.2s ease-out;
}

/* ---------- Starfield layer 2: galaxy nebula band + bright sparkle stars ---------- */

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        /* Milky Way band — confined diagonal cloud in the upper-left, fading out by mid-frame.
           Kept deliberately faint: real astro-photos read mostly black, with texture coming
           from star density, not a bright color haze. */
        radial-gradient(ellipse 26% 36% at 32% 6%,  rgba(130, 155, 195, 0.07), transparent 70%),
        radial-gradient(ellipse 22% 32% at 27% 20%, rgba(120, 145, 190, 0.06), transparent 68%),
        radial-gradient(ellipse 20% 28% at 30% 33%, rgba(110, 135, 175, 0.05), transparent 66%),
        radial-gradient(ellipse 17% 24% at 33% 45%, rgba(100, 125, 165, 0.035), transparent 64%),
        radial-gradient(ellipse 14% 18% at 35% 56%, rgba(90, 115, 150, 0.02), transparent 62%),
        /* Two brighter star-cluster clumps within the band — small and tight, not soft blobs */
        radial-gradient(ellipse 8% 9% at 27% 9%,  rgba(215, 232, 250, 0.16), transparent 70%),
        radial-gradient(ellipse 6% 7% at 24% 31%, rgba(205, 225, 248, 0.12), transparent 68%),
        radial-gradient(ellipse 5% 6% at 32% 47%,  rgba(195, 218, 245, 0.09), transparent 65%),
        /* Core highlight pinpoint — brightest point of the band.
           MUST have an explicit finite size: an unsized radial-gradient defaults to
           "farthest-corner", which stretches a supposed pinpoint into a huge hazy
           patch spanning most of the viewport (the bug that caused the gray blob). */
        radial-gradient(70px 70px at 25% 9%, rgba(255, 255, 255, 0.35), transparent 70%),
        /* Fine star dusting concentrated inside the band */
        radial-gradient(1.6px 1.6px at 22% 5%,  rgba(255,255,255,0.9), transparent 60%),
        radial-gradient(1.2px 1.2px at 30% 11%, rgba(210,225,250,0.85), transparent 60%),
        radial-gradient(1.4px 1.4px at 18% 15%, rgba(255,255,255,0.8), transparent 60%),
        radial-gradient(1px 1px at 26% 22%,   rgba(200,220,245,0.7), transparent 60%),
        radial-gradient(1.5px 1.5px at 21% 28%, rgba(255,255,255,0.85), transparent 60%),
        radial-gradient(1px 1px at 33% 26%,   rgba(210,230,250,0.65), transparent 60%),
        radial-gradient(1.3px 1.3px at 24% 34%, rgba(255,255,255,0.75), transparent 60%),
        radial-gradient(1px 1px at 29% 41%,   rgba(200,220,245,0.6), transparent 60%),
        radial-gradient(1.2px 1.2px at 34% 48%, rgba(255,255,255,0.65), transparent 60%),
        radial-gradient(0.9px 0.9px at 20% 45%, rgba(190,210,240,0.5), transparent 60%),
        /* A few sparse, dim stars out in the plain black portion of the sky */
        radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,0.5), transparent 60%),
        radial-gradient(0.8px 0.8px at 88% 30%, rgba(255,255,255,0.4), transparent 60%),
        radial-gradient(1px 1px at 65% 45%, rgba(255,255,255,0.35), transparent 60%),
        radial-gradient(0.7px 0.7px at 95% 60%, rgba(255,255,255,0.3), transparent 60%),
        radial-gradient(0.9px 0.9px at 72% 75%, rgba(255,255,255,0.35), transparent 60%),
        radial-gradient(0.8px 0.8px at 55% 85%, rgba(255,255,255,0.28), transparent 60%),
        radial-gradient(0.7px 0.7px at 10% 65%, rgba(255,255,255,0.28), transparent 60%),
        radial-gradient(0.8px 0.8px at 48% 92%, rgba(255,255,255,0.3), transparent 60%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    animation: nebulaGlow 12s ease-in-out infinite alternate;
}

main, header, footer { position: relative; z-index: 1; }
a { color: inherit; }

/* ---------- Procedural galaxy background (homepage only) ---------- */

#galaxy-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* The homepage renders its stars/nebula via canvas + JS (galaxy.js) instead of the
   CSS gradient version, so switch the pseudo-element layers off here to avoid
   drawing both at once. Detail pages are untouched and keep the CSS version. */
body.js-galaxy::before,
body.js-galaxy::after {
    content: none;
}

/* ---------- Navbar ---------- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

@keyframes moonDrift {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- SERPIA logo mark (real client SVG, masked + shimmered) ---------- */

.site-logo {
    display: inline-block;
    flex-shrink: 0;
    background: linear-gradient(120deg, #4a4d59 0%, #e8e8ec 20%, #9a9dab 35%, #f3f0e8 50%, #6b6e7a 65%, #4a4d59 100%);
    background-size: 220% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    animation: moonShimmer 8s ease-in-out infinite;
}

.logo-mark {
    -webkit-mask-image: url('../images/serpia-logo-mark.svg');
    mask-image: url('../images/serpia-logo-mark.svg');
    width: 28px;
    height: 28px;
    animation: moonShimmer 8s ease-in-out infinite, logoDrift 16s linear infinite;
}

.logo-full {
    -webkit-mask-image: url('../images/serpia-logo-full.svg');
    mask-image: url('../images/serpia-logo-full.svg');
    width: min(760px, 88vw);
    height: min(380px, 44vw);
    margin: 0 auto 1rem auto;
    animation: moonShimmer 8s ease-in-out infinite, logoGlow 6s ease-in-out infinite;
}

@keyframes logoDrift {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(4deg); }
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 14px rgba(200, 205, 220, 0.18)); }
    50% { filter: drop-shadow(0 0 26px rgba(239, 231, 214, 0.4)); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand-name {
    font-family: 'Cinzel', serif;
    letter-spacing: 5px;
    font-size: 1.2rem;
    color: #d1d5db;
}

.menu-icon .line {
    width: 30px;
    height: 1px;
    background-color: #d1d5db;
    margin: 8px 0;
    transition: background-color 0.3s ease;
}

.menu-icon:hover .line { background-color: var(--pearl); }

/* ---------- Hero ---------- */

.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2.75rem, 7vh, 4.5rem);
    padding: 3rem 2rem;
}

.center-branding { text-align: center; }

/* Quiet rule between the mark and the pillars — replaces the old scroll cue
   now that the hero is the whole page, not a lead-in to copy below. */
.hero-divider {
    display: block;
    width: 64px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

@keyframes moonShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.main-title {
    font-family: 'Cinzel', serif;
    font-size: 4.5rem;
    font-weight: 400;
    letter-spacing: 20px;
    background: linear-gradient(120deg, #9a9dab 0%, #f3f0e8 30%, #cfd2da 50%, #f3f0e8 70%, #9a9dab 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: moonShimmer 8s ease-in-out infinite;
}

/* Decorative flourish on the first letter, in the spirit of the client's wordmark */
.main-title .swash {
    font-family: 'Tangerine', cursive;
    font-size: 2.4em;
    letter-spacing: 0;
    vertical-align: -0.22em;
    margin-right: -0.02em;
}

.pillars-container {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
    width: 100%;
    padding: 0 2rem;
    flex-wrap: wrap;
}

.pillar-card {
    opacity: 0;
    text-decoration: none;
    color: #a1a1aa;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pillar-card p {
    font-size: 0.85rem;
    letter-spacing: 3px;
    line-height: 1.5;
}

.pillar-dash {
    display: block;
    width: 26px;
    height: 1px;
    background: rgba(233, 226, 212, 0.5);
    margin: 0.8rem auto 0 auto;
    transition: background 0.3s ease, width 0.3s ease;
}

.pillar-card:hover .pillar-dash {
    background: var(--pearl);
    width: 36px;
}

.circle-glow {
    position: relative;
    overflow: hidden;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.75rem;
    box-shadow: 0 0 25px 2px rgba(255, 255, 255, 0.05), inset 0 0 15px rgba(255, 255, 255, 0.03);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Dimming overlay: sits on top of the photo background but below the icon glyph,
   so the photo is faded while the icon stays fully opaque and in focus. */
.circle-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(5, 9, 20, 0.6);
    pointer-events: none;
}

/* Per-pillar circle backgrounds — real photographic images. The dimming
   overlay is applied separately via .circle-bg-overlay (see below) so the
   photo is faded while the icon glyph stays fully opaque and in focus. */
.circle-glow.theme-arabic,
.detail-emblem.theme-arabic {
    background-image: url('../images/pillars/arabic.jpg') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.circle-glow.theme-paintings,
.detail-emblem.theme-paintings {
    background-image: url('../images/pillars/paintings.jpg') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.circle-glow.theme-farm,
.detail-emblem.theme-farm {
    background-image: url('../images/pillars/farm.jpg') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

.circle-glow.theme-dress,
.detail-emblem.theme-dress {
    background-image: url('../images/pillars/dress.jpg') !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

/* Additional sparkle stars on circle edges */
.circle-glow::before,
.detail-emblem::before {
    content: '';
    position: absolute;
    bottom: 18%;
    right: 15%;
    width: 7px;
    height: 7px;
    background: var(--pearl);
    clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
    filter: drop-shadow(0 0 4px rgba(239, 231, 214, 0.8));
    animation: twinkle 4.2s ease-in-out infinite 1.5s;
    z-index: 2;
}

.circle-glow::after,
.detail-emblem::after {
    content: '';
    position: absolute;
    top: 42%;
    right: 8%;
    width: 5px;
    height: 5px;
    background: var(--pearl);
    clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
    filter: drop-shadow(0 0 3px rgba(239, 231, 214, 0.7));
    animation: twinkle 3.8s ease-in-out infinite 0.8s;
    z-index: 2;
}

/* Small twinkling accent star, echoing the ones in the reference photo */
.spark {
    position: absolute;
    top: 15%;
    left: 22%;
    width: 9px;
    height: 9px;
    background: var(--pearl);
    clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
    filter: drop-shadow(0 0 4px rgba(239, 231, 214, 0.9));
    animation: twinkle 3.4s ease-in-out infinite;
    z-index: 2;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes nebulaGlow {
    0% { opacity: 0.55; }
    100% { opacity: 1; }
}

.custom-icon {
    width: 96px;
    height: 96px;
    color: var(--pearl);
    position: relative;
    z-index: 2;
    /* always visible: thin soft glow around the white icon so it reads on any background */
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.35));
    transition: all 0.4s ease;
}

.arabic-text {
    font-family: 'Aref Ruqaa', serif;
    font-size: 4.3rem;
    font-weight: 400;
    color: var(--pearl);
    position: relative;
    z-index: 2;
    /* always visible: subtle dark + light glow on the glyph */
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
    transition: all 0.4s ease;
}

.circle-glow.theme-arabic .arabic-text,
.detail-emblem.theme-arabic .arabic-text {
    color: var(--accent, #c9a769);
}

.circle-glow.theme-paintings .custom-icon,
.detail-emblem.theme-paintings .custom-icon {
    color: var(--accent, #a98fd2);
}

.circle-glow.theme-farm .custom-icon,
.detail-emblem.theme-farm .custom-icon {
    color: var(--accent, #8fae7a);
}

.circle-glow.theme-dress .custom-icon,
.detail-emblem.theme-dress .custom-icon {
    color: var(--accent, #7f9bd4);
}

.pillar-card:hover .circle-glow {
    box-shadow: 0 0 45px 8px rgba(255, 255, 255, 0.2), inset 0 0 25px rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.pillar-card:hover .custom-icon,
.pillar-card:hover .arabic-text {
    transform: scale(1.1);
    color: #ffffff;
    /* intensified glow on hover — white icon bright against the photo bg */
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6))
            drop-shadow(0 0 12px rgba(255, 255, 255, 0.85))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
}

/* ---------- Entrance sequence (page load) ---------- */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

.stagger-1 { animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards; }
.stagger-2 { animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards; }
.stagger-3 { animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s forwards; }
.stagger-4 { animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s forwards; }

/* ---------- Shared circular emblem (used on detail pages) ---------- */

.detail-emblem {
    position: relative;
    overflow: hidden;
    width: 210px;
    height: 210px;
    margin: 0 auto 2rem auto;
    border-radius: 50%;
    border: 1px solid var(--accent-soft, rgba(255, 255, 255, 0.12));
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 40px 4px var(--accent-soft, rgba(255, 255, 255, 0.05)), inset 0 0 25px rgba(255, 255, 255, 0.03);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0) 70%);
}

.detail-emblem .custom-icon {
    width: 78px;
    height: 78px;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.35));
    transition: all 0.4s ease;
}
.detail-emblem .arabic-text {
    font-size: 5.5rem;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
    transition: all 0.4s ease;
}

/* ---------- Detail pages ---------- */

.back-link {
    display: inline-block;
    color: var(--steel);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 2px;
    margin: 2.5rem 0 3rem 4rem;
    transition: color 0.3s ease;
}

.back-link:hover { color: var(--pearl); }

.detail-hero {
    text-align: center;
    padding: 1rem 2rem 3rem 2rem;
}

.detail-hero h1 {
    font-family: 'Cinzel', serif;
    font-weight: 400;
    font-size: 2.75rem;
    letter-spacing: 6px;
    color: var(--pearl);
    margin-bottom: 0.9rem;
}

.detail-hero .strap {
    display: block;
    color: var(--accent, var(--gold));
    letter-spacing: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.detail-body {
    max-width: 660px;
    margin: 0 auto;
    padding: 1rem 2rem 0 2rem;
    text-align: center;
}

.detail-body p {
    color: var(--steel);
    font-weight: 300;
    font-size: 1.02rem;
    line-height: 1.9;
    margin-bottom: 1.4rem;
}

.detail-highlights {
    list-style: none;
    display: inline-flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 1.5rem 0 3rem 0;
    text-align: left;
}

.detail-highlights li {
    position: relative;
    padding-left: 1.4rem;
    color: #c7cadb;
    font-weight: 300;
    font-size: 0.95rem;
}

.detail-highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent, var(--gold));
}

.detail-cta {
    text-align: center;
    padding: 1rem 2rem 6rem 2rem;
}

.explore-btn {
    display: inline-block;
    padding: 0.95rem 2.6rem;
    border: 1px solid var(--accent, var(--gold));
    color: var(--pearl);
    text-decoration: none;
    letter-spacing: 2.5px;
    font-size: 0.78rem;
    transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.explore-btn:hover,
.explore-btn:focus-visible {
    background: var(--accent, var(--gold));
    color: #0b0d16;
    box-shadow: 0 0 30px var(--accent-soft, var(--gold-dim));
}

.text-link {
    display: inline-block;
    text-decoration: none;
    color: var(--accent, var(--gold));
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--accent-soft, var(--gold-dim));
    transition: border-color 0.3s ease, color 0.3s ease;
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--pearl);
    border-color: var(--pearl);
}

/* ---------- Footer ---------- */

.site-footer { text-align: center; padding: 3.5rem 2rem 3rem 2rem; }

.footer-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    text-decoration: none;
}

.footer-brand .brand-name { font-size: 1rem; }

.footer-tagline {
    color: var(--steel);
    font-weight: 300;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--steel);
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible { color: var(--accent, var(--gold)); }

.footer-copyright { color: #6b7086; font-size: 0.75rem; letter-spacing: 1px; }

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .navbar { padding: 1.5rem 1.75rem; }
    .main-title { font-size: 2.6rem; letter-spacing: 10px; }
    .logo-full { width: min(420px, 88vw); height: min(210px, 44vw); }
    .hero-section { gap: clamp(2rem, 6vh, 3rem); }
    .pillars-container { gap: 2.25rem; }
    .circle-glow { width: 140px; height: 140px; }
    .detail-emblem { width: 170px; height: 170px; }
    .detail-emblem .custom-icon { width: 60px; height: 60px; }
    .detail-emblem .arabic-text { font-size: 4rem; }
    .detail-hero h1 { font-size: 2rem; letter-spacing: 3px; }
    .back-link { margin-left: 1.75rem; }
}

/* ---------- Course catalog & curriculum ---------- */

.course-grid-section { max-width: 1100px; margin: 0 auto; padding: 2rem; }

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.course-card {
    text-decoration: none;
    color: var(--moonlight);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.course-card:hover { border-color: var(--accent, var(--gold)); transform: translateY(-3px); }
.course-card h3 { font-family: 'Cinzel', serif; font-size: 1.2rem; margin: 0.8rem 0 0.5rem 0; }
.course-card p { color: var(--steel); font-size: 0.9rem; font-weight: 300; }

.price-tag {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--accent-soft, var(--gold-dim));
    color: var(--accent, var(--gold));
    border-radius: 3px;
}

.curriculum { max-width: 660px; margin: 0 auto; padding: 1rem 2rem 4rem 2rem; }
.curriculum-section { margin-bottom: 2rem; }
.curriculum-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: var(--pearl);
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
}

.video-list { list-style: none; }
.video-item a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0;
    text-decoration: none;
    color: var(--moonlight);
    font-size: 0.92rem;
    font-weight: 300;
}
.video-item.locked a { color: var(--steel); }
.video-icon { font-size: 0.85rem; }
.preview-badge {
    margin-left: auto;
    font-size: 0.68rem;
    letter-spacing: 1px;
    color: var(--accent, var(--gold));
    border: 1px solid var(--accent-soft, var(--gold-dim));
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}
.video-placeholder {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 6px;
    color: var(--steel);
}

.membership-status { color: var(--steel); font-size: 0.92rem; margin-bottom: 1.2rem; }
.membership-status.active { color: var(--accent, var(--gold)); }

/* ---------- Plans + payment ---------- */

.membership-status.pending { color: #d4a94f; }

.plan-grid-section { max-width: 700px; margin: 0 auto; padding: 2rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.plan-card {
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2rem 1.5rem;
}
.plan-card h3 { font-family: 'Cinzel', serif; margin-bottom: 0.5rem; }
.plan-price { font-size: 1.8rem; color: var(--accent, var(--gold)); margin-bottom: 0.2rem; }
.plan-duration { color: var(--steel); font-size: 0.85rem; margin-bottom: 1.2rem; }

.bkash-instructions {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}
.bkash-instructions h3 { font-size: 0.95rem; margin-bottom: 0.6rem; color: var(--pearl); }
.bkash-instructions ol { padding-left: 1.2rem; color: var(--steel); font-size: 0.88rem; line-height: 1.8; }

/* ---------- Video player + watermark ---------- */

.video-player-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.video-player-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-watermark {
    position: absolute;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
    font-family: 'Montserrat', sans-serif;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    transition: top 1.5s ease, left 1.5s ease;
    z-index: 5;
}

/* ---------- Notes & Comments (video watch page) ---------- */

.section-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: var(--pearl);
    margin: 3rem 0 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
}

.comment-count { color: var(--steel); font-weight: 300; font-size: 0.85rem; }

/* Notes */
.notes-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.note-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}
.note-type {
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--steel);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    flex-shrink: 0;
}
.note-title { flex: 1; font-size: 0.92rem; color: var(--moonlight); font-weight: 300; }
.note-download {
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--accent, var(--gold));
    text-decoration: none;
    border: 1px solid var(--accent-soft, var(--gold-dim));
    padding: 0.35rem 0.75rem;
    border-radius: 3px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}
.note-download:hover { background: var(--accent, var(--gold)); color: #0b0d16; }

/* Comment composer */
.comment-form textarea,
.reply-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--moonlight);
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    padding: 0.7rem 0.9rem;
    min-height: 70px;
    resize: vertical;
}
.comment-form textarea:focus, .reply-form textarea:focus {
    outline: none;
    border-color: var(--accent, var(--gold));
}
.comment-form-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.5rem; }
.btn-post {
    background: var(--accent, var(--gold));
    color: #0b0d16;
    border: none;
    padding: 0.5rem 1.3rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}
.btn-post:hover { opacity: 0.88; }
.btn-post:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-post-sm { padding: 0.4rem 1rem; font-size: 0.75rem; }
.btn-cancel-reply {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--steel);
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}
.btn-cancel-reply:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--moonlight); }
.comment-error { color: #e08080; font-size: 0.8rem; margin-top: 0.4rem; }

/* Comment list */
.comments-list, .replies-list { list-style: none; }
.comments-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.comment-item { display: flex; gap: 0.8rem; }
.comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(201, 167, 105, 0.15);
    color: var(--accent, var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    border: 1px solid var(--accent-soft, var(--gold-dim));
}
.comment-avatar-sm { width: 28px; height: 28px; font-size: 0.8rem; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; flex-wrap: wrap; }
.comment-author { font-size: 0.88rem; color: var(--pearl); font-weight: 400; margin-right: 0.5rem; }
.comment-admin-badge {
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #0b0d16;
    background: var(--accent, var(--gold));
    padding: 0.12rem 0.5rem;
    border-radius: 99px;
    margin-right: 0.5rem;
}
.comment-time { font-size: 0.74rem; color: var(--steel); }
.comment-text {
    font-size: 0.9rem;
    color: var(--moonlight);
    font-weight: 300;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-actions { display: flex; gap: 1.1rem; margin-top: 0.4rem; }
.comment-reply-btn, .comment-delete-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--steel);
    font-size: 0.76rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    margin-right: 1rem;
}
.comment-reply-btn:hover { color: var(--accent, var(--gold)); }
.comment-delete-btn:hover { color: #e08080; }
.reply-form { margin-top: 0.8rem; max-width: 460px; }
.replies-list {
    margin-top: 1rem;
    padding-left: 1.4rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.replies-list:empty { display: none; margin: 0; padding: 0; border: none; }

/* ---------- Auth forms (login, register, OTP, password reset) ---------- */

.auth-section {
    max-width: 420px;
}

.auth-form {
    text-align: left;
    margin-top: 1rem;
}

.form-field {
    margin-bottom: 1.4rem;
}

.form-field label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--steel);
    margin-bottom: 0.5rem;
}

.form-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--pearl);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-field input::placeholder {
    color: #5c6178;
}

.form-field input:focus {
    outline: none;
    border-color: var(--accent, var(--gold));
    background: rgba(255, 255, 255, 0.05);
}

.field-error {
    display: block;
    color: #e07a7a;
    font-size: 0.78rem;
    margin-top: 0.4rem;
}

.auth-submit {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
    background: transparent;
    cursor: pointer;
}

.auth-switch {
    text-align: center;
    color: var(--steel);
    font-size: 0.88rem;
    margin-top: 1.2rem;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.8rem 1.1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.7rem;
    border: 1px solid transparent;
}

.flash-success {
    background: rgba(60, 160, 100, 0.1);
    border-color: rgba(60, 160, 100, 0.3);
    color: #7fd9a4;
}

.flash-error {
    background: rgba(200, 70, 70, 0.1);
    border-color: rgba(200, 70, 70, 0.3);
    color: #e88b8b;
}

.flash-info {
    background: rgba(100, 130, 200, 0.1);
    border-color: rgba(100, 130, 200, 0.3);
    color: #9db4e8;
}

@media (max-width: 768px) {
    .auth-section { max-width: 100%; padding: 0 0.5rem; }
}

.explore-btn.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* ---------- Cool Blue Theme for All Auth Pages (Login, Register, Reset, OTP) ---------- */
body:has(.auth-section) {
    --accent: #6e94d6;
    --accent-soft: rgba(110, 148, 214, 0.35);
    --gold: #6e94d6;
    --gold-dim: rgba(110, 148, 214, 0.35);
}

.auth-section .explore-btn.auth-submit {
    border-color: rgba(110, 148, 214, 0.65);
    color: #8bb0ee;
}

.auth-section .explore-btn.auth-submit:hover {
    background: #6e94d6;
    color: #050914;
}