:root {
    --bg: #070b14;
    --bg-elevated: #0b1120;
    --surface: rgba(15, 23, 42, .82);
    --surface-solid: #0f172a;
    --surface-hover: #15213a;
    --surface-soft: rgba(30, 41, 59, .52);
    --text: #f8fafc;
    --text-secondary: #b6c2d2;
    --muted: #7f8da3;
    --border: rgba(148, 163, 184, .16);
    --border-strong: rgba(96, 165, 250, .32);
    --primary: #3b82f6;
    --primary-bright: #60a5fa;
    --primary-soft: rgba(59, 130, 246, .13);
    --success: #22c55e;
    --shadow: 0 24px 80px rgba(0, 0, 0, .34);
    --header-bg: rgba(7, 11, 20, .78);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --motion: 180ms ease;
}

html[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-elevated: #eaf0f7;
    --surface: rgba(255, 255, 255, .88);
    --surface-solid: #ffffff;
    --surface-hover: #f1f5f9;
    --surface-soft: rgba(226, 232, 240, .62);
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --border: rgba(15, 23, 42, .10);
    --border-strong: rgba(37, 99, 235, .30);
    --primary: #2563eb;
    --primary-bright: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, .09);
    --shadow: 0 24px 70px rgba(15, 23, 42, .10);
    --header-bg: rgba(241, 245, 249, .82);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; scroll-behavior: smooth; }

@font-face {
    font-family: 'IRANYekan';
    font-stretch: normal;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(IRANYekanXVF.woff);
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 80% -10%, rgba(37, 99, 235, .14), transparent 34rem),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
    font-family: IRANYekan, "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    transition: color var(--motion), background-color var(--motion);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
button, a { touch-action: manipulation; }
svg { display: block; }

:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .72);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    z-index: 100;
    inset: 10px 50% auto auto;
    padding: 9px 14px;
    border-radius: 10px;
    color: #fff;
    background: #2563eb;
    transform: translate(50%, -160%);
    transition: transform var(--motion);
}

.skip-link:focus { transform: translate(50%, 0); }

.shell {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(90px);
    opacity: .10;
}

.ambient-one { inset: 10rem auto auto -12rem; background: #2563eb; }
.ambient-two { inset: auto -13rem 2rem auto; background: #0ea5e9; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; }

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(96, 165, 250, .30);
    border-radius: 14px;
    color: var(--primary-bright);
    background: linear-gradient(145deg, rgba(59, 130, 246, .20), rgba(59, 130, 246, .06));
    box-shadow: inset 0 1px rgba(255,255,255,.08);
}

.brand-mark svg { width: 32px; height: 32px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.25px; direction: ltr; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
    background: var(--surface-soft);
    cursor: pointer;
    transition: color var(--motion), border-color var(--motion), background-color var(--motion);
}

.icon-button:hover { color: var(--primary-bright); border-color: var(--border-strong); background: var(--primary-soft); }
.icon-button:active { background: var(--surface-hover); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }
html[data-theme="light"] .sun-icon { display: none; }
html[data-theme="light"] .moon-icon { display: block; }

.page-shell { padding-block: 64px 48px; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    align-items: end;
    gap: 48px;
    margin-bottom: 44px;
}

.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.2; font-weight: 800; letter-spacing: -1.2px; }
.hero p { max-width: 650px; margin: 14px 0 0; color: var(--text-secondary); font-size: 16px; }

.search-box {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 12px 42px rgba(0,0,0,.12), inset 0 1px rgba(255,255,255,.04);
    transition: border-color var(--motion), box-shadow var(--motion), background-color var(--motion);
}

.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), 0 12px 42px rgba(0,0,0,.12); }
.search-box > svg { width: 21px; height: 21px; flex: 0 0 auto; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; height: 56px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; direction: rtl; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box kbd { min-width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--border); border-bottom-color: var(--border-strong); border-radius: 7px; color: var(--muted); background: var(--surface-soft); font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.search-box input::-webkit-search-cancel-button { filter: grayscale(1); cursor: pointer; }

.breadcrumb-bar {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.back-button { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--text-secondary); transition: color var(--motion), background-color var(--motion); }
.back-button:hover { color: var(--primary-bright); background: var(--primary-soft); }
.back-button[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.back-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 4px; padding: 0; margin: 0; list-style: none; overflow: hidden; white-space: nowrap; }
#breadcrumbs li { min-width: 0; display: flex; align-items: center; gap: 4px; color: var(--muted); }
#breadcrumbs li:not(:last-child)::after { content: "/"; margin-inline: 5px; color: var(--border-strong); direction: ltr; }
#breadcrumbs a, #breadcrumbs span { max-width: 240px; display: block; padding: 7px 8px; overflow: hidden; border-radius: 9px; text-overflow: ellipsis; }
#breadcrumbs a { color: var(--text-secondary); transition: color var(--motion), background-color var(--motion); }
#breadcrumbs a:hover { color: var(--primary-bright); background: var(--primary-soft); }
#breadcrumbs span { color: var(--text); font-weight: 650; }

.listing-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.listing-head { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-bottom: 1px solid var(--border); }
.section-label { display: block; margin-bottom: 3px; color: var(--primary-bright); font: 700 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1.6px; direction: ltr; }
.listing-head h2 { margin: 0; font-size: 19px; font-weight: 750; }
.listing-stats { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.listing-stats span { display: inline-flex; align-items: baseline; gap: 5px; }
.listing-stats b { color: var(--text-secondary); font-size: 14px; }
.listing-stats i { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }

.table-shell { width: 100%; overflow: hidden; }
.table-shell table { width: 100%; border-collapse: collapse; border-spacing: 0; table-layout: fixed; }
.table-shell thead { background: var(--surface-soft); }
.table-shell th { height: 48px; padding: 0 20px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 650; text-align: right; white-space: nowrap; }
.table-shell th:first-child { width: auto !important; }
.table-shell th:nth-child(2) { width: 110px !important; }
.table-shell th:nth-child(3) { width: 190px !important; }
.table-shell th.entry-action-head { width: 74px !important; text-align: center; }
.table-shell th a { pointer-events: none; color: inherit; }

.table-shell tbody tr { border-bottom: 1px solid var(--border); transition: background-color var(--motion); }
.table-shell tbody tr:last-child { border-bottom: 0; }
.table-shell tbody tr:hover { background: var(--surface-hover); }
.table-shell td { height: 70px; padding: 10px 20px; color: var(--text-secondary); text-align: right; vertical-align: middle; }
.table-shell td.entry-date-cell, .table-shell td.entry-size-cell { direction: ltr; color: var(--muted); font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.table-shell td.entry-action-cell { padding-inline: 10px 18px; text-align: center; }

.entry-link { min-width: 0; display: flex; align-items: center; gap: 13px; color: var(--text); font-weight: 600; direction: ltr; text-align: left; }
.entry-link:hover .entry-title { color: var(--primary-bright); }
.entry-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); background: var(--surface-soft); transition: color var(--motion), border-color var(--motion), background-color var(--motion); }
.entry-link:hover .entry-icon { color: var(--primary-bright); border-color: var(--border-strong); background: var(--primary-soft); }
.entry-icon.folder { color: #60a5fa; border-color: rgba(96,165,250,.22); background: rgba(59,130,246,.10); }
.entry-icon.archive { color: #f59e0b; background: rgba(245,158,11,.09); }
.entry-icon.image { color: #a78bfa; background: rgba(167,139,250,.09); }
.entry-icon.binary { color: #34d399; background: rgba(52,211,153,.09); }
.entry-icon.database { color: #fb7185; background: rgba(251,113,133,.09); }
.entry-icon.code { color: #22d3ee; background: rgba(34,211,238,.09); }
.entry-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.entry-copy { min-width: 0; display: flex; flex-direction: column; }
.entry-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--motion); }
.entry-type { margin-top: 2px; color: var(--muted); font: 600 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .55px; text-transform: uppercase; }

.copy-button { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; transition: color var(--motion), border-color var(--motion), background-color var(--motion); }
.copy-button:hover { color: var(--primary-bright); border-color: var(--border-strong); background: var(--primary-soft); }
.copy-button:active { background: var(--surface-soft); }
.copy-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { min-height: 300px; place-items: center; align-content: center; padding: 48px 20px; text-align: center; }
.empty-state:not([hidden]) { display: grid; }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 18px; color: var(--muted); background: var(--surface-soft); }
.empty-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.empty-state strong { font-size: 16px; }
.empty-state p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.site-footer { padding: 0 0 32px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 4px; font-size: 11px; }
.footer-inner p { margin: 0; }
.footer-inner strong { color: var(--text-secondary); direction: ltr; }

.toast { position: fixed; z-index: 60; inset: auto 50% 28px auto; min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 9px 16px; border: 1px solid rgba(34,197,94,.28); border-radius: 13px; color: var(--text); background: var(--surface-solid); box-shadow: 0 18px 60px rgba(0,0,0,.34); opacity: 0; pointer-events: none; transform: translate(50%, 14px); transition: opacity var(--motion), transform var(--motion); }
.toast.is-visible { opacity: 1; transform: translate(50%, 0); }
.toast svg { width: 19px; height: 19px; color: var(--success); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 860px) {
    .page-shell { padding-top: 44px; }
    .hero { grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
    .search-box { max-width: none; }
    .table-shell th:nth-child(2), .table-shell td.entry-date-cell { display: none; }
}

@media (max-width: 640px) {
    .shell { width: min(100% - 24px, 1180px); }
    .header-inner { min-height: 70px; }
    .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
    .brand-copy strong { font-size: 14px; }
    .brand-copy small { font-size: 8px; letter-spacing: .8px; }
    .home-button { display: none; }
    .icon-button { width: 44px; height: 44px; }
    .page-shell { padding-block: 34px 36px; }
    .hero { margin-bottom: 26px; }
    .hero h1 { font-size: 31px; letter-spacing: -.7px; }
    .hero p { font-size: 14px; }
    .search-box { min-height: 54px; border-radius: 14px; }
    .search-box input { height: 52px; }
    .search-box input { font-size: 16px; }
    .search-box kbd { display: none; }
    .breadcrumb-bar { margin-bottom: 12px; }
    #breadcrumbs a, #breadcrumbs span { max-width: 130px; }
    .listing-card { border-radius: 18px; }
    .listing-head { min-height: 84px; padding: 18px; }
    .listing-head h2 { font-size: 16px; }
    .listing-stats { gap: 7px; font-size: 10px; }
    .listing-stats b { font-size: 12px; }
    .table-shell table, .table-shell tbody { display: block; }
    .table-shell thead { display: none; }
    .table-shell tbody { padding: 8px 12px; }
    .table-shell tbody tr { min-height: 74px; display: grid; grid-template-columns: minmax(0, 1fr) 46px; grid-template-rows: auto auto; align-items: center; padding: 8px 4px; border-radius: 13px; }
    .table-shell tbody tr:last-child { border-bottom: 0; }
    .table-shell td { height: auto; padding: 0 5px; }
    .table-shell td.entry-name-cell { grid-area: 1 / 1 / 2 / 2; min-width: 0; }
    .table-shell td.entry-size-cell { grid-area: 2 / 1 / 3 / 2; padding-inline-start: 60px; margin-top: -8px; font-size: 10px; text-align: left; }
    .table-shell td.entry-action-cell { grid-area: 1 / 2 / 3 / 3; padding: 0; }
    .entry-link { gap: 10px; }
    .entry-icon { width: 42px; height: 42px; }
    .entry-title { font-size: 13px; }
    .entry-type { font-size: 8px; }
    .copy-button { width: 44px; height: 44px; }
    .footer-inner { flex-direction: column; gap: 2px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
