/* Palette from the app's VISION.md: lapis, turquoise, saffron gold, pomegranate red, parchment. Typeface: Vazirmatn. */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --lapis: #1F3A68;
  --lapis-deep: #152A4D;
  --turquoise: #2BA6A4;
  --saffron: #E0A526;
  --pomegranate: #B23A48;
  --parchment: #F4ECD8;

  --bg: #FBF8F1;
  --bg-alt: #F4ECD8;
  --surface: #FFFFFF;
  --ink: #1C2536;
  --ink-soft: #5A6275;
  --line: #E4DAC3;
  --link: #1F3A68;
  --btn-ink: #1C2536;
  --shadow: 0 1px 2px rgba(28, 37, 54, .06), 0 8px 24px rgba(28, 37, 54, .08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1A2E;
    --bg-alt: #13213A;
    --surface: #182845;
    --ink: #EDE6D6;
    --ink-soft: #A9B0C0;
    --line: #253759;
    --link: #F0C35A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .5em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--bg-alt); padding: .1em .4em; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
.muted { opacity: .7; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--lapis-deep) 94%, transparent);
  backdrop-filter: blur(8px);
  color: var(--parchment);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; }
.brand img { border-radius: 8px; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { color: inherit; text-decoration: none; opacity: .85; }
.topbar nav a:hover { opacity: 1; color: var(--saffron); }

/* Buttons */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: .55em 1.3em; border-radius: 12px; transition: transform .15s, box-shadow .15s;
}
.btn.primary { background: var(--saffron); color: var(--btn-ink); box-shadow: 0 2px 0 #B98313; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 #B98313; }
.btn.big { font-size: 1.15rem; padding: .7em 1.8em; }

/* Hero: lapis with a faint girih star pattern, the cards are the hero */
.hero {
  color: var(--parchment);
  background-color: var(--lapis);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(43, 166, 164, .18), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23F4ECD8' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M40 8l9 23 23 9-23 9-9 23-9-23-23-9 23-9z'/%3E%3Cpath d='M17 17h46v46H17z' transform='rotate(45 40 40)'/%3E%3Cpath d='M17 17h46v46H17z'/%3E%3C/g%3E%3C/svg%3E");
  overflow: hidden;
}
.hero-in {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px;
  padding-top: 72px; padding-bottom: 88px;
}
.eyebrow { color: var(--saffron); font-weight: 700; margin-bottom: .6em; }
.hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.9rem); font-weight: 800; margin-bottom: .5em; }
.lead { font-size: 1.1rem; opacity: .9; max-width: 34em; }
.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 28px 0 12px; }
.version { opacity: .75; font-size: .95rem; }
.platforms { opacity: .8; font-size: .95rem; margin: 0; }

.fan { position: relative; height: 320px; }
.fan .card {
  position: absolute; left: 50%; bottom: 10px;
  width: 128px; height: 184px; margin-left: -64px;
  background: var(--parchment); color: var(--ink);
  border-radius: 12px; border: 1px solid #E2D5B6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transform-origin: 50% 190%;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  direction: ltr;
}
.fan .card b { position: absolute; top: 8px; left: 12px; font-size: 1.5rem; line-height: 1; font-family: Georgia, serif; }
.fan .card i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 3.6rem; }
.fan .card.red { color: var(--pomegranate); }
.fan .card:nth-child(1) { transform: rotate(-26deg); }
.fan .card:nth-child(2) { transform: rotate(-13deg); }
.fan .card:nth-child(3) { transform: rotate(0deg); }
.fan .card:nth-child(4) { transform: rotate(13deg); }
.fan .card:nth-child(5) { transform: rotate(26deg); }
.fan .card:hover { transform: translateY(-18px) rotate(var(--r, 0deg)); }
.fan .card:nth-child(1):hover { --r: -26deg; }
.fan .card:nth-child(2):hover { --r: -13deg; }
.fan .card:nth-child(4):hover { --r: 13deg; }
.fan .card:nth-child(5):hover { --r: 26deg; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
.sub { color: var(--ink-soft); margin-top: -.3em; }

.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.game {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow);
}
.game p { color: var(--ink-soft); margin: 0; }
.suit { font-size: 1.8rem; line-height: 1; color: var(--ink); }
.suit.red { color: var(--pomegranate); }
.game .suit { display: block; margin-bottom: 12px; }
.tag {
  font-size: .75rem; font-weight: 600; vertical-align: middle;
  background: color-mix(in srgb, var(--turquoise) 18%, transparent); color: var(--turquoise);
  padding: .15em .6em; border-radius: 999px;
}

.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.features h3 { color: var(--ink); }
.features h3::before { content: ""; display: block; width: 28px; height: 3px; background: var(--saffron); border-radius: 2px; margin-bottom: 12px; }
.features p { color: var(--ink-soft); margin: 0; font-size: .97rem; }

/* Downloads */
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.dl-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start;
}
.dl-card.here { border-color: var(--saffron); box-shadow: 0 0 0 2px var(--saffron), var(--shadow); order: -1; }
.dl-card.here .dl-head::after {
  content: "دستگاه شما"; font-size: .75rem; font-weight: 600; margin-inline-start: auto;
  background: var(--saffron); color: var(--btn-ink); padding: .1em .6em; border-radius: 999px;
}
.dl-card.soon { opacity: .6; box-shadow: none; }
.dl-head { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 14px; }
.dl-head h3 { margin: 0; }
.dl-note { color: var(--ink-soft); font-size: .88rem; margin: 10px 0 0; }
.dl-alt { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); width: 100%; }
.dl-alt p { font-size: .92rem; margin: 0; }
.dl-alt span { color: var(--ink-soft); font-size: .85rem; }

/* VirusTotal result per file, and one line for the whole release */
.vt {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: .82rem; font-weight: 600; text-decoration: none;
  padding: .2em .75em; border-radius: 999px;
}
.vt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vt.ok { color: #1E7F5C; background: color-mix(in srgb, #1E7F5C 12%, transparent); }
.vt.warn { color: var(--pomegranate); background: color-mix(in srgb, var(--pomegranate) 12%, transparent); }
.vt.pending { color: var(--ink-soft); background: color-mix(in srgb, var(--ink-soft) 12%, transparent); }
.vt:hover { text-decoration: underline; }
.vt-summary { margin: 4px 0 0; font-size: .95rem; }
.vt-summary.ok { color: #1E7F5C; }
.vt-summary.warn { color: var(--pomegranate); }
@media (prefers-color-scheme: dark) {
  .vt.ok, .vt-summary.ok { color: #5FD3A5; }
  .vt.ok { background: color-mix(in srgb, #5FD3A5 14%, transparent); }
}

.help { margin-top: 40px; display: grid; gap: 10px; }
.help details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; }
.help summary { cursor: pointer; font-weight: 700; }
.help details p { margin: 10px 0 4px; color: var(--ink-soft); }
.help details ol { margin: 8px 0; padding-inline-start: 1.4em; color: var(--ink-soft); }
.help details li { margin-bottom: .3em; }
.dl-hint { font-size: .85rem; color: var(--ink-soft); margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); width: 100%; }

.about p { font-size: 1.05rem; }
.notes li, .release li { margin-bottom: .4em; }

/* Changelog page */
.page-head { padding: 56px 0 8px; }
.release { padding: 28px 0; border-bottom: 1px solid var(--line); }
.release:last-child { border-bottom: 0; }
.release h2 { font-size: 1.35rem; margin: 0; }
.release h2 a { color: inherit; text-decoration: none; }
.release time { color: var(--ink-soft); font-size: .92rem; }
.release ul { margin: 12px 0 0; }
.release:target h2 { color: var(--pomegranate); }

.footer { background: var(--lapis-deep); color: var(--parchment); padding: 28px 0; font-size: .95rem; }
.footer a { color: var(--saffron); }
.footer-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.footer p { margin: 0; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 32px; gap: 8px; }
  .fan { height: 220px; order: -1; margin-top: 8px; }
  .fan .card { width: 96px; height: 138px; margin-left: -48px; }
  .fan .card i { font-size: 2.6rem; }
  .games { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .section { padding: 52px 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .topbar nav { gap: 14px; font-size: .92rem; }
  .brand span { display: none; }
  .features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fan .card, .btn { transition: none; }
}
