:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #171717;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #ffffff;
    --muted: #a3a3a3;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { font-family: 'Vazirmatn', system-ui, sans-serif; }

html { scroll-padding-top: 5.5rem; }

body {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #525252; }

::selection { background: #fff; color: #0a0a0a; }

:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: fixed;
    top: -4rem;
    right: 1rem;
    z-index: 100;
    background: #fff;
    color: #0a0a0a;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Typography ---------- */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.eyebrow::before {
    content: '';
    width: 2rem;
    height: 1px;
    background: currentColor;
}
.eyebrow-center::after {
    content: '';
    width: 2rem;
    height: 1px;
    background: currentColor;
}

.display-title {
    font-size: clamp(2.25rem, 6.4vw, 4.75rem);
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.section-title {
    font-size: clamp(1.7rem, 3.6vw, 2.75rem);
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.lead {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 2;
    text-wrap: pretty;
}

.prose-fa {
    color: #d4d4d4;
    font-size: 1.05rem;
    line-height: 2.25;
    white-space: pre-line;
    text-wrap: pretty;
}

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

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    transition: transform 0.25s var(--ease), background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary:active,
.btn-outline:active { transform: scale(0.97); }

.btn-primary {
    background: #fff;
    color: #0a0a0a;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 12px 32px -12px rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
    background: #e5e5e5;
    box-shadow: 0 0 0 1px #fff, 0 16px 40px -12px rgba(255, 255, 255, 0.5);
}

.btn-outline {
    border: 1px solid var(--line-strong);
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
}
.btn-outline:hover {
    background: #fff;
    color: #0a0a0a;
    border-color: #fff;
}

.btn-primary svg,
.btn-outline svg { transition: transform 0.25s var(--ease); }
.btn-primary:hover .icon-arrow,
.btn-outline:hover .icon-arrow { transform: translateX(-4px); }

/* ---------- Surfaces ---------- */

.card {
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}

.card-hover { transition: transform 0.45s var(--ease), border-color 0.3s ease, box-shadow 0.45s var(--ease); }
.card-hover:hover {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

.card-invert {
    background: #fff;
    color: #0a0a0a;
    border-color: #fff;
    box-shadow: 0 30px 80px -30px rgba(255, 255, 255, 0.25);
}

.icon-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    color: #fff;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.card-hover:hover .icon-tile { background: #fff; color: #0a0a0a; }

.filter-pill {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0.55rem 1.15rem;
    color: #d4d4d4;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.filter-pill:hover { border-color: #fff; color: #fff; }
.filter-pill.is-active { background: #fff; border-color: #fff; color: #0a0a0a; }
[hidden] { display: none !important; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e5e5e5;
}
.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #737373;
}
.status-dot.is-open {
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

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

#header {
    transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
    border-bottom: 1px solid transparent;
}
#header.is-scrolled,
#header.mobile-menu-open {
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(18px) saturate(140%);
    border-bottom-color: var(--line);
}

.nav-link {
    position: relative;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.25s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0;
    height: 1.5px;
    background: #fff;
    transition: width 0.3s var(--ease);
}
.nav-link:hover,
.nav-link.nav-active { color: #fff; }
.nav-link.nav-active::after,
.nav-link:hover::after { width: 100%; }

.hamburger-line { transition: all 0.3s ease; }
.hamburger-active .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger-active .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.45s var(--ease), opacity 0.25s ease;
}
.mobile-menu.open {
    max-height: calc(100vh - 5rem);
    opacity: 1;
    pointer-events: auto;
}
.mobile-menu-panel { padding: 0.75rem 0 1.25rem; }
.mobile-nav-link {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0 1rem;
    border-radius: 0.9rem;
    color: #d4d4d4;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

body.menu-open { overflow: hidden; }

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

.hero { min-height: min(100svh, 58rem); }
.hero-media img { filter: grayscale(1) contrast(1.05); }
.hero-overlay {
    background:
        linear-gradient(270deg, rgba(10, 10, 10, 0.75) 0%, rgba(10, 10, 10, 0.35) 70%, rgba(10, 10, 10, 0.15) 100%),
        linear-gradient(180deg, rgba(10, 10, 10, 0.6) 0%, rgba(10, 10, 10, 0.55) 50%, var(--bg) 100%);
}
.grain::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stat-row > * { padding-inline: 1.25rem; border-inline-start: 1px solid var(--line); }
.stat-row > :nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
@media (min-width: 640px) {
    .stat-row > * { padding-inline: 1.75rem; }
    .stat-row > :nth-child(odd) { padding-inline-start: 1.75rem; border-inline-start: 1px solid var(--line); }
    .stat-row > :first-child { padding-inline-start: 0; border-inline-start: 0; }
}
.counter { font-variant-numeric: tabular-nums; }

.scroll-hint {
    width: 1.5rem;
    height: 2.4rem;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    display: flex;
    justify-content: center;
    padding-top: 0.4rem;
}
.scroll-hint::before {
    content: '';
    width: 3px;
    height: 7px;
    border-radius: 3px;
    background: #fff;
    animation: scroll-hint 1.8s infinite;
}
@keyframes scroll-hint {
    0% { transform: translateY(0); opacity: 1; }
    80%, 100% { transform: translateY(12px); opacity: 0; }
}

/* ---------- Marquee ---------- */

.marquee {
    overflow: hidden;
    border-block: 1px solid var(--line);
    background: var(--surface);
    direction: ltr;
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 1.1rem 1.25rem;
    direction: rtl;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 800;
    color: #d4d4d4;
}
.marquee-group i { color: #525252; font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

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

.bento {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 10.5rem;
    grid-auto-flow: dense;
    gap: 0.75rem;
}
.bento > :nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
.bento > :nth-child(6n) { grid-column: span 2; }
@media (min-width: 1024px) {
    .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 15rem; gap: 1rem; }
    .bento > :nth-child(6n + 4),
    .bento > :nth-child(6n + 5) { grid-column: span 2; }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    border: 1px solid var(--line);
    background: var(--surface-2);
    cursor: zoom-in;
    padding: 0;
    text-align: right;
}
.gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease), filter 0.6s ease;
}
.gallery-item figcaption,
.gallery-item .gallery-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.5rem 1rem 0.9rem;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
}
@media (hover: hover) {
    .gallery-item img { filter: grayscale(1); }
    .gallery-item:hover img,
    .gallery-item:focus-visible img { transform: scale(1.06); filter: grayscale(0); }
}

.lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: min(92vw, 64rem);
    max-height: 92vh;
    color: #fff;
    overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(6px); }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 1.25rem; margin: 0 auto; display: block; }

/* ---------- Video reel (ویدئوی عمودی مقاله) ---------- */

.post-layout { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) {
    .post-layout { grid-template-columns: 21rem minmax(0, 1fr); gap: 3.5rem; align-items: start; }
    .post-layout .reel-col { position: sticky; top: 6.5rem; }
    .post-layout.is-landscape { grid-template-columns: minmax(0, 1fr); }
    .post-layout.is-landscape .reel-col { position: static; }
}

.reel {
    position: relative;
    width: 100%;
    max-width: 21rem;
    margin-inline: auto;
}
.is-landscape .reel { max-width: 100%; }

.reel-glow {
    position: absolute;
    inset: 6% -8% -6%;
    background-size: cover;
    background-position: center;
    filter: blur(48px) saturate(1.3);
    opacity: 0.45;
    border-radius: 3rem;
    pointer-events: none;
    transition: opacity 0.6s ease;
}
.reel.is-playing .reel-glow { opacity: 0.7; }

.reel-frame {
    position: relative;
    aspect-ratio: 9 / 16;
    max-height: 82svh;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 2rem;
    border: 1px solid var(--line-strong);
    background: #000;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    cursor: pointer;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
}
.reel-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}
.reel-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 22%, transparent 68%, rgba(0, 0, 0, 0.7) 100%);
    transition: opacity 0.4s ease;
}

.reel-play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}
.reel-play span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.75rem;
    height: 4.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.14), 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.35s var(--ease);
}
.reel-play svg { width: 1.75rem; height: 1.75rem; fill: currentColor; margin-inline-start: -3px; }
.reel-frame:hover .reel-play span { transform: scale(1.08); }
.reel.is-playing .reel-play { opacity: 0; }

.reel-top,
.reel-bottom {
    position: absolute;
    inset-inline: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem;
    pointer-events: none;
}
.reel-top { top: 0; }
.reel-bottom { bottom: 0.9rem; direction: ltr; }
.reel-top > *,
.reel-bottom > * { pointer-events: auto; }

.reel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.reel-badge svg { width: 0.85rem; height: 0.85rem; }

.reel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    transition: background-color 0.2s ease, transform 0.2s var(--ease);
}
.reel-btn:hover { background: rgba(255, 255, 255, 0.22); }
.reel-btn:active { transform: scale(0.92); }
.reel-btn svg { width: 1.1rem; height: 1.1rem; }
.reel-btn .icon-off,
.reel.is-muted .reel-btn .icon-on { display: none; }
.reel.is-muted .reel-btn .icon-off { display: block; }

.reel-progress {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 4;
    height: 1.1rem;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    direction: ltr;
    touch-action: none;
}
.reel-progress::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.22);
}
.reel-progress span {
    position: relative;
    display: block;
    width: 0;
    height: 3px;
    background: #fff;
    transition: height 0.2s ease;
}
.reel-progress:hover span,
.reel-progress:hover::before { height: 6px; }

.video-badge {
    position: absolute;
    top: 0.9rem;
    inset-inline-start: 0.9rem;
    z-index: 2;
}

/* ---------- Forms ---------- */

.field-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #d4d4d4;
    font-size: 0.82rem;
    font-weight: 600;
}
.field {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 1rem;
    background: rgba(10, 10, 10, 0.7);
    padding: 0.85rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field::placeholder { color: #737373; }
.field:hover { border-color: rgba(255, 255, 255, 0.3); }
.field:focus {
    border-color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    background: #0a0a0a;
}
.field.input-validation-error { border-color: #fb7185; }
.field-error { display: block; margin-top: 0.4rem; color: #fda4af; font-size: 0.75rem; }
.field-error:empty { display: none; }

input, select, textarea { color-scheme: dark; }

/* ---------- Misc ---------- */

.hours-row.is-today { background: #fff; color: #0a0a0a; border-color: #fff; }
.hours-row.is-today .hours-time { color: #404040; }

.mobile-cta {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 0.6rem;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
}
@media (min-width: 768px) { .mobile-cta { display: none; } }
@media (max-width: 767.98px) {
    body.has-mobile-cta { padding-bottom: 4.6rem; }
    body.has-mobile-cta #scrollTopBtn { display: none; }
}

.footer-wordmark {
    font-size: clamp(2.75rem, 13vw, 11rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    user-select: none;
}

/* ---------- Reveal animations (فقط وقتی JS فعال است پنهان می‌شوند) ---------- */

.js .fade-in,
.js .slide-right,
.js .slide-left {
    opacity: 0;
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .fade-in { transform: translateY(28px); }
.js .slide-right { transform: translateX(40px); }
.js .slide-left { transform: translateX(-40px); }
.js .fade-in.visible,
.js .slide-right.visible,
.js .slide-left.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js .fade-in,
    .js .slide-right,
    .js .slide-left { opacity: 1; transform: none; }
}
