/* ═══════════════════════════════════════════════════
   IAML WEBSITE — DESIGN SYSTEM v2
   Mongolian Flag: Blue #003F87, Red #BC2026, Gold #D4A843
   Sky: #2E7ABF → #5BA3D9
   ═══════════════════════════════════════════════════ */

:root {
  --blue: #003F87;
  --sky: #2E7ABF;
  --sky-l: #5BA3D9;
  --sky-ll: #D6EAFA;
  --red: #BC2026;
  --red-soft: #E8434B;
  --gold: #D4A843;
  --gold-l: #E8D5A0;
  --ink: #0F172A;
  --ink-l: #1E293B;

  --bg: #FFFFFF;
  --bg-alt: #F6F9FC;
  --card-bg: #FFFFFF;
  --text: #0A1628;
  --text2: #4A5F7A;
  --border: #E2E8F0;
  --nav-bg: rgba(255,255,255,.92);
  --shadow-sm: 0 1px 8px rgba(0,63,135,.06);
  --shadow: 0 4px 20px rgba(0,63,135,.08);
  --shadow-lg: 0 12px 40px rgba(0,63,135,.12);
  --r: 12px;
  --max: 1120px;
}

[data-theme="dark"] {
  --bg: #0F172A;
  --bg-alt: #0C1628;
  --card-bg: #0F1D33;
  --text: #E0E8F0;
  --text2: #7A8FA8;
  --border: #1A2D48;
  --nav-bg: rgba(15,23,42,.92);
  --shadow-sm: 0 1px 8px rgba(0,0,0,.15);
  --shadow: 0 4px 20px rgba(0,0,0,.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.3);
}

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s, color .5s;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-weight: 600;
  line-height: 1.12;
}
h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -1px; }
h2 { font-size: clamp(30px, 4.5vw, 48px); letter-spacing: -.5px; }
h3 { font-size: clamp(20px, 2.5vw, 28px); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.section { padding: 120px 0; }
.section--alt { background: var(--bg-alt); }

.slabel {
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.slabel::before {
  content: ''; width: 32px; height: 2px;
  background: var(--gold); display: block;
}

/* ── ANIMATIONS ── */
@keyframes skyFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger children */
.reveal-stagger .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger .reveal:nth-child(2) { transition-delay: .1s; }
.reveal-stagger .reveal:nth-child(3) { transition-delay: .2s; }
.reveal-stagger .reveal:nth-child(4) { transition-delay: .3s; }

/* ── LOGO MARK ── */
.lm-letter--b { color: var(--blue); }
.lm-letter--w { color: #FFFFFF; }
[data-theme="dark"] .lm-letter--b { color: var(--sky-l); }

.lc--light { background: #fff; }
.lc--light::before {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 300%; height: 100%;
  background:
    radial-gradient(ellipse 400px 150px at 30% 50%, rgba(91,163,217,.1), transparent),
    radial-gradient(ellipse 350px 130px at 70% 40%, rgba(46,122,191,.06), transparent);
  animation: waveMove 12s linear infinite; pointer-events: none;
}
.lc--light::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--blue); opacity: .1; pointer-events: none;
}
.lc--dark {
  background: linear-gradient(135deg, #003F87, #2E7ABF, #5BA3D9, #2E7ABF, #003F87);
  background-size: 300% 300%;
  animation: skyFlow 8s ease-in-out infinite;
}
.lc--dark::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--gold); opacity: .2; pointer-events: none;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 8px;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: .3px; border: none; cursor: pointer;
  transition: all .3s cubic-bezier(.22,1,.36,1);
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,.1), transparent);
  transform: translateX(-100%); transition: transform .5s;
}
.btn:hover::after { transform: translateX(100%); }
.btn:hover { transform: translateY(-2px); }

.btn--w {
  background: #fff; color: var(--blue);
  box-shadow: 0 4px 16px rgba(255,255,255,.2);
}
.btn--w:hover { box-shadow: 0 8px 28px rgba(255,255,255,.3); }

.btn--go {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn--go:hover { background: rgba(212,168,67,.1); border-color: #fff; color: #fff; }

.btn--p { background: var(--blue); color: #fff; }
[data-theme="dark"] .btn--p { background: var(--sky); }
.btn--p:hover { box-shadow: 0 6px 20px rgba(0,63,135,.3); }

.btn--o {
  background: transparent; color: var(--blue);
  border: 1.5px solid var(--blue);
}
[data-theme="dark"] .btn--o { color: var(--sky-l); border-color: var(--sky-l); }

.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { box-shadow: 0 6px 20px rgba(188,32,38,.3); }

.btn--gold { background: var(--gold); color: #0F172A; }
.btn--gold:hover { background: #c69434; box-shadow: 0 6px 20px rgba(212,168,67,.35); }

/* ── PERIODIC SHINE SWEEP — runs across the header bar and the gold CTA every 10s ── */
@keyframes shineSweep {
  0%   { transform: translateX(-120%); }
  14%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}
.nav::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 42%, rgba(212,168,67,.16) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: shineSweep 10s ease-in-out 1.2s infinite;
  pointer-events: none; z-index: 1;
}
@keyframes shineSweepBtn {
  0%   { transform: translateX(-120%); }
  22%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}
.btn--gold::after {
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.5) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: shineSweepBtn 5s ease-in-out 1.2s infinite;
}

.btn--sm { padding: 10px 22px; font-size: 13px; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background .5s, border .5s;
}
.nav__in {
  max-width: none; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 1.6vw, 80px); height: 108px;
}
.nav__brand, .nav__ctrls { flex-shrink: 0; }
.nav__links { display: flex; gap: clamp(14px, 1.6vw, 44px); }
@media (min-width: 1600px) { .nav__in { padding: 0 48px; } .nav__links { gap: 36px; } }
.nav__link {
  font-size: clamp(14px, 1.05vw, 16px); color: var(--text2); font-weight: 500;
  white-space: nowrap;
  transition: color .2s; position: relative;
}
.nav__link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--red);
  transition: width .3s cubic-bezier(.22,1,.36,1);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after { width: 100%; }
.nav__link--cta {
  background: var(--gold); color: #0F172A;
  padding: 7px 14px; border-radius: 999px;
  letter-spacing: .6px;
  transition: background .15s, color .15s, transform .12s;
}
.nav__link--cta:hover { background: #c69434; color: #0F172A; transform: translateY(-1px); }
.nav__link--cta::after { display: none; }

.nav__ctrls { display: flex; gap: 6px; align-items: center; }
.nav__btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 12px; font-size: 11px; font-weight: 600;
  color: var(--text2); cursor: pointer; transition: all .2s;
  font-family: 'DM Sans', 'Inter', sans-serif;
}
.nav__btn:hover { border-color: var(--blue); color: var(--text); }

.burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.burger span { display: block; width: 18px; height: 1.5px; background: var(--text); margin: 4px 0; }

@media (max-width: 1000px) {
  .nav__links { display: none; }
  .burger { display: block; }
  .nav__links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 108px; left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(20px);
    padding: 20px 32px; gap: 16px;
    border-bottom: 1px solid var(--border);
  }
}

/* ── INTRO ── */
.intro {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; background: #000;
  transition: opacity 1.2s cubic-bezier(.22,1,.36,1);
}
.intro.done { opacity: 0; pointer-events: none; }
.intro video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

/* ── HERO ── */
.hero {
  min-height: 82vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg,
    var(--red) 0%, var(--red) 8%,
    var(--blue) 8%, var(--blue) 60%,
    var(--sky) 60%, var(--sky-l) 100%
  );
}

/* Subtle animated overlay */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, transparent 40%, rgba(255,255,255,.05) 50%, transparent 60%);
  background-size: 300% 300%;
  animation: skyFlow 8s ease-in-out infinite;
}

/* Bottom fade to page background */
.hero .hero__fade {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 2;
}
[data-theme="dark"] .hero .hero__fade {
  background: linear-gradient(to top, var(--ink), transparent);
}

/* Decorative gold line on left */
.hero .hero__gold-accent {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--gold); z-index: 3; opacity: .6;
}

.hero__in {
  max-width: 1700px; margin: 0 auto;
  padding: 180px 64px 140px;
  position: relative; z-index: 3;
  width: 100%;
}
.hero__label {
  font-size: 12px; font-weight: 700;
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.hero__label::before {
  content: ''; width: 40px; height: 2px;
  background: var(--gold); display: block;
}
.hero h1 {
  color: #fff; margin-bottom: 16px;
  max-width: 1300px; text-wrap: balance;
  font-size: clamp(34px, 5vw, 60px);
}
.hero__sub {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-weight: 500;
  font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; letter-spacing: .2px;
  color: var(--gold-l); max-width: 900px; margin-bottom: 40px;
}
.hero__btns { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero__in { padding: 140px 32px 100px; text-align: center; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__btns { justify-content: center; }
  .hero__label { justify-content: center; }
}

/* ── ABOUT ── */
.about__grid {
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: 60px; margin-top: 40px;
}
.about__text p {
  font-size: 16px; color: var(--text2);
  line-height: 1.85; margin-bottom: 16px;
}
.about__stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--r);
  padding: 28px 20px; text-align: center;
  transition: transform .3s, box-shadow .3s;
}
.stat:nth-child(2) { border-left-color: var(--sky-l); }
.stat:nth-child(3) { border-left-color: var(--gold); }
.stat:nth-child(4) { border-left-color: var(--red); }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat__n {
  display: block; font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-size: 44px; font-weight: 700;
  color: var(--blue); margin-bottom: 4px;
}
[data-theme="dark"] .stat__n { color: var(--sky-l); }
.stat__l { font-size: 12px; color: var(--text2); letter-spacing: .5px; }

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
}

/* ── OBJECTIVE TILES ── */
.obj-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.otile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  transition: transform .4s cubic-bezier(.22,1,.36,1), box-shadow .4s;
  position: relative; overflow: hidden;
}
.otile::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--blue), var(--sky-l));
  transform: scaleX(0); transition: transform .4s cubic-bezier(.22,1,.36,1);
  transform-origin: left;
}
.otile:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.otile:hover::before { transform: scaleX(1); }
.otile__icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-alt); display: flex;
  align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.otile p {
  font-size: 14px; color: var(--text2); line-height: 1.7;
}

/* Staggered reveal for tiles */
.obj-tiles .otile { opacity: 0; transform: translateY(24px); }
.obj-tiles.visible .otile {
  animation: tileIn .6s cubic-bezier(.22,1,.36,1) forwards;
}
.obj-tiles.visible .otile:nth-child(1) { animation-delay: 0s; }
.obj-tiles.visible .otile:nth-child(2) { animation-delay: .08s; }
.obj-tiles.visible .otile:nth-child(3) { animation-delay: .16s; }
.obj-tiles.visible .otile:nth-child(4) { animation-delay: .24s; }
.obj-tiles.visible .otile:nth-child(5) { animation-delay: .32s; }

@keyframes tileIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── ACTIVITY TILES ── */
.act-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.atile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  transition: transform .4s cubic-bezier(.22,1,.36,1), box-shadow .4s;
  position: relative; overflow: hidden;
  display: flex; gap: 16px; align-items: flex-start;
}
.atile::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 0; background: var(--gold);
  transition: height .5s cubic-bezier(.22,1,.36,1);
}
.atile:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.atile:hover::before { height: 100%; }
.atile--wide { grid-column: span 2; }
.atile__num {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-size: 32px; font-weight: 700;
  color: var(--blue); opacity: .15;
  line-height: 1; flex-shrink: 0;
  min-width: 36px;
}
[data-theme="dark"] .atile__num { color: var(--sky-l); }
.atile__content h4 {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.atile__content p {
  font-size: 13px; color: var(--text2); line-height: 1.7;
}

/* Staggered reveal for activity tiles */
.act-tiles .atile { opacity: 0; transform: translateY(24px); }
.act-tiles.visible .atile {
  animation: tileIn .6s cubic-bezier(.22,1,.36,1) forwards;
}
.act-tiles.visible .atile:nth-child(1) { animation-delay: 0s; }
.act-tiles.visible .atile:nth-child(2) { animation-delay: .07s; }
.act-tiles.visible .atile:nth-child(3) { animation-delay: .14s; }
.act-tiles.visible .atile:nth-child(4) { animation-delay: .21s; }
.act-tiles.visible .atile:nth-child(5) { animation-delay: .28s; }
.act-tiles.visible .atile:nth-child(6) { animation-delay: .35s; }
.act-tiles.visible .atile:nth-child(7) { animation-delay: .42s; }

@media (max-width: 860px) {
  .obj-tiles { grid-template-columns: repeat(2, 1fr); }
  .act-tiles { grid-template-columns: 1fr; }
  .atile--wide { grid-column: span 1; }
}
@media (max-width: 520px) {
  .obj-tiles { grid-template-columns: 1fr; }
}

/* ── EVENTS ── */
.ev {
  display: flex; background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  transition: transform .3s, box-shadow .3s;
  margin-bottom: 16px;
}
.ev:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ev__accent {
  width: 5px; flex-shrink: 0;
  background: linear-gradient(to bottom, var(--red), var(--gold));
}
.ev__date {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px 32px; gap: 2px;
  border-right: 1px solid var(--border);
  min-width: 96px;
  background: var(--bg-alt);
}
.ev__month {
  font-size: 11px; font-weight: 700;
  color: var(--red); letter-spacing: 2px;
}
.ev__day {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-size: 42px; font-weight: 700; line-height: 1;
  color: var(--blue);
}
[data-theme="dark"] .ev__day { color: var(--sky-l); }
.ev__year { font-size: 11px; color: var(--text2); }
.ev__body { padding: 28px 32px; flex: 1; }
.ev__body h3 { margin-bottom: 8px; }
.ev__loc { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.ev__desc {
  font-size: 14px; color: var(--text2);
  line-height: 1.7; margin-bottom: 20px;
}

@media (max-width: 600px) {
  .ev { flex-direction: column; }
  .ev__date {
    flex-direction: row; gap: 8px;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 16px 20px;
  }
}

/* ── PUBLICATIONS ── */
.pubs__grid {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 48px; margin-top: 40px;
}
.pub-cover {
  width: 260px; height: 380px; border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; position: relative;
  background: linear-gradient(135deg, var(--ink-l), var(--blue), var(--sky));
  background-size: 300% 300%;
  animation: skyFlow 8s ease-in-out infinite;
  box-shadow: 0 12px 40px rgba(0,63,135,.3);
}
.pub-cover__border {
  position: absolute; inset: 8px;
  border: 1px solid rgba(212,168,67,.2);
  pointer-events: none; border-radius: 4px;
}
.pub-cover__sep {
  width: 40px; height: 1px;
  background: var(--gold); opacity: .4; margin: 14px 0;
}
.pub-cover__title {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-size: 20px; color: #fff;
  text-align: center; line-height: 1.3;
}
.pub-cover__vol {
  font-size: 8px; color: var(--gold);
  letter-spacing: 3px; margin-top: 12px;
}
.pub-info h3 { margin-bottom: 12px; }
.pub-info > p {
  font-size: 15px; color: var(--text2);
  line-height: 1.75; margin-bottom: 24px;
}
.pub-articles h4 {
  font-size: 12px; color: var(--red);
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 16px; font-family: 'DM Sans', 'Inter', sans-serif;
  font-weight: 700;
}
.pa {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.pa:last-child { border-bottom: none; }
.pa__tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--blue); background: var(--sky-ll);
  padding: 3px 10px; border-radius: 4px; margin-bottom: 6px;
}
[data-theme="dark"] .pa__tag { background: rgba(46,122,191,.15); color: var(--sky-l); }
.pa h5 {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-size: 17px; margin-bottom: 4px;
}
.pa p { font-size: 12px; color: var(--text2); }

@media (max-width: 860px) {
  .pubs__grid { grid-template-columns: 1fr; }
  .pub-cover { width: 100%; max-width: 260px; margin: 0 auto; }
}

/* ── PARTNERS ── */
.partners { text-align: center; }
.partners__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-top: 40px;
}
.ptr {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 16px;
  font-size: 14px; font-weight: 500; color: var(--text2);
  transition: all .3s;
  position: relative; overflow: hidden;
}
.ptr::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--blue), var(--sky-l));
  transform: scaleX(0); transition: transform .3s;
  transform-origin: left;
}
.ptr:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--sky-l);
}
.ptr:hover::before { transform: scaleX(1); }

@media (max-width: 860px) {
  .partners__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── MEMBERSHIP ── */
.mem__head {
  text-align: center; max-width: 580px; margin: 0 auto 56px;
}
.mem__head .slabel { justify-content: center; }
.mem__head p {
  font-size: 16px; color: var(--text2);
  line-height: 1.75; margin-top: 20px;
}
.mem__cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.tier {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 36px 28px;
  display: flex; flex-direction: column;
  transition: transform .3s, box-shadow .3s;
  position: relative;
}
.tier:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.tier--f {
  border-color: var(--gold);
  box-shadow: 0 4px 24px rgba(212,168,67,.1);
  background: linear-gradient(to bottom, rgba(212,168,67,.03), var(--card-bg));
}
.tier__badge {
  position: absolute; top: -11px; left: 50%;
  transform: translateX(-50%);
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; padding: 4px 16px;
  border-radius: 12px; white-space: nowrap;
  text-transform: uppercase;
}
.tier h4 { margin-bottom: 8px; padding-top: 10px; }
.tier__price {
  font-family: 'Cormorant Garamond', 'Noto Serif', serif;
  font-size: 44px; font-weight: 700;
  color: var(--blue); margin-bottom: 24px;
}
[data-theme="dark"] .tier__price { color: var(--sky-l); }
.tier__price span {
  font-size: 15px; font-family: 'DM Sans', 'Inter', sans-serif;
  color: var(--text2);
}
.tier li {
  font-size: 14px; color: var(--text2);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.tier li:last-child { border-bottom: none; }
.tier .btn { width: 100%; justify-content: center; margin-top: 28px; }

@media (max-width: 860px) {
  .mem__cards {
    grid-template-columns: 1fr;
    max-width: 400px; margin: 0 auto;
  }
}

/* ── FOOTER ── */
.footer {
  background: var(--ink); color: #6A7E96;
  padding: 72px 32px 28px;
  position: relative;
}
.footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--blue), var(--gold));
}
.footer a { color: #6A7E96; transition: color .2s; }
.footer a:hover { color: var(--sky-l); }
.footer__in {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer__brand p {
  font-size: 13px; line-height: 1.7; max-width: 240px; margin-top: 14px;
}
.footer__col h4 {
  color: #B0BEC8; font-size: 11px; margin-bottom: 16px;
  letter-spacing: 2px; text-transform: uppercase;
  font-family: 'DM Sans', 'Inter', sans-serif; font-weight: 700;
}
.footer__col li { margin-bottom: 10px; font-size: 13px; }
.footer__bot {
  max-width: var(--max); margin: 48px auto 0;
  padding-top: 20px;
  border-top: 1px solid #152035;
  display: flex; justify-content: space-between;
  font-size: 11px; color: #3D4F66;
}

@media (max-width: 860px) {
  .footer__in { grid-template-columns: 1fr 1fr; }
  .footer__bot { flex-direction: column; gap: 8px; }
}

/* ═══════════════════════════════════════════════════
   PHASE 0/1 ADDITIONS — consolidated English-only site
   (logo lockups, section helpers, participants, news,
   join card, journal cover, auth modal)
   ═══════════════════════════════════════════════════ */

/* ── SECTION HELPERS ── */
.section__lead {
  font-size: 16px; color: var(--text2); line-height: 1.8;
  margin-top: 24px; margin-bottom: 48px; max-width: 720px;
}
.eyebrow {
  font-size: 14px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; font-family: 'DM Sans', 'Inter', sans-serif;
}
.eyebrow--blue { color: var(--blue); }
.eyebrow--gold { color: var(--gold); }
.otile__h { font-family: 'DM Sans', 'Inter', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 8px; }

/* ── NAV BRAND (Academic Seal — IAML Brand Guidelines v1) ── */
.nav__brand { display: flex; align-items: center; gap: 14px; }
.brand-seal { display: block; flex-shrink: 0; }
.brand-seal svg { display: block; width: 64px; height: 64px; }
.nav__brand-sep { width: 1px; height: 30px; background: var(--gold); opacity: .3; }
.nav__brand-text { display: flex; flex-direction: column; }
.nav__brand-text span { font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-size: 13px; font-weight: 600; letter-spacing: 1px; color: var(--text); line-height: 1.25; white-space: nowrap; }
/* 9 menu items: on mid-width desktops the bar keeps only the seal so nothing is pushed off-screen */
@media (min-width: 1001px) and (max-width: 1260px) { .nav__brand-text, .nav__brand-sep { display: none; } }
@media (max-width: 600px) {
  /* Compact mobile header: seal + association name stay visible */
  .nav__in { height: 80px; padding: 0 16px; }
  .nav__links.open { top: 80px; }
  .nav__brand { gap: 10px; }
  .brand-seal svg { width: 52px; height: 52px; }
  .nav__brand-sep { display: none; }
  .nav__brand-text span { font-size: 10px; letter-spacing: .4px; }
  .nav__ctrls { gap: 4px; }
  .nav__btn { padding: 4px 9px; }
  .nav__link--cta { padding: 6px 11px; font-size: 14px; }
}
@media (max-width: 400px) {
  /* Smallest phones: "Log in" lives inside the Sign up modal (tab) */
  .nav__btn { display: none; }
}
@media (max-width: 340px) {
  .nav__brand-text { display: none; }
}

/* ── PARTICIPANTS DIRECTORY ── */
.pgroup { margin-top: 40px; }
.pgroup__title {
  font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--blue); font-family: 'DM Sans', 'Inter', sans-serif;
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pcard {
  display: flex; gap: 14px; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px;
  transition: transform .3s, box-shadow .3s;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pcard__avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); color: var(--blue);
  font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-weight: 700; font-size: 18px; overflow: hidden;
}
.pcard__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pcard__body h4 { font-family: 'DM Sans', 'Inter', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.pcard__role { font-size: 13px; color: var(--blue); font-weight: 500; margin: 0 0 2px; }
.pcard__org { font-size: 12px; color: var(--text2); margin: 0; }
@media (max-width: 860px) { .pgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .pgrid { grid-template-columns: 1fr; } }

/* ── JOIN / FREE MEMBERSHIP CARD ── */
.join-card {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r);
  padding: 40px; box-shadow: var(--shadow); max-width: 880px; margin: 0 auto;
}
.join-card__perks { display: flex; flex-direction: column; gap: 14px; }
.join-card__perks li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text); }
.join-card__perks svg { flex-shrink: 0; }
.join-card__cta { text-align: center; }
.join-card__cta .btn { width: 100%; justify-content: center; }
.join-card__note { margin-top: 14px; font-size: 13px; color: var(--text2); }
.join-card__note a { color: var(--blue); font-weight: 600; }
@media (max-width: 700px) { .join-card { grid-template-columns: 1fr; gap: 28px; padding: 28px; } }

/* ── NEWS ── */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.ncard {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r);
  padding: 28px; transition: transform .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.ncard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.ncard__date { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--red); margin-bottom: 10px; }
.ncard__title { font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-size: 20px; margin-bottom: 10px; line-height: 1.25; }
.ncard__excerpt { font-size: 14px; color: var(--text2); line-height: 1.7; flex: 1; }
.ncard__more { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--blue); }
@media (max-width: 860px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .news-grid { grid-template-columns: 1fr; } }

/* ── JOURNAL COVER LETTERS ── */
.pub-cover__m { height: 60px; width: auto; fill: #fff; opacity: .6; display: block; }
.pub-cover__rule { width: 1.5px; height: 60px; background: var(--gold); opacity: .5; border-radius: 1px; margin: 0 2px; }
.pub-cover__letters { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 60px; }
.pub-cover__letters span { font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-weight: 700; font-size: 13px; line-height: 1.06; color: rgba(255,255,255,.8); }
.pub-cover__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--red); margin-bottom: 2px; display: block; }
.pa__note { font-size: 11px; color: var(--text2); font-style: italic; margin-top: 4px; opacity: .85; }
.ptr--link { cursor: pointer; }
a.ptr { color: var(--text2); }

/* ── FOOTER BRAND (white seal on dark) ── */
.footer__brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.footer__seal { display: block; flex-shrink: 0; opacity: .85; }
.footer__seal svg { display: block; width: 56px; height: 56px; }
.footer__brand-text span { display: block; font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-size: 12px; font-weight: 600; letter-spacing: 1px; color: rgba(255,255,255,.45); }

/* ── HERO SEAL: white seal on blue, spinning like a coin on its edge ── */
.hero__seal { position: absolute; right: 64px; top: 50%; transform: translateY(-50%); z-index: 2; pointer-events: none; }
.coin { --size: min(320px, 24vw); --thick: 12px; perspective: 1300px; }
.coin__body {
  position: relative; width: var(--size); height: var(--size);
  transform-style: preserve-3d;
  animation: coinSpin 7s linear infinite;
}
.coin__face { position: absolute; inset: 0; display: block; width: 100%; height: 100%; backface-visibility: hidden; }
.coin__face--front { transform: translateZ(calc(var(--thick) / 2)); }
.coin__face--back { transform: rotateY(180deg) translateZ(calc(var(--thick) / 2)); }
.coin__wall { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.coin__seg {
  --R: calc(var(--size) * .45);            /* radius of the seal ring */
  position: absolute; left: 0; top: 0;
  width: calc(var(--R) * .0982 + 1px);      /* 2π/64 of the circumference (+1px overlap) */
  height: var(--thick);
  margin: calc(var(--thick) / -2) 0 0 calc(var(--R) * -.0491 - .5px);
  background: linear-gradient(180deg, #A98428, #F1DC96 50%, #A98428);
  backface-visibility: hidden;
  transform: rotateZ(calc(var(--k) * 5.625deg)) translateY(calc(var(--R) * -1)) rotateX(90deg);
}
.coin__seg:nth-child(even) { background: linear-gradient(180deg, #8F6D1E, #D4A843 50%, #8F6D1E); }
/* Ground shadow: an ellipse under the coin that narrows and widens with the spin (|cos| of the angle) */
.coin__shadow {
  position: absolute; left: 50%; top: calc(var(--size) + 30px);
  width: calc(var(--size) * .82); height: calc(var(--size) * .11);
  margin-left: calc(var(--size) * -.41);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(2,12,40,.6), rgba(2,12,40,.3) 55%, rgba(2,12,40,0));
  filter: blur(3px);
  animation: coinShadow 7s linear infinite;
}
@keyframes coinShadow {
  0%, 100% { transform: scaleX(1); }
  10% { transform: scaleX(.81); }  20% { transform: scaleX(.31); }  25% { transform: scaleX(.07); }
  30% { transform: scaleX(.31); }  40% { transform: scaleX(.81); }  50% { transform: scaleX(1); }
  60% { transform: scaleX(.81); }  70% { transform: scaleX(.31); }  75% { transform: scaleX(.07); }
  80% { transform: scaleX(.31); }  90% { transform: scaleX(.81); }
}
@keyframes coinSpin {
  from { transform: rotateX(-9deg) rotateY(0deg); }
  to   { transform: rotateX(-9deg) rotateY(360deg); }
}
@media (min-width: 1001px) { .hero__copy { max-width: calc(100% - min(320px, 24vw) - 56px); } }
@media (max-width: 1000px) {
  /* Small screens: the coin flows above the heading and fills the blue space */
  .hero__seal { position: relative; transform: none; margin-bottom: 68px; }
  .coin { --size: clamp(150px, 36vw, 230px); --thick: 8px; }
}
@media (max-width: 860px) {
  .hero__seal .coin__body { margin: 0 auto; }
}

/* ── AUTH MODAL ── */
body.auth-open { overflow: hidden; }
.auth { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth[hidden] { display: none; }
.auth__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); }
.auth__dialog {
  position: relative; z-index: 1; width: 100%; max-width: 460px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 32px; max-height: 90vh; overflow-y: auto;
}
.auth__close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 26px; line-height: 1; color: var(--text2); cursor: pointer; }
.auth__tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth__tab {
  background: none; border: none; padding: 10px 4px; margin-right: 22px;
  font-family: 'DM Sans', 'Inter', sans-serif; font-size: 15px; font-weight: 600;
  color: var(--text2); cursor: pointer; position: relative;
}
.auth__tab.is-active { color: var(--blue); }
.auth__tab.is-active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--blue); }
.auth__form { display: none; flex-direction: column; gap: 14px; }
.auth__form.is-active { display: flex; }
.auth__form h3 { font-family: 'Cormorant Garamond', 'Noto Serif', serif; margin-bottom: 2px; }
.auth__form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.auth__form input, .auth__form select {
  font-family: 'DM Sans', 'Inter', sans-serif; font-size: 14px; font-weight: 400;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.auth__form input:focus, .auth__form select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,63,135,.12); }
.auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth__check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 500; }
.auth__check input { width: auto; }
.auth__fineprint { font-size: 12px; color: var(--text2); font-weight: 400; line-height: 1.5; }
.auth__fineprint a, .auth__form a { color: var(--blue); }
.auth__form .btn { margin-top: 6px; justify-content: center; }
.auth__msg { font-size: 13px; min-height: 18px; margin: 0; }
.auth__msg.is-error { color: var(--red); }
.auth__msg.is-ok { color: #1a7f4b; }
@media (max-width: 520px) { .auth__row { grid-template-columns: 1fr; } .auth__dialog { padding: 24px 20px; } }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ═══════════════════════════════════════════════════
   PHASE A — multi-page components
   ═══════════════════════════════════════════════════ */
@media (max-width: 860px) { .nav__in { padding: 0 20px; } }

.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after { width: 100%; }
.nav__link--cta.is-active::after { display: none; }

.footer__linkbtn { background: none; border: none; padding: 0; font: inherit; color: #6A7E96; cursor: pointer; }
.footer__linkbtn:hover { color: var(--sky-l); }

body.modal-open { overflow: hidden; }

/* Page header band */
.page-head { padding: 140px 0 44px; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(34px, 5vw, 60px); margin: 6px 0 10px; }
.page-head p { color: var(--text2); max-width: 640px; font-size: 16px; line-height: 1.7; }

/* Carousel */
.carousel { position: relative; display: flex; align-items: stretch; gap: 8px; }
.carousel__track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 16px; flex: 1; scrollbar-width: thin; }
.carousel__track > .card { scroll-snap-align: start; flex: 0 0 320px; max-width: 320px; }
.carousel__btn { flex: 0 0 auto; align-self: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--card-bg); color: var(--blue); font-size: 22px; line-height: 1; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-sm); }
.carousel__btn:hover:not(:disabled) { background: var(--blue); color: #fff; border-color: var(--blue); }
.carousel__btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 600px) { .carousel__track > .card { flex-basis: 82%; max-width: 82%; } .carousel__btn { display: none; } }

/* Content card */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; cursor: pointer; transition: transform .3s, box-shadow .3s; text-align: left; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.card__date { font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--red); margin-bottom: 10px; }
.card__title { font-size: 21px; line-height: 1.25; margin-bottom: 10px; }
.card__authors { font-size: 13px; color: var(--blue); font-weight: 500; margin-bottom: 8px; }
.card__preview { font-size: 14px; color: var(--text2); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.card__more { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--blue); }
.pub-card .pa__tag { align-self: flex-start; margin-bottom: 10px; }

/* Content modal */
.cmodal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cmodal[hidden] { display: none; }
.cmodal__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); }
.cmodal__dialog { position: relative; z-index: 1; width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 40px; }
.cmodal__close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 28px; line-height: 1; color: var(--text2); cursor: pointer; }
.cmodal__body h2 { font-size: clamp(24px,3.5vw,34px); margin: 4px 0 12px; }
.cmodal__body p { color: var(--text2); line-height: 1.85; margin-bottom: 14px; }
@media (max-width: 600px) { .cmodal__dialog { padding: 28px 20px; } }

/* Login gate */
.gate { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; margin-bottom: 28px; text-align: center; }
.gate p { color: var(--text2); margin-bottom: 16px; }
.gate__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Subscription form */
.sub-form { display: flex; flex-direction: column; gap: 14px; }
.sub-form__intro { color: var(--text2); margin-bottom: 6px; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.sub-row__topic { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.sub-form .btn { align-self: flex-start; margin-top: 6px; }

/* Forms (contact / profile / reply / subscription selects) */
.cform, .profile-form { display: flex; flex-direction: column; gap: 14px; }
.cform label, .profile-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.cform input, .cform textarea, .profile-form input, .reply-form textarea, .sub-form select, .cform select { font-family: 'DM Sans', 'Inter', sans-serif; font-size: 14px; font-weight: 400; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.cform input:focus, .cform textarea:focus, .profile-form input:focus, .reply-form textarea:focus, .sub-form select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,63,135,.12); }
.cform--card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r); padding: 32px; box-shadow: var(--shadow); }
.cform__msg { font-size: 13px; min-height: 18px; margin: 0; }
.cform__msg.is-ok { color: #1a7f4b; } .cform__msg.is-error { color: var(--red); }
.cform .btn, .profile-form .btn { align-self: flex-start; }

/* Contacts layout */
.contacts__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: stretch; }
.contacts__people { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; }
.pcontact {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  background: var(--bg-alt); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: var(--r); padding: 22px 28px; min-width: 0;
  transition: transform .3s, box-shadow .3s;
}
.pcontact:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pcontact__pos { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); }
.pcontact__name { font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-size: 26px; line-height: 1.15; color: var(--text); }
.pcontact__mail { font-size: 14px; color: var(--text2); overflow-wrap: anywhere; }
.pcontact__mail a { color: var(--blue); font-weight: 500; }
.pcontact__mail a:hover { text-decoration: underline; }
.pcontact .is-empty { color: var(--text2); opacity: .65; font-style: italic; }
.contact-admin .cform { width: 100%; }
@media (max-width: 760px) { .contacts__grid { grid-template-columns: 1fr; gap: 24px; } }

/* Avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-alt); color: var(--blue); font-family: 'Cormorant Garamond','Noto Serif',serif; font-weight: 700; overflow: hidden; background-size: cover; background-position: center; flex-shrink: 0; }
.avatar--sm { width: 34px; height: 34px; font-size: 14px; }
.avatar--lg { width: 96px; height: 96px; font-size: 34px; }
.avatar--img { color: transparent; }

/* Discuss */
.discuss__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.discuss__hint { font-size: 13px; color: var(--text2); }
.thread-list { display: flex; flex-direction: column; gap: 14px; }
.thread { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 24px; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.thread:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.thread:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.thread__author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.thread__name { font-size: 13px; font-weight: 600; color: var(--text); }
.thread__when { font-size: 12px; color: var(--text2); margin-left: auto; }
.thread__title { font-size: 20px; margin-bottom: 6px; }
.thread__snippet { font-size: 14px; color: var(--text2); line-height: 1.6; }
.thread__meta { display: flex; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--text2); }

/* Comments */
.comments { margin: 24px 0; display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--border); padding-top: 20px; }
.comment { display: flex; gap: 12px; }
.comment--nested { margin-top: 14px; padding-left: 16px; border-left: 2px solid var(--border); }
.comment__body { flex: 1; }
.comment__name { font-size: 13px; font-weight: 600; color: var(--blue); display: block; margin-bottom: 2px; }
.comment__body p { font-size: 14px; color: var(--text2); line-height: 1.6; margin: 0; }

/* Reply form */
.reply-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.reply-form__row { display: flex; align-items: center; gap: 16px; }
.linkbtn { background: none; border: none; padding: 0; font: inherit; font-size: 13px; color: var(--text2); cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--red); }

/* Profile / avatar edit */
.avatar-edit { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.profile-form__hint { font-size: 12px; color: var(--text2); margin-top: 8px; line-height: 1.5; }
.profile-form__badge { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--gold); background: rgba(212,168,67,.12); padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.account__link { margin-top: 24px; font-size: 14px; color: var(--text2); }
.account__link a { color: var(--blue); font-weight: 600; }

/* Rich text (custom page) */
.rich p { color: var(--text2); line-height: 1.85; margin-bottom: 16px; }
.rich h2 { margin: 28px 0 12px; }
.rich code { background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* Utility */
.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; }


/* ── MANIFESTO (About) ── */
.manifesto { margin-top: 32px; max-width: 780px; }
.manifesto p { font-size: 16px; color: var(--text2); line-height: 1.9; margin-bottom: 22px; }
.manifesto p.manifesto__lead { font-size: 19px; color: var(--text); line-height: 1.8; }

/* ── MONGOLIST text block ── */
.mlist { margin-bottom: 48px; }
.mlist__lead { font-size: 17px; line-height: 1.85; color: var(--text); margin-bottom: 20px; }
.mlist__conduct {
  background: var(--bg-alt); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: var(--r); padding: 16px 20px; margin-bottom: 14px;
  font-size: 14.5px; line-height: 1.75; color: var(--text2);
}
.mlist__conduct strong { color: var(--blue); }
.mlist__host { font-size: 14px; color: var(--text2); margin-bottom: 28px; }
.mlist__cmds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mlist__cmd { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; min-width: 0; }
.mlist__cmd h3 { font-size: 22px; margin-bottom: 10px; }
.mlist__cmd p { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 14px; }
.mlist__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--ink); color: var(--gold-l); padding: 12px 16px;
  border-radius: 8px; font-size: 14px; overflow-x: auto; margin: 0;
}
@media (max-width: 700px) { .mlist__cmds { grid-template-columns: 1fr; } }

/* ── USEFUL LINKS (categories) ── */
.linkcats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg);
  font-size: 13px; font-weight: 600; color: var(--text2);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.chip:hover { color: var(--blue); border-color: var(--blue); background: var(--bg-alt); transform: translateY(-1px); }
.lgroup { margin-top: 48px; scroll-margin-top: 132px; }
.lgroup__blurb { font-size: 14px; color: var(--text2); margin: -6px 0 18px; }
.lgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.lcard {
  display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px 24px; transition: transform .3s, box-shadow .3s, border-color .3s;
}
.lcard::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--sky-l));
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
a.lcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--sky-l); }
a.lcard:hover::before { transform: scaleX(1); }
.lcard h4 { font-family: 'DM Sans', 'Inter', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.lcard p { font-size: 13px; color: var(--text2); line-height: 1.65; }
.lcard__url { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--blue); word-break: break-all; }
.lcard__tag {
  align-self: flex-start; margin-top: 6px; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text2);
  background: var(--bg-alt); border: 1px dashed var(--border); border-radius: 4px; padding: 3px 9px;
}
.lcard--soon { border-style: dashed; }
@media (max-width: 700px) { .lgrid { grid-template-columns: 1fr; } .lgroup { scroll-margin-top: 104px; } }


/* ═══════════════════════════════════════════════════════════════════
   BACKEND-CONNECTED UI  (API v1: log-in, live content, Discuss, account)
   Everything below was added with the backend integration. The static
   draft markup above is unchanged; these rules only style the new,
   JavaScript-built parts (and a few accessibility helpers).
   ═══════════════════════════════════════════════════════════════════ */

/* The `hidden` attribute must win over component display rules (.btn, .gate, .pgrid …) */
[hidden] { display: none !important; }

/* Plain text from the API: keep the line breaks, break long words / URLs */
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.card__title, .card__preview, .card__authors, .ev__body h3, .ev__loc, .ev__desc, .pcard__body, .pcontact__name,
.lcard h4, .lcard p, .thread__name, .comment__name { overflow-wrap: anywhere; }

/* Static placeholders stay invisible until the backend probe has answered (no flash of fake content) */
.live-pending { visibility: hidden; }
.live-status:empty { display: none; }
.live-status { margin-top: 12px; }
.live-error { text-align: center; padding: 28px 20px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-alt); }
.live-error p { color: var(--text2); margin-bottom: 14px; }
.live-loading { color: var(--text2); font-size: 14px; padding: 12px 0; }
.live-note { font-size: 13px; color: var(--text2); text-align: center; margin-top: 8px; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--border); border-radius: var(--r); background: var(--bg-alt); }
.empty__t { font-family: 'Cormorant Garamond', 'Noto Serif', serif; font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty__s { font-size: 14px; color: var(--text2); }

/* Buttons: disabled / busy */
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }

/* ── Form fields (log-in modal, dialogs, account) ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; font-family: 'DM Sans', 'Inter', sans-serif; font-size: 14px; font-weight: 400;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,63,135,.12); }
.field-hint { font-size: 12px; color: var(--text2); line-height: 1.5; font-weight: 400; margin: 0; }
.field-err { font-size: 12.5px; color: var(--red); line-height: 1.45; margin: -8px 0 0; font-weight: 500; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }
input[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(188,32,38,.15); }

.pw { position: relative; display: flex; }
.pw input { flex: 1; min-width: 0; padding-right: 64px; }
.pw__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 6px 9px; border-radius: 6px; cursor: pointer;
  font: 600 12px 'DM Sans', 'Inter', sans-serif; color: var(--blue);
}
.pw__toggle:hover { background: var(--bg-alt); }

/* honeypot: real people never see or fill it */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ── Auth modal: extra views ── */
.auth:not(.is-live) [data-live-only] { display: none; }
.auth__alt { font-size: 13px; color: var(--text2); text-align: center; margin: 0; }
.auth__form .linkbtn { font-size: 13px; color: var(--blue); }
.auth__form .linkbtn:disabled { opacity: .55; cursor: default; text-decoration: none; }
.auth__tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.code-input { font-size: 22px !important; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.auth__msg { min-height: 0; }
.auth__msg:empty { display: none; }
.cform__msg:empty { min-height: 0; }

/* ── Header: log-in buttons ⇄ user menu ── */
.nav__auth { display: flex; align-items: center; gap: 6px; }
.nav__auth--pending { visibility: hidden; }
.umenu { position: relative; }
.umenu__btn {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px 3px 3px;
  font-family: 'DM Sans', 'Inter', sans-serif; font-size: 14px; font-weight: 600; color: var(--text);
  transition: border-color .2s, background .2s;
}
.umenu__btn:hover, .umenu__btn[aria-expanded="true"] { border-color: var(--blue); background: var(--bg-alt); }
.umenu__name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umenu__caret { font-size: 10px; color: var(--text2); }
.umenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 120;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.umenu__item {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; background: none; border-radius: 8px; cursor: pointer;
  font-family: 'DM Sans', 'Inter', sans-serif; font-size: 14px; font-weight: 500; color: var(--text);
}
.umenu__item:hover { background: var(--bg-alt); }
.umenu__item:focus-visible { outline: none; background: var(--bg-alt); box-shadow: inset 0 0 0 2px var(--blue); }
@media (max-width: 600px) {
  .umenu__name, .umenu__caret { display: none; }
  .umenu__btn { padding: 3px; }
  .nav__links.open { max-height: calc(100vh - 80px); overflow-y: auto; }
}
@media (max-width: 1000px) { .nav__links.open { max-height: calc(100vh - 108px); overflow-y: auto; } }
/* many menu entries (custom pages): when the bar would overflow, app.js first adds body.nav-compact (seal only, no
   association name) and then body.nav-collapsed (burger menu) */
body.nav-compact .nav__brand-text, body.nav-compact .nav__brand-sep { display: none; }
@media (min-width: 1001px) {
  body.nav-collapsed .nav__links { display: none; }
  body.nav-collapsed .burger { display: block; }
  body.nav-collapsed .nav__links.open {
    display: flex; flex-direction: column; position: absolute; top: 108px; left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(20px); padding: 20px 32px; gap: 16px;
    border-bottom: 1px solid var(--border); max-height: calc(100vh - 108px); overflow-y: auto;
  }
}

/* ── Avatars with photos, small size ── */
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--xs { width: 26px; height: 26px; font-size: 11px; }

/* ── Toasts ── */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 440px); pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; line-height: 1.45;
  text-align: center; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toastIn .25s ease-out;
}
.toast--error { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Small dialogs (confirm / report / password prompt) ── */
.cmodal--sm .cmodal__dialog { max-width: 480px; padding: 32px 28px 28px; }
.dlg__title { font-size: 28px; margin: 0 0 10px; padding-right: 28px; }
.dlg__intro { color: var(--text2); line-height: 1.7; font-size: 14.5px; margin-bottom: 18px; }
.dlg__form { display: flex; flex-direction: column; gap: 14px; }
.dlg__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 600px) { .cmodal--sm .cmodal__dialog { padding: 28px 20px 22px; } }

/* ── Content modal: dates, authors, lead paragraph ── */
.cmodal__body .card__date { display: block; margin-bottom: 8px; }
.cmodal__body .card__authors { margin-bottom: 6px; }
.cmodal__body .ev__loc { margin-bottom: 14px; }
.cmodal__body .pa__tag { margin-bottom: 8px; }
.cmodal__body .cmodal__lead { font-size: 17px; color: var(--text); line-height: 1.75; }

/* ── Carousel pages: 6 cards per view (3×2 grid on desktop, 2×3 tablet, swipe row on phones) ── */
.carousel__page { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-content: start; }
.carousel__page > .card { max-width: none; }
.carousel__pager { text-align: center; font-size: 13px; color: var(--text2); margin-top: 4px; }
.carousel--single .carousel__btn { display: none; }
.carousel--paged .carousel__track { scrollbar-width: none; }
.carousel--paged .carousel__track::-webkit-scrollbar { display: none; }
@media (max-width: 860px) { .carousel__page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .carousel__page { display: contents; }
  .carousel__page > .card { scroll-snap-align: start; flex: 0 0 82%; max-width: 82%; }
  .carousel__pager { display: none; }
}

/* ── Events: clickable rows, past events muted ── */
.ev[data-card-open] { cursor: pointer; }
.ev:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ev--past { opacity: .6; }
.ev--past:hover, .ev--past:focus-visible { opacity: 1; }
.ev--past .ev__accent { background: var(--border); }
.ev--past .ev__day { color: var(--text2); }
.ev-sub { font-size: clamp(24px, 3vw, 32px); margin: 44px 0 18px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text2); }

/* ── Contacts (live): any number of people + general block ── */
.contacts__people--live { grid-template-rows: none; grid-auto-rows: 1fr; }
.pcontact--general { border-left-color: var(--sky); }
.pcontact__addr { font-size: 14px; color: var(--text2); }

/* ── Custom pages: the rest of the Markdown subset ── */
.rich > :first-child { margin-top: 0; }
.rich h3 { font-size: clamp(22px, 2.6vw, 28px); margin: 26px 0 10px; }
.rich h4 { font-size: 20px; margin: 22px 0 8px; }
.rich ul, .rich ol { margin: 0 0 16px; padding-left: 24px; color: var(--text2); line-height: 1.8; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich li { margin-bottom: 6px; }
.rich blockquote { margin: 0 0 16px; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); }
.rich blockquote p { margin-bottom: 0; }
.rich a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.rich strong { color: var(--text); }
.rich { overflow-wrap: anywhere; }

/* ── Discuss (live) ── */
.discuss { scroll-margin-top: 130px; }
.discuss__ask { margin-bottom: 24px; }
.discuss__more { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.discuss__count { font-size: 13px; color: var(--text2); }
.discuss__none { color: var(--text2); font-size: 14px; }
.discuss__back { display: inline-block; margin-bottom: 18px; font-size: 14px; font-weight: 600; color: var(--blue); }
.discuss__back:hover { text-decoration: underline; }
.thread--live .thread__link { color: inherit; }
.thread--live:hover .thread__link, .thread--live .thread__link:focus-visible { color: var(--blue); }
.thread--live:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.thread--live .thread__snippet, .thread--live .thread__title { overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); background: var(--sky-ll); padding: 2px 8px; border-radius: 4px; }

.dthread { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r); padding: 28px; }
.dthread .thread__author { flex-wrap: wrap; }
.dthread__title { font-size: clamp(26px, 4vw, 38px); margin: 6px 0 14px; overflow-wrap: anywhere; }
.dthread__title:focus { outline: none; }
.dthread__body p { color: var(--text); line-height: 1.8; margin-bottom: 14px; }
.dthread__actions { display: flex; gap: 18px; margin-top: 8px; }
.dthread__replies { margin-top: 32px; }
.dthread__replies > h3 { font-size: 26px; margin-bottom: 14px; }
.dthread__replies .comments { margin-top: 22px; }
.gate--inline { margin-bottom: 0; }

.comment--live { display: block; }
.comment--live:focus { outline: 2px solid var(--sky-l); outline-offset: 4px; border-radius: 6px; }
.comment__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.comment--live .comment__name { display: inline; margin: 0; }
.comment__when { font-size: 12px; color: var(--text2); }
.comment__text p { font-size: 14.5px; color: var(--text); line-height: 1.65; margin: 0 0 8px; }
.comment__text p:last-child { margin-bottom: 0; }
.comment__text--gone { font-style: italic; color: var(--text2); font-size: 14px; margin: 0; }
.comment--gone .avatar { opacity: .6; }
.comment__actions { display: flex; gap: 16px; margin-top: 6px; }
.comment__actions .linkbtn { text-decoration: none; font-weight: 600; font-size: 12.5px; }
.dthread__actions .linkbtn { text-decoration: none; font-weight: 600; font-size: 13px; }
.comment__actions .linkbtn:hover, .dthread__actions .linkbtn:hover { text-decoration: underline; }
.comment__reply { margin-top: 10px; }
.comment__replies { margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 600px) {
  .comment__replies { padding-left: 8px; }
  .dthread { padding: 20px 16px; }
  .discuss__bar { flex-wrap: wrap; }
}

/* ── Mongolist subscriptions ── */
.sub-hint { margin: 0; padding: 12px 16px; font-size: 14px; color: var(--text); line-height: 1.6; background: rgba(212,168,67,.12); border: 1px solid var(--gold-l); border-left: 3px solid var(--gold); border-radius: 8px; }
.sub-note { margin: 4px 0 0; font-size: 13px; color: var(--text2); line-height: 1.6; }
.sub-row__topic input { width: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
.sub-row--off .sub-row__topic { color: var(--text2); }
.sub-row select:disabled { opacity: .5; }
@media (max-width: 420px) { .sub-row { flex-wrap: wrap; } }

/* ── My account ── */
.filebtn { cursor: pointer; position: relative; }
.filebtn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
input[readonly] { background: var(--bg-alt); color: var(--text2); }
.profile-form label > .profile-form__badge { align-self: flex-start; margin-left: 0; }
.avatar-edit__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-edit .cform__msg { margin-top: 6px; }
.account__section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.account__section h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 8px; }
.account__section > p { color: var(--text2); font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.account__danger { border-top-color: rgba(188,32,38,.35); }
.account__danger h2 { color: var(--red); }
.account__actions { display: flex; flex-wrap: wrap; gap: 12px; }


/* ═══════════════════════════════════════════════════════════════════
   i18n / Mongolian   (docs/I18N.md)
   · no flash of English while the Mongolian text is applied (assets/js/i18n.js sets html[data-i18n-pending])
   · language switcher English | Монгол (bar copy + burger-menu copy) and the "EN" tag of untranslated items
   · Cyrillic typography: calmer tracking on upper-case labels, headings, wider date chips, longer words
   Nothing here changes the English pages except the switcher itself.
   ═══════════════════════════════════════════════════════════════════ */

/* the page is revealed as soon as the dictionary has been applied; the animation is the fail-safe (1.2 s) if a script never gets there */
html[data-i18n-pending] body { visibility: hidden; animation: i18nReveal .01s linear 1.2s forwards; }
@keyframes i18nReveal { to { visibility: visible; } }

/* ── Language switcher: English | Монгол (full names, segmented pill) ──
   bar copy: left side of the header, right after the seal (.nav__left); burger copy: first item of the burger menu */
.nav__left { display: flex; align-items: center; gap: clamp(14px, 1.4vw, 28px); flex-shrink: 0; }
.langsw {
  display: inline-flex; align-items: center; flex-shrink: 0; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg);
}
.langsw__btn {
  background: none; border: none; cursor: pointer; border-radius: 999px; white-space: nowrap;
  padding: 7px 13px; font: 600 15px/1 'DM Sans', 'Inter', sans-serif; letter-spacing: 0;
  color: var(--text2); transition: color .2s, background .2s;
}
.langsw__btn:hover { color: var(--text); background: var(--bg-alt); }
.langsw__btn.is-current, .langsw__btn.is-current:hover { background: var(--blue); color: #fff; cursor: default; }
[data-theme="dark"] .langsw__btn.is-current, [data-theme="dark"] .langsw__btn.is-current:hover { background: var(--sky); }
.langsw__btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* the copy in the burger menu exists for phones and tablets: shown only when app.js (fitNav) finds no room for the one in the bar */
@media (max-width: 600px) {
  .nav__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 72px 40px; gap: 0 10px; height: 124px; padding-bottom: 12px; }
  .nav__left { display: contents; }
  .nav__brand { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; }
  .nav__brand-text { min-width: 0; overflow: hidden; }
  .nav__brand-text span { overflow: hidden; text-overflow: ellipsis; }
  .nav__ctrls { grid-column: 2; grid-row: 1; }
  .langsw--bar { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .nav__links.open { top: 124px; max-height: calc(100dvh - 124px); }
}
/* Cyrillic labels are longer: slightly smaller menu type and tighter gaps keep the nine entries inline next to the wider switcher */
@media (min-width: 1001px) {
  :lang(mn) .nav__links { gap: clamp(10px, 1vw, 24px); }
  :lang(mn) .nav__links .nav__link { font-size: clamp(13px, .95vw, 15px); }
}

/* ── "EN" tag: this item has no Mongolian text yet (shown only in the Mongolian UI) ── */
.lang-badge {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 1px 6px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--bg-alt); color: var(--text2);
  font: 700 10px/1.5 'DM Sans', 'Inter', sans-serif; letter-spacing: .6px; text-transform: none; white-space: nowrap; cursor: help;
}
.cmodal__body .lang-badge { font-size: 11px; }

/* ── Cyrillic typography (<html lang="mn">) ── */
:lang(mn) body { line-height: 1.65; }
:lang(mn) h1, :lang(mn) h2 { letter-spacing: 0; }
:lang(mn) h1, :lang(mn) h2, :lang(mn) h3, :lang(mn) h4 { line-height: 1.2; }
:lang(mn) .hero h1 { line-height: 1.15; }
/* upper-case labels: the wide Latin tracking is too loud on Cyrillic */
:lang(mn) .slabel { letter-spacing: 1.5px; }
:lang(mn) .hero__label { letter-spacing: 2px; }
:lang(mn) .eyebrow { letter-spacing: 1.5px; }
:lang(mn) .pgroup__title, :lang(mn) .footer__col h4, :lang(mn) .pub-articles h4 { letter-spacing: 1px; }
:lang(mn) .pcontact__pos { letter-spacing: .8px; }
:lang(mn) .pa__tag, :lang(mn) .lcard__tag, :lang(mn) .tier__badge { letter-spacing: .5px; }
:lang(mn) .badge, :lang(mn) .profile-form__badge { letter-spacing: .3px; }
:lang(mn) .nav__link--cta { letter-spacing: .2px; }
:lang(mn) .btn { letter-spacing: 0; }
:lang(mn) .nav__brand-text span, :lang(mn) .footer__brand-text span { letter-spacing: .3px; }
@media (max-width: 600px) { :lang(mn) .nav__brand-text span { letter-spacing: .2px; } }
/* date chip: "9-р сар" instead of "SEP" — a fixed width keeps the event rows aligned whatever the month */
:lang(mn) .ev__date { width: 124px; padding-left: 12px; padding-right: 12px; flex-shrink: 0; }
:lang(mn) .ev__month { letter-spacing: .2px; font-size: 12px; white-space: nowrap; }
@media (max-width: 600px) { :lang(mn) .ev__date { width: auto; padding-left: 20px; padding-right: 20px; } }
/* longer words: let buttons and tags wrap instead of overflowing their boxes */
:lang(mn) .btn { text-align: center; }
:lang(mn) .carousel__pager, :lang(mn) .discuss__count { text-wrap: balance; }

.membership-form { display: grid; gap: 20px; }
.membership-form input[type="checkbox"] { width: auto; margin-right: 8px; accent-color: var(--blue); }

.membership-history { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 8px; }
.membership-history legend { padding: 0 8px; font-weight: 600; }
.membership-history__rows, .membership-history__row { display: grid; gap: 16px; }
.membership-history__row { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
