@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Cinzel+Decorative:wght@700&display=swap');

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

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

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

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

@font-face {
    font-family: 'IranianSans';
    src: url('../../fonts/Iranian-Sans.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --ph-obsidian: #171411;
    --ph-obsidian-deep: #0D0B0A;
    --ph-obsidian-soft: #1E1A16;
    --ph-stone: #272019;
    --ph-stone-surface: #2D251D;
    --ph-stone-elevated: #352C23;
    --ph-stone-border: #3D3227;
    --ph-stone-border-subtle: rgba(184, 154, 104, 0.15);

    --ph-gold: #C9A24A;
    --ph-gold-bright: #E1C56A;
    --ph-gold-muted: #8E7334;
    --ph-gold-dark: #634F24;
    --ph-gold-glow: rgba(201, 162, 74, 0.22);
    --ph-gold-halo: rgba(201, 162, 74, 0.08);
    --ph-gold-foil: linear-gradient(135deg, #C9A24A 0%, #E1C56A 50%, #B89A68 100%);
    --ph-gold-sheen: linear-gradient(90deg, rgba(201, 162, 74, 0) 0%, rgba(225, 197, 106, 0.35) 50%, rgba(201, 162, 74, 0) 100%);

    --ph-sand: #B89A68;
    --ph-sand-light: #CBB285;
    --ph-sand-dark: #7A6240;

    --ph-papyrus: #EFE2C2;
    --ph-papyrus-bright: #F7EEDB;
    --ph-text-secondary: #B9A889;
    --ph-text-muted: #8E8068;
    --ph-text-dim: #685E4D;

    --ph-blue: #1D5363;
    --ph-blue-deep: #12343F;
    --ph-blue-light: #2B7A91;
    --ph-blue-glow: rgba(29, 83, 99, 0.35);

    --ph-status-featured: #C9A24A;
    --ph-status-popular: #D9822B;
    --ph-status-new: #1D5363;
    --ph-status-soldout: #52473D;
    --ph-status-danger: #8E2B2B;

    --ph-font-display: 'Cinzel', 'Vazirmatn', Georgia, serif;
    --ph-font-royal: 'Cinzel Decorative', 'Cinzel', serif;
    --ph-font-body: 'Vazirmatn', 'IranianSans', Tahoma, sans-serif;

    --ph-header-h: 72px;
    --ph-nav-bottom-h: 68px;
    --ph-toc-h: 56px;
    --ph-radius-sm: 4px;
    --ph-radius-md: 8px;
    --ph-radius-lg: 14px;
    --ph-radius-cartouche: 28px;

    --ph-border-hairline: 1px solid rgba(201, 162, 74, 0.28);
    --ph-border-gold: 1px solid var(--ph-gold);
    --ph-border-gold-double: 3px double var(--ph-gold);
    --ph-border-stone: 1px solid var(--ph-stone-border);

    --ph-shadow-candlelight: 0 0 28px rgba(225, 197, 106, 0.08);
    --ph-shadow-tablet: 0 14px 34px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.5);
    --ph-shadow-elevated: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 16px rgba(201, 162, 74, 0.12);
    --ph-shadow-inset-stone: inset 0 2px 6px rgba(0, 0, 0, 0.4);

    --ph-ease-ceremony: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ph-transition-fast: 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    --ph-transition-smooth: 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
    --ph-transition-slow: 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);

    --np-header-h: var(--ph-header-h);
    --bn-header-h: var(--ph-header-h);
    --theme-gold: var(--ph-gold);
}

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

html {
    direction: rtl;
    text-align: right;
    background-color: var(--ph-obsidian);
    color: var(--ph-papyrus);
    font-family: var(--ph-font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body.ph-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--ph-obsidian);
    color: var(--ph-papyrus);
    font-family: var(--ph-font-body);
    position: relative;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(201, 162, 74, 0.07), transparent 70%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(29, 83, 99, 0.05), transparent 70%),
        url('../../images/decor/stone-grain.svg');
    background-attachment: fixed, fixed, fixed;
    background-repeat: no-repeat, no-repeat, repeat;
    padding-bottom: calc(var(--ph-nav-bottom-h) + 24px);
}

@media (min-width: 992px) {
    body.ph-body {
        padding-bottom: 0;
    }
}

.ph-chamber-env {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ph-chamber-env__pylon-left {
    position: absolute;
    top: 0;
    right: 0;
    width: 140px;
    height: 100%;
    background: linear-gradient(270deg, rgba(201, 162, 74, 0.015) 0%, transparent 100%);
    border-left: 1px dashed rgba(201, 162, 74, 0.06);
}

.ph-chamber-env__pylon-right {
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 100%;
    background: linear-gradient(90deg, rgba(201, 162, 74, 0.015) 0%, transparent 100%);
    border-right: 1px dashed rgba(201, 162, 74, 0.06);
}

.ph-chamber-env__frieze-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        rgba(201, 162, 74, 0) 0%,
        rgba(201, 162, 74, 0.4) 25%,
        rgba(225, 197, 106, 0.7) 50%,
        rgba(201, 162, 74, 0.4) 75%,
        rgba(201, 162, 74, 0) 100%
    );
}

.ph-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 16px;
}

@media (min-width: 768px) {
    .ph-container {
        padding-inline: 24px;
    }
}

.ph-section-head {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.ph-section-head .ph-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--ph-gold);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.ph-section-head .ph-kicker::before,
.ph-section-head .ph-kicker::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--ph-gold);
    opacity: 0.6;
}

.ph-section-head h2,
.ph-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ph-papyrus-bright);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.ph-section-head p {
    color: var(--ph-text-secondary);
    font-size: 0.9rem;
    margin: 0;
    max-width: 580px;
    margin-inline: auto;
}

.ph-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 28px 0;
    position: relative;
    user-select: none;
}

.ph-divider__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 74, 0.35) 60%, var(--ph-gold) 100%);
}

.ph-divider__line--right {
    background: linear-gradient(270deg, transparent, rgba(201, 162, 74, 0.35) 60%, var(--ph-gold) 100%);
}

.ph-divider__emblem {
    padding-inline: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ph-divider__emblem img {
    height: 18px;
    width: auto;
    filter: drop-shadow(0 0 4px var(--ph-gold-glow));
}

.ph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 22px;
    font-family: var(--ph-font-body);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ph-papyrus);
    background: var(--ph-stone-surface);
    border: 1px solid rgba(201, 162, 74, 0.4);
    border-radius: var(--ph-radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--ph-transition-fast);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.ph-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(201, 162, 74, 0.12);
    border-radius: calc(var(--ph-radius-md) - 1px);
    pointer-events: none;
}

.ph-btn:hover {
    color: var(--ph-gold-bright);
    background: var(--ph-stone-elevated);
    border-color: var(--ph-gold);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 14px var(--ph-gold-glow);
    transform: translateY(-1px);
}

.ph-btn:active {
    transform: translateY(0);
}

.ph-btn--primary,
.ph-btn--fill {
    background: linear-gradient(145deg, #2D251D 0%, #1E1812 100%);
    border: 1px solid var(--ph-gold);
    color: var(--ph-gold-bright);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(225, 197, 106, 0.25);
}

.ph-btn--primary:hover,
.ph-btn--fill:hover {
    background: linear-gradient(145deg, #3A3025 0%, #251E17 100%);
    border-color: var(--ph-gold-bright);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px var(--ph-gold-glow);
}

.ph-btn--gold {
    background: var(--ph-gold-foil);
    color: #171411;
    font-weight: 700;
    border: none;
    box-shadow: 0 6px 22px rgba(201, 162, 74, 0.35);
}

.ph-btn--gold:hover {
    background: linear-gradient(135deg, #E1C56A 0%, #F5DE88 50%, #C9A24A 100%);
    color: #0D0B0A;
    box-shadow: 0 8px 26px rgba(201, 162, 74, 0.5);
}

.ph-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: var(--ph-obsidian);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s var(--ph-ease-ceremony), visibility 0.5s var(--ph-ease-ceremony);
}

.ph-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ph-loader__stage {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
}

.ph-loader__mark {
    width: 64px;
    height: 64px;
    border: 2px solid var(--ph-gold);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ph-pulse-gold 2.4s infinite ease-in-out;
}

.ph-loader__mark::after {
    content: '';
    width: 38px;
    height: 38px;
    border: 1px dashed var(--ph-sand);
    border-radius: 50%;
    animation: ph-spin 12s linear infinite;
}

.ph-loader__text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ph-papyrus-bright);
    letter-spacing: 0.1em;
    margin: 0;
}

.ph-loader__hint {
    font-size: 0.82rem;
    color: var(--ph-text-secondary);
}

@keyframes ph-pulse-gold {
    0%, 100% {
        box-shadow: 0 0 10px rgba(201, 162, 74, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 28px rgba(201, 162, 74, 0.45);
        transform: scale(1.04);
    }
}

@keyframes ph-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.is-hidden {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--ph-gold);
    outline-offset: 3px;
}
