/* Shir ya Khat — shiryakhat.app
   "Ink and brass": the two faces of a coin. Tokens mirror the app's theme.
   The landing is one centred column: coin, name, store badges, and little else. */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0B0B0D;
  --surface: #131316;
  --line: #27272D;
  --text: #F3EFE6;
  --muted: #A19D94;
  --accent: #E4B54A;
  /* The coin keeps its own colours in both themes. */
  --brass: #E4B54A;
  --brass-hi: #F6D886;
  --brass-lo: #B5882A;
  --ink: #0B0B0D;
  --on-brass: #1A1407;
  --page: 68rem;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F7F4EE;
    --surface: #FFFFFF;
    --line: #E1DBCF;
    --text: #17150F;
    --muted: #676359;
    --accent: #9A6F0C;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.9;            /* Persian script needs the vertical room */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="en"] body { line-height: 1.65; }

/* Language switching: Farsi is the static default; JS flips data-lang. */
html[data-lang="fa"] .en,
html[data-lang="en"] .fa { display: none; }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-inline-size: 100%; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  inline-size: min(100% - 3rem, var(--page));
  margin-inline: auto;
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  padding: 0.25rem 0.9rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { inset-block-start: 1rem; }

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  text-decoration: none;
}
.brand img { inline-size: 1.5rem; block-size: 1.5rem; }
.top nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }

.lang-toggle {
  display: none;               /* only useful with JS */
  font: inherit;
  color: var(--text);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 1rem;
  cursor: pointer;
}
.js .lang-toggle { display: inline-block; }
.lang-toggle:hover { border-color: var(--accent); }

/* ---------- landing: one centred column, the coin on top ---------- */

.landing .top { padding-block: 1.1rem; }
.landing main { overflow-x: clip; }

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-block: clamp(0.5rem, 3svh, 2.5rem) clamp(3rem, 8vw, 5rem);
}

.hero h1 {
  margin-block-start: 0.4rem;
  font-size: clamp(2.75rem, 11vw, 4.5rem);
  font-weight: 900;
  line-height: 1.4;
}
html[lang="en"] .hero h1 { line-height: 1.1; letter-spacing: -0.03em; margin-block-end: 0.2em; }

.tagline {
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  line-height: 1.8;
  color: var(--muted);
  max-inline-size: 24em;
  text-wrap: balance;
}
html[lang="en"] .tagline { line-height: 1.45; }

/* store badges: the primary action */
.stores { margin-block-start: 1.6rem; }
.stores-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem; }
.badge { display: block; border-radius: 9px; }
.badge img { block-size: clamp(2.9rem, 13vw, 3.4rem); inline-size: auto; }
/* A soft shadow under the TestFlight badge, following its rounded outline. */
.badge-testflight img { filter: drop-shadow(0 0.35rem 0.6rem rgb(0 0 0 / 0.35)); }
.badge[aria-disabled="true"] { opacity: 0.72; cursor: default; }
.soon {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-block-start: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.soon::before {
  content: "";
  inline-size: 0.45rem;
  block-size: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-block-start: clamp(2rem, 6vw, 3rem);
  max-inline-size: 46rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.chips li { padding: 0.1rem 0.95rem; border: 1px solid var(--line); border-radius: 999px; }

/* ---------- the coin ---------- */

.coin {
  --size: min(72vw, 22rem, 42svh);
  position: relative;
  inline-size: var(--size);
  block-size: var(--size);
  margin-block: calc(var(--size) * 0.06) calc(var(--size) * 0.1);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.coin:focus-visible { outline-offset: 6px; border-radius: 50%; }

/* The logo's own neon, as a faint spill of light behind the coin. */
.coin::before {
  content: "";
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 38% 42%, rgba(53, 232, 220, 0.13), transparent 72%),
    radial-gradient(closest-side at 64% 60%, rgba(255, 72, 196, 0.11), transparent 72%);
  pointer-events: none;
}
@media (prefers-color-scheme: light) { .coin::before { opacity: 0.6; } }

/* The stage is taller than the button so the toss has headroom; it never takes clicks. */
.coin-stage { position: absolute; inset: -40% -10%; pointer-events: none; }
.coin-poster, .coin-canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  transition: opacity 0.45s ease;
}
.coin-poster { object-fit: contain; }
.coin-poster[data-face="tails"], .coin-canvas { opacity: 0; }
.coin[data-face="tails"] .coin-poster[data-face="heads"] { opacity: 0; }
.coin[data-face="tails"] .coin-poster[data-face="tails"] { opacity: 1; }
.coin.is-live .coin-canvas { opacity: 1; }
.coin.is-live .coin-poster[data-face] { opacity: 0; transition-delay: 0.1s; }

.coin-note { color: var(--muted); font-size: 0.9rem; min-block-size: 1.9em; }

/* The coin landed on its rim: «شیر یا خط؟ · تصمیم با شماست» or "heads or tails? · …you decide".
   Each line is a .fa/.en pair, so only the active language shows. */
.coin-note.is-undecided > .fa,
.coin-note.is-undecided > .en { display: none; }
.coin-undecided {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 0.7em;
}
.coin-undecided > span { animation: coin-murmur 0.9s ease-out both; }
.coin-undecided > span:nth-child(n+3) { animation-delay: 0.7s; color: var(--accent); }
@keyframes coin-murmur {
  from { opacity: 0; transform: translateY(0.35em); }
  to { opacity: 1; transform: none; }
}

/* ---------- footer ---------- */

.foot { border-block-start: 1px solid var(--line); padding-block: 2.5rem 2.25rem; font-size: 0.95rem; }
.foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.foot h2 { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-block-end: 0.5rem; }
.foot li + li { margin-block-start: 0.2rem; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.foot-links + .fine { margin-block-start: 2.5rem; }
.fine { color: var(--muted); max-inline-size: 44em; }

.landing .foot-links { max-inline-size: 40rem; margin-inline: auto; gap: 1.5rem 1rem; }
.landing .fine { margin-inline: auto; text-align: center; font-size: 0.875rem; }
.fine-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.5rem; margin-block-start: 0.5rem; }
.fine-links a { color: var(--text); }

/* ---------- privacy policy ---------- */

.policy { max-inline-size: 42rem; padding-block: clamp(2rem, 6vw, 4rem) 5rem; }
.policy h1 { font-size: clamp(2.2rem, 6vw, 3.25rem); font-weight: 900; line-height: 1.4; }
html[lang="en"] .policy h1, .policy[lang="en"] h1 { line-height: 1.15; letter-spacing: -0.02em; }
.policy .updated { color: var(--muted); margin-block: 0.5rem 2rem; }
.policy h2 { font-size: 1.35rem; font-weight: 800; line-height: 1.6; margin-block: 2.75rem 0.6rem; }
.policy p + p, .policy p + ul, .policy ul + p { margin-block-start: 0.9rem; }
.policy ul { padding-inline-start: 1.25rem; list-style: disc; }
.policy li::marker { color: var(--accent); }
.policy li + li { margin-block-start: 0.35rem; }
.policy .short {
  margin-block-start: 2rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.policy .short h2 { margin-block-start: 0; }
.policy + .policy { border-block-start: 1px solid var(--line); }   /* no-JS: both languages stacked */

/* ---------- small screens ---------- */

@media (max-width: 46rem) {
  .foot-links { grid-template-columns: 1fr 1fr; }
  .landing .foot-links { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .coin-undecided > span { animation: none; }
}
