/* انجمن علمی مدیریت بازرگانی — نسخه نهایی */

/* ---------- Light (default: navy) ---------- */
:root {
  --bg: #fbfbfd;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f6f7fa;
  --line: #e7e9ef;
  --line-soft: #eff1f5;
  --ink: #0f1626;
  --ink-soft: #3a4356;
  --muted: #737d8f;

  --accent: #0d2745;
  --accent-2: #1a3d63;
  --on-accent: #ffffff;
  --gold: #b08638;
  --gold-2: #cfa653;
  --gold-soft: #fdf7ec;
  --gold-line: rgba(176, 134, 56, .22);
  --hl: rgba(190, 150, 70, .20);

  --c-blue: #3a7bd5;
  --c-teal: #2a9d8f;
  --c-amber: #c48a2c;
  --c-rose: #b5566b;
  --c-violet: #7a5aa8;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-xs: 0 1px 2px rgba(15, 22, 38, .04);
  --shadow-sm: 0 1px 2px rgba(15, 22, 38, .04), 0 2px 6px rgba(15, 22, 38, .04);
  --shadow: 0 1px 2px rgba(15, 22, 38, .04), 0 6px 16px rgba(15, 22, 38, .05);
  --shadow-hover: 0 2px 4px rgba(15, 22, 38, .05), 0 12px 28px rgba(15, 22, 38, .08);

  --brush-title: rgba(13, 39, 69, .10);
}




/* ---------- Dark ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b10;
  --bg-elev: #0e1118;
  --surface: #13161e;
  --surface-alt: #0d1016;
  --line: #232833;
  --line-soft: #1a1f29;
  --ink: #ece9e4;
  --ink-soft: #c9c5be;
  --muted: #938e85;

  --accent: #a6c4e4;
  --accent-2: #c6daf0;
  --on-accent: #090b10;
  --gold: #e6bd72;
  --gold-2: #f0d19a;
  --gold-soft: rgba(230, 189, 114, .10);
  --gold-line: rgba(230, 189, 114, .20);
  --hl: rgba(230, 189, 114, .24);

  --brush-title: rgba(166, 196, 228, .14);

  --c-blue: #7fb0ef;
  --c-teal: #5fc4b6;
  --c-amber: #e0aa55;
  --c-rose: #e08a9b;
  --c-violet: #b39ce0;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 16px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .6), 0 12px 28px rgba(0, 0, 0, .45);
}



/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.9;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s, color .3s;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }

.container { width: min(1120px, 92%); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { color: var(--ink); }

.logos {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-end: 14px;
  border-inline-end: 1px solid var(--line);
}
.logo-azad { height: 40px; width: auto; }
.logo-majors { height: 40px; width: 40px; object-fit: contain; border-radius: 50%; }

.brand-text { display: flex; flex-direction: column; line-height: 1.4; }
.brand-text strong { font-size: 15px; color: var(--accent); font-weight: 700; }
.brand-text small { font-size: 12px; color: var(--muted); }

/* ---------- منوی اصلی: اعمال براش به صورت مستقیم روی background لینک ---------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav .nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 10px;
  text-decoration: none;
  
  /* براش به عنوان پس‌زمینه با شفافیت کم */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 24' preserveAspectRatio='none'><path d='M4 14 C 18 6, 30 20, 46 12 S 74 4, 90 12 S 110 18, 117 10 C 118 14, 116 20, 108 21 C 92 24, 76 16, 60 19 S 28 25, 14 20 C 8 18, 4 16, 4 14 Z' fill='%23b08638' opacity='0.0704'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  transition: color .25s, transform .25s;
}

.main-nav .nav-item:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* هاور براش پررنگ‌تر */
.main-nav .nav-item:hover {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 24' preserveAspectRatio='none'><path d='M4 14 C 18 6, 30 20, 46 12 S 74 4, 90 12 S 110 18, 117 10 C 118 14, 116 20, 108 21 C 92 24, 76 16, 60 19 S 28 25, 14 20 C 8 18, 4 16, 4 14 Z' fill='%23b08638' opacity='0.1936'/></svg>");
}

.main-nav .nav-cta { background-color: transparent; background-image: none; color: var(--ink-soft); margin-inline-start: 0; }
.main-nav .nav-cta:hover { background-color: transparent; color: var(--accent); transform: translateY(-1px); }

/* Theme toggle */
.tools { display: flex; align-items: center; gap: 12px; }









.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color .2s, background .2s;
}
.theme-toggle:hover { border-color: var(--gold); background: var(--surface-alt); }
.theme-toggle::after { content: ""; position: absolute; inset: -4px; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(13, 39, 69, 0.0396) 1px, transparent 1.2px),
    radial-gradient(900px 460px at 90% -20%, rgba(190, 150, 70, .10), transparent 60%);
  background-size: 24px 24px, auto;
}
[data-theme="dark"] .hero {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.0317) 1px, transparent 1.2px),
    radial-gradient(900px 460px at 90% -20%, rgba(230, 189, 114, .07), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: center; }


.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 4.5vw, 54px);
  font-weight: 800;
  line-height: 1.42;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(11, 42, 74, .14), 0 2px 8px rgba(11, 42, 74, .08);
}
[data-theme="dark"] .hero h1 { text-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 2px 10px rgba(0, 0, 0, .25); }
.accent-text {
  background: linear-gradient(transparent 64%, var(--hl) 64%);
  padding: 0 3px;
}
.hero-lead { max-width: 580px; margin: 0 0 34px; color: var(--muted); font-size: 16.5px; line-height: 2; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.stats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.stats li:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--gold-line); }
.stats strong { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: 14px; text-align: start; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 600;
  background: var(--surface);
  transition: background .25s, color .25s, transform .2s, box-shadow .25s, border-color .25s;
  cursor: pointer;
}
.btn:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; position: relative; }
.section-head { margin-bottom: 44px; }
.section-title { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }

/* براش پشت عنوان بخش */
.brush-title {
  position: relative;
  display: inline-block;
  padding: 4px 14px 6px;
  isolation: isolate;
}
.brush-title span { position: relative; z-index: 2; }
.brush-title::before {
  content: "";
  position: absolute;
  inset: -2px -10px -4px;
  z-index: 1;
  background-color: var(--brush-title);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'><path d='M4 9 C 30 3, 60 13, 96 7 S 160 3, 196 8 C 197 11, 190 14, 176 13 C 140 11, 104 15, 68 13 S 18 16, 8 12 C 5 11, 4 10, 4 9 Z' fill='black'/></svg>") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'><path d='M4 9 C 30 3, 60 13, 96 7 S 160 3, 196 8 C 197 11, 190 14, 176 13 C 140 11, 104 15, 68 13 S 18 16, 8 12 C 5 11, 4 10, 4 9 Z' fill='black'/></svg>") center / 100% 100% no-repeat;
  transform: rotate(-.6deg);
  pointer-events: none;
}

/* تنوع رنگی سکشن‌ها */
.section-about { background-color: var(--bg); }
.section-achievements {
  background-color: var(--surface-alt);
  background-image: radial-gradient(rgba(176, 134, 56, 0.0475) 1px, transparent 1.2px);
  background-size: 24px 24px;
  border-block: 1px solid var(--line-soft);
}
.section-members { background-color: var(--bg); }
.section-activities {
  background-color: var(--surface-alt);
  background-image:
    radial-gradient(rgba(181, 86, 107, 0.0396) 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, rgba(181, 86, 107, 0.0158) 0 1px, transparent 1px 26px);
  background-size: 24px 24px, auto;
  border-block: 1px solid var(--line-soft);
}
.section-publications { background-color: var(--bg); }
.section-contact {
  background-color: var(--surface-alt);
  background-image: radial-gradient(rgba(42, 157, 143, 0.0475) 1px, transparent 1.2px);
  background-size: 24px 24px;
  border-block: 1px solid var(--line-soft);
}
[data-theme="dark"] .section-achievements {
  background-image: radial-gradient(rgba(230, 189, 114, 0.0396) 1px, transparent 1.2px);
}
[data-theme="dark"] .section-activities {
  background-image:
    radial-gradient(rgba(224, 138, 155, 0.0317) 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, rgba(224, 138, 155, 0.0158) 0 1px, transparent 1px 26px);
}
[data-theme="dark"] .section-contact {
  background-image: radial-gradient(rgba(95, 196, 182, 0.0396) 1px, transparent 1.2px);
}

/* رنگ‌بندی Eyebrow بر اساس بخش */

/* ---------- About / Pillars ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
.prose p { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.95; }
.prose p:last-child { margin-bottom: 0; }

.pillars { display: grid; gap: 14px; }
.pillar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.pillar:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pillar-num {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.pillar-blue .pillar-num { background: var(--c-blue); }
.pillar-teal .pillar-num { background: var(--c-teal); }
.pillar-amber .pillar-num { background: var(--c-amber); }
.pillar-blue:hover { border-color: color-mix(in srgb, var(--c-blue) 40%, transparent); }
.pillar-teal:hover { border-color: color-mix(in srgb, var(--c-teal) 40%, transparent); }
.pillar-amber:hover { border-color: color-mix(in srgb, var(--c-amber) 40%, transparent); }
.pillar h3 { margin: 0 0 2px; font-size: 15.5px; color: var(--accent); }
.pillar p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 48px; }
.card {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-xs);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--gold-line); }
.card-medal {
  flex: 0 0 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(176, 134, 56, .30);
}
.card-tag { display: block; font-size: 12.5px; color: var(--gold); font-weight: 600; margin-bottom: 3px; }
.card h3 { margin: 0; font-size: 17px; color: var(--accent); line-height: 1.6; }

.achievement-figure, .group-figure { margin: 0; text-align: center; }
.achievement-figure img, .group-figure img {
  margin-inline: auto;
  max-width: 100%;
  width: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}
.achievement-figure .zoom:hover img, .group-figure .zoom:hover img { transform: scale(1.015); box-shadow: var(--shadow); }
.group-figure img { width: min(100%, 760px); height: auto; }
figcaption { margin-top: 16px; color: var(--muted); font-size: 13.5px; }

/* ---------- Members ---------- */
.members {
  list-style: none;
  padding: 0;
  margin: 0 0 56px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.member {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.member:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.member strong { display: block; font-weight: 600; color: var(--ink); font-size: 14.5px; }
.member .role { font-size: 12.5px; color: var(--gold); font-weight: 600; }
.member-lead { border-color: var(--gold-line); background: linear-gradient(180deg, var(--surface), var(--gold-soft)); }

.avatar {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform .25s, background .25s, color .25s;
}
.avatar svg { width: 20px; height: 20px; }
.member:hover .avatar { transform: scale(1.06); }
.member-blue .avatar { color: var(--c-blue); }
.member-teal .avatar { color: var(--c-teal); }
.member-violet .avatar { color: var(--c-violet); }
.member-rose .avatar { color: var(--c-rose); }
.member-amber .avatar { color: var(--c-amber); }
.member-blue:hover { border-color: color-mix(in srgb, var(--c-blue) 35%, transparent); }
.member-teal:hover { border-color: color-mix(in srgb, var(--c-teal) 35%, transparent); }
.member-violet:hover { border-color: color-mix(in srgb, var(--c-violet) 35%, transparent); }
.member-rose:hover { border-color: color-mix(in srgb, var(--c-rose) 35%, transparent); }
.member-amber:hover { border-color: color-mix(in srgb, var(--c-amber) 35%, transparent); }
.member-lead .avatar,
.avatar-lead {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.gallery figure { margin: 0; }
.img-wrap {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .3s, border-color .3s;
}
.gallery figure:hover .img-wrap { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--c-rose) 30%, transparent); }
.gallery img { width: 100%; height: auto; transition: transform .6s cubic-bezier(.25,.46,.45,.94); }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { margin-top: 14px; font-size: 13px; line-height: 1.7; }

/* ---------- Publications ---------- */
.publications-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  color: var(--on-accent);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  box-shadow: 0 20px 50px rgba(13, 39, 69, .16);
  box-shadow: 0 20px 50px color-mix(in srgb, var(--accent) 22%, transparent);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.0634) 1px, transparent 1.2px),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 24px 24px, auto;
  position: relative;
  overflow: hidden;
}
.publications-box::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255, 0.0704), transparent 70%);
  pointer-events: none;
}
.publications-box > div { position: relative; z-index: 1; }
.publications-box .section-title { color: var(--on-accent); }
.publications-box .prose-line { margin: 0; color: var(--on-accent); opacity: .92; font-size: 16.5px; }
.publications-box .prose-line strong { color: var(--on-accent); }
.publications-box .btn-primary {
  background: var(--on-accent);
  color: var(--accent);
  border-color: var(--on-accent);
  position: relative;
  z-index: 1;
}
.publications-box .btn-primary:hover {
  background: var(--gold-soft);
  color: var(--accent);
  border-color: var(--gold-soft);
  transform: translateY(-2px);
}

/* ---------- Footer + Pattern ---------- */
.site-footer {
  position: relative;
  padding: 56px 0 44px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.footer-pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .9;
  background-image:
    radial-gradient(currentColor 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, currentColor 0 1px, transparent 1px 22px);
  background-size: 24px 24px, auto;
  background-position: 0 0, 0 0;
  color: color-mix(in srgb, var(--accent) 16%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
}
[data-theme="dark"] .footer-pattern {
  color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; z-index: 1; }
.footer-brand { display: flex; align-items: center; gap: 22px; }
.footer-brand img { height: 48px; width: auto; }
.footer-brand img[alt*="انجمن"] { border-radius: 50%; }
.footer-brand .zoom:hover img { transform: scale(1.05); }
.footer-brand .zoom img { transition: transform .3s; }
.site-footer p { margin: 0; }

/* ---------- Zoom (CSS only) ---------- */
.zoom { display: block; cursor: zoom-in; }
.zoom img { transition: opacity .2s, transform .3s; }
.zoom:hover img { opacity: .92; }
.achievement-figure .zoom, .group-figure .zoom { display: inline-block; max-width: 100%; }
.lightbox {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 100;
  background: rgba(6, 8, 12, .94);
  padding: 24px;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox:target { display: flex; }
.lightbox img { max-width: 100%; max-height: 92vh; width: auto; height: auto; border-radius: 14px; box-shadow: 0 30px 100px rgba(0,0,0,.5); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats li { flex-direction: column; text-align: center; padding: 18px 12px; }
  .stats span { text-align: center; }
  .publications-box { padding: 38px 30px; }
}

@media (max-width: 640px) {
  .hero { padding: 60px 0 48px; }
  .section { padding: 68px 0; }
  .brand-text small { display: none; }
  .logo-azad { height: 34px; }
  .logo-majors { height: 34px; width: 34px; }
  .logos { gap: 8px; padding-inline-end: 10px; }


  .main-nav { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; gap: 0; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav .nav-item { flex: 0 0 auto; padding: 9px 16px; font-size: 14px; }
  .header-inner { gap: 10px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stats li { flex-direction: column; text-align: center; padding: 16px 8px; gap: 6px; }
  .stats strong { font-size: 26px; }
  .stats span { text-align: center; font-size: 12px; line-height: 1.5; }
  .hero-grid { gap: 28px; }
  .publications-box { padding: 30px 22px; }
  .publications-box .btn { width: 100%; justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 32px; }
}

/* ---------- Accessibility ---------- */
.lightbox:focus-visible, .zoom:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .tools, .lightbox, .hero-actions, .publications-box .btn, .footer-pattern { display: none !important; }
  body { background: #fff; color: #000; }
  .section, .hero { padding: 24px 0; break-inside: avoid; }
}
/* ---------- Entrance motion (CSS only) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-text > * { animation: rise .7s ease both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; }
.stats li { animation: rise .7s ease both; }
.stats li:nth-child(2) { animation-delay: .1s; }
.stats li:nth-child(3) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  .hero-text > *, .stats li { animation: none; }
}


/* ---------- Revision: single clean title + distinct section colours ---------- */
.section-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.brush-title { padding: 0; }
.brush-title::before { display: none; }

:root {
  --tint-blue: #eef4fc;
  --tint-gold: #fbf5e8;
  --tint-rose: #fcf1f3;
  --tint-teal: #ebf7f5;
}
[data-theme="dark"] {
  --tint-blue: #121a27;
  --tint-gold: #1c1912;
  --tint-rose: #1d1417;
  --tint-teal: #111d1c;
}

.section-about {
  background-color: var(--tint-blue);
  background-image: none;
  border-block: none;
}
.section-achievements {
  background-color: var(--tint-gold);
  background-image: radial-gradient(rgba(192, 139, 44, 0.0792) 1px, transparent 1.2px);
  background-size: 24px 24px;
  border-block: none;
}
.section-members {
  background-color: var(--bg);
  background-image: none;
  border-block: none;
}
.section-activities {
  background-color: var(--tint-rose);
  background-image: radial-gradient(rgba(181, 86, 107, 0.0792) 1px, transparent 1.2px);
  background-size: 24px 24px;
  border-block: none;
}
.section-publications { background-color: var(--bg); background-image: none; }
.section-contact {
  background-color: var(--tint-teal);
  background-image: radial-gradient(rgba(42, 157, 143, 0.0792) 1px, transparent 1.2px);
  background-size: 24px 24px;
  border-block: none;
}


/* ---------- Revision 2: no brush highlights; colour rhythm = blue / green / default ---------- */
.main-nav .nav-item,
.main-nav .nav-item:hover { background-image: none; }
.accent-text { background: none; color: var(--gold); padding: 0; }

.section-about,
.section-contact {
  background-color: var(--tint-blue);
  background-image: none;
}
.section-members {
  background-color: var(--tint-teal);
  background-image: radial-gradient(rgba(42, 157, 143, 0.0792) 1px, transparent 1.2px);
  background-size: 24px 24px;
}
.section-achievements,
.section-activities,
.section-publications {
  background-color: var(--bg);
  background-image: none;
}


/* =========================================================
   Painterly layer — hand-brushed edges, strokes and texture.
   Lightweight: CSS masks + tiny inline SVG, no JavaScript.
   ========================================================= */

/* 1) Paper grain on the warm/neutral surfaces */
:root {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .063 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --brush-edge: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'><path d='M0 40 L0 24 C120 8 240 30 380 16 S640 4 780 20 S1040 34 1200 14 L1200 40 Z' fill='black'/></svg>");
  --brush-swash: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 260' preserveAspectRatio='none'><path d='M0 170 C90 120 150 210 230 150 S350 40 400 70 L400 110 C350 90 300 190 230 200 S100 230 0 260 Z' fill='black'/></svg>");
}

/* Hero: grain + painted swash at the bottom edge */
.hero {
  background-image:
    var(--grain),
    radial-gradient(var(--dot) 1px, transparent 1.2px),
    radial-gradient(900px 400px at 85% -10%, var(--glow-a), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, var(--glow-b), transparent 60%);
  background-size: 180px 180px, 22px 22px, auto, auto;
}
.hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -4%;
  bottom: -2px;
  width: min(520px, 60%);
  height: 40%;
  background: var(--gold);
  opacity: .10;
  -webkit-mask: var(--brush-swash) center / 100% 100% no-repeat;
          mask: var(--brush-swash) center / 100% 100% no-repeat;
  pointer-events: none;
}

/* 2) Painted edges between coloured sections (colour follows section tint) */
.section-about::before,
.section-members::before,
.section-contact::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -39px;
  height: 40px;
  background: inherit;
  background-color: var(--tint-blue);
  -webkit-mask: var(--brush-edge) center / 100% 100% no-repeat;
          mask: var(--brush-edge) center / 100% 100% no-repeat;
  pointer-events: none;
}
.section-members::before { background-color: var(--tint-teal); }
.section-contact::before { background-color: var(--tint-blue); }
.section-about { z-index: 0; }

/* 3) Stats: a painted accent stroke on the inline-start edge */
.stats li { position: relative; overflow: hidden; }
.stats li::before {
  content: "";
  position: absolute;
  inset-block: 14px;
  inset-inline-start: 0;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold), var(--accent));
}

/* 4) Achievement cards: hand-drawn corner stroke */
.card { position: relative; overflow: hidden; }
.card::after {
  content: "";
  position: absolute;
  top: -18px;
  inset-inline-end: -18px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: .18;
  pointer-events: none;
}

/* 5) Publications box: swash across the corner */
.publications-box { position: relative; overflow: hidden; isolation: isolate; }
.publications-box::after {
  content: "";
  position: absolute;
  inset-inline-start: -6%;
  top: -10%;
  width: 46%;
  height: 130%;
  background: var(--gold);
  opacity: .14;
  -webkit-mask: var(--brush-swash) center / 100% 100% no-repeat;
          mask: var(--brush-swash) center / 100% 100% no-repeat;
  transform: scaleX(-1);
  z-index: -1;
  pointer-events: none;
}

/* 6) Footer: painted top edge */
.site-footer { position: relative; }
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -15px;
  height: 16px;
  background: var(--tint-teal);
  -webkit-mask: var(--brush-edge) center / 100% 100% no-repeat;
          mask: var(--brush-edge) center / 100% 100% no-repeat;
  opacity: .8;
  pointer-events: none;
}

@media (max-width: 640px) {
  .hero::after { width: 80%; opacity: .07; }
  .section-about::before, .section-members::before, .section-contact::before { height: 26px; top: -25px; }
}
@media (prefers-reduced-motion: reduce) { .card::after { transition: none; } }


/* ---------- Revision 3: restore patterns + brush behind SECTION titles only ---------- */
/* Hero and navigation stay clean (no brush there). */
.section-head .brush-title { padding: 2px 14px 6px; }
.section-head .brush-title::before { display: block; }

.section-about {
  background-color: var(--tint-blue);
  background-image: radial-gradient(rgba(58, 123, 213, 0.095) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.section-members {
  background-color: var(--tint-teal);
  background-image: radial-gradient(rgba(42, 157, 143, 0.1109) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.section-achievements {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(192, 139, 44, 0.1109) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.section-activities {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(181, 86, 107, 0.095) 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, rgba(181, 86, 107, 0.0317) 0 1px, transparent 1px 26px);
  background-size: 22px 22px, auto;
}
.section-publications {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(11, 42, 74, 0.0554) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.section-contact {
  background-color: var(--tint-blue);
  background-image: radial-gradient(rgba(58, 123, 213, 0.095) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
[data-theme="dark"] .section-achievements { background-image: radial-gradient(rgba(230, 189, 114, 0.0634) 1px, transparent 1.2px); }
[data-theme="dark"] .section-activities {
  background-image:
    radial-gradient(rgba(224, 138, 155, 0.0554) 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, rgba(224, 138, 155, 0.0238) 0 1px, transparent 1px 26px);
}
[data-theme="dark"] .section-publications { background-image: linear-gradient(rgba(255, 255, 255, .026) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .026) 1px, transparent 1px); background-size: 30px 30px; }


/* ---------- Revision 4: hero diagonal pattern, no brush marks in hero/publications ---------- */
.hero::after,
.publications-box::after { display: none; }

.hero {
  background-image:
    var(--grain),
    radial-gradient(var(--dot) 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, rgba(11, 42, 74, 0.0572) 0 1px, transparent 1px 26px),
    radial-gradient(900px 400px at 85% -10%, var(--glow-a), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, var(--glow-b), transparent 60%);
  background-size: 180px 180px, 22px 22px, auto, auto, auto;
}
[data-theme="dark"] .hero {
  background-image:
    var(--grain),
    radial-gradient(var(--dot) 1px, transparent 1.2px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.0361) 0 1px, transparent 1px 26px),
    radial-gradient(900px 400px at 85% -10%, var(--glow-a), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, var(--glow-b), transparent 60%);
}


/* ---------- Revision 5: define missing tokens, drop card circles, emphasise footer ---------- */
:root {
  --dot: rgba(11, 42, 74, 0.0792);
  --glow-a: rgba(192, 139, 44, 0.09);
  --glow-b: rgba(11, 42, 74, 0.072);
}
[data-theme="dark"] {
  --dot: rgba(255, 255, 255, 0.0554);
  --glow-a: rgba(227, 185, 110, 0.072);
  --glow-b: rgba(159, 191, 224, 0.063);
}

.card::after { display: none; }

.site-footer p {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
}

/* ---------- Revision 6: bolder, coloured stat labels ---------- */
.stats li span {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

/* ---------- Revision 7: coloured stat numbers, larger footer logos ---------- */
.stats li:nth-child(1) strong { color: var(--c-blue); }
.stats li:nth-child(2) strong { color: var(--c-teal); }
.stats li:nth-child(3) strong { color: var(--c-amber); }

.footer-brand { gap: 28px; }
.footer-brand img { height: 78px; width: auto; }
.footer-brand img[alt*="انجمن"] { width: 78px; height: 78px; object-fit: contain; }
@media (max-width: 640px) {
  .footer-brand img { height: 60px; }
  .footer-brand img[alt*="انجمن"] { width: 60px; height: 60px; }
}

/* ---------- Revision 8: mobile header row + two-column gallery ---------- */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; row-gap: 8px; }
  .brand { order: 1; flex: 1 1 auto; min-width: 0; gap: 10px; }
  .brand-text strong { font-size: 13px; line-height: 1.5; }
  .tools { order: 2; gap: 8px; }
  .main-nav { order: 3; width: 100%; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .gallery figcaption { font-size: 12px; line-height: 1.6; }
}

/* ---------- Revision 9: smaller footer text on phones ---------- */
@media (max-width: 640px) {
  .site-footer p { font-size: 12.5px; line-height: 1.7; }
}


/* ---------- Revision 10: section-aware header, footer wrapping, active nav ---------- */
.nowrap { white-space: nowrap; }
.main-nav a.is-active { color: var(--on-accent); background: var(--accent); font-weight: 700; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
[data-theme="dark"] .main-nav a.is-active { background: var(--c-teal); color: #06201d; }
.brand-text strong { transition: opacity .25s; }


/* ---------- Revision 11: footer sentence on phones ---------- */
.f-line { display: inline; }
@media (max-width: 640px) {
  .site-footer p { font-size: 11px; line-height: 1.8; }
  .f-line { display: block; }
  .f-sep { display: none; }
}

/* Revision 12/17: social links - uniform circular icons with labels */
.contact-row { display: flex; justify-content: center; align-items: flex-start; gap: 36px; flex-wrap: wrap; direction: rtl; }
.contact-item { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border-radius: 12px; }
.contact-badge {
  display: block; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.contact-badge img { width: 100%; height: 100%; display: block; object-fit: cover; }
.contact-name { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.contact-item:hover .contact-badge { transform: translateY(-3px); box-shadow: var(--shadow); }
.contact-item:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 4px; }
@media (max-width: 640px) {
  .contact-badge { width: 52px; height: 52px; }
  .contact-row { gap: 28px; }
  .contact-name { font-size: 13px; }
}

/* Revision 12: section anchors land just under the sticky header */
section[id] { scroll-margin-top: 84px; }
@media (max-width: 900px) { section[id] { scroll-margin-top: 124px; } }

/* Revision 12: mobile tabs - show the contact tab, clear active indicator */
@media (max-width: 900px) {
  .main-nav { padding-inline: 14px; scroll-padding-inline: 14px; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Revision 13: 404 page */
.error-page { min-height: 100vh; min-height: 100dvh; margin: 0; display: grid; place-items: center; background: var(--bg); color: var(--ink); font-family: "Vazirmatn", Tahoma, sans-serif; padding: 16px; }
.error-main { text-align: center; max-width: 420px; }
.error-code { font-size: 72px; font-weight: 800; margin: 0; color: var(--accent); line-height: 1; }
.error-main h1 { font-size: 24px; margin: 12px 0 8px; }
.error-main p { color: var(--muted); margin: 0 0 22px; }
.error-home { display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; }
.error-home:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }

/* Revision 14: section titles in dark green (white inside the dark publications box) */
.section-title { color: #1e5c4a; }
[data-theme="dark"] .section-title { color: #8fd6c2; }
.publications-box .section-title, [data-theme="dark"] .publications-box .section-title { color: var(--on-accent); }

/* Revision 15: subtle shadow under section titles */
.section-title { text-shadow: 0 1px 2px rgba(11, 42, 74, .14), 0 2px 8px rgba(11, 42, 74, .08); }
[data-theme="dark"] .section-title { text-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 2px 10px rgba(0, 0, 0, .25); }
[data-theme="dark"] .publications-box .section-title { text-shadow: none; }

/* Revision 16: accessibility and contrast */
:root:not([data-theme="dark"]) { --muted: #5b6478; }
:root { --gold-text: #7d5a1f; }
[data-theme="dark"] { --gold-text: #e6bd72; }
.card-tag, .member .role { color: var(--gold-text); }
.stats li:nth-child(3) strong { color: #a8731f; }
[data-theme="dark"] .stats li:nth-child(3) strong { color: #e0aa55; }
:root:not([data-theme="dark"]) .pillar-blue .pillar-num { background: #2f6bc4; }
:root:not([data-theme="dark"]) .pillar-teal .pillar-num { background: #1f7f73; }
:root:not([data-theme="dark"]) .pillar-amber .pillar-num { background: #9a6a1c; }
[data-theme="dark"] .pillar-num { color: #0b1220; }
@media (max-width: 900px) { .site-footer p { font-size: 12px; } }
.skip-link { position: absolute; top: -120px; inset-inline-start: 16px; z-index: 300; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus-visible { top: 12px; outline: 3px solid var(--c-teal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }

/* Revision 18: equal gallery tiles; full images are shown without cropping */
.gallery .img-wrap { aspect-ratio: 2 / 3; display: flex; }
.gallery .img-wrap > a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: var(--surface); }
.gallery .img-wrap img { width: 100%; height: 100%; object-fit: contain; }

/* Revision 19: Safari/iOS fallbacks (older WebKit without color-mix) */
[data-theme="dark"] .site-header { background: rgba(14, 20, 32, .94); }

/* Hollow, very faint Azad logo watermark, only in the achievements section (follows theme colour) */
.section-achievements { position: relative; overflow: hidden; }
.azad-watermark {
  position: absolute;
  inset-inline-end: 4%;
  top: 50%;
  translate: 0 -50%;
  width: min(220px, 26%);
  aspect-ratio: 213 / 300;
  background-color: var(--accent);
  opacity: .05;
  -webkit-mask: url("img/logo-azad-outline.png") center / contain no-repeat;
          mask: url("img/logo-azad-outline.png") center / contain no-repeat;
  pointer-events: none;
  z-index: 0;
}
.azad-watermark--end { inset-inline-end: auto; inset-inline-start: 4%; }
.section-achievements > .container { position: relative; z-index: 1; }
@media (max-width: 700px) { .azad-watermark { display: none; } }

/* Site-wide faint grid texture, layered on top of each section's own pattern (about keeps its dots). */
:root:not([data-theme="dark"]) .hero { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .063 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"), radial-gradient(rgba(11, 42, 74, 0.08) 1px, rgba(0, 0, 0, 0) 1.2px), repeating-linear-gradient(135deg, rgba(11, 42, 74, 0.06) 0px, rgba(11, 42, 74, 0.06) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 26px), radial-gradient(900px 400px at 85% -10%, rgba(192, 139, 44, 0.09), rgba(0, 0, 0, 0) 60%), radial-gradient(800px 400px at -10% 0%, rgba(11, 42, 74, 0.07), rgba(0, 0, 0, 0) 60%); background-size: 40px 40px, 40px 40px, 180px 180px, 22px 22px, auto, auto, auto; background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-about { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), radial-gradient(rgba(58, 123, 213, 0.094) 1px, rgba(0, 0, 0, 0) 1.2px); background-size: 40px 40px, 40px 40px, 22px 22px; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-achievements { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), repeating-linear-gradient(45deg, rgba(192, 139, 44, 0.043) 0px, rgba(192, 139, 44, 0.043) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 22px); background-size: 40px 40px, 40px 40px, auto; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-members { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(rgba(42, 157, 143, 0.043) 1px, rgba(0, 0, 0, 0) 1px), linear-gradient(90deg, rgba(42, 157, 143, 0.043) 1px, rgba(0, 0, 0, 0) 1px); background-size: 40px 40px, 40px 40px, 40px 40px, 40px 40px; background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-activities { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), repeating-radial-gradient(circle at 100% 100%, rgba(181, 86, 107, 0.05) 0px, rgba(181, 86, 107, 0.05) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 26px); background-size: 40px 40px, 40px 40px, auto; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-publications { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(rgba(11, 42, 74, 0.043) 1px, rgba(0, 0, 0, 0) 1px), linear-gradient(90deg, rgba(11, 42, 74, 0.043) 1px, rgba(0, 0, 0, 0) 1px); background-size: 40px 40px, 40px 40px, 30px 30px, 30px 30px; background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-contact { background-image: linear-gradient(rgba(11, 42, 74, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .03) 1px, transparent 1px), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .063 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); background-size: 40px 40px, 40px 40px, auto; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
[data-theme="dark"] .hero { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .063 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"), radial-gradient(rgba(255, 255, 255, 0.055) 1px, rgba(0, 0, 0, 0) 1.2px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0px, rgba(255, 255, 255, 0.035) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 26px), radial-gradient(900px 400px at 85% -10%, rgba(227, 185, 110, 0.07), rgba(0, 0, 0, 0) 60%), radial-gradient(800px 400px at -10% 0%, rgba(159, 191, 224, 0.063), rgba(0, 0, 0, 0) 60%); background-size: 40px 40px, 40px 40px, 180px 180px, 22px 22px, auto, auto, auto; background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat; }
[data-theme="dark"] .section-about { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), radial-gradient(rgba(58, 123, 213, 0.094) 1px, rgba(0, 0, 0, 0) 1.2px); background-size: 40px 40px, 40px 40px, 22px 22px; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
[data-theme="dark"] .section-achievements { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), repeating-linear-gradient(45deg, rgba(230, 189, 114, 0.043) 0px, rgba(230, 189, 114, 0.043) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 22px); background-size: 40px 40px, 40px 40px, auto; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
[data-theme="dark"] .section-members { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(rgba(95, 196, 182, 0.043) 1px, rgba(0, 0, 0, 0) 1px), linear-gradient(90deg, rgba(95, 196, 182, 0.043) 1px, rgba(0, 0, 0, 0) 1px); background-size: 40px 40px, 40px 40px, 40px 40px, 40px 40px; background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat, repeat; }
[data-theme="dark"] .section-activities { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), repeating-radial-gradient(circle at 100% 100%, rgba(224, 138, 155, 0.05) 0px, rgba(224, 138, 155, 0.05) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 26px); background-size: 40px 40px, 40px 40px, auto; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
[data-theme="dark"] .section-publications { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), conic-gradient(rgba(255, 255, 255, 0.027) 25%, rgba(0, 0, 0, 0) 0deg, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.027) 0deg, rgba(255, 255, 255, 0.027) 75%, rgba(0, 0, 0, 0) 0deg); background-size: 40px 40px, 40px 40px, 24px 24px; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
[data-theme="dark"] .section-contact { background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .063 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); background-size: 40px 40px, 40px 40px, auto; background-position: 0% 0%, 0% 0%, 0% 0%; background-repeat: repeat, repeat, repeat; }
:root:not([data-theme="dark"]) .section-members::before, :root:not([data-theme="dark"]) .section-contact::before, [data-theme="dark"] .section-members::before, [data-theme="dark"] .section-contact::before { background-image: none; }

/* ---------- Warm palette: deep warm accents on light, deep warm backgrounds on dark ---------- */
.section-about { --sec: #8a4b2a; --sec-title: #6e3a1f; --sec-brush: rgba(138, 75, 42, .16); background-color: #fbf3ec; }
.section-achievements { --sec: #9a6a12; --sec-title: #6f4b0c; --sec-brush: rgba(154, 106, 18, .18); background-color: #f8efdc; }
.section-members { --sec: #8e2f3e; --sec-title: #6b1f2c; --sec-brush: rgba(142, 47, 62, .16); background-color: #f7e9ea; }
.section-activities { --sec: #4f6b2a; --sec-title: #3b5220; --sec-brush: rgba(79, 107, 42, .17); background-color: #f1f3e6; }
.section-publications { --sec: #5a3b6e; --sec-title: #432a54; --sec-brush: rgba(90, 59, 110, .15); background-color: #f3eef6; }
.section-contact { --sec: #7a3416; --sec-title: #5c2410; --sec-brush: rgba(122, 52, 22, .15); background-color: #f9ebe3; }
[data-theme="dark"] .section-about { --sec: #d9a77a; --sec-title: #ecc39c; --sec-brush: rgba(217, 167, 122, .15); background-color: #1c140f; }
[data-theme="dark"] .section-achievements { --sec: #e8c274; --sec-title: #f0d28e; --sec-brush: rgba(232, 194, 116, .15); background-color: #1f1708; }
[data-theme="dark"] .section-members { --sec: #e9a3ad; --sec-title: #f1bcc4; --sec-brush: rgba(233, 163, 173, .15); background-color: #1d1014; }
[data-theme="dark"] .section-activities { --sec: #c9d68f; --sec-title: #d9e3a7; --sec-brush: rgba(201, 214, 143, .14); background-color: #171a0f; }
[data-theme="dark"] .section-publications { --sec: #cdb3e3; --sec-title: #dcc9ee; --sec-brush: rgba(205, 179, 227, .15); background-color: #18121d; }
[data-theme="dark"] .section-contact { --sec: #efb08c; --sec-title: #f5c3a8; --sec-brush: rgba(239, 176, 140, .14); background-color: #1f110b; }
.section-about .section-title, .section-achievements .section-title, .section-members .section-title,
.section-activities .section-title, .section-contact .section-title { color: var(--sec-title); }
.section-about .brush-title::before, .section-achievements .brush-title::before, .section-members .brush-title::before,
.section-activities .brush-title::before, .section-contact .brush-title::before { background-color: var(--sec-brush); }
.publications-box .section-title, [data-theme="dark"] .publications-box .section-title { color: var(--on-accent); }

/* No background patterns: all dot, grid, stripe, checker and grain textures removed. Glows and brush shapes kept. */
:root:not([data-theme="dark"]) .hero { background-image: radial-gradient(900px 400px at 85% -10%, rgba(192, 139, 44, 0.09), rgba(0, 0, 0, 0) 60%), radial-gradient(800px 400px at -10% 0%, rgba(11, 42, 74, 0.07), rgba(0, 0, 0, 0) 60%); background-size: auto, auto; background-position: 0% 0%, 0% 0%; background-repeat: repeat, repeat; }
:root:not([data-theme="dark"]) .section-about { background-image: none; }
:root:not([data-theme="dark"]) .section-about::before { background-image: none; }
:root:not([data-theme="dark"]) .section-achievements { background-image: none; }
:root:not([data-theme="dark"]) .section-members { background-image: none; }
:root:not([data-theme="dark"]) .section-activities { background-image: none; }
:root:not([data-theme="dark"]) .section-publications { background-image: none; }
:root:not([data-theme="dark"]) .section-contact { background-image: none; }
:root:not([data-theme="dark"]) .publications-box { background-image: linear-gradient(135deg, rgb(13, 39, 69), rgb(26, 61, 99)); background-size: auto; background-position: 0% 0%; background-repeat: repeat; }
[data-theme="dark"] .hero { background-image: radial-gradient(900px 400px at 85% -10%, rgba(227, 185, 110, 0.07), rgba(0, 0, 0, 0) 60%), radial-gradient(800px 400px at -10% 0%, rgba(159, 191, 224, 0.063), rgba(0, 0, 0, 0) 60%); background-size: auto, auto; background-position: 0% 0%, 0% 0%; background-repeat: repeat, repeat; }
[data-theme="dark"] .section-about { background-image: none; }
[data-theme="dark"] .section-about::before { background-image: none; }
[data-theme="dark"] .section-achievements { background-image: none; }
[data-theme="dark"] .section-members { background-image: none; }
[data-theme="dark"] .section-activities { background-image: none; }
[data-theme="dark"] .section-publications { background-image: none; }
[data-theme="dark"] .section-contact { background-image: none; }
[data-theme="dark"] .publications-box { background-image: linear-gradient(135deg, rgb(166, 196, 228), rgb(198, 218, 240)); background-size: auto; background-position: 0% 0%; background-repeat: repeat; }
.footer-pattern { display: none; }

/* ---------- Uniform grey background for the page and all sections (no gradients or tints) ---------- */
:root:not([data-theme="dark"]) body, :root:not([data-theme="dark"]) .hero, :root:not([data-theme="dark"]) .section { background-color: #e9ebf0; background-image: none; }
[data-theme="dark"] body, [data-theme="dark"] .hero, [data-theme="dark"] .section { background-color: #16181e; background-image: none; }

/* ---------- No wavy dividers between sections; faint grid in the footer ---------- */
.hero::after, .section-about::before, .section-members::before, .section-contact::before, .site-footer::before { display: none; }
.footer-pattern {
  display: block;
  opacity: 1;
  background-image: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
  color: color-mix(in srgb, var(--accent) 10%, transparent);
}
[data-theme="dark"] .footer-pattern { color: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- Darker grey dividers between sections; grid on the first section that fades downward ---------- */
:root:not([data-theme="dark"]) .section { border-top: 1px solid #c4c9d3; }
[data-theme="dark"] .section { border-top: 1px solid #2c303a; }
.section-about::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(11, 42, 74, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .08) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%);
}
[data-theme="dark"] .section-about::after {
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
}

/* ---------- Grid moves to the first section (hero), fading downward; softer, thicker dividers that fade at both ends ---------- */
.section-about::after { display: none; }
[data-theme="dark"] .section-about::after { display: none; }
.hero { isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(11, 42, 74, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 42, 74, .08) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%);
}
[data-theme="dark"] .hero::before {
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
}
:root:not([data-theme="dark"]) .section { border-top: 0; background-image: linear-gradient(90deg, transparent 0%, #d4d8e0 16%, #d4d8e0 84%, transparent 100%); background-repeat: no-repeat; background-size: 100% 2px; background-position: 0 0; }
[data-theme="dark"] .section { border-top: 0; background-image: linear-gradient(90deg, transparent 0%, #2a2e37 16%, #2a2e37 84%, transparent 100%); background-repeat: no-repeat; background-size: 100% 2px; background-position: 0 0; }

/* Stronger shadow on the hero heading */
:root:not([data-theme="dark"]) .hero h1 { text-shadow: 0 2px 4px rgba(11, 42, 74, .22), 0 6px 18px rgba(11, 42, 74, .16); }
[data-theme="dark"] .hero h1 { text-shadow: 0 2px 4px rgba(0, 0, 0, .55), 0 6px 20px rgba(0, 0, 0, .4); }

/* ---------- Navy outline for the secondary hero button; dividers fade more ---------- */
:root:not([data-theme="dark"]) .btn-ghost { border-color: #1c3d6b; color: #1c3d6b; }
[data-theme="dark"] .btn-ghost { border-color: #a6c4e4; color: #a6c4e4; }
:root:not([data-theme="dark"]) .section { background-image: linear-gradient(90deg, transparent 0%, #d4d8e0 30%, #d4d8e0 70%, transparent 100%); background-repeat: no-repeat; background-size: 100% 2px; background-position: 0 0; }
[data-theme="dark"] .section { background-image: linear-gradient(90deg, transparent 0%, #2a2e37 30%, #2a2e37 70%, transparent 100%); background-repeat: no-repeat; background-size: 100% 2px; background-position: 0 0; }

/* Narrow phones: the header wraps taller, so section targets need more offset */
@media (max-width: 380px) { section[id] { scroll-margin-top: 180px; } }

/* ---------- Section titles: navy text, no brush behind, dark grey ellipse around each title ---------- */
:root:not([data-theme="dark"]) .section .brush-title { color: #1c2f5c; }
[data-theme="dark"] .section .brush-title { color: #a9c3ea; }
:root:not([data-theme="dark"]) .section .brush-title::before { background: none; background-color: transparent; -webkit-mask: none; mask: none; border: 2px solid #4b5160; border-radius: 50%; inset: -12px -24px; transform: none; }
[data-theme="dark"] .section .brush-title::before { background: none; background-color: transparent; -webkit-mask: none; mask: none; border: 2px solid #8c93a0; border-radius: 50%; inset: -12px -24px; transform: none; }

/* ---------- Publications card: faint dot pattern that fades toward the left ---------- */
.publications-box { position: relative; overflow: hidden; isolation: isolate; }
.publications-box > * { position: relative; z-index: 1; }
.publications-box .box-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.4px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 85%);
          mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 85%);
}
[data-theme="dark"] .publications-box .box-dots { background-image: radial-gradient(rgba(11, 42, 74, .22) 1px, transparent 1.4px); }

/* Section titles: plain navy text, no ellipse or brush */
.section .brush-title::before, [data-theme="dark"] .section .brush-title::before { display: none; }

/* Section jump offsets, matched to the measured header height of each width range (+14px air) */
@media (min-width: 960px) and (max-width: 1031px) { section[id] { scroll-margin-top: 148px; } }
@media (min-width: 652px) and (max-width: 959px) { section[id] { scroll-margin-top: 144px; } }
@media (min-width: 641px) and (max-width: 651px) { section[id] { scroll-margin-top: 208px; } }
@media (min-width: 388px) and (max-width: 640px) { section[id] { scroll-margin-top: 136px; } }
@media (min-width: 332px) and (max-width: 387px) { section[id] { scroll-margin-top: 178px; } }
@media (max-width: 331px) { section[id] { scroll-margin-top: 183px; } }

/* Gold words in the hero heading: slightly deeper gold in light mode so they reach 3:1 on the grey background */
:root:not([data-theme="dark"]) .accent-text { color: #a17323; }

/* ---------- 404 page: browser-window card, text on the right, plug illustration on the left (RTL) ---------- */
.err-window { width: min(920px, calc(100% - 32px)); margin: 32px auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(11, 42, 74, .14); }
.err-bar { height: 44px; display: flex; align-items: center; gap: 9px; padding-inline: 20px; background: color-mix(in srgb, var(--surface) 92%, var(--ink) 8%); }
.err-bar span { width: 12px; height: 12px; border-radius: 50%; }
.err-bar span:nth-child(1) { background: #e5534b; }
.err-bar span:nth-child(2) { background: #f0b43c; }
.err-bar span:nth-child(3) { background: #4cb050; }
.err-body { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 48px 44px; min-height: 380px; }
.err-text { text-align: center; }
.err-code { margin: 0; font-size: clamp(72px, 12vw, 104px); font-weight: 800; line-height: 1; color: var(--accent); }
.err-title { margin: 8px 0 12px; font-size: clamp(22px, 3.4vw, 28px); font-weight: 800; color: var(--ink); }
.err-lead { margin: 0 auto 26px; max-width: 360px; font-size: 15px; line-height: 1.9; color: var(--muted); }
.err-btn { display: inline-block; padding: 13px 26px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.err-btn:hover { filter: brightness(1.12); }
.err-btn:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }
.err-art { color: var(--accent); display: flex; justify-content: center; }
.err-art svg { width: min(300px, 100%); height: auto; display: block; }
@media (max-width: 700px) {
  .err-body { grid-template-columns: 1fr; padding: 36px 24px 40px; gap: 8px; min-height: 0; }
  .err-art svg { width: min(230px, 70%); }
  .err-text { order: 1; }
}
.err-bar { direction: ltr; justify-content: flex-start; }

/* 404: full-screen layout (no window card, no dots) */
.err-window { width: 100%; min-height: 100vh; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--surface); display: flex; align-items: center; }
.err-body { width: 100%; min-height: 100vh; min-height: 100dvh; padding: 48px clamp(20px, 6vw, 80px); box-sizing: border-box; }
@media (max-width: 700px) { .err-body { min-height: 100dvh; padding: 40px 24px; } }
body.error-page { display: block; padding: 0; margin: 0; background: var(--surface); }
