/* logo mark as a base64 data-URI mask (path-independent, capture-safe) */
@import url("_logo-mask.css");

/* ============================================================
   AMEDIA — خانه هنر و رسانه آمدیا
   Design system / global styles
   Dark + green cinematic theme. RTL (fa/ar) + LTR (en).
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg:            #0e120e;
  --bg-soft:       #141a14;
  --bg-elevated:   #1b211b;
  --footer-bg:     #20221c;
  --surface:       rgba(255, 255, 255, 0.045);
  --surface-2:     rgba(255, 255, 255, 0.07);
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* text */
  --text:          #f3f5ef;
  --text-soft:     #c4c8bd;
  --text-muted:    #8b9085;
  --text-faint:    #5e635a;

  /* accent — cinema green */
  --accent:        #47d27e;
  --accent-bright: #5ee68f;
  --accent-dim:    #2f8a55;
  --accent-glow:   rgba(71, 210, 126, 0.35);
  --accent-tint:   rgba(71, 210, 126, 0.10);

  /* spectrum (CTA orb) */
  --spectrum: conic-gradient(from 90deg,
      #ff5d73, #ffb13d, #ffe66b, #57e389,
      #4cc9f0, #6a8cff, #b388ff, #ff7ad9, #ff5d73);

  /* shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* shadow */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --shadow-md: 0 14px 40px rgba(0,0,0,.45);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.55);

  /* layout */
  --maxw: 1380px;
  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 86px;

  /* type */
  --font: 'Kalameh', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* hide the native page scrollbar (the long vertical line) — scrolling still works.
   Firefox uses scrollbar-width; Chrome/Safari/Edge use the ::-webkit pseudo. */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* custom triangle cursor replaces the native one on pointer devices — kill ALL native cursors
   (incl. the grab hand on the soon row and the pointer hand on links) */
@media (hover: hover) and (pointer: fine) { *, *::before, *::after { cursor: none !important; } }
/* stop text selection/highlight everywhere except real form fields */
body { -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0;
  overflow-x: hidden;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* English flips to LTR + tighter line-height for Latin */
html[lang="en"] body { line-height: 1.6; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

::selection { background: var(--accent); color: #07140c; }

/* ---------- Type scale ---------- */
.display {
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-size: clamp(2.2rem, 5.2vw, 4rem);
}
.h1 { font-weight: 800; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.25; letter-spacing: -.01em; }
/* screen-reader / SEO only: an accessible heading that isn't shown visually */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.h2 { font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.3; }
.h3 { font-weight: 700; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.4; }
.lead { font-size: clamp(1rem, 1.4vw, 1.18rem); color: var(--text-soft); }
.muted { color: var(--text-muted); }
/* eyebrow = MODEL-1 glass chip (decorative label, no circle) */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 9px 18px; border-radius: var(--r-pill);
  font-size: .82rem; font-weight: 600; letter-spacing: .06em;
  color: var(--accent); text-transform: none;
  background:
    radial-gradient(125% 140% at 0% 0%, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 30%, transparent 58%),
    linear-gradient(135deg, rgba(108,124,104,.40) 0%, rgba(46,56,46,.32) 50%, rgba(20,26,20,.28) 100%);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.18),
    inset -1.5px -1.5px 0 rgba(0,0,0,.30),
    0 12px 26px -16px rgba(0,0,0,.55);
  transition: border-color .5s var(--ease-out), box-shadow .55s var(--ease-out),
              background .5s var(--ease-out), color .4s var(--ease-out), text-shadow .4s var(--ease-out);
}
/* hover: brighten the top-left white wash + make the text glow (no outer glow) */
.eyebrow:hover {
  border-color: rgba(255,255,255,.22);
  color: var(--accent-bright);
  text-shadow: 0 0 12px rgba(94,230,143,.55), 0 0 4px rgba(94,230,143,.4);
  background:
    radial-gradient(125% 140% at 0% 0%, rgba(255,255,255,.30) 0%, rgba(255,255,255,.08) 32%, transparent 62%),
    linear-gradient(135deg, rgba(108,124,104,.40) 0%, rgba(46,56,46,.32) 50%, rgba(20,26,20,.28) 100%);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.26),
    inset -1.5px -1.5px 0 rgba(0,0,0,.34),
    0 16px 30px -16px rgba(0,0,0,.62);
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 132px); position: relative; }
.section--soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin-inline: auto; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head .h2 { margin-top: 12px; }
.section-head .lead { margin-top: 14px; }

.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.grid { display: grid; }

/* ---------- Buttons ---------- */
/* btn = glass like the card panel (transparent, top-left white wash, bevel,
   drop shadow, soft glow on hover). The .dot is the MODEL-2 corner circle. */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: .7em;
  padding: 14px 28px; border-radius: var(--r-pill);
  font-weight: 600; font-size: .98rem; line-height: 1;
  color: var(--text); text-decoration: none;
  background:
    radial-gradient(120% 135% at 0% 0%, rgba(255,255,255,.18) 0%, rgba(255,255,255,.05) 28%, transparent 56%),
    linear-gradient(135deg, rgba(108,124,104,.42) 0%, rgba(46,56,46,.34) 46%, rgba(20,26,20,.30) 100%);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.20),
    inset -1.5px -1.5px 0 rgba(0,0,0,.32),
    0 16px 34px -18px rgba(0,0,0,.6);
  transition: border-color .5s var(--ease-out), box-shadow .55s var(--ease-out), transform .3s var(--ease-out),
              background .5s var(--ease-out), color .4s var(--ease-out), text-shadow .4s var(--ease-out);
  white-space: nowrap;
}
/* hover: brighten the top-left white wash + make the text/label glow.
   No outer glow — only the dark shadow stays underneath. */
.btn:hover {
  border-color: rgba(255,255,255,.24);
  color: #ffffff;
  text-shadow: 0 0 13px rgba(255,255,255,.55), 0 0 4px rgba(255,255,255,.42);
  background:
    radial-gradient(120% 135% at 0% 0%, rgba(255,255,255,.36) 0%, rgba(255,255,255,.11) 30%, transparent 60%),
    linear-gradient(135deg, rgba(108,124,104,.42) 0%, rgba(46,56,46,.34) 46%, rgba(20,26,20,.30) 100%);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.30),
    inset -1.5px -1.5px 0 rgba(0,0,0,.38),
    0 20px 42px -16px rgba(0,0,0,.74);
}
.btn:active { transform: translateY(1px); }
/* MODEL-2 corner circle: white glowing handle.
   Grows via transform:scale so the button size NEVER changes (no layout shift). */
/* MODEL-2 corner circle: the visible shape is the ::after pill so width can grow with NO
   reflow and as a true stadium (straight sides + round caps), not a squished ellipse. */
.btn .dot {
  position: relative; width: 16px; height: 16px; flex: none; background: transparent;
}
.btn .dot::after {
  content: ""; position: absolute; top: 50%; right: 0; height: 16px; width: 16px;
  transform: translateY(-50%); /* stays vertically centered in the button, hover or not */
  border-radius: 999px; flex: none;
  background: radial-gradient(125% 125% at 35% 28%, #fcfdfa, #d7dccf);
  box-shadow: 0 3px 9px rgba(0,0,0,.42), 0 0 10px rgba(255,255,255,.18), inset 0 1px 0 rgba(255,255,255,.85);
  transition: width .5s var(--ease-out), box-shadow .55s var(--ease-out);
}
/* the circle always sits on the physical LEFT, in every language/direction */
html[dir="rtl"] .btn .dot { order: 2; }
html[dir="ltr"] .btn .dot { order: -1; }
.btn:hover .dot::after {
  width: 28px; /* stretches LEFT into a short, clean capsule (right edge pinned) */
  box-shadow: 0 3px 9px rgba(0,0,0,.48), 0 0 10px rgba(255,255,255,.28), inset 0 .6px 0 rgba(255,255,255,.9);
}
/* primary keeps the same glass but leans green to preserve CTA hierarchy */
.btn--primary {
  background:
    radial-gradient(120% 135% at 0% 0%, rgba(255,255,255,.18) 0%, rgba(255,255,255,.05) 28%, transparent 56%),
    linear-gradient(135deg, rgba(71,210,126,.34) 0%, rgba(46,120,80,.26) 50%, rgba(20,40,28,.26) 100%);
  border-color: rgba(120,235,165,.30); color: var(--text); font-weight: 700;
}
.btn--primary:hover {
  border-color: rgba(120,235,165,.5);
  color: #ffffff;
  text-shadow: 0 0 14px rgba(94,230,143,.6), 0 0 5px rgba(94,230,143,.45);
  background:
    radial-gradient(120% 135% at 0% 0%, rgba(255,255,255,.34) 0%, rgba(180,255,210,.12) 30%, transparent 60%),
    linear-gradient(135deg, rgba(71,210,126,.40) 0%, rgba(46,120,80,.30) 50%, rgba(20,40,28,.28) 100%);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.28),
    inset -1.5px -1.5px 0 rgba(0,0,0,.36),
    0 20px 42px -16px rgba(0,0,0,.74);
}
.btn--primary .dot::after { box-shadow: 0 3px 9px rgba(0,0,0,.42), 0 0 12px rgba(94,230,143,.38), inset 0 1px 0 rgba(255,255,255,.85); }
.btn--ghost { background: transparent; }
.btn--lg { padding: 17px 36px; font-size: 1.05rem; }

/* arrow that respects direction */
.btn .arrow { display: inline-block; transition: transform .25s var(--ease); }
html[dir="rtl"] .btn:hover .arrow { transform: translateX(-4px); }
html[dir="ltr"] .btn:hover .arrow { transform: translateX(4px); }

/* ---------- Glass card ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,.025) 0 12px, rgba(255,255,255,0) 12px 24px),
    radial-gradient(120% 100% at 30% 0%, #25302a 0%, #161d18 60%, #11161200 100%),
    var(--bg-elevated);
  color: var(--text-faint);
  display: grid; place-items: center;
}
.ph::after {
  content: attr(data-label);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .72rem; letter-spacing: .08em; color: var(--text-faint);
  padding: 4px 10px; border: 1px dashed var(--border-strong); border-radius: 6px;
  background: rgba(0,0,0,.25);
}
.ph--green { background:
    repeating-linear-gradient(135deg, rgba(71,210,126,.06) 0 12px, transparent 12px 24px),
    radial-gradient(120% 120% at 50% 30%, rgba(71,210,126,.22), transparent 60%),
    var(--bg-elevated); }
/* when the admin attaches a real image/video, drop the hatch + label */
.ph.has-media { background-image: none; }
.ph.has-media::after { display: none; }

/* ---------- Pills / tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--r-pill);
  font-size: .85rem; font-weight: 500; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  transition: all .2s var(--ease); white-space: nowrap;
}
.tag:hover { color: var(--text); border-color: var(--border-strong); }
.tag.is-active {
  color: #06160d; font-weight: 700;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border-color: transparent;
}

/* ---------- Reveal on scroll ----------
   Gated on html.reveal-anim (added by JS). If JS/IO fails,
   the class is never added → content stays fully visible. */
html.reveal-anim [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
html.reveal-anim [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- Mouse-follow glow — soft morphing blob, lives behind the page ---------- */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 460px; height: 460px; margin: -230px 0 0 -230px;
  pointer-events: none; z-index: -1; will-change: transform;
  opacity: 0; transition: opacity .9s var(--ease);
}
.cursor-glow.on { opacity: 1; }
.cursor-glow__blob {
  position: absolute; inset: 0;
  /* tighter fade radius — the glow holds its core then drops off quickly */
  background: radial-gradient(circle at 50% 50%,
      rgba(94,230,143,.18), rgba(71,210,126,.10) 34%, rgba(71,210,126,.03) 52%, rgba(71,210,126,0) 66%);
  filter: blur(40px);
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation: blobMorph 17s ease-in-out infinite;
}
@keyframes blobMorph {
  0%   { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; transform: rotate(0deg)   scale(1);   }
  25%  { border-radius: 62% 38% 34% 66% / 59% 34% 66% 41%; transform: rotate(38deg)  scale(1.10);}
  50%  { border-radius: 34% 66% 56% 44% / 52% 62% 38% 48%; transform: rotate(-26deg) scale(.92); }
  75%  { border-radius: 57% 43% 47% 53% / 37% 56% 44% 63%; transform: rotate(22deg)  scale(1.06);}
  100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; transform: rotate(0deg)   scale(1);   }
}
@media (hover: none) { .cursor-glow { display: none; } }
@media (prefers-reduced-motion: reduce) { .cursor-glow__blob { animation: none; } }

/* ---------- Triangle comet cursor — the Amedia mark, white, stretches with mouse speed ---------- */
.cursor-mark {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 24px; height: 24px; margin: -3.3px 0 0 -11.6px;
  transform-origin: 11.6px 3.3px; /* pivot on the triangle's tip so it pins to the real pointer */
  pointer-events: none; will-change: transform;
  background: #fff;
  -webkit-mask: url("../img/cursor-mark.png") center / contain no-repeat;
  mask: url("../img/cursor-mark.png") center / contain no-repeat;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.5));
  opacity: 0; transition: opacity .3s var(--ease);
}
.cursor-mark.on { opacity: 1; }
@media (hover: none) { .cursor-mark { display: none; } }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(71,210,126,.07), transparent 70%),
    var(--bg);
  transition: opacity .6s var(--ease), visibility .6s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 34px; }

/* logo box keeps the mark's native aspect ratio (278×251) so the
   45° diagonal stripes line up with the artwork */
.loader__logo { position: relative; width: 156px; aspect-ratio: 278 / 251; }
/* the wrapper masks the WHOLE group to the mark silhouette; children
   only need to define which diagonal slice they paint */
.loader__maskwrap {
  position: absolute; inset: 0;
  -webkit-mask: var(--logo-mark) center/contain no-repeat;
          mask: var(--logo-mark) center/contain no-repeat;
}
/* faint full mark — keeps the whole shape readable at all times */
.loader__ghost { position: absolute; inset: 0; background: var(--text); opacity: .12; }
/* each band paints one diagonal slice; a bright pulse travels
   bottom-left → top-right and loops */
.loader__band {
  position: absolute; inset: 0; opacity: .1;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent) 60%, var(--accent-dim));
  -webkit-mask: linear-gradient(45deg, transparent calc(var(--p) - 13%), #000 calc(var(--p) - 5%), #000 calc(var(--p) + 5%), transparent calc(var(--p) + 13%));
          mask: linear-gradient(45deg, transparent calc(var(--p) - 13%), #000 calc(var(--p) - 5%), #000 calc(var(--p) + 5%), transparent calc(var(--p) + 13%));
  animation: bandWave 1.9s var(--ease) infinite;
}
.loader__band:nth-child(2) { animation-delay: 0s; }
.loader__band:nth-child(3) { animation-delay: .19s; }
.loader__band:nth-child(4) { animation-delay: .38s; }
.loader__band:nth-child(5) { animation-delay: .57s; }
.loader__band:nth-child(6) { animation-delay: .76s; }
.loader__band:nth-child(7) { animation-delay: .95s; }
.loader__band:nth-child(8) { animation-delay: 1.14s; }
@keyframes bandWave {
  0%   { opacity: .1; }
  18%  { opacity: 1; }
  42%  { opacity: .1; }
  100% { opacity: .1; }
}
.loader__bar { width: 188px; height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; direction: ltr; }
.loader__fill { display: block; height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transition: width .2s linear; }
.loader__pct { font-size: .92rem; font-weight: 700; color: var(--text-soft); letter-spacing: .14em; font-variant-numeric: tabular-nums; direction: ltr; }
@media (prefers-reduced-motion: reduce) {
  .loader__band { animation: none; opacity: 1; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
}
/* blurred, low-opacity bar that FADES OUT toward the bottom (no border) */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(14,18,14,.50), rgba(14,18,14,0));
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  -webkit-mask-image: linear-gradient(to bottom, #000 48%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 48%, transparent 100%);
  transition: opacity .3s var(--ease);
}
.site-header.is-scrolled::before {
  background: linear-gradient(to bottom, rgba(14,18,14,.62), rgba(14,18,14,0));
  backdrop-filter: blur(13px); -webkit-backdrop-filter: blur(13px);
}
/* subtle separation of the bar from the page (no hard border) */
.site-header.is-scrolled { box-shadow: 0 10px 30px -16px rgba(0,0,0,.7); }
/* logo on the inline-start edge (right in RTL); list pushed to the far inline-end (left) */
.site-header .wrap { display: flex; align-items: center; justify-content: flex-start; gap: 24px; }

.nav { display: flex; align-items: center; gap: clamp(30px, 3.6vw, 60px); margin-inline-start: auto; }
.nav a, .nav .lang__btn {
  font-size: 1.22rem; font-weight: 500; color: var(--text-soft); white-space: nowrap;
  position: relative; padding: 8px 2px; transition: color .2s var(--ease);
  background: none; border: none; line-height: 1;
}
html[lang="en"] .nav a, html[lang="en"] .nav .lang__btn { font-size: 1.1rem; }
.nav a:hover, .nav .lang__btn:hover { color: var(--accent-bright); }
.nav a.is-current { color: var(--text); }
/* thin underline drawn on hover (and for current page) */
.nav a::after, .nav .lang__btn::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1.5px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: right; transition: transform .32s var(--ease);
}
html[dir="ltr"] .nav a::after, html[dir="ltr"] .nav .lang__btn::after { transform-origin: left; }
.nav a:hover::after, .nav .lang__btn:hover::after { transform: scaleX(1); }
.nav a.is-current::after { transform: scaleX(1); background: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 14px; margin-inline-start: auto; }

/* language switcher */
.lang {
  position: relative;
}
.lang__btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-size: .85rem; font-weight: 600; color: var(--text-soft);
  transition: all .2s var(--ease);
}
.lang__btn:hover { color: var(--text); border-color: var(--border-strong); }
.lang__btn svg { width: 17px; height: 17px; opacity: .85; }
.lang__menu {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0;
  min-width: 150px; padding: 6px;
  background: rgba(20,26,20,.96); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  z-index: 10;
}
.lang.open .lang__menu { opacity: 1; visibility: visible; transform: none; }
.lang__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; font-size: .92rem; color: var(--text-soft);
  transition: background .15s, color .15s; text-align: start;
}
.lang__opt:hover { background: var(--surface-2); color: var(--text); }
.lang__opt.is-active { color: var(--accent); }
.lang__opt .tick { opacity: 0; }
.lang__opt.is-active .tick { opacity: 1; }

/* burger */
.burger { display: none; width: 42px; height: 42px; border-radius: 12px; margin-inline-start: auto;
  border: 1px solid var(--border); background: var(--surface); place-items: center; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.burger span::before { top: -6px; } .burger span::after { top: 6px; }

/* ---------- Logo (triangle mark, recolored via mask) ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; position: relative; }
.logo__mark {
  width: 60px; height: 54px; flex: none;
  background: var(--text);
  transition: background .25s var(--ease), transform .25s var(--ease);
  -webkit-mask: var(--logo-mark) center/contain no-repeat;
          mask: var(--logo-mark) center/contain no-repeat;
}
.logo:hover .logo__mark { background: var(--accent-bright); }
.site-header .logo__mark { width: 56px; height: 50px; }
/* Wordmark logo (recolored via mask so hover turns it green, no underline) */
.logo__wordmark {
  display: block; height: 34px; aspect-ratio: 135 / 70; flex: none;
  background: var(--text);
  transition: background .25s var(--ease);
  -webkit-mask: url("../img/amedia-wordmark.png") center/contain no-repeat;
          mask: url("../img/amedia-wordmark.png") center/contain no-repeat;
}
.logo:hover .logo__wordmark { background: var(--accent-bright); }
.footer-brand .logo__wordmark { height: 46px; }
.logo__img { height: 46px; width: auto; flex: none; display: block; }
.logo__text { display: flex; flex-direction: column; line-height: 1; align-items: flex-start; }
.logo__name { font-weight: 900; font-size: 1.32rem; letter-spacing: .01em; line-height: 1; }
.logo__tag { font-size: .62rem; color: var(--text-muted); letter-spacing: .08em; margin-top: 6px; font-weight: 500; }
html[lang="en"] .logo__name { letter-spacing: .04em; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--footer-bg); padding-block: clamp(48px, 6vw, 72px) 28px;
  border-start-start-radius: var(--r-xl); border-start-end-radius: var(--r-xl); /* rounded top edge, like the CTA card */
  position: relative; z-index: 2;
  margin-top: calc(-1 * var(--r-xl)); /* tucks over the school image so it shows behind the rounded corners */
}
.footer-grid {
  display: grid; gap: 40px;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  align-items: start;
}
.footer-brand .logo__name { font-size: 1.5rem; }
.footer-brand p { color: var(--text-muted); font-size: .9rem; margin-top: 16px; max-width: 34ch; }
.footer-col h4 { font-size: .8rem; color: var(--text-faint); font-weight: 600; letter-spacing: .08em; margin-bottom: 16px; }
.footer-col a { display: block; width: fit-content; position: relative; color: var(--text-soft); font-size: .95rem; padding: 6px 0; transition: color .2s; }
.footer-col a:hover { color: var(--accent-bright); }
/* same hover underline as the header nav */
.footer-col a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 2px; height: 1.5px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: right; transition: transform .32s var(--ease);
}
html[dir="ltr"] .footer-col a::after { transform-origin: left; }
.footer-col a:hover::after { transform: scaleX(1); }
/* social icons keep their own hover — no underline bar */
.footer-col .socials a::after { display: none; }
.footer-contact .mail { color: var(--text); font-size: 1.02rem; font-weight: 600; margin: 4px 0 18px; direction: ltr; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-soft); transition: all .2s var(--ease);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
/* custom socials (admin: name + uploaded logo + url) */
.socials .social-logo { width: 20px; height: 20px; background-size: contain; background-repeat: no-repeat; background-position: center; }
.socials .social-logo:not(.has-media) { display: none; }
.socials .social-logo.has-media + .social-fallback { display: none; }
.socials .social-fallback { font-weight: 800; font-size: .95rem; line-height: 1; }
.footer-bottom {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--text-faint); font-size: .82rem;
}

/* ============================================================
   MOBILE NAV DRAWER
   ============================================================ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; backdrop-filter: blur(4px);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 14px; bottom: auto; right: 14px; left: auto; width: min(80vw, 330px); z-index: 201;
  height: auto; max-height: calc(100% - 28px); overflow-y: auto;
  /* same frosted-glass recipe as the site cards */
  background:
    linear-gradient(135deg, rgba(108,124,104,.34) 0%, rgba(46,56,46,.30) 46%, rgba(20,26,20,.40) 100%);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-lg, 22px);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.12),
    inset -1.5px -1.5px 0 rgba(0,0,0,.30),
    0 30px 60px -28px rgba(0,0,0,.75);
  transform: translateX(calc(100% + 18px)); transition: transform .4s var(--ease-out);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 6px;
}
/* subtle top-left light glint, like the cards */
.drawer::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 0% 0%,
    rgba(255,255,255,.14) 0%, rgba(255,255,255,.04) 28%, transparent 56%);
}
.drawer > * { position: relative; z-index: 1; }
.drawer.open { transform: translateX(0); }
.drawer a { font-size: 1.15rem; font-weight: 600; padding: 14px 0; color: var(--text-soft); border-bottom: 1px solid rgba(255,255,255,.12); }
.drawer a:hover { color: var(--accent); }
.drawer a:last-of-type { border-bottom: none; }
.drawer__close { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .nav, .header-tools .lang { display: none; }
  .burger { display: grid; }
  /* slightly more compact header on phones/tablets (not too much) */
  :root { --header-h: 68px; }
  .site-header .logo__mark { width: 46px; height: 41px; }
  .burger { width: 38px; height: 38px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  /* footer — compact & smaller on phones */
  .site-footer { padding-block: 34px 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { font-size: .8rem; margin-top: 10px; max-width: 40ch; }
  .footer-brand .logo__mark { transform: scale(.85); transform-origin: right center; }
  .footer-col h4 { font-size: .72rem; margin-bottom: 9px; }
  .footer-col a { font-size: .86rem; padding: 3px 0; }
  .footer-contact .mail { font-size: .9rem; margin: 2px 0 12px; }
  .socials a { width: 32px; height: 32px; }
  .socials svg { width: 15px; height: 15px; }
  .footer-bottom { margin-top: 26px; padding-top: 14px; font-size: .76rem; gap: 6px;
    flex-direction: column; align-items: flex-start; }
}
