/* BBAS — base layout, header, footer, light/dark */

:root,
[data-theme="light"] {
  /* Color Hunt: #450693 · #8c00ff · #ff3f7f · #ffc400 */
  --bg: #f7f2ff;
  --bg-elevated: #ffffff;
  --bg-muted: #ebe0fb;
  --ink: #1c0738;
  --ink-soft: #5a4578;
  --line: rgba(69, 6, 147, 0.12);
  --brand: #8c00ff;
  --brand-strong: #450693;
  --accent: #ff3f7f;
  --highlight: #ffc400;
  --header-bg: rgba(255, 255, 255, 0.86);
  --footer-bg: #450693;
  --footer-ink: #f7f2ff;
  --footer-muted: #c9b3ef;
  --shadow: 0 12px 32px rgba(69, 6, 147, 0.12);
  --radius: 16px;
  --header-h: 4.5rem;
  --font: "Vazirmatn", "Source Serif 4", serif;
  --font-display: "Source Serif 4", "Vazirmatn", serif;
  --cursor: auto;
  --cursor-click: pointer;
  --cursor-zoom: zoom-in;
  --cursor-wait: wait;
}

html[data-cursor="pen"] {
  --cursor: url("../img/cursors/pen.svg") 2 30, auto;
  --cursor-click: url("../img/cursors/pen.svg") 2 30, pointer;
  --cursor-zoom: url("../img/cursors/pen.svg") 2 30, zoom-in;
  --cursor-wait: url("../img/cursors/pen.svg") 2 30, wait;
}

html[data-cursor="book"] {
  --cursor: url("../img/cursors/book.svg") 8 28, auto;
  --cursor-click: url("../img/cursors/book.svg") 8 28, pointer;
  --cursor-zoom: url("../img/cursors/book.svg") 8 28, zoom-in;
  --cursor-wait: url("../img/cursors/book.svg") 8 28, wait;
}

html[data-cursor="school"] {
  --cursor: url("../img/cursors/school.svg") 16 30, auto;
  --cursor-click: url("../img/cursors/school.svg") 16 30, pointer;
  --cursor-zoom: url("../img/cursors/school.svg") 16 30, zoom-in;
  --cursor-wait: url("../img/cursors/school.svg") 16 30, wait;
}

html[data-cursor="seedling"] {
  --cursor: url("../img/cursors/seedling.svg") 16 30, auto;
  --cursor-click: url("../img/cursors/seedling.svg") 16 30, pointer;
  --cursor-zoom: url("../img/cursors/seedling.svg") 16 30, zoom-in;
  --cursor-wait: url("../img/cursors/seedling.svg") 16 30, wait;
}

html[data-cursor="shield"] {
  --cursor: url("../img/cursors/shield.svg") 16 30, auto;
  --cursor-click: url("../img/cursors/shield.svg") 16 30, pointer;
  --cursor-zoom: url("../img/cursors/shield.svg") 16 30, zoom-in;
  --cursor-wait: url("../img/cursors/shield.svg") 16 30, wait;
}

[data-theme="dark"] {
  --bg: #12061f;
  --bg-elevated: #1c0c32;
  --bg-muted: #2a1448;
  --ink: #f7f2ff;
  --ink-soft: #c4b0e4;
  --line: rgba(247, 242, 255, 0.12);
  --brand: #b44dff;
  --brand-strong: #d4a0ff;
  --accent: #ff6b9d;
  --highlight: #ffc400;
  --header-bg: rgba(18, 6, 31, 0.9);
  --footer-bg: #2a0570;
  --footer-ink: #f7f2ff;
  --footer-muted: #b8a0de;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  cursor: var(--cursor);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: clip;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  cursor: var(--cursor);
}

a,
button,
summary,
label,
select,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="file"],
input[type="range"],
input[type="image"] {
  cursor: var(--cursor-click);
}

input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="image"]),
textarea,
[contenteditable="true"] {
  cursor: text;
}

[data-theme="dark"] body {
  background: var(--bg);
}

/* ----- Ambient wave / mesh background (all pages) ----- */

.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
}

.site-bg__mesh {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(42% 36% at 12% 8%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 70%),
    radial-gradient(38% 34% at 88% 12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%),
    radial-gradient(46% 40% at 70% 78%, color-mix(in srgb, var(--highlight) 18%, transparent), transparent 70%),
    radial-gradient(36% 32% at 18% 72%, color-mix(in srgb, var(--brand-strong) 16%, transparent), transparent 65%),
    radial-gradient(28% 24% at 48% 42%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  filter: blur(8px);
  opacity: 0.9;
  animation: site-bg-mesh 18s ease-in-out infinite alternate;
}

.site-bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  will-change: transform;
}

.site-bg__blob--a {
  width: min(42vw, 28rem);
  height: min(42vw, 28rem);
  top: -6%;
  inset-inline-start: -8%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--brand) 70%, #fff), transparent 70%);
  animation: site-bg-float-a 22s ease-in-out infinite;
}

.site-bg__blob--b {
  width: min(36vw, 24rem);
  height: min(36vw, 24rem);
  top: 28%;
  inset-inline-end: -10%;
  background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent) 65%, #fff), transparent 72%);
  animation: site-bg-float-b 26s ease-in-out infinite;
}

.site-bg__blob--c {
  width: min(48vw, 32rem);
  height: min(34vw, 22rem);
  bottom: -8%;
  inset-inline-start: 18%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--highlight) 55%, #fff), transparent 70%);
  opacity: 0.4;
  animation: site-bg-float-c 24s ease-in-out infinite;
}

.site-bg__wave {
  position: absolute;
  inset-inline: 0;
  width: 100%;
  height: auto;
  display: block;
  color: var(--brand);
}

.site-bg__wave--top {
  top: 0;
  height: clamp(9rem, 22vw, 16rem);
  opacity: 0.55;
}

.site-bg__wave--mid {
  top: 42%;
  height: clamp(7rem, 16vw, 12rem);
  opacity: 0.28;
  transform: scaleY(-1);
}

.site-bg__wave--bottom {
  bottom: 0;
  height: clamp(10rem, 24vw, 17rem);
  opacity: 0.5;
}

.site-bg__wave-path {
  fill: currentColor;
}

.site-bg__wave-path--1 {
  color: color-mix(in srgb, var(--brand) 22%, transparent);
}

.site-bg__wave-path--2 {
  color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.site-bg__wave-path--3 {
  color: color-mix(in srgb, var(--brand-strong) 12%, transparent);
}

.site-bg__wave-path--4 {
  color: color-mix(in srgb, var(--brand) 18%, transparent);
}

.site-bg__wave-path--5 {
  color: color-mix(in srgb, var(--highlight) 14%, transparent);
}

.site-bg__rings {
  position: absolute;
  width: min(70vw, 40rem);
  height: min(70vw, 40rem);
  top: 18%;
  inset-inline-end: -18%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at center,
      transparent 0 18px,
      color-mix(in srgb, var(--brand) 8%, transparent) 18px 20px
    );
  opacity: 0.45;
  mask-image: radial-gradient(circle, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 72%);
  animation: site-bg-spin 48s linear infinite;
}

.site-bg__dots {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--brand-strong) 22%, transparent) 1.1px, transparent 0);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 10%, transparent 75%);
}

[data-theme="dark"] .site-bg__mesh {
  opacity: 0.7;
  filter: blur(12px);
}

[data-theme="dark"] .site-bg__blob {
  opacity: 0.35;
}

[data-theme="dark"] .site-bg__wave--top,
[data-theme="dark"] .site-bg__wave--bottom {
  opacity: 0.35;
}

[data-theme="dark"] .site-bg__rings {
  opacity: 0.28;
}

[data-theme="dark"] .site-bg__dots {
  opacity: 0.22;
}

@keyframes site-bg-mesh {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(1.5%, -1.5%, 0) scale(1.04); }
}

@keyframes site-bg-float-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(8%, 12%, 0) scale(1.08); }
}

@keyframes site-bg-float-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-10%, 8%, 0) scale(1.1); }
}

@keyframes site-bg-float-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6%, -10%, 0) scale(1.06); }
}

@keyframes site-bg-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .site-bg__mesh,
  .site-bg__blob,
  .site-bg__rings {
    animation: none !important;
  }
}

@media (max-width: 700px) {
  .site-bg__blob--c,
  .site-bg__wave--mid {
    display: none;
  }

  .site-bg__rings {
    opacity: 0.28;
  }

  .site-bg__wave--top,
  .site-bg__wave--bottom {
    opacity: 0.4;
  }
}

.site-main,
.site-footer {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-strong);
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ----- Header ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(1.15);
  background: color-mix(in srgb, var(--header-bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: inherit;
}

.brand-logo {
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(69, 6, 147, 0.14);
  background: var(--bg-elevated);
}

.brand-mark {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: linear-gradient(145deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tagline {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-desktop .nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--brand-strong);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: var(--cursor-click);
}

.lang-btn.is-active,
.lang-btn:hover {
  background: var(--brand);
  color: #fff;
}

.theme-toggle,
.menu-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: var(--cursor-click);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover,
.menu-toggle:hover {
  transform: translateY(-1px);
}

[data-theme="light"] .theme-icon-moon,
[data-theme="dark"] .theme-icon-sun {
  display: none;
}

.menu-bars,
.menu-bars::before,
.menu-bars::after {
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-bars {
  position: relative;
}

.menu-bars::before,
.menu-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.menu-bars::before { top: -5px; }
.menu-bars::after { top: 5px; }

.menu-toggle[aria-expanded="true"] .menu-bars {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-mobile {
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 1rem 1rem 1.25rem;
}

.nav-mobile .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.nav-mobile .nav-link {
  width: 100%;
  justify-content: flex-start;
}

.mobile-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}

.mobile-city {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.menu-toggle {
  display: none;
}

@media (max-width: 900px) {
  .nav-desktop,
  .header-actions .lang-switch {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .brand-tagline {
    display: none;
  }
}

/* ----- Main ----- */

.site-main {
  flex: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

.page-hero {
  margin-bottom: 2rem;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.25;
}

.page-hero .lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 42rem;
}

.page-body {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.page-body p {
  margin-top: 0;
}

/* ----- Footer ----- */

.site-footer {
  margin-top: auto;
  background:
    radial-gradient(720px 300px at 0% 0%, rgba(140, 0, 255, 0.45), transparent 60%),
    radial-gradient(560px 260px at 100% 100%, rgba(255, 63, 127, 0.28), transparent 55%),
    radial-gradient(420px 200px at 50% 120%, rgba(255, 196, 0, 0.12), transparent 50%),
    var(--footer-bg);
  color: var(--footer-ink);
}

.footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.75rem 0 1.75rem;
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1.25fr;
  gap: 1.75rem 1.5rem;
  align-items: start;
}

.footer-brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.footer-brand-link:hover {
  color: inherit;
}

.footer-logo {
  width: 3.6rem;
  height: 3.6rem;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.footer-brand-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.footer-school {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.footer-tagline,
.footer-city {
  margin: 0;
  color: var(--footer-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-city {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-heading {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--highlight);
  letter-spacing: 0.03em;
}

.footer-links,
.footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-links a,
.footer-contact a {
  color: var(--footer-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--highlight);
}

.footer-contact li {
  color: var(--footer-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.1rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  color: var(--footer-muted);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.footer-social a {
  color: var(--footer-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-social a:hover {
  color: var(--highlight);
}

.footer-credit {
  line-height: 1.55;
}

.footer-credit strong {
  color: var(--highlight);
  font-weight: 700;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .site-header {
    animation: header-in 0.45s ease both;
  }

  .site-main {
    animation: main-in 0.5s ease 0.05s both;
  }

  .site-footer {
    animation: footer-in 0.55s ease 0.1s both;
  }
}

@keyframes header-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes main-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes footer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
