/* ==========================================================================
   Maedeh Afshar — Design System
   ========================================================================== */

:root {
  --font-serif: Georgia, "Times New Roman", "Palatino Linotype", serif;
  --font-sans: "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  --font-fa: "Vazirmatn", Tahoma, system-ui, sans-serif;
  --font-latin-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-latin-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --container-max: 1120px;
  --page-gutter: max(var(--space-md), env(safe-area-inset-left, 0px));
  --page-gutter-end: max(var(--space-md), env(safe-area-inset-right, 0px));

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 6rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 999px;

  --shadow-soft: 0 8px 32px rgba(20, 16, 12, 0.06);
  --shadow-header: 0 4px 24px rgba(20, 16, 12, 0.08);
  --transition-fast: 180ms ease;
  --transition-base: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --header-height: 4.25rem;
  --container-narrow-max: 720px;

  --color-bg: #f7f4ef;
  --color-bg-elevated: #fffdf9;
  --color-surface: #ffffff;
  --color-text: #2a2520;
  --color-text-muted: #5c534c;
  --color-border: rgba(42, 37, 32, 0.12);
  --color-accent: #8b5a4a;
  --color-accent-soft: rgba(139, 90, 74, 0.12);
  --color-gold: #b8956a;
  --color-gold-soft: rgba(184, 149, 106, 0.18);
  --color-focus: #8b5a4a;
  --color-header-bg: rgba(247, 244, 239, 0.72);
  --hero-glow: rgba(184, 149, 106, 0.35);
  --placeholder-bg: linear-gradient(145deg, #ebe4da 0%, #f5f0e8 45%, #e8dfd3 100%);
  --placeholder-line: rgba(139, 90, 74, 0.15);
}

[data-theme="dark"] {
  --color-bg: #121110;
  --color-bg-elevated: #1a1816;
  --color-surface: #1e1c1a;
  --color-text: #f5f2ed;
  --color-text-muted: #b8aea4;
  --color-border: rgba(245, 242, 237, 0.1);
  --color-accent: #d4a574;
  --color-accent-soft: rgba(212, 165, 116, 0.14);
  --color-gold: #c9a962;
  --color-gold-soft: rgba(201, 169, 98, 0.12);
  --color-focus: #e8c896;
  --color-header-bg: rgba(18, 17, 16, 0.78);
  --hero-glow: rgba(201, 169, 98, 0.2);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-header: 0 8px 32px rgba(0, 0, 0, 0.45);
  --placeholder-bg: linear-gradient(145deg, #252220 0%, #1a1816 50%, #2a2622 100%);
  --placeholder-line: rgba(201, 169, 98, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-gold);
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

html[lang="en"],
html[lang="ru"] {
  --font-serif: var(--font-latin-serif);
  --font-sans: var(--font-latin-sans);
}

html[lang="en"] body,
html[lang="ru"] body {
  font-family: var(--font-latin-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="ru"] h1,
html[lang="ru"] h2,
html[lang="ru"] h3 {
  font-family: var(--font-latin-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

html[lang="en"] .hero-title,
html[lang="ru"] .hero-title {
  font-weight: 700;
  line-height: 1.12;
}

html[lang="en"] .section-title,
html[lang="ru"] .section-title {
  line-height: 1.25;
}

html[lang="en"] .brand-name,
html[lang="en"] .footer-name,
html[lang="ru"] .brand-name,
html[lang="ru"] .footer-name {
  font-family: var(--font-latin-serif);
  font-weight: 600;
}

html[lang="en"] .btn,
html[lang="ru"] .btn {
  font-family: var(--font-latin-sans);
  letter-spacing: 0.04em;
}

html[lang="en"] .journey-step-title,
html[lang="en"] .faq-question,
html[lang="ru"] .journey-step-title,
html[lang="ru"] .faq-question {
  font-family: var(--font-latin-sans);
  font-weight: 600;
}

html[lang="en"] .hero-tagline,
html[lang="ru"] .hero-tagline {
  font-family: var(--font-latin-serif);
  font-weight: 600;
  font-style: italic;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 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: var(--space-md);
  top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.container,
.header-inner,
.hero-grid {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter) var(--page-gutter-end);
}

.container.narrow {
  max-width: var(--container-narrow-max);
}

.section {
  padding-block: var(--space-3xl);
  position: relative;
}

.section-header {
  margin-block-end: var(--space-2xl);
  max-width: 38rem;
}

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 var(--space-sm);
  font-weight: 600;
}

.section-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  margin: 0 0 var(--space-md);
}

.section-intro {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* Header */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 950;
  height: var(--header-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
  transition: box-shadow var(--transition-base);
}

.site-header.is-scrolled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-header);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  position: relative;
  z-index: 1;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  flex: 1 1 auto;
  min-width: 0;
}

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

.brand-name {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[lang="fa"] body,
html[lang="fa"] .brand-name,
html[lang="fa"] .footer-name,
html[lang="fa"] .hero-title,
html[lang="fa"] .section-title,
html[lang="fa"] .hero-tagline,
html[lang="fa"] .journey-step-title,
html[lang="fa"] .faq-question {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

html[lang="fa"] .brand-name {
  font-weight: 600;
  font-size: clamp(1rem, 3.6vw, 1.15rem);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  direction: ltr;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-surface);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-btn.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-gold);
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
  transform: scale(1.04);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.theme-svg {
  width: 1.125rem;
  height: 1.125rem;
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.theme-svg-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-svg-moon {
  opacity: 0;
  transform: rotate(-20deg) scale(0.75);
}

[data-theme="dark"] .theme-svg-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.75);
  pointer-events: none;
}

[data-theme="dark"] .theme-svg-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Hero */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-height) + var(--space-2xl)) var(--space-3xl);
  overflow-x: clip;
  overflow-y: visible;
}

.hero-content {
  overflow: visible;
}

.hero-grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  margin: 0 0 var(--space-sm);
  line-height: 1.28;
  padding-block-end: 0.2em;
  overflow: visible;
  background: linear-gradient(120deg, var(--color-text) 0%, var(--color-accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

[data-theme="dark"] .hero-title {
  background: linear-gradient(120deg, #f5f2ed 0%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[lang="fa"] .hero-title {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: var(--color-text);
  color: var(--color-text);
  line-height: 1.45;
  padding-block-end: 0.28em;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-lg);
  font-style: italic;
}

.hero-intro {
  max-width: 32rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xl);
}

.hero-decor {
  pointer-events: none;
  position: absolute;
  inset-inline-end: -10%;
  top: 15%;
  width: min(50vw, 420px);
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--hero-glow) 0%, transparent 68%);
  filter: blur(2px);
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 420px;
  margin-inline: auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  background: var(--placeholder-bg);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.portrait-img[hidden] {
  display: none;
}

.portrait-placeholder[hidden] {
  display: none;
}

.portrait-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  text-align: center;
  background: var(--placeholder-bg);
}

.placeholder-art {
  width: 70%;
  height: 55%;
  border: 1px solid var(--placeholder-line);
  border-radius: var(--radius-lg);
  position: relative;
  margin-block-end: var(--space-md);
  background: repeating-linear-gradient(
    -12deg,
    transparent,
    transparent 12px,
    var(--placeholder-line) 12px,
    var(--placeholder-line) 13px
  );
}

.placeholder-art::before {
  content: "MA";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--color-gold);
  opacity: 0.45;
  letter-spacing: 0.2em;
}

.placeholder-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  max-width: 16rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.btn-primary {
  background: var(--color-accent);
  color: #fffdf9;
  box-shadow: 0 4px 20px var(--color-accent-soft);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--color-accent-soft);
}

.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* About */
.about-body {
  max-width: none;
}

.about-body p {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.about-body p:first-child {
  color: var(--color-text);
  font-size: 1.15rem;
}

html[lang="fa"] .about-body p {
  line-height: 1.85;
}

/* Journey */
.journey {
  background: var(--color-bg-elevated);
  border-block: 1px solid var(--color-border);
}

.journey-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.journey-header {
  max-width: none;
  margin-block-end: 0;
}

.journey-header .section-intro {
  max-width: 42rem;
}

.journey-rows {
  margin-block-start: var(--space-xl);
}

.journey-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 40rem;
  margin-inline: auto;
}

.journey-step {
  margin: 0;
}

.journey-step-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.35s ease,
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.journey-step-card:has(.journey-step-details[open]:not(.is-closing)) {
  border-color: var(--color-gold-soft);
  box-shadow: 0 14px 40px rgba(20, 16, 12, 0.1);
  transform: translateY(-3px);
}

[data-theme="dark"] .journey-step-card:has(.journey-step-details[open]) {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.journey-step-details {
  margin: 0;
}

.journey-step-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.25s ease;
}

.journey-step-summary:hover {
  background: var(--color-accent-soft);
}

.journey-step-details[open]:not(.is-closing) .journey-step-summary {
  background: linear-gradient(
    180deg,
    var(--color-gold-soft) 0%,
    transparent 100%
  );
}

.journey-step-summary::-webkit-details-marker {
  display: none;
}

.journey-step-num {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--color-gold-soft);
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.journey-step-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 4vw, 1.125rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
}

html[lang="fa"] .journey-step-title {
  font-family: var(--font-fa);
}

.accordion-toggle {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  position: relative;
  opacity: 0.9;
}

.accordion-toggle::before,
.accordion-toggle::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--color-gold);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.accordion-toggle::after {
  inset-inline: auto;
  inset-block: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  margin-top: 0;
  margin-left: -1px;
  transform-origin: center;
}

details[open]:not(.is-closing) .accordion-toggle::after {
  opacity: 0;
  transform: scaleY(0);
}

.accordion-panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

details[open]:not(.is-closing) .accordion-panel-wrap {
  grid-template-rows: 1fr;
}

details.is-closing .accordion-panel-wrap {
  grid-template-rows: 0fr;
}

.accordion-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.accordion-panel {
  opacity: 0;
  transform: translateY(-12px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

details[open]:not(.is-closing) .accordion-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.12s;
}

details.is-closing .accordion-panel {
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
  transition-duration: 0.3s;
  transition-delay: 0s;
}

.journey-step-body {
  padding: 0 var(--space-lg) var(--space-lg);
}

.journey-step-body p {
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  border-inline-start: 3px solid var(--color-gold);
}

html[lang="fa"] .journey-step-body p {
  line-height: 1.85;
}

@media (prefers-reduced-motion: reduce) {
  .journey-step-card,
  .faq-item,
  .accordion-panel-wrap,
  .accordion-panel,
  .accordion-toggle::before,
  .accordion-toggle::after {
    transition: none;
  }

  .journey-step-card:has(.journey-step-details[open]),
  .faq-item[open] {
    transform: none;
  }

  details[open] .accordion-panel {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 900px) {
  .journey-path {
    max-width: 36rem;
    gap: var(--space-xl);
  }

  .journey-step-summary {
    padding: var(--space-lg) var(--space-xl);
  }

  .journey-step-body {
    padding: 0 var(--space-xl) var(--space-xl);
  }

  .journey-step-body p {
    font-size: 1rem;
  }
}

/* Experience */
.experience-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.experience-card {
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.experience-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-gold-soft);
}

.card-title {
  font-size: 1.15rem;
  margin: 0 0 var(--space-sm);
}

.card-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

/* Teaching */
.teaching-body p {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
  font-size: 1.08rem;
}

.teaching {
  position: relative;
}

.teaching::before {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(transparent, var(--color-border), transparent);
  transform: translateX(-50%);
  opacity: 0.5;
  pointer-events: none;
}

/* Courses */
.courses-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.course-card {
  position: relative;
  padding: var(--space-xl);
  padding-block-start: var(--space-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.course-accent {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: var(--color-gold);
}

.course-conversation .course-accent {
  background: linear-gradient(90deg, #8b5a4a, #b8956a);
}

.course-general .course-accent {
  background: linear-gradient(90deg, #5c534c, #8b7d72);
}

.course-grammar .course-accent {
  background: linear-gradient(90deg, #6b5b95, #9b8bb8);
}

.course-exam .course-accent {
  background: linear-gradient(90deg, #4a6670, #7a9aa6);
}

.course-kids .course-accent {
  background: linear-gradient(90deg, #c17f59, #e8b896);
}

.course-modes .course-accent {
  background: linear-gradient(90deg, #2a2520, #b8956a);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.35s ease,
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item[open]:not(.is-closing) {
  border-color: var(--color-gold-soft);
  box-shadow: 0 14px 40px rgba(20, 16, 12, 0.1);
  transform: translateY(-3px);
}

[data-theme="dark"] .faq-item[open]:not(.is-closing) {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.faq-question {
  list-style: none;
  cursor: pointer;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-weight: 600;
  font-family: var(--font-serif);
  user-select: none;
  transition: background-color 0.25s ease;
}

.faq-question:hover {
  background: var(--color-accent-soft);
}

.faq-item[open]:not(.is-closing) .faq-question {
  background: linear-gradient(
    180deg,
    var(--color-gold-soft) 0%,
    transparent 100%
  );
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  font-size: clamp(0.9375rem, 3.6vw, 1.0625rem);
}

html[lang="fa"] .faq-question-text {
  font-family: var(--font-fa);
}

.faq-answer {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--color-text-muted);
}

.faq-answer p {
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  font-size: 0.9375rem;
  line-height: 1.75;
  border-inline-start: 3px solid var(--color-gold);
}

html[lang="fa"] .faq-answer p {
  line-height: 1.85;
}

/* Contact */
.contact-header .section-intro {
  margin-block-end: var(--space-xl);
}

.contact-logos,
.contact-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

.contact-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.875rem;
  height: 2.875rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast), opacity var(--transition-fast),
    border-color var(--transition-fast), background var(--transition-fast);
}

.contact-logo-telegram {
  color: #26a5e4;
}

.contact-logo-instagram {
  color: #c13584;
}

.contact-logo-email {
  color: #c0392b;
}

.contact-logo:not(.is-disabled):hover {
  transform: scale(1.1);
}

.contact-logo:not(.is-disabled):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

.contact-logo.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.contact-logo .contact-icon-svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

/* Footer */
.site-footer {
  padding-block: var(--space-3xl) var(--space-xl);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.footer-grid {
  display: grid;
  gap: var(--space-2xl);
  margin-block-end: var(--space-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: var(--space-sm) 0 0;
}

.footer-role {
  margin: var(--space-xs) 0 0;
  color: var(--color-text-muted);
}

.footer-heading {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 var(--space-md);
}

.footer-nav ul,
.footer-contact ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
}

.footer-nav a:hover {
  color: var(--color-accent);
}

.footer-contact-muted {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.footer-copy {
  text-align: center;
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding-inline: var(--space-md);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

@media (max-width: 959px) {
  .header-controls {
    flex-shrink: 0;
  }

  .portrait-frame {
    max-width: min(100%, 360px);
  }

  .experience-grid,
  .courses-grid {
    grid-template-columns: 1fr;
  }

}

@media (min-width: 768px) and (max-width: 959px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-xl);
  }

  .portrait-frame {
    max-width: 100%;
  }

  .hero-intro {
    max-width: none;
  }

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

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

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 959px) {
  :root {
    --header-height: 3.625rem;
  }
}

@media (max-width: 639px) {
  :root {
    --page-gutter: max(1rem, env(safe-area-inset-left, 0px));
    --page-gutter-end: max(1rem, env(safe-area-inset-right, 0px));
  }

  .section {
    padding-block: var(--space-2xl);
  }

  .section-header {
    margin-block-end: var(--space-xl);
    max-width: none;
  }

  .section-title {
    font-size: clamp(1.45rem, 6.5vw, 2rem);
    line-height: 1.45;
  }

  html[lang="fa"] .section-title {
    line-height: 1.55;
  }

  .hero-grid {
    gap: var(--space-xl);
  }

  .hero-visual {
    order: -1;
  }

  .hero-content {
    order: 0;
  }

  .header-inner {
    gap: var(--space-xs);
  }

  html[lang="fa"] .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    direction: rtl;
  }

  html[lang="fa"] .brand {
    flex: unset;
    justify-self: start;
    min-width: 0;
  }

  html[lang="fa"] .header-controls {
    justify-self: end;
  }

  html[lang="en"] .header-inner,
  html[lang="ru"] .header-inner {
    direction: ltr;
  }

  .brand-name {
    font-size: 0.875rem;
  }

  .lang-btn {
    padding: 0.42rem 0.48rem;
    font-size: 0.625rem;
  }

  .theme-toggle {
    width: 2.35rem;
    height: 2.35rem;
  }

  .hero {
    min-height: auto;
    padding-block: calc(var(--header-height) + var(--space-lg)) var(--space-2xl);
  }

  .hero-title {
    font-size: clamp(1.85rem, 9vw, 2.65rem);
    line-height: 1.35;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-intro {
    font-size: 0.98rem;
    margin-block-end: 0;
  }

  .hero-content .btn-primary {
    display: none;
  }

  .btn {
    width: 100%;
    max-width: 20rem;
  }

  .hero-visual {
    margin-block-start: var(--space-sm);
    display: flex;
    justify-content: center;
  }

  .portrait-frame {
    max-width: min(68vw, 220px);
    aspect-ratio: 3 / 4;
  }

  .about-body p,
  .teaching-body p {
    font-size: 1rem;
  }

  .about-body p:first-child {
    font-size: 1.0625rem;
  }

  .about-body p:last-child {
    margin-block-end: 0;
  }

  .journey-rows {
    gap: var(--space-xl);
  }

  .experience-card,
  .course-card {
    padding: var(--space-lg);
  }

  .faq-question {
    font-size: 1rem;
    padding: var(--space-md) var(--space-lg);
  }

  .teaching::before {
    display: none;
  }

  .hero-decor {
    width: 70vw;
    inset-inline-end: -25%;
    top: 5%;
    opacity: 0.65;
  }

  .footer-grid {
    gap: var(--space-xl);
  }
}

@media (max-width: 380px) {
  .lang-btn {
    padding: 0.4rem 0.42rem;
  }
}

/* Animations */
.hero-animate {
  opacity: 1;
  transform: none;
}

body.is-ready .hero-animate {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-ready .hero-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  opacity: 1;
  transform: none;
}

.js-reveal-ready .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.js-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  body.is-ready .hero-animate,
  .reveal,
  .js-reveal-ready .reveal:not(.is-visible) {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .faq-answer {
    animation: none;
  }

  .btn-primary:hover,
  .experience-card:hover,
  .course-card:hover,
  .contact-logo:hover {
    transform: none;
  }
}
