/* Trilingo website (design page 20). One stylesheet for English (LTR) and Persian (RTL): only logical properties
   (inline/block, start/end), so dir="rtl" mirrors the layout. Mobile first; breakpoints 600 / 840 / 1200. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/fonts/fraunces-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/vazirmatn-arabic-wght-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---------- Tokens (teal palette) ---------- */
:root {
  color-scheme: light;
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --text: #1D2422;
  --muted: #5F6B67;
  --border: #E3DDD2;
  --accent: #0B7480;
  --on-accent: #FFFFFF;
  --accent-soft: #DFF1F2;
  --good: #1E7A4C;
  --good-bg: #E3F3EA;
  --heart: #C2385E;
  --track: #E6E0D5;
  --device: #1D2422;
  --shadow: 0 24px 48px -16px rgba(29, 36, 34, 0.22);
  --hero-top: #DFF1F2;
  --font-text: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --radius: 20px;
  --wrap: 1200px;
  --gutter: 16px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111716;
  --surface: #1A2321;
  --text: #E7ECEA;
  --muted: #9DABA7;
  --border: #2C3936;
  --accent: #4FCDD6;
  --on-accent: #0C1716;
  --accent-soft: #163234;
  --good: #6FD39C;
  --good-bg: #173023;
  --heart: #F28BA6;
  --track: #2C3936;
  --device: #050807;
  --shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
  --hero-top: #163234;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #111716;
    --surface: #1A2321;
    --text: #E7ECEA;
    --muted: #9DABA7;
    --border: #2C3936;
    --accent: #4FCDD6;
    --on-accent: #0C1716;
    --accent-soft: #163234;
    --good: #6FD39C;
    --good-bg: #173023;
    --heart: #F28BA6;
    --track: #2C3936;
    --device: #050807;
    --shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
    --hero-top: #163234;
  }
}
/* Persian: Vazirmatn for everything (Fraunces has no Persian letters). */
:root[lang='fa'] {
  --font-text: 'Vazirmatn', 'Inter', Tahoma, system-ui, sans-serif;
  --font-head: 'Vazirmatn', 'Inter', Tahoma, system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block-start: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
:root[lang='fa'] body { line-height: 1.9; }
img, svg { display: block; max-inline-size: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { inline-size: 100%; max-inline-size: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 12px; inset-block-start: -100px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 12px 18px; border-radius: 12px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { inset-block-start: 12px; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-block-size: 48px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { min-block-size: 44px; padding: 0 16px; font-size: 15px; }
.btn-light { background: #FFFFFF; color: #0B7480; }
.btn-light:hover { background: #F0FAFA; }
.heart { color: var(--heart); flex: none; }
.btn-light .heart { color: #0B7480; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-block-end: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 12px; min-block-size: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; min-block-size: 44px; }
.brand img { inline-size: 32px; block-size: 32px; border-radius: 8px; }
.nav { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 10px 4px; }
.nav a:hover { color: var(--text); }
.header-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch { display: none; color: var(--muted); font-size: 14px; text-decoration: none; padding: 10px 4px; }
.lang-switch:hover { color: var(--text); }
.header-open { display: none; }
.icon-btn {
  display: inline-grid; place-items: center; inline-size: 44px; block-size: 44px; border-radius: 12px;
  background: transparent; color: var(--text); border: 1px solid transparent; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--surface); border-color: var(--border); }
.theme-toggle .moon { display: none; }
:root[data-theme='dark'] .theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun { display: none; }
  :root:not([data-theme='light']) .theme-toggle .moon { display: block; }
}
.theme-toggle { display: none; }
:root.js .theme-toggle { display: inline-grid; }

/* Phone menu: <details>, so it opens without JavaScript. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 8px);
  inline-size: min(300px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 8px; display: grid;
}
.menu-panel a { display: flex; align-items: center; min-block-size: 48px; padding: 0 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.menu-panel a:hover { background: var(--bg); }
.menu-panel .btn { margin: 8px 6px 6px; color: var(--on-accent); }
.menu-panel .btn:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.menu .icon-close { display: none; }
.menu[open] .icon-close { display: block; }
.menu[open] .icon-open { display: none; }

@media (min-width: 600px) {
  .lang-switch { display: inline-block; }
  .header-open { display: inline-flex; }
}
@media (min-width: 960px) {
  .header-row { gap: 28px; min-block-size: 72px; }
  .nav { display: flex; gap: 24px; }
  .menu { display: none; }
}

/* ---------- Sections ---------- */
section { padding-block: 64px; }
.band-surface { background: var(--surface); }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; margin-block-end: 12px; }
:root[lang='fa'] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 15px; }
.h2 { font-family: var(--font-head); font-weight: 600; font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.5px; margin-block-end: 28px; text-wrap: balance; }
:root[lang='fa'] .h2 { font-weight: 800; letter-spacing: 0; line-height: 1.4; }
.lead { color: var(--muted); font-size: 18px; max-inline-size: 60ch; }
.grid { display: grid; gap: 20px; }
@media (min-width: 600px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 840px) { section { padding-block: 96px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 20px; margin-block-end: 8px; }
.card p { color: var(--muted); font-size: 15px; }
.tile { inline-size: 44px; block-size: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-block-end: 18px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(to bottom, var(--hero-top), var(--bg) 85%); padding-block: 40px 64px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(40px, 6vw, 68px); letter-spacing: -1px; line-height: 1.05; margin-block-end: 20px; text-wrap: balance; }
:root[lang='fa'] .hero h1 { font-weight: 800; letter-spacing: 0; line-height: 1.35; }
.hero .lead { margin-block-end: 28px; font-size: clamp(17px, 2vw, 20px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-block-end: 24px; }
.cta-row .btn { min-block-size: 56px; }
.ticks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 15px; }
.ticks li { display: inline-flex; align-items: center; gap: 6px; }
.ticks svg { color: var(--good); }
@media (min-width: 840px) {
  .hero { padding-block: 72px 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
}

/* ---------- Device mockups (HTML/CSS, decorative) ---------- */
.phone {
  inline-size: 260px; max-inline-size: 100%; margin-inline: auto; aspect-ratio: 9 / 16.5;
  background: var(--device); border-radius: 44px; padding: 10px; box-shadow: var(--shadow);
}
.screen { background: var(--bg); block-size: 100%; border-radius: 34px; padding: 26px 18px; display: grid; align-content: start; gap: 8px; overflow: hidden; font-family: 'Inter', 'Vazirmatn', system-ui, sans-serif; }
.screen .s-title { font-size: 21px; font-weight: 700; margin-block-end: 4px; }
.s-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px; font-size: 12px; line-height: 1.35; }
.s-plan { display: flex; align-items: center; gap: 10px; }
.ring { inline-size: 46px; block-size: 46px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) 0 64%, var(--track) 0); display: grid; place-items: center; }
.ring::after { content: ''; inline-size: 36px; block-size: 36px; border-radius: 50%; background: var(--surface); }
.s-strong { font-weight: 700; font-size: 13px; }
.s-muted { color: var(--muted); font-size: 11px; }
.s-list { list-style: none; display: grid; gap: 7px; font-weight: 600; }
.s-list li { display: flex; align-items: center; gap: 8px; }
.dot { inline-size: 16px; block-size: 16px; border-radius: 50%; border: 1.5px solid var(--border); flex: none; }
.dot.done { background: var(--good); border-color: var(--good); }
.s-list .done-label { color: var(--muted); }
.s-q { font-weight: 700; font-size: 13px; margin-block-end: 8px; }
.s-opt { border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 6px 8px; margin-block-start: 6px; }
.s-opt.right { border-color: var(--good); background: var(--good-bg); }
.tablet {
  inline-size: 100%; max-inline-size: 560px; margin-inline: auto; aspect-ratio: 4 / 3.1;
  background: var(--device); border-radius: 28px; padding: 12px; box-shadow: var(--shadow);
}
.tablet .screen { border-radius: 18px; padding: 18px; grid-template-columns: 1fr 0.9fr; gap: 12px; align-content: stretch; }
.tablet .col { display: grid; gap: 8px; align-content: start; }
.skills { display: grid; gap: 9px; align-content: start; }
.bar { block-size: 5px; border-radius: 3px; background: var(--track); margin-block-start: 3px; overflow: hidden; }
.bar > i { display: block; block-size: 100%; background: var(--accent); border-radius: 3px; }
.w22 { inline-size: 22%; } .w35 { inline-size: 35%; } .w48 { inline-size: 48%; } .w55 { inline-size: 55%; } .w62 { inline-size: 62%; }
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 840px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 64px; } }
@media (max-width: 599px) { .tablet .screen { grid-template-columns: 1fr; } .tablet .skills-card { display: none; } .tablet { aspect-ratio: 3 / 3.4; } }

/* ---------- Courses ---------- */
.course-top { display: flex; align-items: center; justify-content: space-between; margin-block-end: 16px; }
.flag { inline-size: 32px; block-size: 22px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.level { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; }

/* ---------- Steps ---------- */
.steps { list-style: none; display: grid; gap: 32px; }
@media (min-width: 840px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step-num { inline-size: 40px; block-size: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 18px; margin-block-end: 16px; }
.steps h3 { font-size: 20px; margin-block-end: 8px; }
.steps p { color: var(--muted); }

/* ---------- Promise ---------- */
.promise { list-style: none; display: grid; gap: 24px 48px; }
@media (min-width: 840px) { .promise { grid-template-columns: repeat(2, 1fr); } }
.promise li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.check { inline-size: 28px; block-size: 28px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: grid; place-items: center; }
.promise h3 { font-size: 18px; margin-block-end: 4px; }
.promise p { color: var(--muted); font-size: 15px; }

/* ---------- Install ---------- */
.install-card { position: relative; }
.install-card h3 { font-size: 19px; margin-block-end: 12px; }
.install-card ol { list-style: none; counter-reset: step; display: grid; gap: 10px; }
.install-card ol li { counter-increment: step; display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--text); font-size: 15px; }
.install-card ol li::before { content: counter(step); color: var(--accent); font-weight: 700; }
:root[lang='fa'] .install-card ol li::before { content: counter(step, persian); }
.install-card .btn { margin-block-start: 18px; }
.yours { display: none; position: absolute; inset-block-start: -12px; inset-inline-end: 20px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.install-card.is-yours { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.install-card.is-yours .yours { display: block; }
.note { color: var(--muted); font-size: 14px; margin-block-start: 20px; max-inline-size: 70ch; }

/* ---------- FAQ ---------- */
.faq { max-inline-size: 760px; border-block-start: 1px solid var(--border); }
.faq details { border-block-end: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-block-size: 56px; padding-block: 14px; font-size: 18px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 22px; font-weight: 400; flex: none; inline-size: 24px; text-align: center; }
.faq details[open] summary::after { content: '–'; }
.faq .answer { color: var(--muted); padding-block-end: 18px; display: grid; gap: 10px; }

/* ---------- Donate band ---------- */
.donate-band { background: var(--bg); }
.donate-box {
  background: #0B7480; color: #FFFFFF; border-radius: 28px; padding: 32px 28px;
  display: grid; gap: 24px; align-items: center;
}
:root[data-theme='dark'] .donate-box { background: #0E5F68; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .donate-box { background: #0E5F68; } }
.donate-box h2 { font-family: var(--font-head); font-weight: 600; font-size: clamp(28px, 4vw, 34px); margin-block-end: 10px; }
:root[lang='fa'] .donate-box h2 { font-weight: 800; }
.donate-box p { color: #E6F5F6; max-inline-size: 62ch; }
.donate-box .btn { justify-self: start; min-block-size: 54px; }
@media (min-width: 840px) { .donate-box { grid-template-columns: 1fr auto; padding: 40px; } }

/* ---------- Footer ---------- */
.site-footer { border-block-start: 1px solid var(--border); padding-block: 48px 40px; background: var(--surface); }
.footer-grid { display: grid; gap: 40px; }
.footer-about p { color: var(--muted); margin-block: 12px 16px; font-size: 15px; max-inline-size: 48ch; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (min-width: 600px) { .footer-cols { grid-template-columns: repeat(3, auto); } }
@media (min-width: 840px) { .footer-grid { grid-template-columns: 1.3fr 1fr; } }
.footer-cols h2 { font-size: 14px; font-weight: 700; margin-block-end: 6px; }
.footer-cols ul { list-style: none; }
.footer-cols a { display: inline-flex; align-items: center; min-block-size: 36px; color: var(--muted); text-decoration: none; font-size: 15px; }
.footer-cols a:hover { color: var(--text); text-decoration: underline; }
.legal { margin-block-start: 32px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.legal a { color: var(--muted); }

/* ---------- Text pages (privacy, terms, 404) ---------- */
.page { padding-block: 48px 80px; }
.prose { max-inline-size: 720px; }
.prose h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(34px, 5vw, 48px); margin-block-end: 12px; }
:root[lang='fa'] .prose h1 { font-weight: 800; }
.prose h2 { font-size: 22px; margin-block: 36px 10px; }
.prose p, .prose li { color: var(--text); margin-block-end: 12px; }
.prose ul { padding-inline-start: 22px; margin-block-end: 12px; }
.prose .updated { color: var(--muted); margin-block-end: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .donate-band, .menu { display: none; }
}
