:root {
  color-scheme: light;
  --ink: #151719;
  --paper: #fbfbfc;
  --muted: #606872;
  --line: #dfe4ea;
  --teal: #16a394;
  --rose: #e8486b;
  --amber: #f4a51c;
  --blue: #315fba;
  --charcoal: #08090a;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(18, 22, 29, 0.12);
  --shadow-lift: 0 28px 70px rgba(18, 22, 29, 0.16);
  --font-latin: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-persian: Vazirmatn, Tahoma, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-latin);
  line-height: 1.55;
  overflow-x: clip;
}

html[dir="rtl"] body {
  font-family: var(--font-persian);
  line-height: 1.72;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(49, 95, 186, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 20;
  transform: translateY(-160%);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 64px);
  background: rgba(251, 251, 252, 0.92);
  border-bottom: 1px solid rgba(21, 23, 25, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand span {
  direction: ltr;
  unicode-bidi: isolate;
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover,
.repo-card a:hover,
.site-footer a:hover {
  color: var(--blue);
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.language-switch {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  direction: ltr;
  box-shadow: 0 8px 24px rgba(18, 22, 29, 0.06);
}

.language-button {
  min-width: 42px;
  min-height: 36px;
  border: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.language-button.active {
  background: var(--ink);
  color: var(--white);
}

.language-button + .language-button {
  border-left: 1px solid var(--line);
}

.hero {
  min-height: min(76svh, 760px);
  display: flex;
  align-items: center;
  padding: clamp(48px, 8vw, 96px) clamp(18px, 4vw, 64px);
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(8, 9, 10, 0.98) 0%, rgba(8, 9, 10, 0.9) 42%, rgba(8, 9, 10, 0.68) 100%),
    url("assets/abzumsai-logo.png");
  background-color: var(--charcoal);
  background-repeat: no-repeat;
  background-position: center, right 8vw center;
  background-size: auto, min(42vw, 480px);
}

html[dir="rtl"] .hero {
  background:
    linear-gradient(270deg, rgba(8, 9, 10, 0.98) 0%, rgba(8, 9, 10, 0.9) 42%, rgba(8, 9, 10, 0.68) 100%),
    url("assets/abzumsai-logo.png");
  background-color: var(--charcoal);
  background-repeat: no-repeat;
  background-position: center, left 8vw center;
  background-size: auto, min(42vw, 480px);
}

.hero-inner {
  width: min(760px, 100%);
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

html[dir="rtl"] .eyebrow {
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: none;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4rem, 13vw, 9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy {
  width: min(650px, 100%);
  max-width: 100%;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  overflow-wrap: anywhere;
}

html[dir="rtl"] .hero-copy,
html[dir="rtl"] .section-note,
html[dir="rtl"] .metric-card p,
html[dir="rtl"] .path-grid p,
html[dir="rtl"] .project-card p,
html[dir="rtl"] .teacher-card li,
html[dir="rtl"] .video-card p,
html[dir="rtl"] .repo-card p {
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  background: var(--teal);
  color: var(--charcoal);
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--white);
}

.signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(720px, 100%);
  margin: 44px 0 0;
}

.signals div {
  border-inline-start: 3px solid var(--amber);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.signals dt {
  font-weight: 800;
}

.signals dd {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.path-section,
.material-section,
.project-section,
.gallery-section,
.teachers-section,
.videos-section,
.repo-section {
  padding: clamp(52px, 8vw, 96px) clamp(18px, 4vw, 64px);
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 64px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.status-strip div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.status-strip strong {
  font-size: 1.05rem;
}

.status-strip span {
  color: var(--muted);
}

.status-strip a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.section-heading {
  width: min(780px, 100%);
  margin-bottom: 26px;
}

.section-heading.wide {
  width: 100%;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

html[dir="rtl"] .section-heading h2 {
  line-height: 1.14;
}

.section-note {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.text-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--rose);
}

.path-grid,
.material-grid,
.repo-grid {
  display: grid;
  gap: 18px;
}

.path-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.material-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.path-grid article,
.metric-card,
.repo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.path-grid article {
  padding: 24px;
}

.metric-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 22px;
}

.metric-card strong {
  color: var(--rose);
  font-size: 2.4rem;
  line-height: 1;
}

.metric-card h3 {
  margin: 18px 0 8px;
  font-size: 1.15rem;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
}

.metric-card a {
  margin-top: auto;
  padding-top: 20px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.card-note {
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted);
  font-weight: 800;
}

.step-mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 850;
}

.path-grid h3,
.repo-card h3 {
  margin: 18px 0 8px;
  font-size: 1.25rem;
}

.path-grid p,
.repo-card p {
  margin: 0;
  color: var(--muted);
}

.project-section {
  background: var(--white);
}

.project-grid,
.teacher-grid,
.video-grid {
  display: grid;
  gap: 18px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card,
.teacher-card,
.video-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.project-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 24px;
}

.featured-project {
  grid-column: span 2;
}

.project-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--blue);
  font-weight: 850;
}

.project-topline span {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(49, 95, 186, 0.1);
  font-size: 0.82rem;
}

.project-card h3,
.teacher-card h3,
.video-card h3 {
  margin: 18px 0 10px;
  font-size: 1.35rem;
  line-height: 1.25;
}

html[dir="rtl"] .project-card h3,
html[dir="rtl"] .teacher-card h3,
html[dir="rtl"] .video-card h3 {
  line-height: 1.42;
}

.project-owner {
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.project-card p,
.teacher-card li,
.video-card p {
  color: var(--muted);
}

.project-card p,
.video-card p {
  margin: 0;
}

.project-card h3 + p,
.video-card h3 + p {
  margin-top: 0;
}

.project-card a,
.teacher-card a,
.video-card a {
  color: var(--blue);
  font-weight: 820;
  text-decoration: none;
}

.project-card > a,
.video-card a {
  margin-top: auto;
  padding-top: 20px;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: auto;
  padding-top: 20px;
}

.gallery-section {
  background: #f7f2ed;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gallery-grid figure {
  margin: 0;
  border: 1px solid rgba(21, 23, 25, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  transition: filter 180ms ease, transform 180ms ease;
}

.gallery-grid figure:first-child,
.gallery-grid figure:nth-child(4),
.gallery-grid figure:nth-child(9) {
  grid-column: span 2;
}

.gallery-grid figure:first-child img,
.gallery-grid figure:nth-child(4) img,
.gallery-grid figure:nth-child(9) img {
  aspect-ratio: 16 / 9;
}

.gallery-grid figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.teachers-section {
  background: var(--paper);
}

.teacher-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.teacher-card img {
  width: 132px;
  height: 132px;
  border-radius: 8px;
  background: var(--charcoal);
  object-fit: cover;
}

.teacher-card h3 {
  margin-top: 0;
}

.teacher-card ul {
  margin: 0;
  padding-block: 0;
  padding-inline: 20px 0;
}

.teacher-card li + li {
  margin-top: 8px;
}

.teacher-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.teacher-links a {
  border: 1px solid rgba(49, 95, 186, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(49, 95, 186, 0.08);
  font-size: 0.84rem;
  line-height: 1.2;
  text-decoration: none;
}

html[dir="rtl"] .teacher-links a {
  line-height: 1.5;
}

.videos-section {
  background: var(--charcoal);
  color: var(--white);
}

.videos-section .section-note,
.videos-section .video-card p {
  color: rgba(255, 255, 255, 0.72);
}

.video-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 22px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.video-card span {
  color: var(--amber);
  font-weight: 850;
}

.video-card a {
  color: var(--white);
}

.repo-section {
  background: #f0f4f7;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 720;
}

.filter-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.repo-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.repo-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.repo-tools input {
  width: min(360px, 100%);
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.repo-tools input:focus {
  border-color: rgba(49, 95, 186, 0.7);
  box-shadow: 0 0 0 4px rgba(49, 95, 186, 0.1);
}

.repo-count {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  text-align: end;
}

.empty-state {
  margin: 22px 0 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
  color: var(--muted);
  text-align: center;
}

.repo-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 22px;
}

.repo-kind {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(49, 95, 186, 0.1);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 820;
}

.repo-card:nth-child(3n + 1) .repo-kind {
  background: rgba(22, 163, 148, 0.12);
  color: #0f766d;
}

.repo-card:nth-child(3n + 2) .repo-kind {
  background: rgba(232, 72, 107, 0.1);
  color: #bb2451;
}

.repo-card a {
  margin-top: auto;
  padding-top: 24px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.repo-card.hidden {
  display: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 64px);
  background: var(--charcoal);
  color: rgba(255, 255, 255, 0.74);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}

@media (hover: hover) {
  .path-grid article:hover,
  .metric-card:hover,
  .project-card:hover,
  .teacher-card:hover,
  .video-card:hover,
  .repo-card:hover {
    border-color: rgba(49, 95, 186, 0.28);
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px);
  }

  .gallery-grid figure:hover img {
    filter: saturate(1.04) contrast(1.02);
    transform: scale(1.01);
  }
}

@media (max-width: 980px) {
  .hero {
    background-size: auto, 420px;
    background-position: center, right -120px center;
  }

  html[dir="rtl"] .hero {
    background-position: center, left -120px center;
    background-size: auto, 420px;
  }

  .project-grid,
  .teacher-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .featured-project {
    grid-column: auto;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-header nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 18px 28px;
  }

  .hero {
    min-height: min(70svh, 760px);
    background-position: center, center 24px;
    background-size: auto, 320px;
    padding-top: 148px;
  }

  html[dir="rtl"] .hero {
    background-position: center, center 24px;
    background-size: auto, 320px;
  }

  .hero-inner {
    width: min(100%, 350px);
  }

  .repo-grid {
    grid-template-columns: 1fr;
  }

  .material-grid {
    grid-template-columns: 1fr;
  }

  .signals {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .signals div {
    padding: 8px;
  }

  .signals dd {
    font-size: 0.82rem;
  }

  .section-heading.wide {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .repo-tools,
  .repo-tools input {
    width: 100%;
  }

  .repo-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .repo-count {
    text-align: start;
  }

  .status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .repo-card {
    min-height: 190px;
  }

  .metric-card {
    min-height: 210px;
  }

  .teacher-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
  }

  .teacher-card img {
    width: 96px;
    height: 96px;
  }

}

@media (max-width: 480px) {
  .site-header {
    gap: 14px;
    min-height: 0;
  }

  .header-actions {
    gap: 10px;
  }

  .site-header nav {
    overflow-x: auto;
    padding-bottom: 4px;
    white-space: nowrap;
  }

  .hero {
    padding-top: 132px;
  }

  .hero h1 {
    font-size: clamp(3rem, 18vw, 4.1rem);
  }

  .hero-actions .button {
    width: 100%;
  }

  .filter-button {
    flex: 1 1 120px;
  }

  .teacher-card {
    grid-template-columns: 1fr;
  }

  .teacher-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid figure:first-child,
  .gallery-grid figure:nth-child(4),
  .gallery-grid figure:nth-child(9) {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
