/* MDJ base.css — shared design system for all pages (extracted from the original styles.css).
   Tokens, header, single-button language menu, buttons, cards, reveal, modal, footer. */

:root {
  color-scheme: dark;
  --bg: #080808;
  --bg-soft: #111111;
  --surface: rgba(255, 255, 255, 0.07);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f0ed;
  --muted: #b7aaa2;
  --subtle: #81746f;
  --red: #8f0915;
  --red-bright: #d7192b;
  --silver: #d6d2cb;
  --gold: #d7aa62;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --fx-red: rgba(215, 25, 43, 0.22);
  --fx-gold: rgba(215, 170, 98, 0.2);
  --fx-silver: rgba(214, 210, 203, 0.14);
  --maxw: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f2ee;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(78, 33, 26, 0.14);
  --text: #1c1715;
  --muted: #63544f;
  --subtle: #8a7b73;
  --red: #96101a;
  --red-bright: #c81021;
  --silver: #423e3a;
  --gold: #9a6d2f;
  --shadow: 0 22px 70px rgba(82, 46, 38, 0.16);
  --fx-red: rgba(200, 16, 33, 0.18);
  --fx-gold: rgba(154, 109, 47, 0.18);
  --fx-silver: rgba(66, 62, 58, 0.1);
}

* { box-sizing: border-box; }

/* Always reserve the scrollbar gutter so the fixed, centered header never jumps
   sideways when a vertical scrollbar appears. Pages whose main content is built
   by JS (media grid, apply questionnaire) are short at first paint, so their
   scrollbar shows up late — without a stable gutter that shift is a visible
   header "shake" on those pages only. */
html { scroll-behavior: auto; background: var(--bg); scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Subtle grid texture (fixed, non-interactive). Pages with a video background override via .has-bg. */
body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid rgba(215, 170, 98, 0.78);
  outline-offset: 4px;
}

main, .site-footer { position: relative; z-index: 2; }

/* ---------------- Header (Liquid Glass surface) ----------------
   The header and both dropdowns are .lg-surface glass panes driven by
   assets/js/liquid-glass.js: --lg-tint is the glass dye (also used by the
   clone pipeline), --lg-url is the per-element SVG refraction filter that
   the engine injects on Chromium. Without JS they degrade to blur + tint. */
.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 24px;
  right: 24px;
  width: auto;
  min-height: 68px;
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 218px;
  align-items: center;
  gap: 14px;
  padding: 10px max(16px, calc((100vw - var(--maxw)) / 2)) 10px;
  border: 1px solid transparent; /* the gradient edge lives on ::before */
  border-top: 0;
  border-radius: 0 0 22px 22px;
  --lg-tint: rgba(16, 13, 13, 0.52);
  --lg-blur: 16px;
  --lg-sat: 1.5;
  background: var(--lg-tint);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  transition: background 0.45s ease, box-shadow 0.45s ease;
}
:root[data-theme="light"] .site-header { --lg-tint: rgba(255, 255, 255, 0.6); }
.site-header.is-scrolled { --lg-tint: rgba(16, 13, 13, 0.7); box-shadow: 0 16px 46px rgba(0, 0, 0, 0.28); }
:root[data-theme="light"] .site-header.is-scrolled { --lg-tint: rgba(255, 255, 255, 0.82); }

/* Chromium pipeline: refract the live backdrop through the SVG lens filter. */
.site-header[data-lg-mode="backdrop"],
.lang-menu__list[data-lg-mode="backdrop"],
.account-menu__list[data-lg-mode="backdrop"] {
  backdrop-filter: var(--lg-url) blur(var(--lg-blur)) saturate(var(--lg-sat));
}

/* ---- Liquid Glass chrome shared by header + dropdown surfaces ---- */
/* Real children ride above the clone/highlight layers. */
.site-header > :not(.lg-backdrop),
.lang-menu__list > :not(.lg-backdrop),
.account-menu__list > :not(.lg-backdrop) {
  position: relative;
  z-index: 3;
}
/* Gradient edge: a masked ring so only the 1px border band paints. */
.site-header::before,
.lang-menu__list::before,
.account-menu__list::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border: inherit;
  border-color: transparent;
  border-radius: inherit;
  background: linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0.12) 34%,
      rgba(255, 255, 255, 0.04) 60%,
      rgba(255, 255, 255, 0.34)
    ) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0) border-box;
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0) border-box;
  mask-composite: exclude;
}
:root[data-theme="light"] .site-header::before,
:root[data-theme="light"] .lang-menu__list::before,
:root[data-theme="light"] .account-menu__list::before {
  background: linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.95),
      rgba(120, 80, 70, 0.22) 38%,
      rgba(120, 80, 70, 0.1) 62%,
      rgba(255, 255, 255, 0.75)
    ) border-box;
}
/* Specular highlight: top rim light + a grazing diagonal sheen. */
.site-header::after,
.lang-menu__list::after,
.account-menu__list::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 1px rgba(255, 255, 255, 0.06);
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.02) 30%,
    rgba(255, 255, 255, 0) 46% 58%,
    rgba(255, 255, 255, 0.05) 82%,
    rgba(255, 255, 255, 0.12)
  );
}
:root[data-theme="light"] .site-header::after,
:root[data-theme="light"] .lang-menu__list::after,
:root[data-theme="light"] .account-menu__list::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(255, 255, 255, 0.35);
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.1) 32%,
    rgba(255, 255, 255, 0) 48% 60%,
    rgba(255, 255, 255, 0.16) 84%,
    rgba(255, 255, 255, 0.4)
  );
}

/* hidden SVG-filter defs holder (width/height 0 keeps filters active vs display:none).
   a class, not an inline style, so the CSP style-src needs no 'unsafe-inline'. */
.lg-defs { position: fixed; top: -1px; left: -1px; width: 0; height: 0; overflow: hidden; pointer-events: none; }
/* muted inline-fallback note (e.g. "…is loading") — was an inline style, now a class */
.is-loading-note { color: var(--muted); }

/* ---- Background-clone pipeline (Safari/Firefox: SVG filter on a replica) ---- */
.lg-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.lg-backdrop::after {
  /* glass dye above the refracted replica, below highlights/content */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lg-tint);
  transition: background 0.45s ease;
}
.lg-backdrop__view {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.lg-backdrop__view > * { position: absolute; inset: 0; }
.lg-clone-video { width: 100%; height: 100%; object-fit: cover; opacity: 0.82; }
.lg-clone-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.16) 48%, rgba(0, 0, 0, 0.46)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.36));
}
.lg-clone-grid {
  /* replica of the body grid texture (body::before) over the page base color */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}
.brand-mark img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  justify-self: center;
  width: 100%;
  max-width: 790px;
}
.site-nav a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-radius: 22px;
  padding: 0 10px;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: 1.1;
  text-align: center;
  transition: color 0.3s ease;
}
.site-nav a:last-of-type { min-width: 78px; }
/* The liquid-glass slider (base.css .nav-slider) is the highlight; links only shift color. */
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }

/* ---- Liquid Glass sliding highlight (created by site.js) ---- */
.nav-slider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: 22px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 6px rgba(255, 255, 255, 0.12),
    0 8px 22px rgba(0, 0, 0, 0.28);
  /* No backdrop-filter here: Chromium samples the sibling nav text into the
     slider's backdrop, so any blur/displacement warps the labels while sliding. */
  /* slight overshoot = the "liquid droplet" settle */
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
}
:root[data-theme="light"] .nav-slider {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55));
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 20px rgba(82, 46, 38, 0.14);
}
@media (prefers-reduced-motion: reduce) {
  .nav-slider { transition: opacity 0.2s ease; }
}
.nav-badge {
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 2px 5px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #1c1715;
  background: var(--gold);
}

.header-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

/* ---------------- Single-button language menu ---------------- */
.lang-menu { position: relative; }
.lang-menu__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 80px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 0.86rem;
}
.lang-menu__button:hover { background: var(--surface-strong); }
.lang-menu__globe { font-size: 1rem; line-height: 1; }
.lang-menu__caret { font-size: 0.7rem; opacity: 0.7; transition: transform 0.2s ease; }
.lang-menu[data-open="true"] .lang-menu__caret { transform: rotate(180deg); }

/* Dropdowns stay rendered (visibility-gated) so open/close can spring instead
   of the old display:none hard cut, and so the glass engine can measure them. */
.lang-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 184px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 16px;
  --lg-tint: rgba(16, 13, 13, 0.66);
  --lg-blur: 20px;
  --lg-sat: 1.55;
  background: var(--lg-tint);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px) scale(0.92);
  transform-origin: top right;
  transition:
    opacity 0.2s ease,
    transform 0.24s cubic-bezier(0.5, 0, 0.75, 0.35),
    visibility 0s 0.24s;
}
:root[data-theme="light"] .lang-menu__list { --lg-tint: rgba(255, 255, 255, 0.78); }
.lang-menu[data-open="true"] .lang-menu__list {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 0.22s ease,
    transform 0.38s cubic-bezier(0.32, 1.45, 0.35, 1),
    visibility 0s;
}

.lang-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}
.lang-menu__item:hover { color: var(--text); background: var(--surface-strong); }
.lang-menu__item[aria-current="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
}
.lang-menu__item .tick { opacity: 0; font-size: 0.8rem; }
.lang-menu__item[aria-current="true"] .tick { opacity: 1; }

.theme-toggle {
  width: 112px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: center;
}
.theme-toggle:hover { background: var(--surface); }

/* ---------------- Header account menu (sign-in / member) ---------------- */
.account-menu { position: relative; }
.account-link,
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 0.86rem;
  text-decoration: none;
  white-space: nowrap;
}
.account-link:hover, .account-button:hover { background: var(--surface-strong); }
.account-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
}
.account-name { overflow: hidden; text-overflow: ellipsis; }

.account-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 16px;
  --lg-tint: rgba(16, 13, 13, 0.66);
  --lg-blur: 20px;
  --lg-sat: 1.55;
  background: var(--lg-tint);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px) scale(0.92);
  transform-origin: top right;
  transition:
    opacity 0.2s ease,
    transform 0.24s cubic-bezier(0.5, 0, 0.75, 0.35),
    visibility 0s 0.24s;
}
:root[data-theme="light"] .account-menu__list { --lg-tint: rgba(255, 255, 255, 0.78); }
.account-menu[data-open="true"] .account-menu__list {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 0.22s ease,
    transform 0.38s cubic-bezier(0.32, 1.45, 0.35, 1),
    visibility 0s;
}
.account-menu__who {
  padding: 8px 12px 6px;
  color: var(--subtle);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px dashed var(--line);
}
.account-menu__item {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}
.account-menu__item:hover { color: var(--text); background: var(--surface-strong); }

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle { display: none; }

/* ---------------- Buttons ---------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 24px;
  padding: 0 20px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.button.primary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, var(--red-bright), var(--red) 58%, #4e050a);
  box-shadow: 0 18px 46px rgba(143, 9, 21, 0.34);
}
.button.secondary, .button.ghost {
  color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(20px);
}
.button:hover { transform: translateY(-2px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------------- Sections / headings ---------------- */
.section { padding: 96px max(24px, calc((100vw - var(--maxw)) / 2)); }
.section-inner { width: 100%; }
.section-heading { max-width: 760px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 0.98;
}
.section-heading p:not(.eyebrow) { color: var(--muted); line-height: 1.72; margin-top: 18px; }

/* ---------------- Shared card primitive ---------------- */
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.45s ease, box-shadow 0.45s ease;
}
.card::after {
  position: absolute;
  inset: -35%;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.16;
  background:
    radial-gradient(circle at 12% 18%, var(--fx-gold), transparent 28%),
    radial-gradient(circle at 78% 20%, var(--fx-red), transparent 24%),
    linear-gradient(120deg, transparent 12%, var(--fx-silver) 46%, transparent 72%);
  transform: translate3d(-12%, 8%, 0);
  animation: component-gradient-drift 11s ease-in-out infinite;
  animation-delay: var(--fx-delay, 0ms);
}
.card > * { position: relative; z-index: 1; }
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(215, 170, 98, 0.34);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}
@keyframes component-gradient-drift {
  0%, 100% { opacity: 0.12; transform: translate3d(-14%, 8%, 0) rotate(0deg); }
  45% { opacity: 0.26; transform: translate3d(9%, -4%, 0) rotate(8deg); }
  72% { opacity: 0.18; transform: translate3d(16%, 7%, 0) rotate(-5deg); }
}

/* ---------------- Reveal system ---------------- */
html.js .reveal {
  opacity: 0;
  filter: blur(6px);
  transform: translate3d(0, 22px, 0) scale(0.985);
}
html.js .reveal[data-reveal="slide-left"] { transform: translate3d(-30px, 0, 0) scale(0.99); }
html.js .reveal[data-reveal="slide-right"] { transform: translate3d(30px, 0, 0) scale(0.99); }
html.js .reveal[data-reveal="zoom"] { transform: translate3d(0, 14px, 0) scale(0.96); }
html.js .reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 0.72s ease, filter 0.72s ease, transform 0.72s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* ---------------- Modal (accessible dialog) ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.modal.is-open { display: grid; place-items: center; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100% - 28px));
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}
.modal__head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.modal__head h2, .modal__head h3 { margin: 0; font-size: 1.3rem; }
.modal__close {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.modal__close:hover { background: var(--surface-strong); }
.modal__body { padding: 20px; }
body.modal-open { overflow: hidden; }

/* ---------------- Footer ---------------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 28px max(24px, calc((100vw - var(--maxw)) / 2)) 42px;
  color: var(--subtle);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-brand { display: grid; gap: 8px; }
.footer-brand strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; }
.footer-links a { color: var(--muted); font-weight: 800; }
.footer-links a:hover { color: var(--text); }

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .button:hover, .card:hover { transform: none; }
  html.js .reveal, html.js .reveal.is-visible { filter: none; transform: none; transition-delay: 0ms !important; }
}

/* ---------------- Responsive header/footer ---------------- */
/* Nav collapse breakpoint: the desktop pill row (4 × 94px + 160px links) plus the
   brand and tools columns needs ~1060px of viewport, so anything narrower gets the
   hamburger. Keep in sync with the desktop() check in site.js (min-width: 1281px). */
@media (max-width: 1280px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 22px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    font-size: 1.1rem;
  }
  .site-header {
    display: flex;
    flex-wrap: wrap;
    top: 10px;
    left: 10px;
    right: auto;
    width: calc(100% - 20px);
    padding: 10px 12px;
    border-top: 1px solid transparent; /* gradient edge on ::before covers all sides here */
    border-radius: 24px;
  }
  /* Collapsible nav panel. display:none while closed keeps the collapsed
     header at its original height (a 0-height in-flow row would still add
     the header's 14px flex gap); allow-discrete + @starting-style animate
     across the display flip on modern engines, older ones get the legacy
     hard cut. */
  .site-nav {
    order: 5;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    display: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition:
      max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.28s ease,
      transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      display 0.4s allow-discrete;
  }
  .site-header.nav-open .site-nav {
    display: flex;
    max-height: 340px;
    opacity: 1;
    transform: none;
    transition:
      max-height 0.44s cubic-bezier(0.32, 1.25, 0.35, 1),
      opacity 0.3s ease 0.06s,
      transform 0.44s cubic-bezier(0.32, 1.25, 0.35, 1),
      display 0.44s allow-discrete;
  }
  @starting-style {
    .site-header.nav-open .site-nav {
      max-height: 0;
      opacity: 0;
      transform: translateY(-6px);
    }
  }
  /* flex-basis: auto — the desktop pill widths are flex-basis values, which would
     become heights (94px/160px rows) in this column layout. */
  .site-nav a { justify-content: flex-start; flex: 0 0 auto; }
  .site-nav a:last-of-type { flex-basis: auto; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 820px) {
  .section { padding: 72px 20px; }
  .site-footer { flex-direction: column; padding: 24px 20px 34px; }
  .footer-links { justify-content: flex-start; }
  .button { width: 100%; }
}

/* ---------- video lightbox (pop-out player, shared across pages) ---------- */
.vlb { position: fixed; inset: 0; z-index: 90; }
.vlb[hidden] { display: none; }
.vlb__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.86); }
.vlb__stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
}
.vlb__video {
  max-width: min(440px, 94vw);
  max-height: 90vh;
  width: auto; height: auto;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.vlb__back {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease;
}
.vlb__back:hover, .vlb__back:focus-visible { background: rgba(255, 255, 255, 0.3); outline: none; }
body.vlb-open { overflow: hidden; }
.vlb__error {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(360px, 80vw);
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  text-align: center;
  font-weight: 700;
  line-height: 1.5;
}
.vlb.is-error .vlb__video { visibility: hidden; }
