/* ============================================================
   Monano Land — Premium Design System
   Black + Gold • RTL/LTR • Dark/Light • Animated
   ============================================================ */

:root {
    --gold: #d4af37;
    --gold-bright: #f5c842;
    --gold-deep: #9a7b1e;
    --gold-soft: rgba(212, 175, 55, .12);

    --bg: #07070c;
    --bg-2: #0d0d16;
    --surface: rgba(255, 255, 255, .04);
    --surface-2: rgba(255, 255, 255, .07);
    --border: rgba(212, 175, 55, .16);
    --border-strong: rgba(212, 175, 55, .35);

    --text: #f2efe6;
    --text-muted: #a8a399;
    --text-faint: #6f6b62;

    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .5);
    --radius: 18px;
    --radius-sm: 12px;

    --header-h: 74px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="light"] {
    --bg: #f7f5f0;
    --bg-2: #fffdf8;
    --surface: rgba(0, 0, 0, .03);
    --surface-2: rgba(0, 0, 0, .055);
    --border: rgba(154, 123, 30, .22);
    --border-strong: rgba(154, 123, 30, .45);

    --text: #17150f;
    --text-muted: #5c574c;
    --text-faint: #8d887c;

    --shadow-lg: 0 24px 64px rgba(80, 66, 20, .14);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.site-body {
    margin: 0;
    font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(212, 175, 55, .07), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(212, 175, 55, .05), transparent 60%),
        var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    transition: background-color .5s var(--ease), color .5s var(--ease);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-bright); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--gold); }

.container { width: min(1180px, 92%); margin-inline: auto; }
.container-narrow { width: min(820px, 92%); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--text-muted); }

.skip-link {
    position: absolute; inset-inline-start: -9999px; top: 0;
    background: var(--gold); color: #000; padding: .6rem 1rem;
    border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip-link:focus { inset-inline-start: 0; }

/* ---------- Animated background orbs ---------- */

.bg-orbs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(90px); opacity: .5;
    animation: orb-float 16s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(212,175,55,.20), transparent 70%); top: -120px; inset-inline-end: -80px; }
.orb-2 { width: 360px; height: 360px; background: radial-gradient(circle, rgba(120,100,30,.16), transparent 70%); bottom: -100px; inset-inline-start: -60px; animation-delay: -6s; }
.orb-3 { width: 260px; height: 260px; background: radial-gradient(circle, rgba(212,175,55,.10), transparent 70%); top: 40%; inset-inline-start: 55%; animation-delay: -11s; }

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -24px) scale(1.06); }
    66% { transform: translate(-24px, 18px) scale(.96); }
}

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    transition: box-shadow .3s var(--ease), height .3s var(--ease);
}
/* The glass sits on ::before: a backdrop-filter on .site-header itself would turn
   the header into the containing block of its fixed children, and the mobile
   navigation sheet has to be anchored to the viewport bottom. */
.site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.site-header.scrolled { height: 62px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }

.header-inner { display: flex; align-items: center; gap: 1rem; height: 100%; }

.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); }
.brand-mark {
    display: grid; place-items: center;
    /* min-width keeps a single letter square while letting longer monograms breathe */
    min-width: 40px; height: 40px; padding-inline: .5rem; border-radius: 12px;
    font-weight: 800; font-size: 1.05rem; line-height: 1; letter-spacing: -.01em; color: #151204;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
    box-shadow: 0 6px 18px rgba(212,175,55,.35);
    transition: transform .35s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
/* Uploaded logo replaces the monogram in the same slot */
.brand-logo {
    width: 40px; height: 40px; border-radius: 12px; object-fit: cover;
    background: var(--surface); box-shadow: 0 6px 18px rgba(212,175,55,.28);
    transition: transform .35s var(--ease);
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
/* Both icon and name switched off in settings: keep the empty link out of the way */
.brand:not(:has(.brand-mark, .brand-logo, .brand-name)) { display: none; }
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 1.05rem; }

.main-nav { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; }
.nav-actions { display: flex; align-items: center; gap: .35rem; }
.nav-spacer { flex: 1; }
.nav-link {
    color: var(--text-muted); padding: .5rem .85rem; border-radius: 10px;
    font-weight: 500; position: relative;
}
.nav-link::after {
    content: ""; position: absolute; inset-inline: .85rem; bottom: .2rem; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transform: scaleX(0); transform-origin: center;
    transition: transform .3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); cursor: pointer;
    transition: border-color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.lang-btn { font-weight: 700; font-size: .8rem; }

/* theme icons */
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* mobile sheet: grabber + page scrim only exist on small screens */
.nav-grabber, .nav-scrim { display: none; }

/* burger */
.nav-burger { display: none; flex-direction: column; gap: 5px; }
.nav-burger span { width: 18px; height: 2px; background: var(--gold); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .72rem 1.5rem; border-radius: 12px; border: 1px solid transparent;
    font-weight: 700; font-size: .95rem; cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
    will-change: transform;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-lg { padding: .9rem 2.1rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-gold {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
    color: #151204;
    box-shadow: 0 8px 24px rgba(212,175,55,.30);
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(212,175,55,.42); color: #151204; }

.btn-outline {
    background: transparent; color: var(--gold-bright);
    border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--gold-soft); transform: translateY(-3px); color: var(--gold-bright); }

.btn-ghost { background: var(--surface); color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.inline-form { display: inline; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding: clamp(5rem, 12vw, 9rem) 0; }
.hero.has-bg { background-size: cover; background-position: center; }
.hero.has-bg::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), var(--bg));
}
.hero-inner { position: relative; text-align: center; max-width: 780px; }

.hero-eyebrow {
    color: var(--gold); letter-spacing: .35em; font-size: .8rem; font-weight: 700;
    margin-bottom: 1.2rem;
}
.hero-title {
    font-size: clamp(2.4rem, 6.5vw, 4.4rem);
    font-weight: 900; line-height: 1.15; margin: 0 0 1.4rem;
}
.gold-text {
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright) 40%, var(--gold) 60%, var(--gold-bright));
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: gold-shimmer 6s linear infinite;
}
@keyframes gold-shimmer { to { background-position: 200% center; } }

.hero-subtitle { color: var(--text-muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-body { color: var(--text-muted); max-width: 640px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-compact { padding: 2rem 0; }
.section-title {
    font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; margin: 0 0 .8rem;
    position: relative; display: inline-block;
}
.section-subtitle { color: var(--text-muted); margin: 0 0 2rem; }
.page-head { padding-bottom: 1rem; }

/* ---------- Grid & Cards ---------- */

.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card:hover, .card-hover:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.card-media { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); display: block; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-media-empty { display: grid; place-items: center; }
.card-media-empty span {
    font-size: 2.4rem; font-weight: 900;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; color: var(--text-faint); font-size: .8rem; }
.card-title { margin: 0; font-size: 1.12rem; line-height: 1.5; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--gold-bright); }
.card-excerpt { color: var(--text-muted); font-size: .92rem; margin: 0; flex: 1; }
.card-link { font-size: .88rem; font-weight: 700; margin-top: auto; }
.card-icon { font-size: 1.4rem; }

.chip {
    display: inline-block; padding: .18rem .7rem; border-radius: 999px;
    background: var(--gold-soft); color: var(--gold-bright);
    font-size: .74rem; font-weight: 700; border: 1px solid var(--border);
}
.chip-outline { background: transparent; }

/* ---------- CTA panel ---------- */

.cta-panel {
    position: relative; overflow: hidden;
    text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background:
        radial-gradient(600px 200px at 50% 0%, rgba(212,175,55,.14), transparent 70%),
        var(--surface);
}
.cta-glow {
    position: absolute; top: -60%; inset-inline-start: 50%; transform: translateX(-50%);
    width: 480px; height: 480px; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,.18), transparent 60%);
    filter: blur(50px); animation: orb-float 10s ease-in-out infinite;
}
.cta-title { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin: 0 0 1rem; position: relative; }
.cta-body { color: var(--text-muted); max-width: 620px; margin: 0 auto 1.8rem; position: relative; }

/* ---------- Article ---------- */

.article-header { text-align: center; margin-bottom: 2.4rem; }
.article-title { font-size: clamp(1.8rem, 4.4vw, 2.8rem); margin: .8rem 0; line-height: 1.3; }
.article-lead { color: var(--text-muted); font-size: 1.1rem; }
.article-figure { margin: 0 0 2.2rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.article-body { font-size: 1.05rem; }

.prose { color: var(--text); }
.prose h1, .prose h2, .prose h3 { line-height: 1.4; margin: 1.8em 0 .6em; }
.prose h2 { font-size: 1.5rem; font-weight: 800; }
.prose h3 { font-size: 1.2rem; font-weight: 700; }
.prose p { margin: 0 0 1.1em; color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose blockquote {
    margin: 1.4em 0; padding: .8em 1.4em;
    border-inline-start: 3px solid var(--gold);
    background: var(--surface); border-radius: var(--radius-sm);
    color: var(--text);
}
.prose img { border-radius: var(--radius-sm); margin: 1.2em 0; }
.prose ul, .prose ol { padding-inline-start: 1.6em; color: var(--text-muted); }
.prose code { background: var(--surface-2); padding: .15em .5em; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1em; overflow-x: auto; }

.tag-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }

/* ---------- Gallery ---------- */

.gallery-grid { gap: 1rem; }
.gallery-item { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .5s var(--ease); }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
    position: absolute; inset-inline: 0; bottom: 0;
    padding: 2rem .9rem .7rem;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
    color: #fff; font-size: .85rem;
}

/* ---------- Video ---------- */

.video-frame {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); aspect-ratio: 16/9; background: #000;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.block-video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Auth ---------- */

.auth-section { display: grid; place-items: center; min-height: 70vh; }
.auth-card {
    width: min(430px, 92%);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 2.4rem 2.2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.auth-title { font-size: 1.35rem; margin: 0 0 1.6rem; }
.auth-alt { display: inline-block; margin-top: 1.2rem; font-size: .88rem; color: var(--text-muted); }
.auth-alt:hover { color: var(--gold-bright); }

.form { display: flex; flex-direction: column; gap: 1.1rem; text-align: start; }
.form-field { display: flex; flex-direction: column; gap: .45rem; }
.form-label { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.form-input {
    width: 100%; padding: .8rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.form-input:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}
.form-input.has-error { border-color: #e5484d; }
.form-input.otp-input { text-align: center; font-size: 1.6rem; letter-spacing: .6em; direction: ltr; }
.form-error { color: #e5484d; font-size: .82rem; margin: 0; }

.alert {
    padding: .85rem 1.2rem; border-radius: var(--radius-sm);
    margin-bottom: 1.2rem; font-size: .92rem;
}
.alert-success { background: rgba(70,180,120,.12); border: 1px solid rgba(70,180,120,.35); color: #7ce0a7; }
.alert-info { background: var(--gold-soft); border: 1px solid var(--border-strong); color: var(--gold-bright); }

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.6rem 0 2rem;
    margin-top: 3rem;
    background: color-mix(in srgb, var(--bg-2) 70%, transparent);
}
.footer-inner { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: .55rem; }
.footer-social { display: flex; gap: 1rem; margin-inline-start: auto; }
.social-link { color: var(--text-muted); font-size: .9rem; }
.social-link:hover { color: var(--gold-bright); }
.footer-copy { width: 100%; text-align: center; color: var(--text-faint); font-size: .82rem; margin: 1.4rem 0 0; }
.footer-dot { margin: 0 .5rem; color: var(--gold); }

/* ---------- Pagination ---------- */

.pagination-wrap { display: flex; justify-content: center; margin-top: 2.5rem; }
.pagination { display: flex; gap: .4rem; }
.page-link {
    min-width: 42px; height: 42px; display: inline-grid; place-items: center;
    border-radius: 10px; border: 1px solid var(--border);
    color: var(--text-muted); font-weight: 600;
    transition: all .25s var(--ease);
}
.page-link:hover:not(.disabled) { border-color: var(--gold); color: var(--gold-bright); transform: translateY(-2px); }
.page-link.active { background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep)); color: #151204; border-color: transparent; }
.page-link.disabled { opacity: .35; cursor: default; }

/* ---------- Reveal on scroll ---------- */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .orb, .gold-text, .cta-glow { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    /* "3-bar" pinned to the opposite edge of the brand, mirroring the desktop nav */
    .nav-burger { display: inline-flex; margin-inline-start: auto; }

    /* Navigation slides up as a bottom sheet: rounded, draggable, thumb sized */
    .main-nav {
        position: fixed; inset-inline: 0; top: auto; bottom: 0; z-index: 49;
        flex-direction: column; align-items: stretch; gap: .3rem;
        max-height: min(86dvh, 620px);
        overflow-y: auto; overscroll-behavior: contain;
        background: color-mix(in srgb, var(--bg-2) 97%, transparent);
        border-top: 1px solid var(--border-strong);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
        padding: .4rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
        transform: translateY(102%); visibility: hidden;
        transition: transform .45s var(--ease), visibility .45s;
    }
    .main-nav.open { transform: none; visibility: visible; }
    .main-nav.dragging { transition: none; }

    /* Padded hit area with a thin bar painted in the content box, so the grab
       target stays comfortable while the handle looks like a handle */
    .nav-grabber {
        display: block; flex: none; width: 46px; height: 26px; margin: .1rem auto .3rem;
        padding: 11px 0; background: var(--border-strong); background-clip: content-box;
        border-radius: 999px; cursor: grab; touch-action: none;
    }

    /* Page behind the sheet */
    .nav-scrim {
        display: block; position: fixed; inset: 0; z-index: 48;
        background: rgba(4, 4, 9, .6);
        backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
        opacity: 0; pointer-events: none;
        transition: opacity .35s var(--ease);
    }
    .nav-scrim.open { opacity: 1; pointer-events: auto; }

    /* The player would sit on top of the sheet */
    body.nav-open .music-player, body.nav-open .music-fab { opacity: 0; pointer-events: none; }

    .nav-link {
        display: flex; align-items: center; min-height: 3rem; padding: .85rem 1rem;
    }
    /* Utilities and the account action share one row instead of stacking */
    .nav-actions { width: 100%; gap: .5rem; padding-top: .5rem; }
    .nav-actions .btn { min-height: 44px; }
    .nav-actions .icon-btn { width: 44px; height: 44px; }
    .nav-actions > .btn, .nav-actions .inline-form { flex: 1; }
    .nav-actions .inline-form { display: flex; }
    .nav-actions .inline-form .btn { width: 100%; }
    .nav-spacer { display: none; }
    .footer-social { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .main-nav, .nav-scrim { transition: none; }
}