/* 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;
}
.hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.9rem); font-weight: 800; margin-bottom: .2em; }
.tagline { color: var(--saffron); font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 700; margin-bottom: .9em; }
.lead { font-size: 1.1rem; opacity: .9; max-width: 34em; }
.quip {
  display: inline-block; margin: 0; padding: .35em 1em; font-size: 1.05rem; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px 18px 4px 18px;
}
.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 28px 0 12px; }
.version { opacity: .75; font-size: .95rem; }
.platforms { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: .95rem; margin: 0; }
.platforms > span:first-child { opacity: .8; }
.pf { display: inline-flex; opacity: .9; transition: opacity .15s, transform .15s; }
.pf:hover { opacity: 1; transform: translateY(-1px); }
.pf .pf-icon { width: 24px; height: 24px; }
.pf.soon { opacity: .35; }
/* Platform logos (site/assets/platforms.svg), painted in the text color */
.pf-icon { width: 28px; height: 28px; fill: currentColor; flex: none; }

.fan { position: relative; height: 320px; }
.fan .card {
  position: absolute; left: 50%; bottom: 10px;
  width: 128px; height: 184px; margin-left: -64px;
  /* The game's Standard deck: white paper, a thin grey border, the face fitted to the height clear of the corners */
  background: #fff; border-radius: 9px; border: 1px solid #BDBDBD; padding: 4px;
  display: flex; justify-content: center; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transform-origin: 50% 190%;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.fan .card img { height: 100%; width: auto; display: block; pointer-events: none; }
/* The hand fanned around a point below it; app.js sets each card's --i (its place from the middle) and the fan's --step */
.fan { --spread: 76deg; --step: 13deg; }
.fan .card { --r: calc(var(--i, 0) * var(--step)); transform: translate(0, 0) rotate(var(--r)); }
.fan .card:hover { transform: translate(0, -18px) rotate(var(--r)); }
.fan .card.deal-in { animation: deal .5s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) backwards; }
@keyframes deal { from { transform: translate(0, 40px) rotate(0deg); opacity: 0; } }
/* Any card can be dragged (app.js); the fan opens a gap where it would land */
.fan .card { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.fan .card.dragging { cursor: grabbing; transition: none; z-index: 99 !important; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
/* Under the fan: call Hokm, then deal again */
.deal-ctl { text-align: center; min-height: 92px; margin-top: 44px; }
.deal-ctl > div { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.deal-ctl > div[hidden] { display: none; }
.deal-ctl p { margin: 0; font-weight: 600; opacity: .9; }
.suits { display: flex; gap: 10px; direction: ltr; }  /* ♣ ♦ ♠ ♥ left to right, like the hand above */
.suits button, .deal-again {
  font: inherit; cursor: pointer; border-radius: 12px; color: var(--parchment);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(244, 236, 216, .28);
  transition: background .15s, transform .15s, border-color .15s;
}
.suits button { width: 52px; height: 52px; font-size: 1.7rem; line-height: 1; display: grid; place-items: center; }
.suits button.red { color: #F08A94; }
.suits button:hover, .deal-again:hover { background: rgba(255, 255, 255, .16); border-color: var(--saffron); transform: translateY(-2px); }
.suits button:focus-visible, .deal-again:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
.deal-again { padding: .35em 1.2em; font-weight: 600; }
#deal-hokm { font-size: 1.4rem; vertical-align: -2px; }
#deal-hokm.red { color: #F08A94; }

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

/* Gameplay demos: one accessible link after the three game introductions. */
.instagram-demo {
  display: flex; align-items: center; gap: 20px; margin-top: 28px; padding: 24px;
  color: var(--ink); text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  background-image: linear-gradient(110deg, color-mix(in srgb, var(--pomegranate) 7%, transparent), transparent 65%);
  transition: border-color .2s, box-shadow .2s;
}
.instagram-demo:hover { border-color: var(--pomegranate); box-shadow: 0 6px 24px color-mix(in srgb, var(--pomegranate) 15%, transparent); }
.instagram-demo:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; }
.instagram-demo-icon {
  flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px;
  color: #fff; background: linear-gradient(135deg, #7044B5, #C13584 48%, #D45138 78%, #E0A526);
}
.instagram-demo-icon svg { width: 34px; height: 34px; }
.instagram-demo-copy { flex: 1; min-width: 0; }
.instagram-demo-copy strong { display: block; font-size: 1.12rem; line-height: 1.6; }
.instagram-demo-copy > span { display: block; color: var(--ink-soft); font-size: .92rem; margin-top: 4px; }
.instagram-demo-action { display: inline-flex; align-items: center; gap: 10px; color: var(--link); font-weight: 700; }
.instagram-demo-action svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 640px) {
  .instagram-demo { flex-wrap: wrap; gap: 14px; padding: 20px; }
  .instagram-demo-icon { width: 48px; height: 48px; border-radius: 14px; }
  .instagram-demo-icon svg { width: 28px; height: 28px; }
  .instagram-demo-copy { flex-basis: calc(100% - 62px); }
  .instagram-demo-action { width: 100%; justify-content: center; padding-top: 14px; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .instagram-demo { transition: none; }
}

/* The Aparat video: a lazy iframe, so it loads only near the viewport and never holds up the page */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; margin-top: 20px; overflow: hidden;
  border-radius: 16px; background: var(--lapis-deep); box-shadow: var(--shadow);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.games { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 20px; margin-top: 24px; }
.game {
  --accent: var(--saffron);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 24px 24px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.game::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--accent); }
.game:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.game.ghafoon { --accent: var(--turquoise); }
.game.shelem { --accent: var(--pomegranate); }
.game p { color: var(--ink-soft); margin: 0 0 .9em; }
.game p:last-child { margin: 0; }
.game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.game-head h3 { margin: 0; font-size: 1.45rem; }
.game .suit {
  flex: none; display: grid; place-items: center; width: 56px; height: 72px;
  font-size: 2rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px;
}
.level { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--ink-soft); }
.level i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.level i.on { background: var(--accent); }
.level i:last-of-type { margin-inline-end: 4px; }
.game p.how { margin-top: auto; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: .95rem; }
.game .how b { color: var(--ink); }
.suit { font-size: 1.8rem; line-height: 1; color: var(--ink); }
.suit.red { color: var(--pomegranate); }
.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(6, 1fr); gap: 32px 28px; }
.features li { grid-column: span 2; }
.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-head .pf-icon { color: var(--ink); }
.dl-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.dl-stores .btn { text-align: center; padding-inline: .5em; white-space: nowrap; }
.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 a { color: inherit; }
.verify { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; }
.verify summary { cursor: pointer; font-weight: 700; }
.verify p, .verify li { color: var(--ink-soft); }
.verify code { word-break: break-all; }
.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); }
}

.stores { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.stores li {
  display: inline-flex; align-items: center; gap: 8px; font-size: .92rem;
  background: var(--surface); border: 1px dashed var(--line); border-radius: 999px; padding: .35em .5em .35em 1em;
}
.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: 20px; padding-bottom: 32px; gap: 8px; }
  .deal { order: -1; margin: 8px 0 20px; }
  .fan { height: 190px; --spread: 56deg; }
  .deal-ctl { margin-top: 36px; }
  .fan .card { width: 96px; height: 138px; margin-left: -48px; padding: 3px; border-radius: 7px; }
  .games { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .features li { grid-column: auto; }
  .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, .game { transition: none; }
  .fan .card.deal-in { animation: none; }
  .suits button, .deal-again { transition: none; }
  .game:hover { transform: none; }
}
