:root {
  --paper: #f3ede2;
  --paper-strong: #fffaf1;
  --paper-muted: #e6d9c6;
  --ink: #171411;
  --ink-soft: #484038;
  --line: #d4c5ae;
  --clay: #a85f3d;
  --clay-dark: #79432e;
  --teal: #165f64;
  --teal-dark: #0d3d42;
  --olive: #617044;
  --gold: #c79244;
  --plum: #5b4660;
  --white: #fffdfa;
  --shadow: 0 22px 70px rgba(38, 28, 18, 0.14);
  color-scheme: light;
  font-family: Vazirmatn, IRANSans, Tahoma, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 20, 17, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 20, 17, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
}

html[lang="en"] {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(243, 237, 226, 0.88);
  border-bottom: 1px solid rgba(64, 51, 40, 0.16);
  backdrop-filter: blur(18px);
}

.brand,
.mirror-pill,
.top-nav,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  direction: ltr;
  font-weight: 760;
  font-size: 1.04rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.top-nav {
  justify-content: center;
  gap: clamp(12px, 3vw, 34px);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.top-nav a {
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}

.top-nav a:hover {
  color: var(--ink);
  border-color: var(--clay);
}

.mirror-pill {
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.64);
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 680;
}

.header-actions {
  justify-content: end;
  gap: 10px;
}

.language-toggle {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper-strong);
  cursor: pointer;
  font-weight: 760;
}

.language-toggle:hover {
  background: #2b2620;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #2f9b68;
  box-shadow: 0 0 0 4px rgba(47, 155, 104, 0.16);
}

.status-dot.warning {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(199, 146, 68, 0.18);
}

.hero-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(28px, 5vw, 72px);
  min-height: min(760px, calc(100vh - 72px));
  padding: clamp(52px, 7vw, 92px) clamp(18px, 4vw, 52px) clamp(42px, 5vw, 66px);
  overflow: hidden;
}

.hero-copy {
  z-index: 1;
  align-self: center;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--clay-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.35rem, 9.2vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  text-align: start;
}

html[dir="rtl"] h1 {
  text-align: right;
}

html[dir="ltr"] h1 {
  text-align: left;
}

.hero-lede {
  max-width: 650px;
  margin: 28px 0 24px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.58;
}

.hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: min(100%, 700px);
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(47, 35, 25, 0.1);
}

.hero-search input,
.filter-block input,
.filter-block select,
.catalog-tools select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffbf4;
  color: var(--ink);
  outline: none;
}

.hero-search input {
  height: 48px;
  padding: 0 16px;
  border: 0;
  background: transparent;
}

.hero-search input:focus,
.filter-block input:focus,
.filter-block select:focus,
.catalog-tools select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 95, 100, 0.16);
}

.hero-search button,
.solid-button,
.ghost-button,
.reset-button,
.icon-button,
.download-button,
.checksum-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 760;
  line-height: 1;
}

.hero-search button,
.solid-button,
.download-button {
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper-strong);
}

.hero-search button:hover,
.solid-button:hover,
.download-button:hover {
  background: #2b2620;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.solid-button,
.ghost-button {
  min-width: 158px;
  padding: 0 18px;
}

.ghost-button,
.reset-button,
.icon-button,
.checksum-button {
  background: rgba(255, 250, 241, 0.58);
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button:hover,
.reset-button:hover,
.icon-button:hover,
.checksum-button:hover {
  background: var(--paper-strong);
  border-color: #baa789;
}

.hero-media {
  align-self: center;
  min-width: 0;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(55, 43, 34, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #1b1815;
  color: var(--paper-strong);
}

.stats-band div {
  min-height: 112px;
  padding: 22px clamp(18px, 4vw, 52px);
  border-right: 1px solid rgba(255, 250, 241, 0.14);
}

.stats-band div:last-child {
  border-right: 0;
}

.stats-band strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1;
}

.stats-band span {
  display: block;
  margin-top: 9px;
  color: #d6c7b4;
}

.section-shell,
.catalog-shell,
.split-band,
.verification-band,
.mirror-band,
.site-footer {
  padding-right: clamp(18px, 4vw, 52px);
  padding-left: clamp(18px, 4vw, 52px);
}

.section-shell {
  padding-top: clamp(54px, 8vw, 92px);
  padding-bottom: clamp(54px, 8vw, 92px);
}

.section-heading,
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0;
}

.pinned-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pinned-card,
.artifact-card,
.stream-grid article,
.verify-grid article,
.firmware-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.74);
  box-shadow: 0 18px 42px rgba(47, 35, 25, 0.08);
}

.pinned-card {
  display: grid;
  gap: 18px;
  min-height: 248px;
  padding: 18px;
}

.pinned-top,
.card-top,
.results-meta,
.artifact-actions,
.source-row,
.mirror-band,
.site-footer {
  display: flex;
  align-items: center;
}

.pinned-top,
.card-top,
.source-row {
  justify-content: space-between;
  gap: 12px;
}

.type-badge,
.license-badge,
.stream-code {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.type-badge {
  background: rgba(22, 95, 100, 0.12);
  color: var(--teal-dark);
}

.license-badge {
  background: rgba(168, 95, 61, 0.12);
  color: var(--clay-dark);
}

.pinned-card p,
.artifact-card p,
.stream-grid p,
.split-band p,
.verify-grid p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.52;
}

bdi {
  unicode-bidi: isolate;
}

.artifact-meta,
.pinned-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #5f5549;
  font-size: 0.84rem;
}

.catalog-shell {
  padding-top: clamp(54px, 8vw, 92px);
  padding-bottom: clamp(54px, 8vw, 92px);
  background: rgba(229, 217, 199, 0.52);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catalog-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-tools select,
.icon-button {
  min-height: 42px;
}

.catalog-tools select {
  width: 190px;
  padding: 0 12px;
}

.icon-button {
  padding: 0 14px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.8);
  box-shadow: 0 18px 42px rgba(47, 35, 25, 0.07);
}

.filter-block {
  display: grid;
  gap: 8px;
}

.filter-block label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-block input,
.filter-block select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
}

.chip-list {
  display: grid;
  gap: 7px;
}

.chip-list button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 250, 0.7);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  font-weight: 690;
}

.chip-list button:hover,
.chip-list button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-strong);
}

.reset-button {
  width: 100%;
  padding: 0 14px;
}

.results-panel {
  min-width: 0;
}

.results-meta {
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.artifact-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  min-height: 318px;
  padding: 16px;
}

.catalog-grid.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-grid.is-compact .artifact-card {
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  min-height: 0;
}

.catalog-grid.is-compact .artifact-card p {
  grid-column: 1 / -1;
}

.catalog-grid.is-compact .artifact-meta,
.catalog-grid.is-compact .artifact-tags {
  grid-column: 1 / -1;
}

.artifact-card h3 {
  font-size: 1.03rem;
}

.artifact-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 6px;
}

.artifact-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(55, 43, 34, 0.12);
  border-radius: 6px;
  background: rgba(233, 221, 202, 0.74);
  color: #5e5143;
  font-size: 0.76rem;
}

.artifact-actions {
  gap: 8px;
}

.download-button,
.checksum-button {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.87rem;
}

.download-button,
.checksum-button,
.source-download,
.firmware-item a {
  text-align: center;
}

.stream-grid,
.verify-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stream-grid article,
.verify-grid article {
  min-height: 212px;
  padding: 18px;
}

.stream-code {
  margin-bottom: 38px;
  background: rgba(97, 112, 68, 0.14);
  color: #465331;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(28px, 6vw, 80px);
  padding-top: clamp(54px, 8vw, 92px);
  padding-bottom: clamp(54px, 8vw, 92px);
  background: #201d19;
  color: var(--paper-strong);
}

.split-band .eyebrow {
  color: #d9a971;
}

.split-band p {
  max-width: 620px;
  color: #d9cbbb;
}

.firmware-rail {
  display: grid;
  gap: 10px;
}

.firmware-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  background: rgba(255, 250, 241, 0.08);
  border-color: rgba(255, 250, 241, 0.16);
  box-shadow: none;
}

.firmware-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #d7a15c;
  color: #211a13;
  font-weight: 820;
}

.firmware-item span,
.firmware-item small {
  display: block;
}

.firmware-item small {
  margin-top: 4px;
  color: #cbbba8;
}

.firmware-item a {
  color: #f3d5ad;
  font-weight: 780;
}

.source-section {
  background: var(--paper);
}

.source-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 250, 241, 0.72);
}

.source-row {
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row strong,
.source-row span {
  min-width: 0;
}

.source-row span {
  color: var(--ink-soft);
}

.source-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-strong);
  font-weight: 780;
}

.verification-band {
  display: grid;
  grid-template-columns: minmax(230px, 0.32fr) minmax(0, 0.68fr);
  gap: 30px;
  padding-top: clamp(54px, 7vw, 82px);
  padding-bottom: clamp(54px, 7vw, 82px);
  background: #e5d8c4;
  border-top: 1px solid var(--line);
}

.verify-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.verify-grid article {
  min-height: 170px;
  background: rgba(255, 250, 241, 0.62);
}

.mirror-band {
  justify-content: center;
  gap: 12px;
  min-height: 86px;
  background: var(--teal-dark);
  color: var(--paper-strong);
}

.mirror-band div {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 241, 0.18);
  border-radius: 8px;
}

.site-footer {
  justify-content: space-between;
  gap: 24px;
  min-height: 116px;
  background: #151310;
  color: var(--paper-strong);
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer span {
  margin-top: 6px;
  color: #cdbfac;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #d9cbbb;
}

.download-toast {
  position: fixed;
  right: clamp(16px, 4vw, 34px);
  bottom: 22px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.download-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .catalog-grid,
  .pinned-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .hero-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-media {
    order: -1;
  }

  .hero-media img {
    max-height: 390px;
  }

  .stats-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-layout,
  .split-band,
  .verification-band {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .catalog-grid.is-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 66px;
    gap: 12px;
  }

  .mirror-pill {
    display: none;
  }

  .hero-shell {
    padding-top: 30px;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .hero-search button {
    width: 100%;
  }

  .hero-actions,
  .catalog-tools,
  .section-heading,
  .catalog-heading,
  .results-meta,
  .site-footer,
  .mirror-band {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-tools select,
  .icon-button,
  .solid-button,
  .ghost-button {
    width: 100%;
  }

  .stats-band,
  .catalog-grid,
  .pinned-grid,
  .stream-grid,
  .verify-grid {
    grid-template-columns: 1fr;
  }

  .stats-band div {
    min-height: 90px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 250, 241, 0.14);
  }

  .firmware-item {
    grid-template-columns: auto 1fr;
  }

  .firmware-item a {
    grid-column: 1 / -1;
  }

  .source-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .source-download {
    width: 100%;
  }
}
