:root {
  --bg-1: #f7f5ef;
  --bg-2: #e7ece8;
  --ink-1: #171d21;
  --ink-2: #4a5861;
  --surface-1: #ffffff;
  --surface-2: #f7faf9;
  --line: #d7e1e4;
  --primary: #0f5f64;
  --primary-strong: #0b4549;
  --secondary: #c57a31;
  --danger: #b83a3a;
  --success: #1f8450;
  --shadow-soft: 0 12px 30px rgba(15, 32, 35, 0.08);
  --shadow-strong: 0 22px 50px rgba(15, 32, 35, 0.16);
  --radius-lg: 1.2rem;
  --radius-md: 0.85rem;
  --radius-sm: 0.6rem;
  --header-bg: rgba(247, 250, 249, 0.75);
  --header-border: rgba(255, 255, 255, 0.45);
  --card-elevate-y: -6px;
}

:root[data-theme="dark"] {
  --bg-1: #10161c;
  --bg-2: #0c1116;
  --ink-1: #e5ecf0;
  --ink-2: #a7b4bc;
  --surface-1: #161c22;
  --surface-2: #12181d;
  --line: #2a3640;
  --primary: #2e949b;
  --primary-strong: #8fe1e6;
  --secondary: #cf9050;
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.28);
  --shadow-strong: 0 20px 46px rgba(0, 0, 0, 0.42);
  --header-bg: rgba(12, 17, 22, 0.82);
  --header-border: rgba(53, 71, 82, 0.8);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(950px 440px at 95% -80px, rgba(23, 68, 74, 0.3), transparent 72%),
    radial-gradient(720px 360px at -12% 22%, rgba(86, 61, 38, 0.22), transparent 68%),
    linear-gradient(165deg, #0d1318, #0a1014);
}

* {
  box-sizing: border-box;
}

@font-face {
  font-family: 'IranMarker';
  src: url('../fonts/iranmarker/IRANMarker.woff2') format('woff2'),
       url('../fonts/iranmarker/IRANMarker.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}



html {
  scroll-behavior: smooth;
  font-family: 'IranMarker', sans-serif !important;
}

body {
  margin: 0;
  direction: rtl;
  color: var(--ink-1);
  line-height: 1.9;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 95% -80px, rgba(15, 95, 100, 0.22), transparent 72%),
    radial-gradient(720px 360px at -12% 22%, rgba(197, 122, 49, 0.22), transparent 68%),
    linear-gradient(165deg, var(--bg-1), var(--bg-2));
  transition: background-color 0.35s ease, color 0.35s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

.narrow {
  width: min(920px, 92%);
}

.skip-link {
  position: fixed;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 150;
  background: var(--ink-1);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  width: 0;
  z-index: 140;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: clamp(1.28rem, 2.6vw, 1.9rem);
  color: var(--primary-strong);
  line-height: 1.2;
  padding: 0.28rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 95, 100, 0.18);
  background: linear-gradient(130deg, rgba(15, 95, 100, 0.18), rgba(197, 122, 49, 0.14));
}

#mainNav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-inline-start: auto;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

#mainNav a {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: color 0.28s ease, border-color 0.28s ease, background-color 0.28s ease;
}

#mainNav a:hover,
#mainNav a.is-active {
  color: var(--primary-strong);
  border-color: rgba(15, 95, 100, 0.26);
  background: rgba(255, 255, 255, 0.78);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fff;
  padding: 0.45rem 0.7rem;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-strong);
  font: inherit;
  font-weight: 700;
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.45rem;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: var(--surface-1);
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle-desktop {
  display: inline-flex;
}

.theme-toggle-mobile {
  display: none;
}

.theme-toggle:hover {
  border-color: rgba(15, 95, 100, 0.45);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  font-size: 0.95rem;
  line-height: 1;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: inline-block;
}

.menu-toggle-icon {
  width: 20px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-toggle-icon span {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open .menu-toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open .menu-toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.4rem 0 3rem;
}

.hero::before {
  content: "";
  position: absolute;
  width: 510px;
  height: 510px;
  left: -150px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 122, 49, 0.35), transparent 70%);
  pointer-events: none;
}

.hero-bg-shape {
  position: absolute;
  top: -160px;
  right: -100px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 95, 100, 0.3), transparent 72%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  align-items: center;
  gap: 1.3rem;
  grid-template-columns: 1.25fr 0.92fr;
}

.eyebrow {
  margin: 0;
  color: var(--secondary);
  font-weight: 800;
}

.hero-title {
  margin: 0.35rem 0 0.95rem;
  min-height: 2.7em;
  color: #162833;
  line-height: 1.33;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.typing-text {
  white-space: pre-line;
}

.typing-cursor {
  display: inline-block;
  color: var(--secondary);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.lead {
  margin: 0;
  max-width: 56ch;
  color: var(--ink-2);
}

.hero-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-metrics {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.hero-metric {
  border: 1px solid rgba(15, 95, 100, 0.2);
  border-radius: 0.85rem;
  padding: 0.5rem 0.55rem;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(4px);
}

.hero-metric strong {
  display: block;
  line-height: 1.1;
  color: var(--primary-strong);
  font-size: 1.2rem;
}

.hero-metric span {
  color: var(--ink-2);
  font-size: 0.82rem;
}

.hero-card {
  background: linear-gradient(165deg, #103d4d 0%, #0f5f64 85%);
  color: #f5f8f6;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-strong);
}

.hero-card,
.card,
.article-detail,
.comments,
.contact-card,
.contact-visual {
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-portrait-wrap {
  border-radius: 0.95rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 0.85rem;
}

.hero-portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 500px;
  object-fit: cover;
  display: block;
  transition: opacity 0.5s ease;
}

.hero-portrait.fade {
  opacity: 0.24;
}

.hero-card h3 {
  margin: 0.45rem 0;
  letter-spacing: 0.02em;
  font-size: 1.5rem;
}

.hero-card ul {
  margin: 0;
  padding-right: 1rem;
}

.section {
  padding: 2.5rem 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.52s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.52s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-alt {
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(215, 225, 228, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(243, 247, 246, 0.78));
}

.section-head {
  margin-bottom: 1.05rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  color: #1d2f3a;
  line-height: 1.3;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}

.section-head p {
  margin: 0;
  color: var(--ink-2);
}

.section-link {
  color: var(--primary-strong);
  font-weight: 700;
  border-bottom: 2px solid rgba(15, 95, 100, 0.3);
}

.list-toolbar {
  margin-bottom: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.toolbar-search {
  width: min(520px, 100%);
}

.toolbar-search input {
  padding-inline: 2.6rem 0.85rem;
  background-image: radial-gradient(circle, rgba(15, 95, 100, 0.23) 2px, transparent 3px);
  background-size: 0.9rem 0.9rem;
  background-position: 0.8rem 50%;
  background-repeat: no-repeat;
}

.toolbar-count {
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.92rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.class-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-click {
  cursor: pointer;
}

.card-click:focus-visible {
  outline: 3px solid rgba(15, 95, 100, 0.25);
  outline-offset: 2px;
}

.card:hover {
  transform: translateY(var(--card-elevate-y));
  box-shadow: var(--shadow-strong);
  border-color: rgba(15, 95, 100, 0.28);
}

.card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  flex-shrink: 0;
}

.card-body {
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
}

.card-body h3 {
  margin: 0.55rem 0 0.45rem;
  color: #202c33;
  line-height: 1.6;
  font-size: 1.06rem;
}

.card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 3.3em;
}

.card-subject,
.card-schedule,
.card-status {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.card-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 5.4em;
}

.card-body p,
.card-body small {
  margin: 0.25rem 0 0;
  color: var(--ink-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 100, 0.2);
  background: rgba(233, 245, 245, 0.85);
  padding: 0.15rem 0.58rem;
  align-self: flex-start;
  width: auto;
  max-width: max-content;
}

.tag-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  font-size: 0.86rem;
  line-height: 1;
  color: var(--primary-strong);
}

.card-meta {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--ink-2);
  font-size: 0.83rem;
  font-weight: 600;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card-meta i {
  font-style: normal;
}

.icon-meta {
  width: 0.95rem;
  text-align: center;
  font-size: 0.86rem;
}

.empty-state {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(15, 95, 100, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-2);
  text-align: center;
  padding: 0.85rem 1rem;
}

.article-detail,
.comments {
  background: linear-gradient(180deg, #fff, #f9fcfb);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-soft);
}

.article-detail h1 {
  margin: 0;
  color: #1a2e3a;
  line-height: 1.35;
  font-size: clamp(1.95rem, 3.1vw, 2.75rem);
}

.article-meta {
  margin: 0.7rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--ink-2);
  font-size: 0.93rem;
}

.article-meta span {
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 100, 0.18);
  background: rgba(237, 246, 246, 0.85);
  padding: 0.14rem 0.65rem;
}

.article-cover {
  width: 100%;
  border-radius: 0.9rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
}

.excerpt {
  margin: 0.35rem 0 0.85rem;
  font-weight: 500;
  color: #37424a;
}

.article-body {
  max-width: 78ch;
  color: #2a3238;
  font-size: 1.03rem;
}

.video-wrap {
  margin: 0.8rem 0;
}

.video-wrap video,
.video-wrap iframe {
  width: 100%;
  min-height: 340px;
  border: 0;
  border-radius: 0.95rem;
  background: #000;
}

.video-player {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: #000;
}

.video-player video {
  border-radius: 0;
  min-height: 260px;
  margin: 0;
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.58rem;
  background: linear-gradient(180deg, rgba(18, 26, 33, 0.95), rgba(9, 13, 17, 0.96));
  color: #f6fafb;
}

.video-control-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.6rem;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.video-control-btn:hover {
  transform: none;
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.45);
}

.video-seek {
  flex: 1;
}

.video-time {
  min-width: 100px;
  text-align: center;
  font-size: 0.77rem;
  color: #d4dce0;
}

.video-volume {
  width: 72px;
}

.poem-lines {
  border: 1px dashed rgba(197, 122, 49, 0.5);
  background: rgba(255, 251, 245, 0.9);
  border-radius: 0.95rem;
  padding: 0.85rem;
}

.poem-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(197, 122, 49, 0.2);
  font-size: 1.16rem;
  line-height: 2;
  font-weight: 500;
}

.poem-row:last-child {
  border-bottom: 0;
}

.poem-lines.en-poem {
  background: #fbfaf6;
}

.poem-lines.en-poem .poem-row {
  text-align: left;
}

.article-body.en-poem {
  text-align: left;
  line-height: 1.9;
}

.analysis-title {
  margin: 1rem 0 0.45rem;
  color: var(--primary-strong);
}

.comments {
  margin-top: 1rem;
}

.comments h2 {
  margin-top: 0;
  font-size: 1.65rem;
  color: #1f313a;
}

.comment-form,
.contact-form {
  display: grid;
  gap: 0.7rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border: 1px solid rgba(129, 151, 159, 0.45);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-1);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(15, 95, 100, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 95, 100, 0.12);
}

textarea {
  resize: vertical;
}

.btn,
button {
  border: 1px solid var(--primary);
  border-radius: 0.74rem;
  padding: 0.56rem 0.95rem;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-outline {
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.2);
}

.btn[disabled],
button[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.video-controls .video-control-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.6rem;
  background: transparent;
  color: #f6fafb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 600;
}

.video-controls .video-control-btn:hover {
  transform: none;
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.45);
}

.video-controls input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: #e2a264;
}

.video-controls input[type="range"]:focus {
  box-shadow: none;
}

.engagement-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  min-width: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-2);
  padding: 0.4rem 0.66rem;
  box-shadow: none;
}

.like-btn:hover {
  transform: none;
  opacity: 1;
  border-color: rgba(197, 122, 49, 0.45);
}

.icon-heart {
  font-size: 1rem;
  line-height: 1;
  color: #d26170;
}

.like-btn.liked {
  border-color: rgba(210, 97, 112, 0.48);
  background: rgba(210, 97, 112, 0.1);
  color: #b14453;
}

.class-details-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.class-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: var(--surface-1);
  padding: 0.55rem 0.66rem;
}

.class-detail-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(15, 95, 100, 0.14);
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.class-detail-item strong {
  display: block;
  color: var(--primary-strong);
  font-size: 0.9rem;
}

.class-detail-item p {
  margin: 0.1rem 0 0;
  color: var(--ink-2);
}

.comment-item {
  margin-top: 0.65rem;
  padding: 0.72rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.badge {
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  color: #174b65;
  background: #e6f0f5;
}

.comment-replies {
  margin-right: 0.4rem;
  padding-right: 0.7rem;
  border-right: 2px solid rgba(197, 122, 49, 0.4);
}

.pagination {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.pagination a {
  min-width: 36px;
  text-align: center;
  border-radius: 0.56rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  padding: 0.3rem 0.48rem;
  font-weight: 700;
}

.pagination a.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.contact-section {
  padding-top: 1.3rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.contact-card,
.contact-visual {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fcfb);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.contact-card h2 {
  margin: 0;
  font-size: 2rem;
  color: #1d313a;
}

.contact-card p {
  color: var(--ink-2);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 0.75rem;
  border: 1px solid #dce6e8;
  background: #fff;
  padding: 0.5rem 0.62rem;
}

.contact-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-strong);
  background: rgba(15, 95, 100, 0.12);
}

.contact-icon svg {
  width: 18px;
  height: 18px;
}

.icon-contact {
  font-size: 0.95rem;
  line-height: 1;
}

.contact-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.contact-visual {
  display: grid;
  place-items: center;
  text-align: center;
  border-style: dashed;
  background:
    radial-gradient(200px 90px at top, rgba(15, 95, 100, 0.16), transparent 70%),
    linear-gradient(170deg, #f2f8f8, #fff7ef);
}

.contact-visual p {
  margin: 0.6rem 0 0;
  color: #1f3a44;
  line-height: 1.45;
  font-size: 1.58rem;
}

.contact-visual small {
  margin-top: 0.35rem;
  color: var(--ink-2);
}

.contact-mini-cards {
  width: 100%;
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.mini-card {
  border-radius: 0.74rem;
  border: 1px solid #dbe6e7;
  background: #fff;
  padding: 0.5rem 0.4rem;
}

.mini-card strong {
  display: block;
  color: var(--primary-strong);
  font-size: 1.1rem;
}

.mini-card span {
  color: var(--ink-2);
  font-size: 0.82rem;
}

.site-footer {
  margin-top: 2.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.55);
}

.footer-grid {
  padding: 1.4rem 0;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 1rem;
}

.footer-grid h4 {
  margin: 0;
  font-size: 1.55rem;
}

.footer-grid p {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
}

.footer-col h5 {
  margin: 0;
  color: #233c46;
  font-size: 1rem;
}

.footer-toggle summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  color: #233c46;
  font-size: 1rem;
  font-weight: 700;
}

.footer-toggle summary::-webkit-details-marker {
  display: none;
}

.footer-chevron {
  font-size: 0.82rem;
  transition: transform 0.2s ease;
}

.footer-toggle[open] .footer-chevron {
  transform: rotate(180deg);
}

.footer-links {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.footer-links a {
  color: var(--ink-2);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary-strong);
}

.flash-wrap {
  padding-top: 0.8rem;
}

.flash {
  margin-bottom: 0.5rem;
  border-radius: 0.72rem;
  border: 1px solid;
  padding: 0.62rem 0.82rem;
}

.flash.success {
  border-color: #c1e8d3;
  color: #1d7a49;
  background: #eaf8ef;
}

.flash.error {
  border-color: #f2c8c8;
  color: #a83030;
  background: #fff0f0;
}

.form-message {
  margin: 0;
  min-height: 1rem;
  font-size: 0.9rem;
}

.to-top {
  position: fixed;
  left: 1.2rem;
  bottom: 1.2rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 100, 0.3);
  background: #fff;
  color: var(--primary-strong);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

:root[data-theme="dark"] .brand {
  color: #dbf4f6;
  border-color: rgba(143, 225, 230, 0.28);
  background: linear-gradient(130deg, rgba(34, 88, 96, 0.45), rgba(88, 61, 36, 0.38));
}

:root[data-theme="dark"] .menu-toggle {
  background: #1a232c;
  border-color: #31414c;
  color: #c7e8eb;
}

:root[data-theme="dark"] #mainNav a:hover,
:root[data-theme="dark"] #mainNav a.is-active {
  background: rgba(24, 32, 39, 0.95);
  border-color: rgba(143, 225, 230, 0.3);
}

:root[data-theme="dark"] #mainNav {
  background: rgba(16, 22, 28, 0.96);
  border-color: #2b3842;
}

:root[data-theme="dark"] #mainNav a {
  color: #c2d0d9;
}

:root[data-theme="dark"] .section-alt {
  border-top-color: rgba(42, 54, 64, 0.7);
  border-bottom-color: rgba(42, 54, 64, 0.9);
  background: linear-gradient(180deg, rgba(20, 27, 33, 0.72), rgba(13, 18, 23, 0.88));
}

:root[data-theme="dark"] .hero-card {
  background: linear-gradient(165deg, #12323c 0%, #0f4851 85%);
}

:root[data-theme="dark"] .hero-title,
:root[data-theme="dark"] .section-head h1,
:root[data-theme="dark"] .section-head h2,
:root[data-theme="dark"] .card-body h3,
:root[data-theme="dark"] .article-detail h1,
:root[data-theme="dark"] .comments h2,
:root[data-theme="dark"] .contact-card h2,
:root[data-theme="dark"] .contact-visual p,
:root[data-theme="dark"] .footer-col h5,
:root[data-theme="dark"] .footer-toggle summary {
  color: #e6eef3;
}

:root[data-theme="dark"] .lead,
:root[data-theme="dark"] .section-head p,
:root[data-theme="dark"] .excerpt,
:root[data-theme="dark"] .article-body,
:root[data-theme="dark"] .card-body p,
:root[data-theme="dark"] .contact-card p,
:root[data-theme="dark"] .contact-visual small,
:root[data-theme="dark"] .footer-grid p,
:root[data-theme="dark"] .footer-links a {
  color: #b9c6cf;
}

:root[data-theme="dark"] .article-detail,
:root[data-theme="dark"] .comments,
:root[data-theme="dark"] .contact-card,
:root[data-theme="dark"] .contact-visual {
  background: linear-gradient(180deg, #182129, #141b21);
  border-color: #2c3943;
}

:root[data-theme="dark"] .comment-item,
:root[data-theme="dark"] .contact-list li,
:root[data-theme="dark"] .mini-card,
:root[data-theme="dark"] .pagination a {
  background: #1a232b;
  border-color: #32404a;
  color: #c8d5dd;
}

:root[data-theme="dark"] .empty-state {
  border-color: rgba(143, 225, 230, 0.26);
  background: rgba(22, 30, 37, 0.85);
  color: #b9c6cf;
}

:root[data-theme="dark"] .contact-visual {
  background:
    radial-gradient(220px 100px at top, rgba(46, 148, 155, 0.18), transparent 72%),
    linear-gradient(170deg, #182028, #121920);
}

:root[data-theme="dark"] .poem-lines,
:root[data-theme="dark"] .poem-lines.en-poem {
  background: #191f26;
  border-color: rgba(207, 144, 80, 0.35);
}

:root[data-theme="dark"] .poem-row {
  border-bottom-color: rgba(207, 144, 80, 0.22);
}

:root[data-theme="dark"] .article-meta span,
:root[data-theme="dark"] .tag,
:root[data-theme="dark"] .badge {
  background: rgba(33, 45, 54, 0.9);
}

:root[data-theme="dark"] .article-meta span {
  color: #c8d5dd;
  border-color: rgba(143, 225, 230, 0.24);
}

:root[data-theme="dark"] .tag {
  border-color: rgba(143, 225, 230, 0.26);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: #11171c;
  border-color: #2e3b44;
  color: #deeaef;
}

:root[data-theme="dark"] .site-footer {
  border-top-color: rgba(42, 54, 64, 0.85);
  background: rgba(12, 17, 22, 0.7);
}

:root[data-theme="dark"] .btn-outline {
  background: #1b2730;
  color: #c8ebee;
  border-color: #35515f;
}

:root[data-theme="dark"] .flash.success {
  border-color: #2f5d46;
  background: #1a2b22;
  color: #8ed0aa;
}

:root[data-theme="dark"] .flash.error {
  border-color: #684043;
  background: #2a1b1d;
  color: #f0b6bc;
}

:root[data-theme="dark"] .to-top {
  background: #151c22;
  border-color: rgba(143, 225, 230, 0.22);
  color: #c8ebee;
}

:root[data-theme="dark"] .video-controls {
  background: linear-gradient(180deg, rgba(8, 11, 14, 0.95), rgba(4, 6, 8, 0.98));
}

:root[data-theme="dark"] .like-btn {
  border-color: #34424d;
  color: #c6d2db;
}

:root[data-theme="dark"] .class-detail-item {
  background: #1a232b;
  border-color: #33424d;
}

:root[data-theme="dark"] .class-detail-icon {
  background: rgba(46, 148, 155, 0.2);
}

:root[data-theme="dark"] .pagination a.active {
  color: #0a1116;
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
  }

  .menu-toggle-text {
    display: none;
  }

  .nav-actions {
    display: inline-flex;
    margin-inline-start: auto;
  }

  .theme-toggle-mobile {
    display: inline-flex;
  }

  .theme-toggle-desktop {
    display: none;
  }

  #mainNav {
    display: none;
    position: absolute;
    top: 79px;
    right: 4%;
    left: 4%;
    padding: 0.75rem;
    gap: 0.35rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--surface-1);
    box-shadow: var(--shadow-strong);
    flex-direction: column;
    align-items: stretch;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }

  #mainNav a {
    border-radius: 0.7rem;
    padding: 0.5rem 0.7rem;
  }

  #mainNav.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hero {
    padding-top: 3.3rem;
  }

  .hero-metrics,
  .cards-grid,
  .class-grid,
  .poem-row,
  .contact-mini-cards {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-about {
    order: 1;
  }

  .footer-toggle {
    border-top: 1px solid var(--line);
    padding-top: 0.55rem;
  }

  .footer-toggle .footer-links {
    margin-top: 0.45rem;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .video-wrap video,
  .video-wrap iframe {
    min-height: 240px;
  }

  .video-controls {
    flex-wrap: wrap;
  }

  .video-time {
    order: 5;
    width: 100%;
  }

  .video-volume {
    width: 100%;
  }

  .to-top {
    left: 0.9rem;
    bottom: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
