/* =====================================================================
   Venomers — Global CSS (Black / Gold / White)
   Revised & RTL‑safe shared stylesheet for EN + AR

   WHAT CHANGED (high level):
   • Fixed horizontal scroll in RTL by using logical viewport units (vi/vb),
     clipping overflow on the root, and eliminating width leaks in overlays.
   • Tightened Arabic nav typography (letter‑spacing = 0; neutralized opsz) to
     prevent menu growth/overflow.
   • Normalized layout containers and overlay panels with contain/layout rules.
   • Consolidated tokens, cleaned comments, and aligned structure for EN/AR.
   • Kept your black/gold/white aesthetic + glass surfaces intact.
====================================================================== */

/* ----------------------------------------------------------------------
  0) Reset / Box Sizing / Root Overflow Guard
---------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  overflow-x: clip;
}
@supports not (overflow: clip) {
  html {
    overflow-x: hidden;
  }
}

/* ----------------------------------------------------------------------
  1) Design Tokens (Colors, Layout, Type Scale, States)
---------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* ===== Palette: Black / Gold / White ===== */
  --gold: #e4c76c; /* primary gold accent */
  --gold-deep: #a07c19; /* deeper gold for active states */

  --bg: #000000; /* main background: true black */
  --bg-spot: #0a0a0a; /* subtle vignette spot */
  --surface: #0c0c0c; /* primary surface layers */
  --surface-2: #111111; /* secondary surfaces/stripes */
  --card: #0e0e0e; /* cards/dialogs */

  /* Gold-tinted subtle border */
  --border: rgba(212, 175, 55, 0.22);

  --text: #ffffff; /* primary text: white */
  --muted: #c9c9c9; /* secondary/caption */
  --link: var(--gold); /* links = gold */
  --link-hover: color-mix(in oklab, var(--gold), white 10%);

  /* ===== Accents ===== */
  --accent: var(--gold);
  --accent-ink: #0a0a0a; /* text on accent */
  --accent-2: #b88a1e; /* deeper bronze/gold */
  --accent-2-ink: #0a0a0a;

  /* ===== Background gradient (very subtle; stays black) ===== */
  --bg-grad-size-x: clamp(1200px, 60vw, 2200px);
  --bg-grad-size-y: clamp(800px, 40vw, 1400px);
  --bg-grad-pos: 65% -10%;
  --bg-grad-stop1: 0%;
  --bg-grad-stop2: 55%;
  --bg-gradient: radial-gradient(
    var(--bg-grad-size-x) var(--bg-grad-size-y) at var(--bg-grad-pos),
    var(--bg-spot) var(--bg-grad-stop1),
    var(--bg) var(--bg-grad-stop2)
  );

  /* ===== Layout ===== */
  --max-w: clamp(1000px, 82vw, 1360px);
  --gutter: clamp(16px, 3.2vw, 36px);
  --radius: 12px;
  --radius-sm: 10px;

  /* Gold-tinted shadow */
  --shadow-1: 0 10px 30px rgba(212, 175, 55, 0.22);

  /* ===== Type scale ===== */
  --fs-1: clamp(30px, 4vw, 52px);
  --fs-2: clamp(22px, 2.6vw, 34px);
  --fs-3: clamp(18px, 2vw, 24px);
  --fs-body: clamp(15px, 1.4vw, 18px);
  --fs-small: 13px;

  /* ===== Focus (gold, accessible) ===== */
  --focus: 2px solid color-mix(in oklab, var(--accent), white 12%);

  /* ===== Safe areas ===== */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* ===== Sticky nav height ===== */
  --nav-h: clamp(56px, 5.2vw, 68px);

  /* ===== Glass / translucency ===== */
  --glass-bg: color-mix(in oklab, #000, white 6%);
  --glass-border: rgba(212, 175, 55, 0.25);
  --glass-hover: color-mix(in oklab, var(--glass-bg), white 8%);

  /* ===== Semantic states ===== */
  --success: oklch(0.62 0.12 150);
  --success-ink: #0a0a0a;
  --warning: color-mix(in oklab, var(--gold), white 25%);
  --warning-ink: #0a0a0a;
  --danger: oklch(0.58 0.2 27);
  --danger-ink: #0a0a0a;

  /* ===== Interactive ramps ===== */
  --accent-hover: color-mix(in oklab, var(--gold), black 12%);
  --accent-active: color-mix(in oklab, var(--gold-deep), black 10%);
  --accent-soft: color-mix(in oklab, var(--gold), white 88%);

  --accent-2-hover: color-mix(in oklab, var(--accent-2), black 14%);
  --accent-2-active: color-mix(in oklab, var(--accent-2), black 24%);
  --accent-2-soft: color-mix(in oklab, var(--accent-2), white 84%);

  /* ===== Typography tokens (defaults = EN) ===== */
  --ff-ui: "Inter", ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --ff-display: "Space Grotesk", "Inter", ui-sans-serif, -apple-system,
    system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --ff-body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --lh-body: 1.7;
  --lh-heading: 1.22;

  --w-h1: 700;
  --w-h2: 680;
  --w-h3: 600;

  --ls-h1: 0.15px;
  --ls-h2: 0.12px;
  --ls-h3: 0.1px;

  /* UI / Nav tokens */
  --nav-font-size: 15.5px;
  --nav-letter: 0.2px; /* will be zeroed in RTL */
  --nav-weight: 500;
  --nav-weight-active: 600;
  --nav-opsz: 16; /* Inter optical size axis; neutralized in RTL */
}

/* ===== Arabic font + spacing overrides when page is RTL ===== */
:root[dir="rtl"] {
  /* UI/Display → Readex Pro (HEXP,wght) | fallback: Noto Sans Arabic */
  --ff-ui: "Readex Pro VF", "Noto Sans Arabic VF", system-ui, sans-serif;
  --ff-display: "Readex Pro VF", "Noto Sans Arabic VF", system-ui, sans-serif;
  /* Body text → Noto Naskh Arabic (wght) for paragraph readability */
  --ff-body: "Noto Naskh Arabic VF", serif;
  /* Arabic doesn’t benefit from Latin letter-spacing */
  --nav-letter: 0;
}

/* ----------------------------------------------------------------------
  2) Base / HTML & Body / Media
---------------------------------------------------------------------- */
body {
  margin: 0;
  background: var(--bg-gradient);
  color: var(--text);

  /* Type base */
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-optical-sizing: auto;

  /* Rendering & usability */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Ensure embedded Arabic in EN pages uses Arabic body font */
:lang(ar) {
  font-family: "Noto Naskh Arabic VF", serif;
}

/* Anchor targets won't hide under the sticky nav */
:where(h1, h2, h3, [id]) {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

/* Media elements */
img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Headings (shared sizing) */
h1,
h2,
h3 {
  line-height: var(--lh-heading);
  margin: 0 0 0.5em;
  font-family: var(--ff-display);
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-1);
  font-weight: var(--w-h1);
  letter-spacing: var(--ls-h1);
}
h2 {
  font-size: var(--fs-2);
  font-weight: var(--w-h2);
  letter-spacing: var(--ls-h2);
}
h3 {
  font-size: var(--fs-3);
  font-weight: var(--w-h3);
  letter-spacing: var(--ls-h3);
}

/* Hero keeps display family and strong weight */
.home-hero h1 {
  font-weight: 700;
  letter-spacing: 0.2px;
  text-wrap: balance;
}

/* Numeric alignment where needed */
.metrics .value,
.metrics .unit,
.site-nav .menu a {
  font-variant-numeric: tabular-nums;
}

/* Content wrapper rhythm */
main > * {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(28px, 5vw, 72px);
}

/* Paragraph rhythm */
p {
  margin: 0 0 1em;
  color: var(--text);
}
small.note {
  color: var(--muted);
  font-size: var(--fs-small);
}

/* ----------------------------------------------------------------------
  3) Webfonts (shared: EN + AR) — use standard woff2 for broad support
---------------------------------------------------------------------- */
/* === EN: Inter (UI/Nav) === */
@font-face {
  font-family: "Inter";
  src: url("/en/font/inter/Inter-VariableFont_opsz,wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/en/font/inter/Inter-Italic-VariableFont_opsz,wght.woff2")
    format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* === EN: Space Grotesk (Display/Headings + Hero) === */
@font-face {
  font-family: "Space Grotesk";
  src: url("/en/font/Space_Grotesk/SpaceGrotesk-VariableFont_wght.woff2")
    format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* === EN: Source Serif 4 (Body) === */
@font-face {
  font-family: "Source Serif 4";
  src: url("/en/font/Source_Serif_4/SourceSerif4-VariableFont_opsz,wght.woff2")
    format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/en/font/Source_Serif_4/SourceSerif4-Italic-VariableFont_opsz,wght.woff2")
    format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* === AR: Noto Sans Arabic Variable (wdth,wght) — UI fallback === */
@font-face {
  font-family: "Noto Sans Arabic VF";
  src: url("/ar/font/Noto_Sans_Arabic/NotoSansArabic-VariableFont_wdth,wght.woff2")
    format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* === AR: Readex Pro Variable (HEXP,wght) — UI/Headings === */
@font-face {
  font-family: "Readex Pro VF";
  src: url("/ar/font/Readex_Pro/ReadexPro-VariableFont_HEXP,wght.woff2")
    format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

/* === AR: Noto Naskh Arabic Variable (wght) — Body === */
@font-face {
  font-family: "Noto Naskh Arabic VF";
  src: url("/ar/font/Noto_Naskh_Arabic/NotoNaskhArabic-VariableFont_wght.woff2")
    format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------------
  4) UI / Navigation (direction-aware font variations)
---------------------------------------------------------------------- */
.site-nav,
.site-nav .menu,
.site-nav .menu a,
.nav-toggle {
  font-family: var(--ff-ui);
  font-optical-sizing: auto;
  font-synthesis: none;
  font-kerning: normal;
}

/* Default (EN/Latin) uses Inter 'opsz' axis */
:root:not([dir="rtl"]) .site-nav .menu a,
:root:not([dir="rtl"]) .nav-toggle {
  font-variation-settings: "opsz" var(--nav-opsz);
}

/* RTL (AR) neutralizes opsz; Arabic letter-spacing is zero (token) */
:root[dir="rtl"] .site-nav .menu a,
:root[dir="rtl"] .nav-toggle {
  font-variation-settings: normal;
}

.site-nav .menu a {
  font-size: var(--nav-font-size);
  font-weight: var(--nav-weight);
  letter-spacing: var(--nav-letter);
  text-transform: none;
  text-align: start;
}
.site-nav .menu a[aria-current="page"] {
  font-weight: var(--nav-weight-active);
}

.nav-toggle {
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Mobile tuning for nav labels */
@media (max-width: 860px) {
  :root {
    --nav-font-size: 16px;
    --nav-opsz: 14;
  }
  .nav-toggle {
    font-size: 16px;
  }
}

/* ----------------------------------------------------------------------
  5) Accessibility Helpers  (RTL-safe & no horizontal overflow)
---------------------------------------------------------------------- */

/* Skip to content: hide via transform (doesn't expand layout/scroll) */
.skip-link {
  position: fixed;
  inset-block-start: 12px; /* top in logical (works in RTL/LTR) */
  inset-inline-start: 12px; /* left in LTR, right in RTL */
  transform: translateX(
    -150%
  ); /* keep off-canvas without affecting scroll width */
  inline-size: 1px; /* minimal box so it doesn't paint large */
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  background: transparent;
  color: inherit;
  z-index: 20000;
}

/* When focused, bring the link into view with proper sizing/style */
.skip-link:focus {
  transform: none; /* show in place */
  inline-size: auto;
  block-size: auto;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  outline: var(--focus);
}

/* Screen-reader-only utility (modern recipe, no horizontal overflow) */
.sr-only {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  /* Modern clipping */
  clip-path: inset(50%);
  /* Legacy fallback for older UAs */
  clip: rect(1px, 1px, 1px, 1px);
  border: 0;
}

/* Global focus style for keyboard navigation */
:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* High-contrast mode adjustments for Windows */
@media (forced-colors: active) {
  .nav,
  .lang summary,
  .site-nav .menu a {
    background: Canvas;
    border-color: GrayText;
  }
  :focus-visible {
    outline: 2px solid Highlight;
  }
}

/* ----------------------------------------------------------------------
  6) Language Switcher (fixed, glassy)
---------------------------------------------------------------------- */
.ln {
  position: fixed;
  inset-block-start: calc(14px + var(--safe-top));
  inset-inline-end: clamp(8px, 2vw, 14px);
  z-index: 1600;
}
.lang {
  position: relative;
}
.lang summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  box-shadow: var(--shadow-1);
  transition: background 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, transform 0.18s ease;
  text-decoration: none;
}
.lang[open] summary {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.28);
}
.lang summary:hover,
.lang summary:focus-visible {
  background: var(--glass-hover);
  border-color: color-mix(in oklab, var(--accent), white 50%);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.28);
  outline: none;
  text-decoration: none;
}
/* Hide default marker in Safari/Chromium */
.lang summary::-webkit-details-marker {
  display: none;
}

.lang-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  margin: 0;
  padding: 10px;
  min-width: 180px;
  max-width: min(92vi, 280px);
  max-height: 50vb;
  overflow: auto;
  z-index: 1650;
  display: grid;
  gap: 6px;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.02) 30%
    ),
    var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.3);
  contain: layout paint;
}
:root[dir="rtl"] .lang-list {
  left: 0;
  right: auto;
}
.lang-list li {
  list-style: none;
}
.lang-list a {
  display: block;
  padding: 10px 12px;
  min-height: 36px;
  line-height: 1.2;
  color: var(--text);
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--glass-border), white 4%);
  background: transparent;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease,
    background 0.16s ease, box-shadow 0.16s ease;
}
.lang-list a:hover,
.lang-list a:focus-visible {
  background: var(--glass-hover);
  border-color: color-mix(in oklab, var(--accent), white 55%);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.24);
  transform: translateY(-1px);
  text-decoration: none;
  outline: none;
}
.lang-list a:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.lang-list a[aria-current="true"],
.lang-list a[aria-current="page"] {
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.18),
    rgba(212, 175, 55, 0.06)
  );
  border-color: color-mix(in oklab, var(--accent), white 70%);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.22),
    0 0 0 1px color-mix(in oklab, var(--accent), white 55%) inset;
}

/* ----------------------------------------------------------------------
  7) Primary Nav (sticky bar + mobile overlay)
---------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1400;
  background: color-mix(in oklab, var(--surface), black 6%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.site-nav {
  position: relative;
  z-index: 1400;
}

/* Shared list styles */
.nav nav ul,
.site-nav .menu {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 22px);
  list-style: none;
  /* allow horizontal scroll for long menus without causing page overflow */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Links */
.nav a,
.site-nav .menu a {
  display: inline-block;
  padding: 10px 12px;
  color: var(--text);
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.nav a:hover,
.site-nav .menu a:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--border);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.22);
  text-decoration: none;
}
.nav a[aria-current="page"],
.site-nav .menu a[aria-current="page"] {
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.18),
    rgba(212, 175, 55, 0.06)
  );
  border-color: color-mix(in oklab, var(--accent), white 70%);
  box-shadow: 0 10px 24px rgba(212, 175, 55, 0.26),
    0 0 0 1px color-mix(in oklab, var(--accent), white 55%) inset;
}

/* Desktop: hide hamburger */
@media (min-width: 861px) {
  .site-nav {
    max-width: var(--max-w);
    margin: 0 auto;
  }
  .nav-toggle {
    display: none;
  }
}

/* Mobile: hamburger overlay (GLASSY, not opaque) */
@media (max-width: 860px) {
  .site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 8px var(--gutter);
  }

  /* Burger button */
  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-1);
  }
  .nav-toggle-box {
    position: relative;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: background 0.2s ease;
  }
  .nav-toggle-box::before,
  .nav-toggle-box::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-toggle-box::before {
    transform: translateY(-7px);
  }
  .nav-toggle-box::after {
    transform: translateY(7px);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-box {
    background: transparent;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-box::before {
    transform: rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-box::after {
    transform: rotate(-45deg);
  }

  /* Overlay menu — frosted glass so page content shows through */
  .site-nav .menu {
    position: fixed;
    z-index: 3000;
    inset: calc(var(--nav-h) + var(--safe-top)) 0 0 0;
    margin: 0;

    /* Subtle translucent tint + blur (adjust alpha 0.35–0.55 to taste) */
    background-color: rgba(12, 12, 16, 0.45);
    background-image: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.02) 22%
    );
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-top: 1px solid
      color-mix(in oklab, var(--glass-border), transparent 40%);
    box-shadow: inset 0 1px 0 rgba(212, 175, 55, 0.18);

    display: grid;
    gap: clamp(10px, 2.5vh, 16px);
    padding: 12px var(--gutter)
      max(16px, calc(16px + env(safe-area-inset-bottom)));
    place-content: start center;
    grid-auto-rows: min-content;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;

    /* Enter animation & visibility control */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    will-change: transform, opacity;

    /* Prevent width leaks that can cause page horizontal scroll */
    contain: layout paint size style;
  }

  /* Show overlay when toggled */
  .nav-toggle[aria-expanded="true"] + .menu,
  body.menu-open .site-nav .menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  /* Menu items inside overlay */
  .site-nav .menu a {
    display: block;
    width: min(92vi, 540px);
    margin-inline: auto;
    margin-block: 0;
    padding: 12px 14px;
    min-height: 48px;
    font-size: 1rem;
    line-height: 1.35;
    letter-spacing: var(--nav-letter);
    color: var(--text);
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0) 30%
      ),
      color-mix(in oklab, var(--glass-bg), transparent 40%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease,
      border-color 0.18s ease, background 0.18s ease;
    text-decoration: none;
    backdrop-filter: blur(6px);
    text-align: start;
  }
  .site-nav .menu a:hover,
  .site-nav .menu a:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--accent), white 60%);
    box-shadow: 0 12px 28px rgba(212, 175, 55, 0.28);
    background: linear-gradient(
        180deg,
        rgba(212, 175, 55, 0.12),
        rgba(212, 175, 55, 0.04) 38%
      ),
      var(--glass-hover);
    text-decoration: none;
  }
  .site-nav .menu a:active {
    transform: translateY(0);
    filter: brightness(0.98);
  }
  .site-nav .menu a[aria-current="page"] {
    border-color: color-mix(in oklab, var(--accent), white 70%);
    background: linear-gradient(
        180deg,
        rgba(212, 175, 55, 0.18),
        rgba(212, 175, 55, 0.06)
      ),
      var(--glass-hover);
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.26),
      0 0 0 1px color-mix(in oklab, var(--accent), white 55%) inset;
  }

  .site-nav .menu li {
    list-style: none;
    justify-self: stretch;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Prevent background page from scrolling while overlay is open */
  body.menu-open {
    overflow: hidden;
  }

  /* Avoid double blur on sticky bar while overlay is open */
  .menu-open .nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Fallback when backdrop-filter is unsupported: keep translucency without blur */
  @supports not (
    (backdrop-filter: blur(0)) or (-webkit-backdrop-filter: blur(0))
  ) {
    .site-nav .menu {
      background-color: rgba(12, 12, 16, 0.5);
      background-image: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06),
        rgba(255, 255, 255, 0.02) 22%
      );
    }
  }
}

/* No-JS fallback: keep menu visible and simple */
.no-js .site-nav .menu {
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  display: grid !important;
  grid-template-columns: 1fr;
  padding: 8px var(--gutter) 12px;
}

/* ----------------------------------------------------------------------
  8) Shared UI Pieces
---------------------------------------------------------------------- */
.recognitions-list {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2.6vw, 24px);
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.recognitions-list li {
  list-style: none;
}
.logo-box {
  display: inline-block;
}
.recognitions-list img,
.logo-box img {
  height: clamp(64px, 8vw, 120px);
  width: auto;
  object-fit: contain;
  filter: saturate(0.96) contrast(1.05);
}

/* Generic card surface */
.card-surface {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: clamp(16px, 3vw, 28px);
}

/* Section lead */
.section-lead {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  max-width: 70ch;
}

/* Utilities */
.hide-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ----------------------------------------------------------------------
  9) Progressive Fallbacks (no color-mix/backdrop-filter)
---------------------------------------------------------------------- */
@supports not (background: color-mix(in oklab, white, black)) {
  .nav {
    background: rgba(0, 0, 0, 0.94);
  }
  .lang summary,
  .lang-list,
  .site-nav .menu {
    background-color: rgba(0, 0, 0, 0.88);
  }
}

@supports (
  (-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))
) {
  .lang summary,
  .lang-list,
  .site-nav .menu {
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
  }
}

/* ----------------------------------------------------------------------
  10) Reduced Motion / Print
---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: #fff !important;
  }
  body,
  a {
    color: #000;
  }
  .nav,
  .ln {
    display: none !important;
  }
  a {
    text-decoration: underline;
  }
}

/* ----------------------------------------------------------------------
  11) Widescreen token tuning
---------------------------------------------------------------------- */
@media (min-width: 1440px) {
  :root {
    --max-w: clamp(1200px, 76vw, 1420px);
    --gutter: clamp(18px, 2.6vw, 40px);
    --bg-grad-pos: 60% -12%;
    --nav-font-size: 16.5px;
    --nav-opsz: 16;
  }
  .section-lead {
    max-width: 76ch;
  }
}
@media (min-width: 1920px) {
  :root {
    --max-w: clamp(1280px, 72vw, 1520px);
    --gutter: clamp(20px, 2vw, 48px);
    --bg-grad-pos: 58% -12%;
    --nav-font-size: 17px;
    --nav-opsz: 18;
  }
  .section-lead {
    max-width: 80ch;
  }
}

/* ----------------------------------------------------------------------
  12) At a Glance — Icon Cards (mask-based icons)
---------------------------------------------------------------------- */
#key-metrics .metric {
  --icon-size: 48px;
  position: relative;
}
#key-metrics .metric > img {
  display: none;
}
#key-metrics .metric::before {
  content: "";
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
  margin-inline: auto;
  margin-bottom: 12px;
  background: var(--gold);
  -webkit-mask: var(--_mask) center / contain no-repeat;
  mask: var(--_mask) center / contain no-repeat;
  opacity: 0.95;
  transition: filter 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
/* Per-card icon masks */
#metric-area {
  --_mask: url("/svg/factory.svg");
}
#metric-scorpions {
  --_mask: url("/svg/scorpion.svg");
}
#metric-number {
  --_mask: url("/svg/dna.svg");
}
#metric-venom {
  --_mask: url("/svg/laboratory.svg");
}
#key-metrics .metric:hover::before {
  filter: brightness(1.1);
  transform: translateY(-1px);
  opacity: 1;
}

/* ----------------------------------------------------------------------
  13) Quick Actions — Icon Buttons (mask-based icons)
---------------------------------------------------------------------- */
#quick-actions .qa-icon {
  --icon-size: 48px;
  position: relative;
}
#quick-actions .qa-icon > img {
  display: none;
}
#quick-actions .qa-icon::before {
  content: "";
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
  background: var(--gold);
  -webkit-mask: var(--_mask) center / contain no-repeat;
  mask: var(--_mask) center / contain no-repeat;
  opacity: 0.95;
  transition: filter 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
/* Icon masks per item */
#quick-actions .qa-item:nth-child(1) .qa-icon {
  --_mask: url("/svg/phone.svg");
}
#quick-actions .qa-item:nth-child(2) .qa-icon {
  --_mask: url("/svg/phone.svg");
}
#quick-actions .qa-item:nth-child(3) .qa-icon {
  --_mask: url("/svg/email.svg");
}
#quick-actions .qa-card:hover .qa-icon::before,
#quick-actions .qa-card:focus-visible .qa-icon::before {
  filter: brightness(1.1);
  transform: translateY(-1px);
  opacity: 1;
}

/* Respect system Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #key-metrics .metric::before,
  #quick-actions .qa-icon::before {
    transition: none;
    transform: none;
  }
}

/* Optional: make Quick Actions icons larger */
#quick-actions .qa-icon {
  --icon-size: 56px;
}
