/* ===== Reset & Base ===== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --glass-bg: rgba(255,255,255,0.12);
    --glass-border: rgba(255,255,255,0.25);
    --neon: #00f5ff;
    --primary: #1286b8;
    --secondary: #54005c;
}

html, body {
    font-family: 'Nazanin', sans-serif;
    background: linear-gradient(
        rgba(0,0,0,0.55),
        rgba(0,0,0,0.55)
    ), url(z.jpg) center / cover fixed no-repeat;
    min-height: 100%;
    width: 100%;
    margin: 0;
    direction: rtl;
}

body {
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 14px;
    z-index: 50;
    margin: clamp(10px, 3vw, 22px);
    padding: clamp(10px, 2.2vw, 14px);
    border-radius: clamp(18px, 4vw, 26px);
    background: rgba(8,12,22,0.58);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 18px 55px rgba(0,0,0,0.55);
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(0,245,255,0.85),
        rgba(0,119,255,0.18),
        rgba(255,255,255,0.22)
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 180% 180%;
    animation: headerBorder 9s ease-in-out infinite;
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.site-header::after {
    content: "";
    position: absolute;
    inset: -60% -30%;
    background:
        radial-gradient(circle at 12% 20%, rgba(0,245,255,0.22), transparent 55%),
        radial-gradient(circle at 74% 18%, rgba(0,119,255,0.16), transparent 52%),
        radial-gradient(circle at 72% 86%, rgba(255,255,255,0.12), transparent 60%);
    filter: blur(14px);
    opacity: 0.95;
    pointer-events: none;
    animation: headerGlow 10s ease-in-out infinite;
    z-index: 0;
}

@keyframes headerBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes headerGlow {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(1.5%, -1%, 0) scale(1.02); }
}

/* ===== Header Inner ===== */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    position: relative;
    z-index: 1;
}

.header-title {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.02rem, 4.2vw, 1.38rem);
    letter-spacing: clamp(4px, 1.1vw, 11px);
    text-transform: uppercase;
    line-height: 1;
    text-align: center;
    padding-inline: 92px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.95;
    user-select: none;
    pointer-events: none;
    text-shadow:
        0 0 16px rgba(0,245,255,0.36),
        0 0 46px rgba(0,245,255,0.14);
    z-index: 1;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .header-title {
        background: linear-gradient(
            90deg,
            rgba(255,255,255,0.92),
            rgba(0,245,255,0.95),
            rgba(255,255,255,0.92)
        );
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

/* ===== Logo ===== */
.logo {
    position: relative;
    z-index: 2;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow:
        0 10px 26px rgba(0,0,0,0.35),
        inset 0 0 0 1px rgba(0,245,255,0.12);
    overflow: hidden;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.logo:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.12);
    box-shadow:
        0 16px 34px rgba(0,0,0,0.45),
        inset 0 0 0 1px rgba(0,245,255,0.22);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.55));
}

.logo:focus-visible,
.hamburger:focus-visible,
nav#mobileMenu a:focus-visible {
    outline: 2px solid rgba(0,245,255,0.85);
    outline-offset: 3px;
}

/* ===== Layout ===== */
.container {
    padding: clamp(12px, 3vw, 24px);
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(14px, 2vw, 22px);
}

/* ===== Cards (Glassmorphism) ===== */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: clamp(14px, 3vw, 20px);
    color: #fff;
    box-shadow:
        0 20px 45px rgba(0,0,0,0.45);
    transition: all .35s ease;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 30px 70px rgba(0,0,0,0.6);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--neon), #0077ff);
    color: #000;
    padding: 12px 22px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(0,255,255,0.6);
    transition: all .3s ease;
}

.btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 35px rgba(0,255,255,0.9);
}

.btn.ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(0,255,255,0.6);
    box-shadow: none;
}

.btn.ghost:hover {
    background: rgba(0,255,255,0.18);
    box-shadow: 0 0 20px rgba(0,255,255,0.35);
}

/* ===== Music Player ===== */
.music-player audio {
    width: 100%;
    margin-top: 12px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,.5));
}

.playlist {
    list-style: none;
    padding: 0;
    margin-top: 14px;
}

.playlist li {
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    transition: all .25s ease;
}

.playlist li:hover {
    background: rgba(0,255,255,0.25);
    transform: translateX(-4px);
}

/* ===== News ===== */
.news article {
    background: rgba(0,0,0,0.25);
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 10px;
}

/* ===== Footer ===== */
footer {
    margin-top: 25px;
    text-align: center;
    padding: 18px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* ===== Hamburger ===== */
.hamburger {
    width: 48px;
    height: 48px;
    display: grid;
    place-content: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 2;
    appearance: none;
    -webkit-appearance: none;
    color: inherit;
    font: inherit;
    line-height: 1;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.hamburger span {
    width: 22px;
    height: 3px;
    border-radius: 4px;
    background: #fff;
    transform-origin: center;
    transition: transform .35s ease, opacity .2s ease;
}

.hamburger:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.12);
    border-color: rgba(0,245,255,0.35);
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== Mobile Menu ===== */
nav#mobileMenu {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(110%);
    width: min(82vw, 340px);
    max-width: 340px;
    height: 100%;
    background: linear-gradient(180deg, rgba(10,14,24,0.94), rgba(0,0,0,0.85));
    backdrop-filter: blur(18px);
    box-shadow: -20px 0 50px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    margin-inline-start: auto;
    padding: 92px 22px 22px;
    padding-top: calc(92px + env(safe-area-inset-top));
    gap: 16px;
    transition: transform .38s ease;
    z-index: 1000;
    border-left: 1px solid rgba(255,255,255,0.12);
    will-change: transform;
}

nav#mobileMenu a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

nav#mobileMenu a:hover {
    transform: translateX(-2px);
    background: rgba(0,245,255,0.16);
    border-color: rgba(0,245,255,0.35);
}

/* ===== Active Menu ===== */
nav#mobileMenu.active {
    transform: translateX(0);
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 900;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .hamburger,
    .hamburger span,
    .site-header::before,
    .site-header::after,
    nav#mobileMenu,
    nav#mobileMenu a,
    .menu-backdrop {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== Tablet ===== */
@media (min-width: 600px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Desktop ===== */
@media (min-width: 900px) {
    .hamburger {
        display: none;
    }

    nav#mobileMenu {
        position: relative;
        z-index: 2;
        top: auto;
        right: auto;
        transform: none;
        height: auto;
        width: auto;
        max-width: none;
        flex-direction: row;
        align-items: center;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0;
        border-left: 0;
        gap: 10px;
        will-change: auto;
    }

    nav#mobileMenu a {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.14);
        font-size: 0.98rem;
        margin-left: 0;
        padding: 9px 14px;
    }

    nav#mobileMenu a:hover {
        transform: translateY(-1px);
    }

    .menu-backdrop {
        display: none;
    }

    .header-title {
        padding-inline: 180px;
    }
}

@media (min-width: 1024px) {
    .site-header {
        max-width: 1100px;
        margin: 18px auto;
    }

    .container {
        max-width: 1200px;
        margin: auto;
        grid-template-columns: repeat(3, 1fr);
    }
}
