/* ============================================================
   Inner pages — articles index, about, rules.
   Style: "Vibrant & Block-based" (ui-ux-pro-max), on the brand
   tokens in site.css: bold blocks, a duotone per topic, large
   spacing, 200–300 ms transitions, all motion off under
   prefers-reduced-motion.
   ============================================================ */

/* the hero every inner page opens with */
.page-hero {
  color: #fff; position: relative; overflow: hidden;
  padding-block: clamp(2.25rem, 1.4rem + 3.2vw, 4rem);
  background:
    radial-gradient(680px 320px at 10% -30%, rgb(var(--accent) / .5), transparent 62%),
    radial-gradient(480px 300px at 95% 120%, rgb(var(--accent-2) / .35), transparent 60%),
    linear-gradient(135deg, rgb(var(--brand-700)), rgb(var(--brand)) 55%, rgb(var(--brand-2)));
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgb(255 255 255 / .18) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .35;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
.page-hero::after {
  content: ""; position: absolute; inset-block-start: -90px; inset-inline-end: -70px;
  width: 300px; height: 300px; border-radius: 40% 60% 55% 45%;
  background: rgb(255 255 255 / .07); transform: rotate(18deg);
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; margin: .5rem 0 .6rem; max-width: 22ch; }
.page-hero .lead { color: rgb(255 255 255 / .86); max-width: 56ch; font-size: 1.05rem; margin: 0; }
.page-hero .crumbs, .page-hero .crumbs a { color: rgb(255 255 255 / .78); }
.page-hero .crumbs a:hover { color: #fff; }
.eyebrow {
  display: inline-block; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .25);
  border-radius: 999px; padding: .25rem .85rem; font-size: .8rem; font-weight: 700;
  backdrop-filter: blur(6px);
}
.hero-stats { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.hero-stats span {
  background: rgb(255 255 255 / .12); border-radius: var(--r-md); padding: .45rem .9rem;
  font-size: .88rem; color: rgb(255 255 255 / .9);
}
.hero-stats b { color: #fff; font-size: 1.05rem; margin-inline-end: .2rem; }

.btn-ghost-light { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .4); }
.btn-ghost-light:hover { background: rgb(255 255 255 / .12); color: #fff; }

/* a short gradient rule under a heading */
.h-rule { position: relative; padding-bottom: .55rem; margin-bottom: 1rem; }
.h-rule::after {
  content: ""; position: absolute; inset-inline-start: 0; inset-block-end: 0;
  width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, rgb(var(--brand)), rgb(var(--accent)));
}
.center-head { text-align: center; margin-inline: auto; }
.h-rule-center::after { inset-inline-start: 50%; transform: translateX(50%); }

/* ------------------------------------------------ topic duotones */
.cover-buy   { --c1: var(--brand);  --c2: var(--brand-2); }
.cover-learn { --c1: 14 165 233;    --c2: var(--accent-2); }
.cover-fix   { --c1: 245 158 11;    --c2: 249 115 22; }
.cover-must  { --c1: 244 63 94;     --c2: 220 38 38; }
.cover-safe  { --c1: 16 185 129;    --c2: 20 184 166; }
.cover-know  { --c1: 139 92 246;    --c2: 236 72 153; }

.chip-buy   { --cc: var(--brand); }
.chip-learn { --cc: 2 132 199; }
.chip-fix   { --cc: 180 83 9; }
.chip-must  { --cc: 225 29 72; }
.chip-safe  { --cc: 4 120 87; }
.chip-know  { --cc: 124 58 237; }
@media (prefers-color-scheme: dark) {
  .chip-buy { --cc: 165 156 255; } .chip-learn { --cc: 125 211 252; } .chip-fix { --cc: 251 191 36; }
  .chip-must { --cc: 251 113 133; } .chip-safe { --cc: 52 211 153; } .chip-know { --cc: 196 181 253; }
}

/* ------------------------------------------------ articles index */
.filters {
  display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1.5rem;
  scrollbar-width: thin;
}
.filter {
  display: inline-flex; align-items: center; gap: .4rem; flex: none;
  min-height: 44px; padding: 0 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgb(var(--line)); background: rgb(var(--card)); color: rgb(var(--ink));
  font: inherit; font-weight: 700; font-size: .9rem;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.filter svg { width: 17px; height: 17px; }
.filter:hover { border-color: rgb(var(--brand) / .45); }
.filter.is-on {
  background: linear-gradient(135deg, rgb(var(--brand)), rgb(var(--brand-2)));
  color: #fff; border-color: transparent; box-shadow: var(--shadow-card);
}

.bento { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .bento { grid-template-columns: repeat(3, 1fr); } }

.acard {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: rgb(var(--card)); border: 1px solid rgb(var(--line));
  border-radius: var(--r-xl); box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.acard[hidden] { display: none; }
.acard:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: rgb(var(--brand) / .35); }
.acard:focus-within { outline: 3px solid rgb(var(--brand) / .5); outline-offset: 2px; }

.acover {
  position: relative; height: 150px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, rgb(var(--c1)), rgb(var(--c2)));
}
.acover::before {   /* soft geometric shapes, so no cover feels flat */
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 42% 58% 60% 40%;
  inset-block-start: -90px; inset-inline-end: -60px; background: rgb(255 255 255 / .16);
  transform: rotate(20deg);
}
.acover::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / .22) 1.2px, transparent 1.2px);
  background-size: 18px 18px; opacity: .45;
  mask-image: linear-gradient(to top, transparent, #000 70%);
}
.acover-icon {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center; color: #fff;
  background: rgb(255 255 255 / .2); border: 1px solid rgb(255 255 255 / .35);
  backdrop-filter: blur(6px); box-shadow: 0 10px 24px rgb(0 0 0 / .12);
  transition: transform .25s ease;
}
.acover-icon svg { width: 30px; height: 30px; }
.acard:hover .acover-icon { transform: scale(1.06) rotate(-4deg); }

.abody { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1.15rem 1.2rem; flex: 1; }
.achip {
  align-self: flex-start; font-size: .75rem; font-weight: 800; border-radius: 999px;
  padding: .2rem .7rem; color: rgb(var(--cc)); background: rgb(var(--cc) / .12);
}
.abody h3 { margin: 0; font-size: 1.04rem; line-height: 1.75; }
.abody h3 a { color: rgb(var(--ink)); }
.abody h3 a:hover { color: rgb(var(--brand)); text-decoration: none; }
.abody p { margin: 0; color: rgb(var(--muted)); font-size: .9rem; line-height: 1.85; }
.ameta {
  margin-top: auto; padding-top: .7rem; border-top: 1px dashed rgb(var(--line));
  display: flex; gap: .45rem; color: rgb(var(--muted)); font-size: .8rem;
}
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 2; }

/* the lead article: a big tile */
@media (min-width: 640px) {
  .acard-lead { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .acard-lead { grid-column: span 2; grid-row: span 2; }
  .acard-lead .acover { height: auto; min-height: 260px; flex: 1; }
  .acard-lead .acover-icon { width: 92px; height: 92px; border-radius: 28px; }
  .acard-lead .acover-icon svg { width: 44px; height: 44px; }
  .acard-lead .abody { flex: none; padding: 1.4rem 1.5rem 1.5rem; }
  .acard-lead h3 { font-size: 1.35rem; }
  .acard-lead p { font-size: .98rem; }
}
.bento.filtered .acard-lead { grid-column: auto; grid-row: auto; }
.bento.filtered .acard-lead .acover { min-height: 0; height: 150px; flex: none; }
.empty-note { text-align: center; color: rgb(var(--muted)); padding: 2rem 0; }

/* "read next" under an article: the same cards, three across */
.related-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-grid .acover { height: 110px; }
.related-grid .acover-icon { width: 52px; height: 52px; border-radius: 16px; }
.related-grid .acover-icon svg { width: 24px; height: 24px; }

/* ------------------------------------------------ about */
.split { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr .9fr; gap: 3rem; } }
.split-text p { color: rgb(var(--ink)); font-size: 1rem; }

.promise {
  position: relative; border-radius: var(--r-xl); padding: 1.5rem; overflow: hidden; color: #fff;
  background:
    radial-gradient(420px 220px at 90% -10%, rgb(var(--accent) / .45), transparent 60%),
    linear-gradient(150deg, rgb(var(--brand-700)), rgb(var(--brand-2)));
  box-shadow: var(--shadow-pop);
}
.promise-head { font-weight: 800; font-size: 1.05rem; margin-bottom: 1rem; }
.promise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.promise-list li {
  display: flex; gap: .8rem; align-items: flex-start;
  background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16);
  border-radius: var(--r-md); padding: .8rem .9rem;
}
.promise-list b { display: block; font-size: .96rem; }
.promise-list small { display: block; color: rgb(255 255 255 / .82); font-size: .84rem; line-height: 1.75; margin-top: .15rem; }
.pdot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: .45rem; }
.pdot-1 { background: rgb(var(--accent)); box-shadow: 0 0 0 4px rgb(var(--accent) / .25); }
.pdot-2 { background: #34d399; box-shadow: 0 0 0 4px rgb(52 211 153 / .25); }
.pdot-3 { background: #fbbf24; box-shadow: 0 0 0 4px rgb(251 191 36 / .25); }
.pdot-4 { background: #f472b6; box-shadow: 0 0 0 4px rgb(244 114 182 / .25); }

.value {
  background: rgb(var(--card)); border: 1px solid rgb(var(--line)); border-radius: var(--r-xl);
  padding: 1.4rem 1.25rem; text-align: center; position: relative; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.value::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; height: 4px; }
.v-1::before { background: linear-gradient(90deg, rgb(var(--brand)), rgb(var(--brand-2))); }
.v-2::before { background: linear-gradient(90deg, rgb(var(--ok)), rgb(20 184 166)); }
.v-3::before { background: linear-gradient(90deg, rgb(var(--accent)), rgb(var(--accent-2))); }
.v-4::before { background: linear-gradient(90deg, rgb(245 158 11), rgb(249 115 22)); }
.value:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.value .tile { margin: 0 auto .9rem; width: 56px; height: 56px; border-radius: 18px; }
.value .tile svg { width: 26px; height: 26px; }
.value h3 { margin-bottom: .35rem; }
.value p { margin: 0; color: rgb(var(--muted)); font-size: .9rem; }

.contact {
  display: flex; flex-direction: column; gap: .35rem; padding: 1.3rem; min-height: 44px;
  border-radius: var(--r-xl); border: 1px solid rgb(var(--line)); background: rgb(var(--card));
  color: rgb(var(--ink)); box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.contact:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); text-decoration: none; }
.contact b { font-size: 1.02rem; }
.contact small { color: rgb(var(--muted)); font-size: .88rem; }
.contact-ic {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  margin-bottom: .45rem;
}
.contact-ic svg { width: 22px; height: 22px; }
.c-panel .contact-ic   { background: linear-gradient(135deg, rgb(var(--brand)), rgb(var(--brand-2))); }
.c-support .contact-ic { background: linear-gradient(135deg, rgb(var(--accent)), rgb(var(--accent-2))); }
.c-channel .contact-ic { background: linear-gradient(135deg, rgb(139 92 246), rgb(236 72 153)); }
.c-panel:hover   { border-color: rgb(var(--brand) / .45); }
.c-support:hover { border-color: rgb(var(--accent) / .55); }
.c-channel:hover { border-color: rgb(236 72 153 / .45); }

/* ------------------------------------------------ rules */
.rules-layout { display: grid; gap: 1.5rem; }
@media (min-width: 960px) {
  .rules-layout { grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: start; }
  .toc-card { position: sticky; top: 88px; }
}
.toc-card {
  background: rgb(var(--card)); border: 1px solid rgb(var(--line));
  border-radius: var(--r-xl); padding: 1.1rem; box-shadow: var(--shadow-card);
}
.toc-title { font-weight: 800; margin: 0 0 .6rem; font-size: .95rem; }
.toc-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.toc-card a {
  display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .35rem .5rem;
  border-radius: var(--r-md); color: rgb(var(--ink)); font-size: .9rem; font-weight: 600;
  transition: background-color .2s, color .2s;
}
.toc-card a:hover { background: rgb(var(--brand-soft)); color: rgb(var(--brand)); text-decoration: none; }
.toc-n {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: rgb(var(--soft)); color: rgb(var(--muted)); font-size: .78rem; font-weight: 800;
}

.rules-body { display: grid; gap: 1.1rem; min-width: 0; }
.rule-sec {
  background: rgb(var(--card)); border: 1px solid rgb(var(--line)); border-radius: var(--r-xl);
  padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--shadow-card); scroll-margin-top: 88px;
  position: relative; overflow: hidden;
}
.rule-sec::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; }
.rule-sec header { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; }
.rule-sec h2 { margin: 0; font-size: 1.2rem; }
.rule-sec p { line-height: 2; }
.rule-n {
  flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; font-weight: 800; box-shadow: var(--shadow-card);
}
.rs-1 .rule-n, .rs-1::before { background: linear-gradient(135deg, rgb(var(--brand)), rgb(var(--brand-2))); }
.rs-2 .rule-n, .rs-2::before { background: linear-gradient(135deg, rgb(var(--accent)), rgb(var(--accent-2))); }
.rs-3 .rule-n, .rs-3::before { background: linear-gradient(135deg, rgb(var(--ok)), rgb(20 184 166)); }
.rs-4 .rule-n, .rs-4::before { background: linear-gradient(135deg, rgb(245 158 11), rgb(249 115 22)); }
.rs-5 .rule-n, .rs-5::before { background: linear-gradient(135deg, rgb(139 92 246), rgb(236 72 153)); }
.rs-6 .rule-n, .rs-6::before { background: linear-gradient(135deg, rgb(100 116 139), rgb(71 85 105)); }

.flow { list-style: none; padding: 0; margin: 1.1rem 0; display: grid; gap: .6rem; counter-reset: fl; }
@media (min-width: 720px) { .flow { grid-template-columns: repeat(4, 1fr); } }
.flow li {
  counter-increment: fl; background: rgb(var(--soft));
  border-radius: var(--r-md); padding: .85rem; font-size: .88rem; font-weight: 700;
  display: flex; align-items: center; gap: .6rem;
}
.flow li::before {
  content: counter(fl, persian); flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .78rem;
  background: rgb(var(--brand)); color: #fff;
}

.callout { border-radius: var(--r-md); padding: 1rem 1.1rem; font-size: .93rem; line-height: 1.95; margin: 1rem 0; }
.callout-info { background: rgb(var(--brand-soft)); color: rgb(var(--ink)); border-inline-start: 4px solid rgb(var(--brand)); }
.callout-warn { background: rgb(var(--warn-soft)); color: rgb(var(--ink)); border-inline-start: 4px solid rgb(var(--warn)); }

.checks { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .7rem; }
.checks li { position: relative; padding-inline-start: 2rem; line-height: 1.95; }
.checks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .3em; width: 22px; height: 22px;
  border-radius: 7px; background: rgb(var(--ok-soft));
}
.checks li::after {
  content: ""; position: absolute; inset-inline-start: 8px; top: calc(.3em + 5px);
  width: 6px; height: 10px; border: solid rgb(var(--ok)); border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.arrow-link { font-weight: 800; }
.arrow-link::after { content: " ←"; }

.rules-cta {
  margin-top: .5rem; border-radius: var(--r-xl); padding: 1.5rem; text-align: center;
  background: linear-gradient(135deg, rgb(var(--brand-soft)), rgb(var(--accent) / .14));
  border: 1px solid rgb(var(--line));
}
.rules-cta p { font-weight: 700; margin-bottom: .9rem; }

/* ------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .acard:hover, .value:hover, .contact:hover, .card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
