@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F6F7F9; --surface: #FFFFFF; --sunk: #EEF0F3;
  --ink: #111317; --muted: #555C66; --line: #E1E4E9;
  --accent: #13825C; --accent-hover: #0F6E4E; --on-accent: #FFFFFF; --accent-soft: #E2F2EA;
  --warn: #9A5B00; --warn-soft: #FBEFD9;
  --radius: 14px; --wrap: 1180px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1013; --surface: #161A1F; --sunk: #1D2127;
    --ink: #F2F3F5; --muted: #A3A9B2; --line: #2A2F36;
    --accent: #34C98E; --accent-hover: #5AD7A5; --on-accent: #0E1013; --accent-soft: #15291F;
    --warn: #F0A63A; --warn-soft: #2B2112;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--line) var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.85 Vazirmatn, Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
html[lang="en"] body { line-height: 1.6; }
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-underline-offset: .3em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; font-weight: 700; text-wrap: balance; }
html[lang="en"] :is(h1, h2, h3, h4) { line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* One language at a time: each piece of copy exists in both, the inactive one is hidden. */
html[lang="fa"] body [lang="en"], html[lang="en"] body [lang="fa"] { display: none !important; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { width: 36px; height: 36px; flex: none; transition: transform .45s var(--ease); }
.brand:hover .logo { transform: rotate(-8deg); }
.name { display: grid; line-height: 1.2; }
.brand b { font-size: 1.25rem; font-weight: 700; }
.brand small { color: var(--muted); font-size: .75rem; }
header nav { display: flex; gap: 28px; margin-inline-start: auto; font-size: .9375rem; }
header nav a { position: relative; text-decoration: none; color: var(--muted); transition: color .2s; }
header nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 2px; background: var(--accent); border-radius: 2px; transform: scaleX(0); transition: transform .35s var(--ease); }
header nav a:hover { color: var(--ink); }
header nav a:hover::after { transform: scaleX(1); }
header nav a[aria-current="page"] { color: var(--ink); }
header nav a[aria-current="page"]::after { transform: scaleX(1); }
.lang { display: flex; gap: 2px; padding: 3px; background: var(--sunk); border-radius: 999px; }
.lang button { font: inherit; font-size: .8125rem; font-weight: 500; min-width: 40px; padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; transition: background .25s, color .25s; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); outline: 1px solid var(--line); }
section[id], main[id] { scroll-margin-top: 72px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 500; text-decoration: none; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }
.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
html[dir="rtl"] .btn svg { transform: scaleX(-1); }
html[dir="rtl"] .btn:hover svg { transform: scaleX(-1) translateX(4px); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 72px; align-items: center; padding-block: 96px 112px; }
.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
.hero h1 em { font-style: normal; color: var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)) no-repeat 0 92% / 100% .32em; }
html[dir="rtl"] .hero h1 em { background-position: 100% 92%; }
.lede { margin-top: 20px; max-width: 34em; color: var(--muted); font-size: 1.1875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Hero: Faronio's solutions, GameSense as one of them */
.stack-label { color: var(--muted); font-size: .875rem; margin-bottom: 12px; }
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sol { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 14px; }
.sol b { display: block; font-weight: 700; }
.sol small { display: block; color: var(--muted); font-size: .875rem; }
.sol.live { background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: 0 18px 40px -30px rgb(17 19 23 / .45); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .2s; }
.sol.live:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 24px 48px -28px rgb(17 19 23 / .5); }
.sol.live img { width: 40px; height: 40px; }
.dots { display: grid; grid-template-columns: repeat(4, 8px); gap: 5px; margin-inline-start: auto; }
.dots i { width: 8px; height: 8px; border-radius: 2px; background: var(--sunk); }
.dots i.b { background: var(--accent); }
.dots i.e { background: var(--warn); }
.sol.soon { border: 1.5px dashed var(--line); color: var(--muted); }
.sol.soon b { color: var(--ink); font-weight: 500; }
.ph { width: 40px; height: 40px; border-radius: 12px; flex: none; background: var(--sunk); display: grid; place-items: center; }
.ph svg { width: 18px; height: 18px; }

/* Sections */
section { padding-block: 96px; border-top: 1px solid var(--line); }
.sec-head { max-width: 40em; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
.sec-head p { margin-top: 12px; color: var(--muted); }
.sec-head p b { color: var(--accent); }

/* GameSense */
.product { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 48px; }
.product .logo { height: 44px; width: auto; }
.product .pitch { margin-top: 20px; font-size: 1.125rem; }
.product .actions { margin-top: 28px; }

.demo { margin-top: 36px; max-width: 360px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.demo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .875rem; font-weight: 500; }
.demo-head > span { white-space: nowrap; }
.head-end { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.tag { font-size: .75rem; color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 4px 12px; line-height: 1.4; }
.pause { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; }
.pause:hover { color: var(--ink); border-color: var(--muted); }
.pause svg { width: 12px; height: 12px; }
.pause[aria-pressed="true"] .i-pause, .pause[aria-pressed="false"] .i-play { display: none; }
.clock-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; }
.clock-row small { color: var(--muted); font-size: .8125rem; }
.clock { font-size: 1.75rem; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; unicode-bidi: isolate; direction: ltr; }
.meter { height: 4px; background: var(--sunk); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 70%; background: var(--accent); border-radius: inherit; transition: width 1s linear; }
.strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 14px 0 0; padding: 0; list-style: none; }
.strip li { text-align: center; font-size: .75rem; padding: 4px 0; border-radius: 8px; background: var(--sunk); color: var(--muted); font-variant-numeric: tabular-nums; transition: background-color .5s, color .5s; }
.strip .busy { background: var(--accent-soft); color: var(--accent-hover); }
.strip .ending { background: var(--warn-soft); color: var(--warn); }
.strip .here { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--ink); }
.strip .flip { animation: flip .6s var(--ease); }
@keyframes flip { from { transform: scale(.7); } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: .75rem; color: var(--muted); }
.legend > span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 6px; background: var(--sunk); border: 1px solid var(--line); }
.legend .l-busy::before { background: var(--accent); border-color: var(--accent); }
.legend .l-ending::before { background: var(--warn); border-color: var(--warn); }

.features h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.features h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.features h3 + .feat { margin-top: 16px; }
.feat + h3 { margin-top: 36px; }
.feat { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feat li { display: flex; gap: 12px; padding: 14px; border-radius: 12px; transition: background .25s; }
.feat li:hover { background: var(--sunk); }
.feat .ic { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hover); transition: transform .35s var(--ease); }
.feat li:hover .ic { transform: rotate(-6deg) scale(1.06); }
.feat b { display: block; font-weight: 700; font-size: .9688rem; }
.feat p > span { display: block; color: var(--muted); font-size: .875rem; line-height: 1.7; }
.feat.later .ic { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }

.next { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.slot { border: 1.5px dashed var(--line); border-radius: 20px; padding: 28px 32px; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.slot b { color: var(--ink); font-weight: 500; }

/* About */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin: 0; }
.principles > div { position: relative; padding-top: 22px; }
.principles > div::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 2px; background: var(--ink); transform-origin: var(--from, left); }
html[dir="rtl"] .principles > div::before { --from: right; }
.principles dt { font-weight: 700; font-size: 1.125rem; }
.principles dd { margin: 8px 0 0; color: var(--muted); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact .sec-head { margin: 0; }
.contact dl { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contact dl div { display: flex; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.contact dl div + div { border-top: 1px solid var(--line); }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; font-weight: 500; }
.todo { color: var(--warn); text-decoration: underline dashed; text-underline-offset: .4em; }

footer { border-top: 1px solid var(--line); padding-block: 32px; color: var(--muted); font-size: .875rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { text-decoration: none; transition: color .2s; }
footer a:hover { color: var(--ink); }

/* Copyright and licensing page */
.legal { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px 64px; padding-block: 72px 112px; align-items: start; }
.legal-head { grid-column: 1 / -1; max-width: 44em; margin-bottom: 32px; }
.legal-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.legal-head p { margin-top: 12px; color: var(--muted); }
.updated { margin-top: 16px !important; font-size: .875rem; }
.toc { position: sticky; top: 100px; font-size: .875rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line); }
.toc a { display: block; padding: 6px 16px; margin-inline-start: -1px; border-inline-start: 2px solid transparent; color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); border-color: var(--accent); }
.terms { max-width: 68ch; counter-reset: clause; }
section.clause { padding: 0; border: 0; counter-increment: clause; scroll-margin-top: 96px; }
.clause + .clause { margin-top: 48px; }
.clause h2 { display: flex; gap: 14px; font-size: 1.25rem; }
.clause h2::before { content: counter(clause, persian); color: var(--accent); min-width: 1ch; }
html[lang="en"] .clause h2::before { content: counter(clause); }
.clause p, .clause ul { margin-top: 14px; }
.clause ul { padding-inline-start: 1.25em; margin-bottom: 0; }
.clause li + li { margin-top: 8px; }
.clause li::marker { color: var(--accent); }
.clause a { color: var(--accent); }


/* ---- Motion (only when .anim is set: JS on and reduced motion off) ---- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes sweep { from { background-size: 0% .32em; } }
@keyframes blink { 40% { background: var(--accent); } 75% { background: var(--warn); } }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.anim [data-in] { animation: rise .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 80ms); }
.anim .hero h1 em { animation: sweep 1.1s var(--ease) .7s both; }
.anim .dots i { animation: blink 2.6s steps(1) calc(var(--d) * 1s) 3; }
.anim .ph { background: linear-gradient(90deg, var(--sunk) 30%, color-mix(in srgb, var(--sunk) 40%, var(--surface)) 50%, var(--sunk) 70%) 0 0 / 250% 100%; animation: shimmer 1.8s ease-in-out 1s 3; }
.anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.anim .reveal.in { opacity: 1; transform: none; }
.anim .principles > div::before { transform: scaleX(0); transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 120ms + 150ms); }
.anim .principles > div.in::before { transform: scaleX(1); }

@media (max-width: 900px) {
  .bar { flex-wrap: wrap; height: auto; gap: 4px 16px; padding-top: 12px; }
  .lang { margin-inline-start: auto; }
  header nav { order: 3; width: 100%; margin: 0; gap: 22px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; padding-block: 8px 12px; }
  section[id], main[id] { scroll-margin-top: 112px; }
  .legal { grid-template-columns: 1fr; padding-block: 48px 72px; }
  .legal-head { margin-bottom: 8px; }
  .toc { position: static; }
  .hero, .product, .contact { grid-template-columns: 1fr; }
  .hero { gap: 48px; padding-block: 56px 72px; }
  .product { padding: 28px 20px; gap: 40px; }
  .demo { max-width: none; }
  .principles, .next { grid-template-columns: 1fr; gap: 28px; }
  section { padding-block: 72px; }
}
@media (max-width: 560px) {
  .feat { grid-template-columns: 1fr; }
  .feat li { padding: 12px 4px; }
}
@media (max-width: 420px) {
  .wrap { padding-inline: 16px; }
  .brand small { display: none; }
}
