
/* ============================================================
   UNIT 9 — THEME TOKENS
   ============================================================ */
:root,
[data-theme="light"] {
    --bg: #eef1f8;
    --surface: #ffffff;
    --surface-2: #f6f8fd;
    --text: #0d1b3e;
    --muted: #5d6c8c;
    --border: rgba(13, 27, 62, .10);
    --gold: #b8912f;
    --gold-2: #d9b451;
    --gold-soft: rgba(184, 145, 47, .12);
    --navy: #0d1b3e;
    --shadow: 0 10px 30px rgba(13, 27, 62, .09);
    --shadow-lg: 0 24px 60px rgba(13, 27, 62, .16);
    --folder: #fdfcf6;
    --folder-2: #ffffff;
    --folder-line: rgba(13, 27, 62, .055);
    --glass: rgba(255, 255, 255, .62);
    --header-bg: rgba(255, 255, 255, .78);
    --footer-bg: #ffffff;
    --pattern: rgba(13, 27, 62, .045);
    --pattern-2: rgba(13, 27, 62, .022);
    --glow: rgba(184, 145, 47, .28);
    --backdrop: rgba(8, 14, 32, .55);
}

[data-theme="dark"] {
    --bg: #070d1f;
    --surface: #0f1b3d;
    --surface-2: #14224b;
    --text: #e9eefb;
    --muted: #94a3c4;
    --border: rgba(212, 175, 55, .16);
    --gold: #d4af37;
    --gold-2: #f2d97e;
    --gold-soft: rgba(212, 175, 55, .12);
    --navy: #0a1230;
    --shadow: 0 14px 40px rgba(0, 0, 0, .5);
    --shadow-lg: 0 26px 70px rgba(0, 0, 0, .6);
    --folder: #101c40;
    --folder-2: #0c1635;
    --folder-line: rgba(212, 175, 55, .065);
    --glass: rgba(20, 34, 75, .45);
    --header-bg: rgba(7, 13, 31, .72);
    --footer-bg: #0a1230;
    --pattern: rgba(212, 175, 55, .055);
    --pattern-2: rgba(120, 160, 255, .03);
    --glow: rgba(212, 175, 55, .45);
    --backdrop: rgba(2, 5, 14, .78);
}

/* ============================================================
   BASE
   ============================================================ */
* {
    -webkit-tap-highlight-color: transparent;
    -moz-font-feature-settings: "ss01";
    -webkit-font-feature-settings: "ss01";
    font-feature-settings: "ss01";
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    background-color: var(--bg);
    background-image: /* radial-gradient(ellipse 70% 55% at 12% -8%, var(--glow), transparent 60%), */ radial-gradient(ellipse 70% 55% at 90% 108%, rgba(40, 80, 180, .20), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 26px, var(--pattern-2) 26px 27px),
    linear-gradient(var(--pattern) 1px, transparent 1px),
    linear-gradient(90deg, var(--pattern) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, auto, 58px 58px, 58px 58px;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color .45s ease, color .45s ease;
}

.ss01 {
    -moz-font-feature-settings: "ss01";
    -webkit-font-feature-settings: "ss01";
    font-feature-settings: "ss01";
}

.ss02 {
    -moz-font-feature-settings: "ss02";
    -webkit-font-feature-settings: "ss02";
    font-feature-settings: "ss02";
}

.ss03 {
    -moz-font-feature-settings: "ss03";
    -webkit-font-feature-settings: "ss03";
    font-feature-settings: "ss03";
}

.ss04 {
    -moz-font-feature-settings: "ss04";
    -webkit-font-feature-settings: "ss04";
    font-feature-settings: "ss04";
}

body, .site-header, .site-footer, .stat-card, .staff-card,
.folder-body, .case-back, .modal-content, .chip, .theme-toggle,
.access-badge, .prefooter-card, .btn-gold, .btn-ghost, .section-title {
    transition: background-color .45s ease, color .45s ease,
    border-color .45s ease, box-shadow .45s ease;
}

::selection {
    background: var(--gold);
    color: #0a1230;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -.01em;
}

a {
    text-decoration: none;
}

.container {
    padding-inline: clamp(14px, 4vw, 24px);
}

.gold {
    color: var(--gold) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--gold), rgba(212, 175, 55, .4));
    border-radius: 99px;
    border: 3px solid var(--bg);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--header-bg);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 70px;
    flex-wrap: wrap;
}

/* Logo */
.logo-badge {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: #0a1230;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset,
    0 6px 18px rgba(0, 0, 0, .28);
    isolation: isolate;
    cursor: pointer;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.logo-badge:hover {
    transform: scale(1.06) rotate(-4deg);
}

.logo-badge::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 25%, var(--gold) 45%, transparent 60% 100%);
    filter: blur(7px);
    opacity: .85;
    z-index: -1;
    animation: logoGlow 3.4s linear infinite;
}

.logo-badge::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, .5);
    animation: logoPulse 2.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes logoGlow {
    to {
        transform: rotate(360deg);
    }
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: .65;
    }
    50% {
        transform: scale(1.18);
        opacity: 0;
    }
}

/* Nav */
.main-nav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .15rem;
}

.main-nav a {
    position: relative;
    padding: .5rem .85rem;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    transition: color .25s ease, background .25s ease;
}

.main-nav a:hover {
    color: var(--gold);
    background: var(--gold-soft);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 50%;
    transform: translateX(50%) scaleX(0);
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
    transition: transform .3s ease;
}

.main-nav a:hover::after {
    transform: translateX(50%) scaleX(1);
}

/* Theme switch */
.theme-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 29px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: 0;
    cursor: pointer;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .10);
}

.theme-toggle .thumb {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    box-shadow: 0 0 14px var(--glow), 0 2px 6px rgba(0, 0, 0, .3);
    transition: transform .5s cubic-bezier(.4, 1.4, .5, 1), background .4s ease;
}

[data-theme="dark"] .theme-toggle .thumb {
    transform: translateX(-25px);
}

@media (max-width: 768px) {

    .theme-toggle {
        margin-right: auto;
    }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    padding: clamp(38px, 7vw, 74px) 0 clamp(22px, 4vw, 34px);
    text-align: center;
}

.hero-title {
    font-size: clamp(2.3rem, 7vw, 4.1rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 .55rem;
    background: linear-gradient(180deg, var(--text) 30%, var(--gold) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.02em;
}

.hero-title .num {
    background: linear-gradient(160deg, var(--gold-2), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    max-width: 620px;
    margin: 0 auto 1.6rem;
    color: var(--muted);
    font-size: clamp(.9rem, 2.2vw, 1.02rem);
    line-height: 2;
}

/* Access badge */
.access-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1.25rem .55rem 1.1rem;
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid var(--border);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .14);
    overflow: hidden;
    isolation: isolate;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
}

.access-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
    transparent 28%,
    rgba(255, 255, 255, .30) 45%,
    rgba(212, 175, 55, .42) 52%,
    rgba(255, 255, 255, .18) 58%,
    transparent 74%);
    transform: translateX(-130%);
    animation: shimmer 5.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-130%);
    }
    55% {
        transform: translateX(130%);
    }
    100% {
        transform: translateX(130%);
    }
}

.access-badge .eye {
    position: relative;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold);
    flex: 0 0 auto;
}

.access-badge .eye svg {
    animation: blink 3.4s infinite;
    transform-origin: center;
}

.access-badge .eye::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    opacity: 0;
    animation: eyeRing 3.4s infinite;
}

@keyframes blink {
    0%, 88%, 100% {
        transform: scaleY(1);
    }
    93% {
        transform: scaleY(.12);
    }
}

@keyframes eyeRing {
    0%, 88%, 100% {
        transform: scale(1);
        opacity: 0;
    }
    92% {
        transform: scale(1.55);
        opacity: .6;
    }
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section {
    padding: clamp(38px, 6vw, 68px) 0;
    scroll-margin-top: 88px;
}

.section-head {
    text-align: center;
    margin-bottom: clamp(22px, 4vw, 38px);
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: .6rem;
}

.section-kicker::before,
.section-kicker::after {
    content: '';
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.section-kicker::after {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.section-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin: 0 0 .5rem;
}

.section-desc {
    color: var(--muted);
    font-size: .9rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.9;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(12px, 2vw, 18px);
}

.stat-card {
    position: relative;
    text-align: center;
    padding: 26px 16px 22px;
    border-radius: 20px;
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.34, 1.3, .64, 1), box-shadow .35s ease, background-color .45s ease, border-color .45s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--gold-soft), transparent 70%);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--border);
}

.stat-value {
    font-size: clamp(1.5rem, 4vw, 1.95rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

.stat-value small {
    font-size: .6em;
    color: var(--gold);
}

.stat-label {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 6px;
    font-weight: 600;
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-bottom: clamp(22px, 4vw, 36px);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .95rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all .28s cubic-bezier(.34, 1.3, .64, 1), background-color .45s ease, border-color .45s ease;
}

.chip:hover {
    color: var(--gold);
    border-color: var(--gold);
    transform: translateY(-2px);
}

.chip .cnt {
    font-size: .68rem;
    padding: .05rem .45rem;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 700;
}

.chip.active {
    color: #0a1230;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    border-color: transparent;
    box-shadow: 0 8px 22px var(--glow);
}

.chip.active .cnt {
    background: rgba(10, 18, 48, .18);
    color: #0a1230;
}

/* ============================================================
   CASE CARDS (folders)
   ============================================================ */
.cases-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(215px, 1fr));
    gap: clamp(16px, 2.4vw, 26px);
    align-items: start;
}

.case-card {
    position: relative;
    padding-top: 22px;
    perspective: 1600px;
    cursor: pointer;
    outline: none;
    transition: transform .3s ease, opacity .3s ease;
}

.case-card:focus-visible .folder-body,
.case-card:focus-visible .case-back {
    box-shadow: 0 0 0 3px var(--glow), var(--shadow);
}

.case-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.414;
    transform-style: preserve-3d;
    transition: transform .8s cubic-bezier(.4, .15, .2, 1);
    will-change: transform;
}

@media (hover: hover) {
    .case-card:hover .case-inner {
        transform: rotateY(180deg);
    }
}

.case-card.is-flipped .case-inner {
    transform: rotateY(180deg);
}

.case-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

/* ---- FRONT ---- */
.case-front {
    overflow: visible;
}

.folder-tab {
    position: absolute;
    top: -22px;
    right: 20px;
    height: 22px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, var(--folder-2), var(--folder));
    border: 1px solid var(--border);
    border-bottom: none;
    color: var(--gold);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .09em;
    white-space: nowrap;
    z-index: 2;
}

.folder-body {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    overflow: hidden;
    background-color: var(--folder);
    /*background-image:repeating-linear-gradient(
      to bottom,
      transparent 0 26px,
      var(--folder-line) 26px 27px
    );*/
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
}

.folder-body::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 60px;
    background: linear-gradient(180deg, var(--gold-soft), transparent);
    pointer-events: none;
}

.folder-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 16px 14px 14px;
    text-align: center;
    gap: .35rem;
}

.genre-chip {
    display: inline-flex;
    align-items: center;
    align-self: center;
    padding: .16rem .65rem;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.case-title {
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.5;
    margin: .3rem 0 0;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-desc {
    font-size: .7rem;
    line-height: 1.85;
    color: var(--muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-stats {
    margin-top: auto;
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 5px 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.cs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .66rem;
    gap: .2rem;
    padding: .22rem .45rem;
    border-radius: 7px;
    background: var(--gold-soft);
}

.cs-row span {
    color: var(--muted);
}

.cs-row b {
    color: var(--gold);
    font-weight: 800;
}

/* ---- BACK ---- */
.case-back {
    transform: rotateY(180deg);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: #0b1430;
}

.case-poster {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background-color: #0b1430;
    background-image: radial-gradient(circle at 50% 36%, rgba(212, 175, 55, .20), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(212, 175, 55, .07) 44px 45px),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(212, 175, 55, .07) 44px 45px),
    linear-gradient(165deg, #0d1836 0%, #17264f 100%);
    background-size: cover;
    background-position: center;
}

.case-poster::after {
    content: '9';
    font-size: 5.4rem;
    font-weight: 800;
    transform:translateY(-35%);
    color: rgba(212, 175, 55, .5);
    text-shadow: 0 0 40px rgba(212, 175, 55, .5);
    line-height: 1;
}

@media (max-width: 410px) {
    .case-poster::after {
        transform:translateY(-60%);
    }
}

.case-poster.has-image::after {
    display: none;
}

.back-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px 14px;
    text-align: center;
    gap: .35rem;
    background: linear-gradient(to top,
    rgba(4, 8, 22, .96) 0%,
    rgba(4, 8, 22, .80) 28%,
    rgba(4, 8, 22, .35) 55%,
    rgba(4, 8, 22, 0) 78%);
    color: #fff;
}

.back-overlay .genre-chip {
    align-self: center;
    color: var(--gold-2);
    background: rgba(212, 175, 55, .16);
    border-color: rgba(212, 175, 55, .4);
}

.back-overlay h3 {
    font-size: .95rem;
    margin: .15rem 0 0;
    color: #fff;
    font-weight: 800;
}

.back-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .3rem .5rem;
    font-size: .65rem;
    color: rgba(255, 255, 255, .78);
}

.back-meta span {
    padding: .15rem .5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
}

/* filter animation */
.cases-grid.is-filtering .case-card {
    transform: scale(.88);
    opacity: .25;
}

.cases-grid.is-filtered .case-card {
    animation: popUp .42s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes popUp {
    0% {
        transform: scale(.86);
        opacity: 0;
    }
    60% {
        transform: scale(1.02);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* CSS-only filtering */
.cases-grid[data-filter="murder"] .case-card:not([data-genre="murder"]),
.cases-grid[data-filter="theft"] .case-card:not([data-genre="theft"]),
.cases-grid[data-filter="mystery"] .case-card:not([data-genre="mystery"]),
.cases-grid[data-filter="espionage"] .case-card:not([data-genre="espionage"]),
.cases-grid[data-filter="fraud"] .case-card:not([data-genre="fraud"]),
.cases-grid[data-filter="missing"] .case-card:not([data-genre="missing"]) {
    display: none;
}

/* ============================================================
   STAFF
   ============================================================ */
.staff-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
    gap: clamp(14px, 2vw, 20px);
}

.staff-card {
    text-align: center;
    padding: 24px 16px 20px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform .35s cubic-bezier(.34, 1.3, .64, 1), box-shadow .35s ease, background-color .45s ease, border-color .45s ease;
}

.staff-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.staff-avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 5px var(--gold-soft), 0 10px 26px rgba(0, 0, 0, .2);
    background: #0d1836;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.staff-name {
    font-size: .95rem;
    font-weight: 800;
    margin: 0 0 .3rem;
}

.staff-rank {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .68rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--border);
    padding: .18rem .65rem;
    border-radius: 999px;
    margin-bottom: .5rem;
}

.staff-role {
    font-size: .76rem;
    color: var(--muted);
    margin-bottom: .85rem;
}

.staff-contact {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding-top: .75rem;
    border-top: 1px dashed var(--border);
}

.staff-contact a, .staff-contact span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    font-size: .7rem;
    color: var(--muted);
    direction: ltr;
    word-break: break-all;
    transition: color .25s ease;
}

.staff-contact a:hover {
    color: var(--gold);
}

.staff-contact svg {
    flex: 0 0 auto;
    color: var(--gold);
}

/* ============================================================
   PRE-FOOTER CTA
   ============================================================ */
.prefooter-card {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    padding: clamp(30px, 5vw, 54px) clamp(20px, 4vw, 48px);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.prefooter-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 85% 15%, var(--gold-soft), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 34px, var(--folder-line) 34px 35px),
    repeating-linear-gradient(90deg, transparent 0 34px, var(--folder-line) 34px 35px);
    pointer-events: none;
}

.pf-number {
    position: absolute;
    left: clamp(-10px, 1vw, 10px);
    top: 50%;
    transform: translateY(-2.5%);
    font-size: clamp(9rem, 26vw, 17rem);
    font-weight: 800;
    line-height: .8;
    color: var(--gold);
    opacity: .075;
    pointer-events: none;
    user-select: none;
}

.prefooter-card > * {
    position: relative;
    z-index: 1;
}

.prefooter-card h2 {
    font-size: clamp(1.2rem, 3.4vw, 1.7rem);
    margin-bottom: .75rem;
}

.prefooter-card p {
    color: var(--muted);
    font-size: .88rem;
    line-height: 2;
    max-width: 640px;
    margin: 0 auto 1.6rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1.7rem;
    border-radius: 999px;
    border: none;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 700;
    color: #0a1230;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    box-shadow: 0 10px 26px var(--glow);
    cursor: pointer;
    transition: transform .28s cubic-bezier(.34, 1.4, .64, 1), box-shadow .28s ease, filter .28s ease;
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px var(--glow);
    filter: brightness(1.06);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-gold.w-100 {
    width: 100%;
    border-radius: 14px;
    padding: .9rem;
    font-size: .92rem;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .62rem 1.35rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .28s ease;
}

.btn-ghost:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: clamp(36px, 6vw, 60px) 0 0;
    margin-top: clamp(30px, 6vw, 60px);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: .6;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.footer-brand .logo-badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.footer-brand span {
    font-size: 1.1rem;
    font-weight: 800;
}

.footer-about {
    color: var(--muted);
    font-size: .82rem;
    line-height: 2;
    max-width: 420px;
    margin: 0 auto 1.4rem;
    text-align: center;
}

.footer-title {
    font-size: .85rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    justify-content: center;
}

.footer-title::after {
    content: '';
    flex: 0 0 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    text-align: center;
}

.footer-links a {
    color: var(--muted);
    font-size: .8rem;
    transition: color .25s ease, padding .25s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: .75rem;
    padding: 0;
    margin: 0 0 .5rem;
    list-style: none;
}

.footer-badges li {
    display: inline-flex;
}

.badge-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform .3s cubic-bezier(.34, 1.4, .64, 1),
    border-color .3s ease,
    box-shadow .3s ease,
    background-color .45s ease;
}

.badge-card:hover,
.badge-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 10px 24px var(--glow);
    outline: none;
}

.badge-card img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: grayscale(.15);
    transition: filter .3s ease, transform .3s ease;
}

.badge-card:hover img,
.badge-card:focus-visible img {
    filter: grayscale(0);
    /*transform: scale(1.04);*/
}

/* کاهش اندازه در موبایل */
@media (max-width: 575.98px) {

    .badge-card img {
        width: 56px;
        height: 56px;
    }

    .footer-badges {
        gap: .5rem;
    }
}

.socials {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .6rem;
}

.social-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: all .3s cubic-bezier(.34, 1.4, .64, 1);
}

.social-btn:hover {
    color: #0a1230;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    border-color: transparent;
    transform: translateY(-4px) rotate(-4deg);
    box-shadow: 0 10px 24px var(--glow);
}

.footer-bottom {
    margin-top: clamp(24px, 4vw, 40px);
    padding: 1.1rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .74rem;
    color: var(--muted);
    line-height: 2;
}

.footer-bottom b {
    color: var(--gold);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-backdrop.show {
    opacity: .78;
    background: var(--backdrop);
}

.modal-body {
    padding: clamp(18px, 3.5vw, 30px);
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px clamp(18px, 3.5vw, 30px) 20px;
}

.modal-dialog {
    margin: clamp(10px, 3vw, 28px) auto;
}

/* case modal */
.case-poster-frame {
    position: relative;
    width: min(100%, 290px);
    margin: 0 auto;
    aspect-ratio: 1 / 1.414;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.case-poster-frame .case-poster {
    position: absolute;
    inset: 0;
}

.cm-title {
    font-size: clamp(1.1rem, 3.6vw, 1.5rem);
    margin: .5rem 0 .35rem;
}

.cm-caseid {
    display: inline-block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--border);
    padding: .2rem .75rem;
    border-radius: 999px;
    direction: ltr;
}

.cm-desc {
    font-size: .84rem;
    line-height: 2.1;
    color: var(--muted);
    margin: 1rem 0 1.2rem;
}

.cm-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.cm-item {
    padding: .7rem .8rem;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    text-align: center;
}

.cm-item .k {
    font-size: .66rem;
    color: var(--muted);
    margin-bottom: .25rem;
}

.cm-item .v {
    font-size: .88rem;
    font-weight: 800;
    color: var(--gold);
}

/* about modal */
.about-hero {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.2rem;
    border: 1px solid var(--border);
}

.about-hero .case-poster {
    position: absolute;
    inset: 0;
}

.about-hero .case-poster::after {
    font-size: 7rem;
}

.video-frame {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1.4rem;
    background: #000;
}

.timeline {
    position: relative;
    padding-inline-start: 26px;
    margin-top: 1.2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    inset-inline-start: 7px;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), transparent);
    border-radius: 2px;
}

.tl-item {
    position: relative;
    padding-bottom: 1.2rem;
    text-align: start;
}

.tl-item:last-child {
    padding-bottom: 0;
}

.tl-item::before {
    content: '';
    position: absolute;
    inset-inline-start: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-soft);
}

.tl-year {
    font-size: .72rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: .2rem;
}

.tl-text {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.95;
}

/* contact / terms */
.info-list {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    margin: 1rem 0;
}

.info-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem .9rem;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .82rem;
}

.info-row svg {
    color: var(--gold);
    flex: 0 0 auto;
}

.info-row span {
    direction: ltr;
}

.terms-text {
    font-size: .83rem;
    line-height: 2.15;
    color: var(--muted);
}

.terms-text h4 {
    font-size: .92rem;
    color: var(--text);
    margin: 1.2rem 0 .5rem;
}

.terms-text ul {
    padding-inline-start: 1.1rem;
    margin: 0 0 .8rem;
}

.terms-text li {
    margin-bottom: .4rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .pf-number {
        opacity: .05;
    }
}

@media (max-width: 767.98px) {
    .header-inner {
        min-height: 62px;
        gap: .6rem;
        padding-block: .5rem;
    }

    .main-nav {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: .35rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        padding: .42rem .7rem;
        font-size: .8rem;
    }

    .logo-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .cases-grid {
        grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .case-card {
        padding-top: 18px;
    }

    .folder-tab {
        top: -18px;
        height: 18px;
        font-size: .58rem;
        padding: 0 11px;
        right: 14px;
    }

    .folder-content {
        padding: 12px 10px 11px;
    }

    .case-title {
        font-size: .82rem;
    }

    .case-desc {
        font-size: .64rem;
        -webkit-line-clamp: 2;
    }

    .cs-row {
        font-size: .58rem;
        padding: .18rem .35rem;
    }

    .back-overlay {
        padding: 12px 10px;
    }

    .back-overlay h3 {
        font-size: .82rem;
    }

    .back-meta {
        font-size: .58rem;
    }

    .case-poster::after {
        font-size: 3.6rem;
    }

    .access-badge {
        font-size: .72rem;
        padding: .5rem 1rem .5rem .9rem;
    }

    .staff-grid {
        grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 400px) {
    .cases-grid {
        grid-template-columns:1fr 1fr;
        gap: 12px;
    }

    .case-title {
        font-size: .76rem;
    }

    .cs-row span {
        display: none;
    }

    .cs-row {
        justify-content: center;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1240px;
    }
}

/* touch: don't flip on hover */
@media (hover: none) {
    .case-card:hover .case-inner {
        transform: none;
    }

    .case-card.is-flipped .case-inner {
        transform: rotateY(180deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}