/* Persian By Proshat — design tokens
   canvas #F7F7F9 · ink #111 · mint #6FD6C6 · lavender #C9A8F0
   blush #FBD5DC · butter #FFE9A8 · hard 4px shadow, no blur, ever. */

:root {
  --canvas: #f7f7f9;
  --paper: #ffffff;
  --ink: #111111;
  --ink-soft: #5c5c66;
  --mint: #6fd6c6;
  --mint-deep: #4bbfad;
  --lav: #c9a8f0;
  --blush: #fbd5dc;
  --butter: #ffe9a8;
  --grey: #e6e6ea;

  --line: 2px solid var(--ink);
  --hard: 4px 4px 0 var(--ink);
  --hard-sm: 3px 3px 0 var(--ink);
  --hard-lg: 6px 6px 0 var(--ink);
  --r-card: 20px;
  --r-lg: 24px;
  --s: 8px;

  --fa: "Vazirmatn", "Noto Naskh Arabic", "Tahoma", serif;
  --ui: "Poppins", ui-rounded, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- phone shell ---------- */

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

.blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.blobs i {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: .5;
}
.blobs i:nth-child(1) { width: 260px; height: 260px; background: var(--blush); top: -80px; left: -110px; opacity: .35; }
.blobs i:nth-child(2) { width: 320px; height: 320px; background: var(--mint); bottom: -140px; right: -130px; opacity: .25; }
.blobs i:nth-child(3) { width: 180px; height: 180px; background: var(--lav); top: 42%; left: -90px; opacity: .22; }

.app {
  position: relative;
  z-index: 1;
  --pad-b: 120px;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  padding: 16px 16px var(--pad-b);
  background: transparent;
}

@media (min-width: 560px) {
  .stage { padding: 32px 0 48px; align-items: flex-start; }
  .app {
    --pad-b: 20px;
    display: flex;
    flex-direction: column;
    max-width: 402px;
    min-height: 820px;
    height: 820px;
    overflow-y: auto;
    background: var(--canvas);
    border: var(--line);
    border-radius: 38px;
    box-shadow: var(--hard-lg);
    scrollbar-width: none;
  }
  .app::-webkit-scrollbar { display: none; }
  .app > * { flex: 0 0 auto; }
}

/* ---------- type ---------- */

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

.fa {
  font-family: var(--fa);
  direction: rtl;
  unicode-bidi: isolate;
  font-weight: 600;
}
.translit {
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-soft);
  font-style: italic;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.muted { color: var(--ink-soft); }
.tiny { font-size: 12px; }
.center { text-align: center; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  min-height: 44px;
}
.topbar .title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.topbar .title.left { text-align: left; }

.iconbtn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--hard-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.iconbtn.lav { background: var(--lav); }
.iconbtn.mint { background: var(--mint); }
.iconbtn.ghost { border: none; box-shadow: none; background: transparent; }
.iconbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.spacer { flex: 0 0 44px; }

/* ---------- surfaces ---------- */

.card {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--hard);
  padding: 16px;
}
.card + .card { margin-top: 14px; }
.grid2 .card + .card,
.stack .card + .card,
.hscroll .card + .card,
.row .card + .card,
.unit .card + .card { margin-top: 0; }
.card.mint { background: var(--mint); }
.card.lav { background: var(--lav); }
.card.blush { background: var(--blush); }
.card.butter { background: var(--butter); }
.card.flat { box-shadow: none; }

.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-head a { font-size: 13px; font-weight: 600; color: var(--ink); }

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: var(--line);
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--hard);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn.block { width: 100%; }
.btn.lav { background: var(--lav); }
.btn.blush { background: var(--blush); }
.btn.butter { background: var(--butter); }
.btn.paper { background: var(--paper); }
.btn.sm { min-height: 38px; padding: 8px 16px; font-size: 13px; box-shadow: var(--hard-sm); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}
.pill.butter { background: var(--butter); }
.pill.mint { background: var(--mint); }
.pill.lav { background: var(--lav); }
.pill.blush { background: var(--blush); }

/* segmented choice */
.choice {
  width: 100%;
  text-align: left;
  display: block;
  padding: 14px 16px;
  border: var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--hard-sm);
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
}
.choice[aria-pressed="true"], .choice.on { background: var(--mint); }
.choice strong { display: block; font-size: 15px; }
.choice span { font-size: 12px; color: var(--ink-soft); }
.choice[aria-pressed="true"] span { color: #14403a; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- progress ---------- */

.bar {
  height: 14px;
  border: var(--line);
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--mint); border-right: 2px solid var(--ink); }
.bar.thin { height: 10px; }

.steps { display: flex; gap: 5px; }
.steps i {
  flex: 1;
  height: 10px;
  border: var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.steps i.on { background: var(--mint); }

.ring { display: grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .val {
  position: absolute;
  font-weight: 700;
  text-align: center;
  line-height: 1.05;
}

/* ---------- lesson ---------- */

.bubble {
  position: relative;
  border: var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--hard);
  padding: 18px 16px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-right: var(--line);
  border-bottom: var(--line);
  transform: rotate(45deg);
}

.slots {
  direction: rtl;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  padding: 10px;
  margin-top: 26px;
  border: 2px dashed var(--ink);
  border-radius: 16px;
  background: rgba(255, 255, 255, .55);
}
.bank {
  direction: rtl;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.chip {
  font-family: var(--fa);
  direction: rtl;
  font-size: 17px;
  font-weight: 600;
  padding: 9px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--hard-sm);
  cursor: pointer;
  color: var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, opacity .12s ease;
}
.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chip.used { opacity: .25; pointer-events: none; box-shadow: none; }
.chip.in-slot { background: var(--butter); }

/* result sheet */
.sheet {
  position: sticky;
  bottom: 0;
  margin: 24px -16px calc(-1 * var(--pad-b));
  padding: 22px 18px 34px;
  border-top: var(--line);
  border-radius: 26px 26px 0 0;
  background: var(--mint);
  text-align: center;
  animation: rise .18s ease-out;
}
.sheet.wrong { background: var(--blush); }
.sheet h2 { font-size: 21px; }
.sheet .xp { font-size: 28px; font-weight: 700; margin: 6px 0 14px; }
@keyframes rise { from { transform: translateY(24px); } to { transform: none; } }

/* ---------- learning path ---------- */

.path { position: relative; padding-left: 44px; }
.path::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 22px;
  bottom: 22px;
  border-left: 2px dashed var(--ink);
}
.node {
  position: absolute;
  left: 0;
  width: 36px;
  height: 36px;
  border: var(--line);
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.node.done { background: var(--mint); }
.node.current { background: var(--lav); box-shadow: var(--hard-sm); }
.node.locked { background: var(--grey); color: var(--ink-soft); }
.unit { position: relative; margin-bottom: 14px; }
.unit .card { padding: 14px; }
.unit.locked .card { background: #f1f1f4; box-shadow: none; color: var(--ink-soft); }

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 16px 14px 0;
  margin: 0 -16px 0 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 148px; scroll-snap-align: start; }

/* ---------- lists ---------- */

.listrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey);
}
.listrow:last-child { border-bottom: 0; }
.listrow .grow { flex: 1; min-width: 0; }

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--blush);
}
.avatar.mint { background: var(--mint); }
.avatar.lav { background: var(--lav); }
.avatar.butter { background: var(--butter); }
.avatar.big { width: 66px; height: 66px; flex-basis: 66px; font-size: 22px; box-shadow: var(--hard-sm); }

/* ---------- charts ---------- */

.chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.chart .col i {
  display: block;
  width: 100%;
  border: var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--mint);
}
.chart .col.today i { background: var(--lav); }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal .h { font-size: 10px; font-weight: 700; color: var(--ink-soft); }
.cal .d {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 11px;
  border-radius: 50%;
  border: 1px solid transparent;
}
.cal .d.on { background: var(--mint); border: var(--line); font-weight: 700; }

.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.badges .b i {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: var(--line);
  border-radius: 16px;
  background: var(--butter);
  box-shadow: var(--hard-sm);
  font-style: normal;
  font-size: 20px;
}
.badges .b.off i { background: #f1f1f4; opacity: .55; box-shadow: none; }
.badges .b span { display: block; font-size: 10px; margin-top: 6px; line-height: 1.25; }

/* ---------- toggles ---------- */

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 52px;
  border: var(--line);
  border-radius: 999px;
  background: var(--grey);
  cursor: pointer;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border: var(--line);
  border-radius: 50%;
  background: var(--paper);
  transition: left .14s ease;
}
.switch[aria-checked="true"] { background: var(--mint); }
.switch[aria-checked="true"]::after { left: 24px; }

/* ---------- bottom nav ---------- */

.navbar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(398px, calc(100% - 32px));
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px;
  border: var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--hard);
  z-index: 20;
}
@media (min-width: 560px) {
  .navbar {
    position: sticky;
    bottom: 14px;
    left: auto;
    transform: none;
    width: 100%;
    margin-top: auto;
  }
}
.navbar a {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 2px solid transparent;
}
.navbar a.on { background: var(--lav); border: var(--line); }

/* ---------- states ---------- */

.empty { text-align: center; padding: 40px 20px; }
.empty .art {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 24px;
  background: var(--blush);
  box-shadow: var(--hard);
}
.skel {
  border: var(--line);
  border-radius: 14px;
  background: linear-gradient(90deg, #ececf0 25%, #f6f6f8 50%, #ececf0 75%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -300% 0; } }
.skel.line { height: 14px; border-radius: 999px; }

/* ---------- misc ---------- */

.icon { width: 22px; height: 22px; display: block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 18px; height: 18px; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
