/* AppIraqi — components. Uses the variables from tokens.css. Logical properties keep RTL (Arabic) and LTR (English) in step. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; color: var(--ink); }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
/* Reduced motion: spatial entrances and loops stop; colour and opacity feedback stays. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
::selection { background: color-mix(in srgb, var(--lapis) 22%, transparent); color: var(--ink); }
html { accent-color: var(--lapis); caret-color: var(--accent); scrollbar-color: color-mix(in srgb, var(--ink-3) 45%, transparent) transparent; }

/* ---------- Type scale ---------- */
.t-display { font-family: var(--font-display); font-size: clamp(34px, 5.6vw, 56px); line-height: 1.24; font-weight: 700; letter-spacing: -.01em; }
.t-h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); line-height: 1.3; font-weight: 700; }
.t-h2 { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 28px); line-height: 1.38; font-weight: 700; }
.t-h3 { font-size: 20px; line-height: 1.5; font-weight: 600; }
.t-lead { font-size: 18px; line-height: 1.8; color: var(--ink-2); }
.t-small { font-size: 14px; line-height: 1.65; }
.t-caption { font-size: 12.5px; line-height: 1.4; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.t-muted { color: var(--ink-2); }
.t-meta { color: var(--ink-3); font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--gold-ink); }
[lang="en"] .eyebrow, [lang="en"] .t-caption { text-transform: uppercase; }
.prose { max-width: 68ch; }
.prose p + p, .prose ul, .prose ol, .prose h2, .prose h3 { margin-top: 1em; }
.prose h2 { font-family: var(--font-display); font-size: 24px; margin-top: 1.6em; }
.prose h3 { font-size: 19px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .container { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.section { padding-block: var(--space-8); }
.section-sm { padding-block: var(--space-7); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-block-end: var(--space-5); }
.section-head > div { display: grid; gap: var(--space-2); min-width: 0; }
.stack { display: grid; gap: var(--space-4); align-content: start; }
.stack-sm { display: grid; gap: var(--space-2); align-content: start; }
.stack-lg { display: grid; gap: var(--space-6); align-content: start; }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid-3 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-stats { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.grid-4 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.layout-side { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 960px) { .layout-side { grid-template-columns: 260px minmax(0, 1fr); } .layout-side.end { grid-template-columns: minmax(0, 1fr) 340px; } }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-block-end: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: var(--space-4); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; direction: ltr; }
.brand:hover { text-decoration: none; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand .dot { color: var(--gold-ink); }
.mark .m-step { fill: var(--lapis); }
.mark .m-sun { fill: var(--gold); }
.nav-main { display: none; gap: var(--space-1); margin-inline-start: var(--space-4); }
.nav-main a { color: var(--ink-2); font-weight: 500; padding: 8px 12px; border-radius: var(--radius-md); font-size: 15px; }
.nav-main a:hover, .nav-main a[aria-current="page"] { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-tools { display: flex; align-items: center; gap: var(--space-2); margin-inline-start: auto; }
.nav-tools .hide-sm { display: none; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-link { font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 8px 10px; border-radius: var(--radius-md); }
.lang-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
@media (min-width: 1020px) { .nav-main { display: flex; } .nav-tools .hide-sm { display: inline-flex; } .icon-btn.menu-toggle, .menu-panel { display: none; } }
.mobile-nav { border-block-start: 1px solid var(--line); padding-block: var(--space-3) var(--space-4); display: grid; gap: 2px; }
.mobile-nav a { padding: 10px 4px; color: var(--ink); font-weight: 500; border-block-end: 1px solid var(--line); }
.mobile-nav a:last-child { border: 0; }
.menu-panel[hidden] { display: none; }

/* ---------- Buttons ---------- */
.btn { --b-bg: var(--surface); --b-fg: var(--ink); --b-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-md); border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font: 600 15px/1 var(--font-sans); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { text-decoration: none; border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --b-bg: var(--action); --b-fg: var(--on-action); --b-bd: var(--action); }
.btn-primary:hover { --b-bg: var(--action-hover); --b-bd: var(--action-hover); }
.btn-gold { --b-bg: var(--gold); --b-fg: var(--on-gold); --b-bd: var(--gold); }
.btn-gold:hover { filter: brightness(1.05); border-color: var(--gold); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--accent); }
.btn-ghost:hover { --b-bg: var(--accent-soft); --b-bd: transparent; }
.btn-danger { --b-bg: var(--danger-soft); --b-fg: var(--danger); --b-bd: transparent; }
.btn-on-night { --b-bg: transparent; --b-fg: var(--on-night); --b-bd: rgba(255,255,255,.28); }
.btn-on-night:hover { --b-bd: rgba(255,255,255,.6); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- Upvote ---------- */
.vote { display: inline-grid; justify-items: center; align-content: center; gap: 0; min-width: 58px; min-height: 62px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); cursor: pointer; font: 700 16px/1.1 var(--font-sans); font-variant-numeric: tabular-nums; }
.vote svg { width: 18px; height: 18px; color: var(--ink-3); }
.vote:hover { border-color: var(--lapis); }
.vote:hover svg { color: var(--lapis); }
.vote[aria-pressed="true"] { background: var(--lapis); border-color: var(--lapis); color: var(--on-action); }
.vote[aria-pressed="true"] svg { color: var(--gold); }

/* ---------- Chips, badges, status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 500; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.chip svg { width: 14px; height: 14px; }
a.chip:hover { text-decoration: none; border-color: var(--line-strong); color: var(--ink); }
.chip-invest { background: var(--gold-soft); color: var(--gold-ink); }
.chip-beta { background: var(--turq-soft); color: var(--turq-ink); }
.chip-partners, .chip-collaborators { background: var(--accent-soft); color: var(--accent); }
.chip-marketing, .chip-hiring { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.chip.is-active { background: var(--lapis); color: var(--on-action); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.badge-new { background: var(--turq-soft); color: var(--turq-ink); }
.badge-sponsored { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold); }
.badge-featured { background: var(--lapis); color: var(--on-action); }
.badge-verified { color: var(--accent); padding: 0; }
.badge-verified svg { width: 16px; height: 16px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-draft { background: var(--surface-2); color: var(--ink-2); }
.status-pending { background: var(--accent-soft); color: var(--accent); }
.status-changes_requested { background: var(--warn-soft); color: var(--warn); }
.status-published { background: var(--ok-soft); color: var(--ok); }
.status-rejected, .status-hidden { background: var(--danger-soft); color: var(--danger); }
.status-new, .status-open { background: var(--accent-soft); color: var(--accent); }
.status-resolved, .status-approved { background: var(--ok-soft); color: var(--ok); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-card); min-width: 0; }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); min-width: 0; }
.card-tint { background: var(--surface-2); border-radius: var(--radius-lg); padding: var(--space-5); min-width: 0; }

.logo-tile { width: 56px; height: 56px; border-radius: 14px; flex: none; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--lapis); border: 1px solid var(--line); }
.logo-tile img { width: 100%; height: 100%; object-fit: cover; }
.logo-tile.lg { width: 88px; height: 88px; border-radius: 20px; font-size: 34px; }
.logo-tile.sm { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; overflow: hidden; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; font-family: var(--font-display); }
.avatar.md { width: 48px; height: 48px; font-size: 19px; }

/* Product card (grid) */
.p-card { position: relative; display: grid; gap: var(--space-3); align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-card); min-width: 0; transition: border-color .15s, transform .15s; }
.p-card:hover { border-color: var(--line-strong); }
.p-card .p-top { display: flex; gap: var(--space-3); align-items: flex-start; }
.p-card .p-title { display: grid; gap: 2px; min-width: 0; flex: 1; }
.p-card .p-name { font-weight: 700; font-size: 17px; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.p-card .p-name a { color: inherit; }
.p-card .p-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.p-card .p-meta { font-size: 13px; color: var(--ink-3); }
.p-card .p-desc { color: var(--ink-2); font-size: 15px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .p-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-block-start: var(--space-3); border-block-start: 1px solid var(--line); font-size: 14px; }
.p-card .p-maker { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); position: relative; z-index: 1; min-width: 0; }
.p-card .p-maker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-card .p-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p-card .vote { position: relative; z-index: 1; }

/* Product row (launch list, leaderboard) */
.p-row { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-lg); transition: background .15s; }
.p-row:hover { background: var(--surface-2); }
.p-row .rank { font-family: var(--font-mono); font-size: 14px; color: var(--ink-3); width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.p-row .p-body { display: grid; gap: 2px; min-width: 0; }
.p-row .p-name { font-weight: 700; color: var(--ink); font-size: 16.5px; }
.p-row .p-name a { color: inherit; }
.p-row .p-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.p-row .p-desc { color: var(--ink-2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row .p-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.p-row .vote { position: relative; z-index: 1; }
@media (max-width: 560px) { .p-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); padding: var(--space-3); } .p-row .rank { display: none; } }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-2); box-shadow: var(--shadow-card); }
.list-card .p-row + .p-row { margin-top: 2px; }

/* Builder card */
.b-card { position: relative; display: grid; gap: var(--space-3); justify-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-card); min-width: 0; }
.b-card:hover { border-color: var(--line-strong); }
.b-card .b-head { display: flex; gap: var(--space-3); align-items: center; min-width: 0; width: 100%; }
.b-card .b-name { font-weight: 700; color: var(--ink); font-size: 17px; display: flex; gap: 6px; align-items: center; }
.b-card .b-name a { color: inherit; }
.b-card .b-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.b-card .b-sub { color: var(--ink-3); font-size: 14px; }
.b-card .b-bio { color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-card .b-stats { display: flex; gap: var(--space-4); font-size: 14px; color: var(--ink-2); }
.b-card .b-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Category tile */
.cat-tile { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); gap: var(--space-3); align-items: center; padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); min-width: 0; }
.cat-tile:hover { border-color: var(--lapis); text-decoration: none; }
.cat-tile .cat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cat-tile .cat-icon svg { width: 24px; height: 24px; }
.cat-tile .cat-name { font-weight: 600; font-size: 16px; }
.cat-tile .cat-count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cat-tile.is-empty .cat-icon { background: var(--surface-2); color: var(--ink-3); }

/* Stat */
.stat { display: grid; gap: 2px; }
.stat .v { font-family: var(--font-display); font-size: 34px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat .l { font-size: 14px; color: var(--ink-2); }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); display: grid; gap: 4px; min-width: 0; }
.stat-tile .l { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat-tile .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-tile .d { font-size: 13px; color: var(--ink-3); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 96px) clamp(40px, 6vw, 80px); border-block-end: 1px solid var(--line); }
.hero-grid { display: grid; gap: var(--space-7); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } }
.hero h1 .gold { color: var(--gold-ink); }
.hero .t-lead { max-width: 54ch; }
.search-xl { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 6px; padding-inline-start: 16px; max-width: 560px; box-shadow: var(--shadow-card); }
.search-xl svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search-xl input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px/1.5 var(--font-sans); color: var(--ink); padding: 10px 0; }
.search-xl:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-stats { display: flex; gap: var(--space-6); flex-wrap: wrap; }

/* The glazed brick wall: Ishtar Gate bricks, a golden ziggurat climbing through them */
.brickwall { --cols: 9; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 5px; padding: 14px; background: var(--lapis-deep); border-radius: var(--radius-lg); aspect-ratio: 1 / .92; max-width: 100%; direction: ltr; box-shadow: var(--shadow-pop); }
.brickwall .brick { border-radius: 3px; background: var(--brick-1); }
.brickwall .brick.b2 { background: var(--brick-2); }
.brickwall .brick.b3 { background: var(--brick-3); }
.brickwall .brick.glow { background: var(--brick-glow); }
.brickwall .brick.gold { background: var(--gold); }
.brickwall .brick.sun { background: var(--gold); border-radius: 50%; transform: scale(.7); }
.brickwall { position: relative; overflow: hidden; isolation: isolate; }
.brickwall::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(104deg, transparent 32%, rgba(255, 255, 255, .17) 47%, rgba(255, 255, 255, .05) 55%, transparent 66%); }
@keyframes lay { from { opacity: 0; transform: translateY(-22px); filter: brightness(1.6); } 55% { opacity: 1; } to { opacity: 1; transform: none; filter: none; } }
@keyframes sunrise { from { opacity: 0; transform: translateY(14px) scale(.25); } 60% { opacity: 1; box-shadow: 0 0 0 9px rgba(224, 166, 58, .22); } to { opacity: 1; transform: scale(.7); box-shadow: 0 0 0 0 rgba(224, 166, 58, 0); } }
@keyframes glaze { from { opacity: 1; transform: translateX(-105%); } to { opacity: 1; transform: translateX(105%); } }
.brickwall .brick.half { grid-column: span 1; }
.brickwall .brick.w2 { grid-column: span 2; }
@media (prefers-reduced-motion: no-preference) {
  /* The ziggurat is laid course by course from the ground up, then the sun rises and light runs over the glaze. */
  .brickwall .brick.gold { animation: lay .6s var(--ease-out) both; animation-delay: calc(150ms + var(--row, 0) * 130ms + var(--col, 0) * 24ms); }
  .brickwall .brick.sun { animation: sunrise 1s var(--ease-out) 900ms both; }
  .brickwall::after { animation: glaze 1.5s var(--ease-out) 1.15s both; }
}

/* ---------- Bands ---------- */
.band-night { background: var(--night); color: var(--on-night); }
.band-night h2, .band-night h3 { color: var(--on-night); }
.band-night .t-muted, .band-night .t-lead { color: var(--on-night-2); }
.band-night a:not(.btn) { color: var(--on-night); }
.band-tint { background: var(--surface-2); }
.steps { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); counter-reset: step; }
.step { display: grid; gap: var(--space-2); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); counter-increment: step; }
.step::before { content: counter(step); font-family: var(--font-display); font-size: 15px; font-weight: 700; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--gold); color: var(--on-gold); }
.band-night .step { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
.band-night .step p { color: var(--on-night-2); }

.signal-list { display: grid; gap: var(--space-3); }
.signal-item { display: flex; gap: var(--space-3); align-items: flex-start; }
.signal-item .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.signal-item .ico svg { width: 18px; height: 18px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-4); }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .label { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--ink-3); }
.field .error { font-size: 13px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); font: 400 16px/1.5 var(--font-sans); }
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.input-ltr { direction: ltr; text-align: start; }
[dir="rtl"] .input-ltr { text-align: end; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--lapis); flex: none; }
.check-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); margin: 0; display: grid; gap: var(--space-4); min-width: 0; }
.fieldset legend { font-weight: 700; padding-inline: 6px; font-size: 16px; }
.form-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { inset-inline-start: 21px; }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Alerts */
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert strong { color: inherit; }
.code-box { font-family: var(--font-mono); font-size: 22px; letter-spacing: .12em; padding: 12px 18px; border-radius: var(--radius-md); background: var(--surface); border: 1px dashed var(--line-strong); direction: ltr; display: inline-block; color: var(--ink); }

/* ---------- Filters sidebar ---------- */
.filters { display: grid; gap: var(--space-5); align-content: start; }
.filter-group { display: grid; gap: 4px; }
.filter-group h3 { font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; margin-block-end: 6px; }
.filter-link { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 15px; }
.filter-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.filter-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filter-link .n { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; }
.filters-toggle { display: block; }
@media (min-width: 960px) { .filters-toggle > summary { display: none; } }
details.filters-toggle > summary { list-style: none; cursor: pointer; }
details.filters-toggle > summary::-webkit-details-marker { display: none; }
.toolbar { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-block-end: var(--space-4); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

/* ---------- Product page ---------- */
.p-hero { display: grid; gap: var(--space-5); grid-template-columns: auto minmax(0, 1fr); align-items: start; }
@media (max-width: 640px) { .p-hero { grid-template-columns: 1fr; } }
.p-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 46%); gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-block-end: 8px; }
.shots img { border-radius: var(--radius-md); border: 1px solid var(--line); scroll-snap-align: start; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface-2); }
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: var(--space-3); padding-block: 10px; border-block-end: 1px solid var(--line); font-size: 15px; }
.kv > div:last-child { border: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; text-align: end; }

/* ---------- Tables (dashboard / admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: start; font-size: 13px; color: var(--ink-3); font-weight: 600; padding: 12px 16px; border-block-end: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-block-end: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-block-end: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }

/* Dashboard shell */
.dash { display: grid; gap: var(--space-6); grid-template-columns: 1fr; padding-block: var(--space-6) var(--space-8); }
@media (min-width: 960px) { .dash { grid-template-columns: 220px minmax(0, 1fr); } }
.dash-nav { display: flex; gap: 4px; overflow-x: auto; align-content: start; }
@media (min-width: 960px) { .dash-nav { display: grid; position: sticky; top: 90px; } }
.dash-nav a { padding: 9px 12px; border-radius: var(--radius-md); color: var(--ink-2); font-weight: 500; white-space: nowrap; display: flex; justify-content: space-between; gap: 8px; }
.dash-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.dash-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dash-nav .count { background: var(--gold); color: var(--on-gold); border-radius: 999px; font-size: 12px; padding: 0 7px; font-weight: 700; }

/* Mini bar chart (analytics) */
.chart { margin: 0; position: relative; }
.chart-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; direction: ltr; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11.5px; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-block: -5px; min-width: 2ch; }
.chart-plot { position: relative; height: 128px; border-radius: 4px; background:
  linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat,
  linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat,
  linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat; }
.chart-plot:focus-visible { outline-offset: 6px; }
.chart-bars { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.chart-bars li { flex: 1; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.chart-bars li::before { content: ""; width: 100%; max-width: 18px; height: var(--v); min-height: 3px; background: var(--lapis); border-radius: 4px 4px 0 0;
  transform-origin: 50% 100%; transition: transform .7s var(--ease-out) calc(min(var(--i), 30) * 12ms), background-color .15s, opacity .15s; }
.chart-bars li.is-zero::before { background: var(--line-strong); min-height: 2px; height: 2px; border-radius: 1px; }
.chart-bars li.is-today::before { background: var(--gold); }
.chart-bars.has-focus li::before { opacity: .45; }
.chart-bars.has-focus li.is-active::before { opacity: 1; background: var(--accent); }
.chart-bars.has-focus li.is-today.is-active::before { background: var(--gold-ink); }
.chart.is-armed .chart-bars li::before { transform: scaleY(0); }
.chart.is-armed.is-in .chart-bars li::before { transform: none; }
.chart-tip { position: absolute; top: 0; left: 0; transform: translate(-50%, calc(-100% - 8px)); display: grid; gap: 0; padding: 6px 10px; border-radius: var(--radius-md); background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.35; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-pop); text-align: center; z-index: 3; }
.chart-tip strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-tip span { opacity: .78; }
.chart-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); direction: ltr; margin-top: 8px; padding-inline-start: calc(2ch + 8px); }

/* Empty state */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--space-3); padding: var(--space-7) var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-2); }
.empty svg { width: 40px; height: 40px; color: var(--ink-3); }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: var(--space-6); }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 10px; display: grid; place-items: center; border-radius: var(--radius-md); border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; background: var(--surface); }
.pagination a:hover { border-color: var(--line-strong); text-decoration: none; }
.pagination .is-active { background: var(--lapis); border-color: var(--lapis); color: var(--on-action); }
.pagination .is-disabled { opacity: .45; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--on-night-2); padding-block: var(--space-8) var(--space-5); margin-top: var(--space-8); font-size: 15px; }
.site-footer .footer-sign a.brand { color: var(--on-night); }
.site-footer .mark .m-step { fill: #8FB1FF; }
.site-footer a:not(.btn) { color: var(--on-night-2); text-decoration: none; transition: color var(--dur-fast, .15s) var(--ease-out, ease); }
.site-footer a:not(.btn):hover { color: var(--on-night); }
.site-footer a:focus-visible { outline: 2px solid #8FB1FF; outline-offset: 3px; border-radius: 4px; }
.site-footer li { overflow-wrap: anywhere; }

/* Signature row: who we are on one side, the two ways to reach us on the other */
.footer-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-5) var(--space-7); padding-bottom: var(--space-6); border-block-end: 1px solid rgba(255,255,255,.1); }
.footer-sign { display: grid; gap: var(--space-2); max-width: 46ch; }
.footer-sign .brand { margin-bottom: var(--space-2); justify-self: start; }
.footer-line { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; line-height: 1.25; color: var(--on-night); text-wrap: balance; }
.footer-sign p:not(.footer-line) { margin: 0; line-height: 1.7; }
.footer-reach { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.footer-mail { display: inline-flex; align-items: center; gap: 10px; color: var(--on-night) !important; font-weight: 500; padding-block: 6px; border-block-end: 1px solid rgba(255,255,255,.24); }
.footer-mail:hover { border-color: #8FB1FF; }
.footer-mail svg { width: 18px; height: 18px; flex: none; color: #8FB1FF; }

.footer-grid { display: grid; gap: var(--space-6) var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: var(--space-6); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); } }
.footer-grid h2 { color: var(--on-night); font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: .04em; margin: 0 0 var(--space-3); opacity: .7; }
:lang(ar) .footer-grid h2 { letter-spacing: 0; font-size: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-follow { grid-column: 1 / -1; }
@media (min-width: 760px) { .footer-follow { grid-column: auto; } }

.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-grid ul.socials { display: flex; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.03); transition: background var(--dur-fast, .15s) var(--ease-out, ease), border-color var(--dur-fast, .15s) var(--ease-out, ease), color var(--dur-fast, .15s) var(--ease-out, ease), transform var(--dur-fast, .15s) var(--ease-out, ease); }
.socials a:hover { background: rgba(143,177,255,.14); border-color: rgba(143,177,255,.5); color: var(--on-night); transform: translateY(-1px); }
.socials svg { width: 18px; height: 18px; }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-4); flex-wrap: wrap; border-block-start: 1px solid rgba(255,255,255,.1); padding-top: var(--space-4); font-size: 13.5px; }
.footer-bottom > span:nth-child(2) { flex: 1 1 auto; text-align: center; }
.footer-lang { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; font-weight: 500; }
.footer-lang svg { width: 16px; height: 16px; }
@media (max-width: 759px) { .footer-bottom { flex-direction: column; align-items: flex-start; } .footer-bottom > span:nth-child(2) { text-align: start; } }
@media (prefers-reduced-motion: reduce) { .socials a, .site-footer a { transition: none; } .socials a:hover { transform: none; } }

/* Toast / flash */
.flash { position: fixed; inset-inline: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; z-index: 60; pointer-events: none; padding-inline: 16px; }
.flash > div { pointer-events: auto; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--radius-md); box-shadow: var(--shadow-pop); font-weight: 500; max-width: 560px; }

/* Utilities */
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.center { text-align: center; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.hide-mobile { display: none; }
@media (min-width: 720px) { .hide-mobile { display: initial; } }

/* The night band sits flush on the footer when it ends the page */
main:has(> section.band-night:last-child) + .site-footer { margin-top: 0; border-top: 1px solid rgba(255,255,255,.08); }

/* Grid children never push their track wider than the screen */
.hero-grid > *, .layout-side > *, .dash > *, .grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .footer-grid > * { min-width: 0; }
.search-xl input { width: 100%; }
.filters .search-xl { max-width: 100%; }
[hidden] { display: none !important; }
@media (max-width: 979px) { .hero .brickwall { max-width: 380px; margin-inline: auto; } }

/* ---------- Tags ---------- */
.tag { unicode-bidi: isolate; display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 500; background: var(--surface); white-space: nowrap; }
a.tag:hover { border-color: var(--lapis); color: var(--accent); text-decoration: none; }
.tag::before { content: "#"; color: var(--ink-3); margin-inline-end: 2px; }

/* ---------- Store buttons (cards and product page) ---------- */
.store-links { display: flex; gap: 6px; position: relative; z-index: 1; }
.store-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.store-btn:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.store-btn svg { width: 15px; height: 15px; }

/* ---------- Product page head ---------- */
.p-head { display: grid; gap: var(--space-5); grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; padding-block: var(--space-6) var(--space-5); }
.p-head .vote { min-width: 76px; min-height: 80px; font-size: 20px; }
.p-head .vote svg { width: 22px; height: 22px; }
@media (max-width: 720px) { .p-head { grid-template-columns: auto minmax(0, 1fr); } .p-head .p-head-vote { grid-column: 1 / -1; } .p-head .p-head-vote .vote { width: 100%; min-height: 52px; grid-auto-flow: column; gap: 10px; justify-content: center; } }
.byline { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 15px; }
.byline a { color: var(--ink); font-weight: 600; }
.section-nav { position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-block: 1px solid var(--line); }
.section-nav .inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 6px; }
.section-nav .inner::-webkit-scrollbar { display: none; }
.section-nav a { padding: 8px 14px; border-radius: var(--radius-md); color: var(--ink-2); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.section-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.section-nav a .n { color: var(--ink-3); font-weight: 500; margin-inline-start: 4px; }
[id^="sec-"] { scroll-margin-top: 140px; }

/* ---------- Share menu ---------- */
.share { position: relative; }
.share > summary { list-style: none; }
.share > summary::-webkit-details-marker { display: none; }
.share-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 50; width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 6px; display: grid; }
.share-panel a, .share-panel button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--ink); font: 500 15px/1.3 var(--font-sans); background: none; border: 0; cursor: pointer; text-align: start; width: 100%; }
.share-panel a:hover, .share-panel button:hover { background: var(--surface-2); text-decoration: none; }
.share-panel svg { width: 18px; height: 18px; color: var(--ink-2); }

/* ---------- Gallery ---------- */
.gallery { position: relative; }
.gallery .rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 62%); gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-block-end: 6px; }
.gallery .rail button { padding: 0; border: 0; background: none; cursor: zoom-in; scroll-snap-align: start; border-radius: var(--radius-md); }
.gallery .rail img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-2); }
.gallery .g-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.gallery .g-count { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); direction: ltr; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); width: 100%; }
.lightbox::backdrop { background: rgba(6, 13, 31, .82); }
.lightbox img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: var(--radius-md); }
.lightbox .lb-close { position: absolute; top: 8px; inset-inline-end: 8px; }

/* ---------- Opportunity rows ---------- */
.opp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.opp .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.opp .ico svg { width: 22px; height: 22px; }
.opp .t { font-weight: 700; }
.opp .d { color: var(--ink-2); font-size: 15px; }
@media (max-width: 560px) { .opp { grid-template-columns: auto minmax(0, 1fr); } .opp .btn { grid-column: 1 / -1; } }

/* ---------- Mini product list ---------- */
.mini { display: flex; gap: var(--space-3); align-items: center; padding: 10px; border-radius: var(--radius-md); color: var(--ink); }
.mini:hover { background: var(--surface-2); text-decoration: none; }
.mini .t { font-weight: 600; } .mini .s { color: var(--ink-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini > div:last-child { min-width: 0; }

/* ---------- Category hero ---------- */
.cat-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: center; padding: var(--space-6); border-radius: var(--radius-lg); background: var(--lapis-deep); color: var(--on-night); position: relative; overflow: hidden; }
.cat-hero h1 { color: var(--on-night); }
.cat-hero p { color: var(--on-night-2); }
.cat-hero .big-icon { width: 88px; height: 88px; border-radius: 20px; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); }
.cat-hero .big-icon svg { width: 44px; height: 44px; }
.cat-hero .stats { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-top: var(--space-3); }
.cat-hero .stats .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--on-night); line-height: 1.1; }
.cat-hero .stats .l { font-size: 13px; color: var(--on-night-2); }
.cat-hero .bricks { position: absolute; inset-block: 14px; inset-inline-end: 14px; width: 30%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; opacity: .55; pointer-events: none; }
.cat-hero .bricks span { border-radius: 3px; background: var(--brick-1); }
.cat-hero .bricks span:nth-child(3n) { background: var(--brick-2); }
.cat-hero .bricks span:nth-child(7n) { background: var(--brick-glow); }
.cat-hero > *:not(.bricks) { position: relative; z-index: 1; }
@media (max-width: 720px) { .cat-hero { grid-template-columns: 1fr; padding: var(--space-5); } .cat-hero .bricks { display: none; } }
.cat-nav { display: grid; gap: 2px; }
.cat-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--ink-2); font-size: 15px; }
.cat-nav a svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.cat-nav a .n { margin-inline-start: auto; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cat-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.cat-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat-nav a.is-active svg { color: var(--accent); }

/* ---------- Inbox ---------- */
.msg { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.msg.is-unread { background: var(--accent-soft); border-color: transparent; }
.msg .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lapis); display: inline-block; }
.msg .body { white-space: pre-wrap; }

/* ---------- Builder profile head ---------- */
.b-head-lg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: center; }
@media (max-width: 560px) { .b-head-lg { grid-template-columns: 1fr; } }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) { .share-panel { position: fixed; top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); inset-inline: 16px; width: auto; } }
@media (max-width: 720px) { .p-head .logo-tile.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; } .p-head { gap: var(--space-4); } }
.share { align-self: flex-start; }

/* ---------- Stars ---------- */
.stars { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; }
.stars-row { display: inline-flex; gap: 1px; direction: ltr; }
[dir="rtl"] .stars-row { transform: scaleX(-1); }
.stars svg { width: 15px; height: 15px; fill: var(--line); }
.stars svg.on { fill: var(--gold); }
.stars svg.half { fill: var(--gold); opacity: .5; }
.stars-n strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Reviews ---------- */
.review-box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-5); align-items: center; padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
@media (max-width: 720px) { .review-box { grid-template-columns: 1fr; } }
.review-score { display: grid; gap: 4px; justify-items: start; }
.review-score .big { font-family: var(--font-display); font-size: 44px; line-height: 1; font-weight: 700; }
.review-bars { display: grid; gap: 6px; min-width: 0; }
.review-bars .rb { display: grid; grid-template-columns: 1.5ch minmax(0, 1fr) 3ch; gap: 10px; align-items: center; font-size: 13px; }
.review-bars .track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.review-bars .track span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; padding: 2px; }
.star-input svg { width: 28px; height: 28px; fill: var(--line); transition: fill .1s; }
.star-input label:hover svg, .star-input label:hover ~ label svg, .star-input input:checked ~ label svg { fill: var(--gold); }
.star-input input:focus-visible + label { outline: 3px solid var(--accent); border-radius: 6px; }

/* ---------- Comments ---------- */
.comment-form { display: flex; gap: var(--space-3); align-items: flex-start; }
.comments { display: grid; gap: 0; }
.comment { display: flex; gap: var(--space-3); align-items: flex-start; padding-block: var(--space-4); border-block-start: 1px solid var(--line); }
.comments > .comment:first-child { border-block-start: 0; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.replies { display: grid; margin-top: var(--space-2); padding-inline-start: var(--space-4); border-inline-start: 2px solid var(--line); }
.replies .comment { padding-block: var(--space-3); }
.replies .comment:first-child { border-block-start: 0; }
.replies .avatar.md { width: 36px; height: 36px; font-size: 15px; }
.reply-toggle > summary { list-style: none; }
.reply-toggle > summary::-webkit-details-marker { display: none; }
.reply-toggle[open] { flex-basis: 100%; }
.badge-maker { background: var(--gold-soft); color: var(--gold-ink); }

/* Card stats line */
.p-stats { display: flex; gap: var(--space-3); align-items: center; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.p-stats svg { width: 14px; height: 14px; vertical-align: -2px; }
[data-save] button[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
[data-save] button[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- App of the day ---------- */
.aotd { border-radius: var(--radius-lg); padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); position: relative; overflow: hidden; display: grid; gap: var(--space-4); }
.aotd-top { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.aotd-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; }
@media (max-width: 720px) { .aotd-body { grid-template-columns: auto minmax(0, 1fr); } .aotd-act { grid-column: 1 / -1; } }

/* ---------- Leaderboard card ---------- */
.board { padding: 0; overflow: hidden; }
.board-head { display: flex; justify-content: space-between; align-items: end; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-5); border-block-end: 1px solid var(--line); }
.board .p-row { border-radius: 0; padding-inline: var(--space-5); }
.board .p-row + .p-row { border-block-start: 1px solid var(--line); margin: 0; }
.board-foot { padding: var(--space-3) var(--space-5); border-block-start: 1px solid var(--line); display: flex; justify-content: flex-end; }
.delta { font-size: 13px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: var(--radius-pill); padding: 2px 9px; font-variant-numeric: tabular-nums; }

/* ---------- Side bits ---------- */
.side-stat { display: flex; align-items: baseline; gap: 8px; }
.side-stat strong { font-family: var(--font-display); font-size: 24px; }
.sponsor-slot { display: grid; gap: 4px; justify-items: center; text-align: center; padding: var(--space-5); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink); }
.sponsor-slot:hover { border-color: var(--gold); text-decoration: none; }
.faces { display: inline-flex; align-items: center; }
.faces .avatar { width: 34px; height: 34px; border: 2px solid var(--bg); margin-inline-start: -8px; font-size: 13px; }
.faces .avatar:first-child { margin-inline-start: 0; }
.faces-n { margin-inline-start: 10px; font-weight: 700; font-size: 14px; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: var(--radius-pill); }
.mini { min-width: 0; }
.delta { direction: ltr; unicode-bidi: isolate; }

/* ---------- Header search ---------- */
.head-search { display: none; align-items: center; gap: 8px; height: 40px; padding-inline: 12px 6px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-3); width: 240px; }
.head-search input { border: 0; outline: 0; background: transparent; font: 400 14.5px/1 var(--font-sans); color: var(--ink); width: 100%; min-width: 0; }
.head-search svg { width: 17px; height: 17px; flex: none; }
.head-search kbd { font: 500 11px/1 var(--font-mono); border: 1px solid var(--line); border-radius: 5px; padding: 4px 5px; color: var(--ink-3); direction: ltr; white-space: nowrap; }
.head-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (min-width: 1400px) { .head-search { display: flex; } }
.icon-btn.search-mobile { display: inline-grid; }
@media (min-width: 1400px) { .icon-btn.search-mobile { display: none; } }

/* ---------- Cookie notice ---------- */
.cookie { position: fixed; z-index: 70; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); inset-inline-start: max(16px, env(safe-area-inset-left, 0px)); max-width: 440px; display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); font-size: 14px; }
@media (max-width: 560px) { .cookie { inset-inline-end: 16px; } }

/* ---------- Google button ---------- */
.btn-google { --b-bg: var(--surface); --b-fg: var(--ink); --b-bd: var(--line-strong); }
.btn-google .g { width: 18px; height: 18px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Checklist ---------- */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); counter-reset: ck; }
.check-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.check-list li::before { counter-increment: ck; content: counter(ck); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-family: var(--font-mono); font-size: 14px; }
.check-list h3 { font-size: 16.5px; font-weight: 700; }
.check-list p { color: var(--ink-2); font-size: 15px; }

/* Category tile with description */
.cat-tile .cat-desc { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-block: 2px; }
.cat-tile .cat-go { grid-column: 3; color: var(--ink-3); }
.cat-tile.with-go { grid-template-columns: auto minmax(0, 1fr) auto; }
[dir="rtl"] .cat-tile .cat-go svg { transform: scaleX(-1); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a { white-space: nowrap; }
.nav-main a { white-space: nowrap; }

/* ---------- Header "More" menu ---------- */
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; padding: 8px 12px; border-radius: var(--radius-md); font-size: 15px; white-space: nowrap; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover, .nav-more[open] > summary { color: var(--ink); background: var(--surface-2); }
.nav-more > summary svg { width: 16px; height: 16px; }
.nav-more .menu { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 50; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 6px; display: grid; }
.nav-more .menu a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-md); color: var(--ink); font-weight: 500; }
.nav-more .menu a:hover { background: var(--surface-2); text-decoration: none; }
.nav-more .menu svg { width: 18px; height: 18px; color: var(--accent); }
.nav-more .menu small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }

/* ---------- Stories ---------- */
.post-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-grid .is-lead { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 760px) { .post-grid .is-lead { grid-template-columns: 1fr; } }
.post-card { display: grid; gap: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; min-width: 0; }
.post-card .post-body { display: grid; gap: var(--space-2); padding: 0 var(--space-5) var(--space-5); align-content: start; }
.post-card.is-lead .post-body { padding: var(--space-5); }
.post-card h3 a { color: var(--ink); }
.post-cover { display: block; aspect-ratio: 16 / 9; background: var(--lapis-deep); overflow: hidden; }
.post-card.is-lead .post-cover { aspect-ratio: auto; height: 100%; min-height: 260px; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover-fallback { display: grid; place-items: center; width: 100%; height: 100%; padding: 18px; }
.mini-wall { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; width: min(220px, 70%); direction: ltr; }
.mini-wall span { aspect-ratio: 2 / 1; border-radius: 2px; background: var(--brick-1); }
.mini-wall span.b2 { background: var(--brick-2); }
.mini-wall span.g { background: var(--gold); }
.article { max-width: 760px; margin-inline: auto; display: grid; gap: var(--space-5); }
.article-cover { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.article-body { max-width: none; font-size: 17.5px; line-height: 1.9; }
.article-body img { border-radius: var(--radius-md); }
.article-body blockquote { margin: 1.2em 0; padding-inline-start: 1em; border-inline-start: 3px solid var(--gold); color: var(--ink-2); }
.article-body code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.post-grid.three { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* ---------- Wanted apps ---------- */
.req-list { padding: 0; overflow: hidden; }
.req-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start; padding: var(--space-4) var(--space-5); }
.req-row + .req-row { border-block-start: 1px solid var(--line); }
.req-title { font-size: 17px; font-weight: 700; line-height: 1.5; }
.req-title a { color: var(--ink); }
.req-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.req-head .vote { min-width: 72px; min-height: 78px; font-size: 19px; }
.status-req-open { background: var(--accent-soft); color: var(--accent); }
.status-req-building { background: var(--turq-soft); color: var(--turq-ink); }
.status-req-launched { background: var(--gold-soft); color: var(--gold-ink); }
.status-req-closed { background: var(--surface-2); color: var(--ink-3); }

@media (max-width: 480px) { .seg a { padding: 6px 9px; font-size: 13px; } }

/* ---------- Live surfaces and motion ---------- */
.hero-proof { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink-2); font-size: 14.5px; }
.hero-art { position: relative; padding-block-end: 44px; }
@media (max-width: 979px) { .hero-art { max-width: 420px; margin-inline: auto; width: 100%; } }

/* Spotlight deck: real products stacked over the wall; the top card is pulled away and the next one comes forward. */
.spot { position: absolute; z-index: 2; inset-block-end: 0; inset-inline-start: -28px; width: min(372px, 88%); }
@media (max-width: 979px) { .spot { inset-inline-start: 50%; transform: translateX(-50%); width: min(372px, 94%); } [dir="rtl"] .spot { transform: translateX(50%); } }
.spot-stack { display: grid; }
.spot-card { grid-area: 1 / 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 18px 40px -12px rgba(13, 22, 40, .32), 0 2px 6px rgba(13, 22, 40, .08);
  text-decoration: none; transform-origin: 50% 0; transition: transform .75s var(--ease-out), opacity .5s var(--ease-out), filter .5s var(--ease-out); }
.spot-card:hover { text-decoration: none; border-color: var(--line-strong); }
.spot-card[data-pos="0"] { z-index: 3; }
.spot-card[data-pos="1"] { z-index: 2; transform: translateY(-12px) scale(.94); opacity: .82; filter: saturate(.55) brightness(.97); }
.spot-card[data-pos="2"] { z-index: 1; transform: translateY(-23px) scale(.88); opacity: .5; filter: saturate(.3) brightness(.94); }
.spot-card[data-pos="hide"] { z-index: 0; transform: translateY(-30px) scale(.84); opacity: 0; }
.spot-card[data-pos="out"] { z-index: 4; transform: translateY(26px) rotate(-1.2deg); opacity: 0; filter: blur(2px); transition-duration: .42s, .32s, .32s; transition-timing-function: var(--ease-in); }
[dir="rtl"] .spot-card[data-pos="out"] { transform: translateY(26px) rotate(1.2deg); }
.spot-card[data-pos]:not([data-pos="0"]) { pointer-events: none; }
.spot-card > * { transition: opacity .35s var(--ease-out) .12s; }
.spot-card:not([data-pos="0"]) > * { opacity: 0; transition-delay: 0s; }
.spot-body { display: grid; min-width: 0; line-height: 1.45; }
.spot-kicker { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.spot-rank { color: var(--gold-ink); }
.spot-name { font-size: 16.5px; }
.spot-tag { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-votes { display: grid; justify-items: center; gap: 0; min-width: 52px; padding: 6px 8px; border-radius: var(--radius-md); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.spot-votes svg { width: 16px; height: 16px; color: var(--lapis); }
.spot-dots { position: absolute; inset-block-start: -36px; inset-inline-end: 16px; display: flex; gap: 6px; z-index: 5; }
.spot-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .35s var(--ease-out), background-color .2s; }
.spot-dots button[aria-current="true"] { width: 22px; background: var(--gold); }
.spot-dots button:focus-visible { outline-color: var(--gold); }
.spot-dots::before { content: ""; position: absolute; inset: -9px -10px; border-radius: 99px; background: rgba(10, 30, 79, .42); z-index: -1; }

/* In-place tab swaps: the frame stays, rows move to their new places. */
[data-swapping] { transition: opacity .2s; }
[data-swapping="loading"] .p-row, [data-swapping="loading"] .p-card { opacity: .55; transition: opacity .2s; }

/* Votes: the arrow lifts and the new count rises into place. */
.vote span { display: inline-block; font-variant-numeric: tabular-nums; }
.vote { transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-fast), color var(--dur-base); }

/* Cards answer the pointer with their edge and logo, not a jump. */
.p-card { transition: border-color var(--dur-fast), box-shadow var(--dur-base) var(--ease-out); }
.p-card:hover { box-shadow: 0 10px 28px -14px rgba(13, 22, 40, .28); }
.p-card .logo-tile, .p-row .logo-tile { transition: transform var(--dur-base) var(--ease-out); }
.p-card:hover .logo-tile, .p-row:hover .logo-tile { transform: translateY(-2px); }

/* Page to page: the product's logo carries over from the card to the product header. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .16s var(--ease-in) both vt-out; }
::view-transition-new(root) { animation: .28s var(--ease-out) both vt-in; }
::view-transition-group(p-logo) { animation-duration: .5s; animation-timing-function: var(--ease-out); }
::view-transition-old(p-logo), ::view-transition-new(p-logo) { height: 100%; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
.p-head .logo-tile[data-vt-self] { view-transition-name: p-logo; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } .spot-card { transition: opacity .2s; } }
