/* ============================================================
   SPEAK FARSI — site design system
   Palette: deep teal (dominant) · teal · terracotta (accent)
   · saffron (highlight) · cream (paper) · ink
   Type: Inter (display+body) · Vazirmatn (Farsi)
   Signature: the phrase card + stress-pulse on stressed syllables
   ============================================================ */

:root {
  --teal: #0F6B5C;
  --teal-dk: #0A4A40;
  --teal-deep: #073630;
  --terra: #B04A2F;
  --terra-lt: #C96A4E;
  --saffron: #D9A441;
  --cream: #FAF6EF;
  --sand: #EFE7D8;
  --mint: #E4F0ED;
  --ink: #1A1A2E;
  --ink-soft: #3A3A4E;
  --paper: #FFFFFF;
  --line: #D8CFBF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(10, 74, 64, 0.12);
  --shadow-sm: 0 4px 14px rgba(10, 74, 64, 0.10);
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.fa { font-family: 'Vazirmatn', 'Inter', sans-serif; direction: rtl; }

a { color: var(--teal); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 2px;
  border-radius: 4px;
}
img, svg, video { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 54, 48, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: baseline; gap: 8px;
  color: #fff; text-decoration: none;
  font-weight: 900; font-size: 1.15rem; letter-spacing: 0.4px;
}
.logo .accent { color: var(--saffron); }
.logo .fa { font-size: 1.05rem; font-weight: 500; color: rgba(255,255,255,0.75); }
.nav { display: flex; gap: 6px; }
.nav a {
  color: rgba(255,255,255,0.88); text-decoration: none;
  font-weight: 600; font-size: 0.92rem;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255,255,255,0.12); color: #fff; }

/* ---------- hero ---------- */
.hero {
  background: url("assets/img/kaashi-teal.jpg") center/cover no-repeat, linear-gradient(160deg, var(--teal-deep), var(--teal-dk));
  color: #fff;
  padding: 88px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero > .wrap { position: relative; z-index: 3; }
.hero .fa-watermark {
  position: absolute; right: -20px; bottom: -50px;
  font-family: 'Vazirmatn'; font-weight: 700;
  font-size: clamp(180px, 26vw, 330px);
  color: rgba(255,255,255,0.045);
  line-height: 1; pointer-events: none; user-select: none;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 2.2px;
  text-transform: uppercase; color: var(--saffron);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
  font-weight: 900; line-height: 1.06; letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero h1 .stress { color: var(--saffron); }
.hero .sub {
  font-size: 1.13rem; color: rgba(255,255,255,0.82);
  max-width: 34rem; margin-bottom: 32px;
}
.hero .sub b { color: #fff; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 1rem;
  padding: 14px 26px; border-radius: 999px; border: 0;
}
.btn-primary { background: var(--terra); color: #fff; box-shadow: 0 6px 20px rgba(176,74,47,0.4); }
.btn-primary:hover { background: var(--terra-lt); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: #fff; }
.hero .note { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 16px; }

/* the signature: floating phrase card */
.phrase-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 30px; max-width: 340px;
  transform: rotate(-1.5deg);
}
.phrase-card .tr { font-size: 2.2rem; font-weight: 800; color: var(--teal-dk); letter-spacing: 0.3px; position: relative; display: inline-block; }
.phrase-card .tr::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 4px; border-radius: 4px; background: var(--saffron);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.phrase-card .en { font-size: 1.02rem; color: var(--ink-soft); margin-top: 6px; }
.phrase-card .meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sand);
  font-size: 0.8rem; color: #6b6052;
}
.phrase-card .meta .fa { font-size: 1.15rem; color: var(--teal); }

/* ---------- sections ---------- */
.section { padding: 78px 0; }
.section.alt { background: var(--paper); }
.section-head { max-width: 620px; margin-bottom: 42px; }
.section-head .eyebrow { color: var(--terra); }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 900; letter-spacing: -0.5px; line-height: 1.15; }
.section-head p { color: var(--ink-soft); margin-top: 12px; font-size: 1.04rem; }

/* trio cards */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trio .t-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm);
}
.section.alt .trio .t-card { background: var(--cream); }
.t-card .t-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; margin-bottom: 16px;
  background: var(--mint); color: var(--teal-dk);
}
.t-card h3 { font-size: 1.12rem; font-weight: 800; margin-bottom: 8px; }
.t-card .dur { color: var(--terra); font-weight: 700; font-size: 0.82rem; letter-spacing: 1px; text-transform: uppercase; }
.t-card p { font-size: 0.95rem; color: var(--ink-soft); margin-top: 8px; }

/* cast */
.cast-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cast-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.cast-card .ava {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 1.3rem; margin-bottom: 14px;
}
.cast-card .rl { font-size: 0.72rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--terra); }
.cast-card h3 { font-size: 1.05rem; font-weight: 800; margin: 2px 0 6px; }
.cast-card h3 .fa { font-size: 0.95rem; color: var(--teal); font-weight: 500; }
.cast-card p { font-size: 0.88rem; color: var(--ink-soft); }

/* curriculum preview + page */
.unit {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
}
.unit summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
}
.unit summary::-webkit-details-marker { display: none; }
.unit summary:hover { background: var(--cream); }
.unit .u-num {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: var(--teal-dk); color: var(--saffron);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.05rem;
}
.unit .u-title { font-weight: 800; font-size: 1.05rem; }
.unit .u-meta { font-size: 0.82rem; color: #6b6052; margin-top: 2px; }
.unit .u-chev { margin-left: auto; color: var(--terra); font-weight: 900; transition: transform 0.2s; transform: rotate(90deg); }
.unit[open] .u-chev { transform: rotate(-90deg); }
.lesson-rows { border-top: 1px solid var(--sand); }
.lesson-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 22px; border-bottom: 1px solid var(--sand);
  text-decoration: none; color: var(--ink);
}
.lesson-row:last-child { border-bottom: 0; }
a.lesson-row:hover { background: var(--mint); }
.lesson-row .n { width: 34px; font-weight: 800; color: var(--teal); font-size: 0.92rem; }
.lesson-row .t { font-weight: 600; font-size: 0.97rem; flex: 1; }
.lesson-row .done-mark { color: var(--teal); font-weight: 900; }
.badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.avail { background: var(--mint); color: var(--teal-dk); }
.badge.prod { background: #F6E7C8; color: #8a6a1f; }
.badge.plan { background: var(--sand); color: #6b6052; }

.progress-shell {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 26px;
  display: flex; align-items: center; gap: 18px;
}
.progress-bar { flex: 1; height: 12px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--saffron)); border-radius: 999px; transition: width 0.4s; }
.progress-label { font-weight: 800; font-size: 0.92rem; color: var(--teal-dk); white-space: nowrap; }

/* ---------- lesson page ---------- */
.lesson-hero { background: linear-gradient(160deg, var(--teal-deep), var(--teal-dk)); color: #fff; padding: 46px 0 40px; }
.lesson-hero .crumbs { font-size: 0.85rem; color: rgba(255,255,255,0.65); margin-bottom: 14px; }
.lesson-hero .crumbs a { color: rgba(255,255,255,0.85); }
.lesson-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 900; letter-spacing: -0.5px; }
.lesson-hero .fa-big { font-family: 'Vazirmatn'; font-size: 1.5rem; color: var(--saffron); margin-top: 8px; }
.lesson-hero .objectives { margin-top: 16px; color: rgba(255,255,255,0.85); max-width: 40rem; font-size: 1rem; }

.lesson-main { padding: 46px 0 80px; }
.lesson-grid { display: grid; grid-template-columns: 1fr 300px; gap: 34px; align-items: start; }
.lesson-col-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }

.video-slot {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--teal-deep); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8); text-align: center; padding: 20px;
}
.video-slot iframe { width: 100%; height: 100%; border: 0; }
.video-slot .ph { font-size: 0.95rem; }
.video-slot .ph .big { font-size: 2.4rem; display: block; margin-bottom: 10px; }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin-top: 26px; box-shadow: var(--shadow-sm);
}
.panel > h2 { font-size: 1.15rem; font-weight: 900; color: var(--terra); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 16px; }

.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pm-card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.pm-card .tr { font-size: 1.45rem; font-weight: 800; color: var(--teal-dk); }
.pm-card .tr .stress { color: var(--terra); }
.pm-card .en { font-size: 0.98rem; color: #2e2e40; margin-top: 2px; }
.pm-card .note { font-size: 0.85rem; color: #635a49; font-style: italic; margin-top: 6px; }

.dlg-table { width: 100%; border-collapse: collapse; }
.dlg-table td { padding: 12px 10px; border-bottom: 1px solid var(--sand); vertical-align: top; }
.dlg-table tr:last-child td { border-bottom: 0; }
.dlg-table .who { font-weight: 800; color: var(--terra); width: 76px; font-size: 0.9rem; }
.dlg-table .line { font-weight: 700; color: var(--teal-dk); font-size: 1.12rem; }
.dlg-table .line .stress { color: var(--terra); }
.dlg-table .gloss { color: #2e2e40; font-size: 0.95rem; }

.tipbox { border: 2px dashed var(--terra); border-radius: var(--radius-sm); padding: 16px 18px; margin-top: 16px; background: #fff; }
.tipbox .t { font-weight: 800; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; color: var(--terra); margin-bottom: 6px; }
.tipbox p { font-size: 0.95rem; color: var(--ink-soft); }

.drill-box { background: var(--teal-dk); color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-top: 26px; }
.drill-box h2 { font-size: 1.05rem; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--saffron); margin-bottom: 10px; }
.drill-box p { font-size: 0.93rem; color: rgba(255,255,255,0.85); }
.drill-box audio { width: 100%; margin-top: 14px; }
.drill-box .ph { margin-top: 14px; border: 1.5px dashed rgba(255,255,255,0.35); border-radius: var(--radius-sm); padding: 14px; font-size: 0.9rem; color: rgba(255,255,255,0.75); }

.ex-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--cream); overflow: hidden; }
.ex-item summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: 0.98rem; display: flex; gap: 10px; align-items: center; }
.ex-item summary::-webkit-details-marker { display: none; }
.ex-item summary .n { background: var(--terra); color: #fff; font-size: 0.78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.ex-item .ex-body { padding: 0 18px 16px; font-size: 0.97rem; line-height: 1.9; }
.ex-item .answer { margin-top: 10px; background: var(--mint); border-radius: 8px; padding: 10px 14px; font-size: 0.92rem; }
.ex-item .answer b { color: var(--teal-dk); }

.side-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.side-card h3 { font-size: 0.8rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--terra); margin-bottom: 10px; }
.side-card p { font-size: 0.9rem; color: var(--ink-soft); }
.side-card .dl {
  display: block; text-align: center; margin-top: 12px;
  background: var(--teal); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 0.95rem; padding: 12px; border-radius: 999px;
}
.side-card .dl:hover { background: var(--teal-dk); }
.btn-complete {
  width: 100%; text-align: center;
  background: var(--paper); color: var(--teal-dk);
  border: 2px solid var(--teal); border-radius: 999px;
  font-weight: 800; font-size: 0.95rem; padding: 12px; cursor: pointer;
}
.btn-complete.done { background: var(--teal); color: #fff; }
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 34px; }
.pager a { text-decoration: none; font-weight: 800; color: var(--teal-dk); background: var(--paper); border: 1px solid var(--line); padding: 13px 20px; border-radius: 999px; font-size: 0.93rem; }
.pager a:hover { background: var(--mint); }

/* stub lesson pages */
.stub-note { background: #F6E7C8; border-radius: var(--radius-sm); padding: 16px 20px; margin-top: 22px; font-size: 0.95rem; color: #6a4f14; }

/* ---------- footer ---------- */
.site-foot { background: var(--teal-deep); color: rgba(255,255,255,0.75); padding: 44px 0; margin-top: 0; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-foot .fa { font-size: 1.2rem; color: var(--saffron); }
.site-foot small { font-size: 0.82rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .phrase-card { transform: none; margin: 0 auto; }
  .trio { grid-template-columns: 1fr; }
  .cast-grid { grid-template-columns: 1fr 1fr; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-col-side { position: static; }
  .pm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  html, body { overflow-x: hidden; }
  .cast-grid { grid-template-columns: 1fr; }
  .site-head .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 4px; justify-content: center; }
  .logo { font-size: 1.05rem; }
  .logo .fa { display: none; }
  .nav { flex-wrap: wrap; justify-content: center; }
  .nav a { padding: 6px 10px; font-size: 0.84rem; }
  .hero { padding: 56px 0 66px; }
  .hero h1 { font-size: clamp(2rem, 8.5vw, 2.5rem); }
  .section { padding: 56px 0; }
  .phrase-card { max-width: 100%; }
  .pager { flex-direction: column; }
  .pager a { text-align: center; }
}

.btn-pdf { display:inline-block; background:#fff; border:2px solid var(--teal); color:var(--teal-dk, #0A4A40);
  font-weight:800; padding:12px 22px; border-radius:999px; text-decoration:none; }
.btn-pdf:hover { background: var(--mint, #E4F0ED); }


/* --- lesson prev/next navigation --- */
.lesson-nav-top { display:flex; align-items:center; gap:16px; margin:26px 0 8px; flex-wrap:wrap; }
.lnav-btn { display:inline-block; padding:13px 24px; border-radius:14px; background:#F4EDDE; color:#0A4A40 !important;
  text-decoration:none !important; font-weight:800; font-size:15px; line-height:1;
  box-shadow:0 5px 16px rgba(0,0,0,.28); transition:transform .12s, background .12s; }
.lnav-btn:hover { background:#fff; transform:translateY(-1px); }
.lnav-next { background:#D9A441; color:#26170a !important; }
.lnav-next:hover { background:#E9BC55; }
.lnav-dim { opacity:.9; }
.lnav-count { flex:1; text-align:center; font-size:13px; letter-spacing:2px; color:rgba(255,255,255,.65); font-weight:800; padding:0 4px; }

/* ---- progress strip: one cell per lesson, grouped by unit ---- */
.ptotal { font-weight: 800; font-size: 0.95rem; color: var(--teal-dk); margin: 0 0 12px; }
.pstrip { display: flex; flex-wrap: wrap; gap: 14px 12px; margin-bottom: 10px; }
.pcells { display: flex; gap: 2px; }
.pcell { width: 9px; height: 18px; border-radius: 3px; display: block;
  background: var(--paper); border: 1px solid var(--line);
  transition: transform 0.1s, border-color 0.1s; }
.pcell.avail { background: var(--sand); border-color: #CDBFA9; }
a.pcell.avail:hover { transform: scaleY(1.18); border-color: var(--terra); }
.pcell.done { background: var(--teal); border-color: var(--teal); }
.pcell.next { box-shadow: 0 0 0 2px var(--terra); }
.plabel { text-align: center; font-weight: 700; font-size: 11px; color: #6b6052; margin-top: 4px; }
.blockdone .plabel { color: var(--teal); }
.blockdone .plabel:after { content: " ✓"; font-weight: 900; }
