/* ─── Local Vazirmatn (no CDN) ──────────────────────────────────────────── */
/* Absolute paths so these resolve no matter which page of the site loads
   the stylesheet. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ─── Design tokens ─────────────────────────────────────────────────────── */
/* --brand / --brand-2 / --premium are written by app.js at boot from
   AppConfig.colors so the palette tracks config.js without touching CSS.
   Brand: navy (#1a2f55) + coral (#ff5a5f) — matches the "english with
   atousa" logo. */
:root {
  --bg: #f7f8fc;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --card-hover: #fff6f6;
  --line: #e1e6f0;
  --fg: #11192e;
  --fg-dim: #475068;
  --fg-mute: #7a8298;
  --brand: #1a2f55;
  --brand-2: #ff5a5f;
  --premium: #f5b942;
  --premium-bg: rgba(245, 185, 66, 0.18);
  --shadow: 0 14px 30px -18px rgba(26, 47, 85, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1430;
    --bg-soft: #121d3f;
    --card: #182552;
    --card-hover: #1f2e63;
    --line: #2a3a72;
    --fg: #f3f5fa;
    --fg-dim: #b9c0d8;
    --fg-mute: #7d87a6;
    --shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.7);
  }
}

/* ─── Reset / base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ────────────────────────────────────────────────────────────── */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  header.site { background: rgba(11, 20, 48, 0.78); }
}
.site-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}
@media (max-width: 480px) {
  .brand-logo { height: 38px; }
}
.spacer { flex: 1; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand-2);
  color: white;
  font-weight: 700;
  font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 8px 22px -10px rgba(255, 90, 95, 0.65);
}
.cta:hover {
  transform: translateY(-1px);
  background: #ff7176;
  box-shadow: 0 12px 28px -10px rgba(255, 90, 95, 0.8);
}
.cta svg { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .cta { padding: 9px 12px; font-size: 13px; }
  .cta svg { width: 14px; height: 14px; }
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  margin: 24px 0 8px;
  padding: 56px 28px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 90, 95, 0.28) 0%, transparent 55%),
    radial-gradient(80% 100% at 0% 100%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    linear-gradient(135deg, #1a2f55 0%, #243b6b 60%, #2c4683 100%);
  color: white;
  box-shadow: 0 20px 60px -30px rgba(26, 47, 85, 0.55);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  opacity: .5;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 90, 95, 0.18);
  color: #ffd0d2;
  border: 1px solid rgba(255, 90, 95, 0.4);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.hero p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
  margin: 0;
  font-size: 16px;
}
@media (max-width: 520px) {
  .hero { padding: 36px 20px; border-radius: 22px; }
}

/* ─── Courses ───────────────────────────────────────────────────────────── */
section.course {
  margin: 36px 0 8px;
  padding: 0;
}
.course-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  .course-head { grid-template-columns: 1fr; }
}
.course-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1a2f55, #2c4683);
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-headline { min-width: 0; }
.course-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  color: var(--brand);
  line-height: 1.3;
}
@media (prefers-color-scheme: dark) {
  .course-title { color: var(--fg); }
}
.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.course-meta span {
  font-size: 12.5px;
  color: var(--fg-dim);
  background: var(--bg-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.course-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--fg-dim);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Sections inside a course ──────────────────────────────────────────── */
section.category { padding: 22px 0 8px; }
.category-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}
@media (prefers-color-scheme: dark) {
  .category-title { color: var(--fg); }
}
.category-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--brand-2);
  transform: translateY(2px);
}
.category-sub {
  color: var(--fg-mute);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ─── Cards / grid ──────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.card:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: rgba(255, 90, 95, 0.55);
  box-shadow: 0 22px 40px -24px rgba(255, 90, 95, 0.45);
}
.card .thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #1a2f55, #2c4683);
  overflow: hidden;
}
.card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
}
.card .thumb img.loaded { opacity: 1; }
.card .thumb .duration {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 8px;
  background: rgba(11, 20, 48, 0.78);
  color: white;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  backdrop-filter: blur(6px);
}
.card .thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.card .thumb .play span {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  display: grid; place-items: center;
  transition: transform .2s ease, background .2s ease;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.35);
}
.card:hover .thumb .play span {
  transform: scale(1.08);
  background: var(--brand-2);
  color: white;
}
.card .thumb .play svg { width: 20px; height: 20px; fill: currentColor; margin-inline-start: 2px; }

.badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--premium-bg);
  color: var(--premium);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 185, 66, 0.45);
}
.badge svg { width: 12px; height: 12px; fill: currentColor; }

.card .meta { padding: 14px 16px 16px; }
.card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .sub { color: var(--fg-mute); font-size: 12.5px; }

/* Skeleton placeholder while a thumbnail is offscreen / not yet loaded. */
.skeleton {
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.10) 50%, transparent 70%)
    rgba(255, 255, 255, 0.05);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 48, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade .2s ease;
}
.modal[aria-hidden="false"] { display: flex; }
.modal-box {
  width: min(960px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(26, 47, 85, 0.06), rgba(255, 90, 95, 0.06));
}
.modal-head h5 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand);
}
@media (prefers-color-scheme: dark) {
  .modal-head h5 { color: var(--fg); }
}
.modal-close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.modal-close:hover {
  background: var(--brand-2);
  color: white;
  border-color: var(--brand-2);
}
.modal-close svg { width: 16px; height: 16px; }
.modal-body video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  background: black;
  display: block;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer.site {
  margin-top: 64px;
  padding: 48px 0 28px;
  border-top: 1px solid var(--line);
  background: var(--brand);
  color: rgba(255, 255, 255, 0.92);
  position: relative;
}
footer.site::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-2) 0%, #ff8a8d 50%, var(--brand-2) 100%);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
.foot-brand { display: flex; flex-direction: column; gap: 12px; max-width: 340px; }
.foot-brand-row { display: flex; align-items: center; gap: 12px; }
.foot-brand-row .brand-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  padding: 0;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
}
.foot-brand-row .brand-mark img {
  width: 100%; height: 100%;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
.foot-brand-row strong { font-size: 17px; font-weight: 800; color: white; }
.foot-brand p { margin: 0; color: rgba(255, 255, 255, 0.72); font-size: 13.5px; line-height: 1.7; }
.foot-col h6 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.02em;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  transition: color .15s ease;
}
.foot-col a:hover { color: var(--brand-2); }
.foot-bottom {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.foot-bottom a { color: var(--brand-2); }
.foot-bottom a:hover { color: #ff8a8d; }

/* ─── State ─────────────────────────────────────────────────────────────── */
.state {
  padding: 60px 20px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 14.5px;
}
.state code {
  direction: ltr;
  display: inline-block;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12.5px;
}
