/* =========================================================================
   Cobsky — Flux / Neural Canvas Design System
   ========================================================================= */

/* ----- Design tokens ----- */
:root {
  /* Palette */
  --cobalt: #0057FF;
  --cobalt-light: #4F8BFF;
  --violet: #9152B8;
  --coral: #FF6B4A;
  --coral-light: #FF8A6B;
  --turquoise: #2BE0BC;

  /* Deep-ink surfaces */
  --bg: #0B0F1A;
  --surface-1: #131826;
  --surface-2: #1A2030;
  --surface-3: #222A3C;

  /* Text */
  --text: #F5F3EF;
  --text-muted: #A9B2C4;

  /* Signature gradient (Flux : cobalt -> violet -> coral) */
  --flux-gradient: linear-gradient(135deg, #0057FF, #9152B8 50%, #FF6B4A);

  /* 3-font system (per brand kit) */
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-label: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Spacing / shape */
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1160px;
  --header-h: 72px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  font-family: var(--font-body);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Neural Canvas: soft gradient glows (no grid) */
  background-image:
    radial-gradient(900px 600px at 12% -5%, rgba(0, 87, 255, 0.16), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(255, 107, 74, 0.12), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(43, 224, 188, 0.08), transparent 60%);
  background-attachment: fixed;
}

/* Site-wide cursor-tracking glow: a fixed full-viewport radial light
   that follows the pointer on every page. Driven by --mx/--my (px),
   set from main.js. Sits behind content but above the base background. */
:root {
  --mx: 50vw;
  --my: 40vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(300px 300px at var(--mx) var(--my), rgba(0, 87, 255, 0.14), rgba(145, 82, 184, 0.07) 45%, transparent 72%);
  opacity: 0.85;
}

/* Keep the page content above the cursor glow so it stays readable. */
.site-header,
main,
.site-footer { position: relative; z-index: 1; }

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----- Layout helpers ----- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section-head {
  max-width: 680px;
  margin-bottom: 48px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--flux-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ----- Typography ----- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }

.lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-muted);
  line-height: 1.6;
}

.muted { color: var(--text-muted); }

/* ======================================================================
   Header
   ====================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 15, 26, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  background: var(--flux-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand svg { width: 30px; height: 30px; flex: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 10px;
  font-family: var(--font-label);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-cta { margin-left: 8px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ======================================================================
   Buttons
   ====================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.3s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background-image: var(--flux-gradient);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 10px 26px rgba(0, 87, 255, 0.26), 0 4px 14px rgba(255, 107, 74, 0.16);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(0, 87, 255, 0.34), 0 6px 22px rgba(255, 107, 74, 0.22);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(79, 139, 255, 0.32);
  color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(79, 139, 255, 0.1);
  border-color: rgba(79, 139, 255, 0.55);
  transform: translateY(-2px);
}

/* ======================================================================
   Hero
   ====================================================================== */
.hero {
  position: relative;
  padding-block: clamp(72px, 12vw, 150px);
  text-align: center;
}

.hero-symbol {
  width: 84px;
  height: 84px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 8px 30px rgba(0, 87, 255, 0.4));
  animation: float 6s ease-in-out infinite;
}

/* Hero lockup: the Flux mark next to the "Cobsky" wordmark, centered. */
.hero-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: fit-content;
  margin: 0 auto 28px;
}
.hero-lockup .hero-symbol {
  width: 76px;
  height: 76px;
  margin: 0;
  flex: none;
}
.hero-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  letter-spacing: -0.025em;
  /* room for the "y" descender — background-clip:text clips a tight box */
  line-height: 1.12;
  padding-bottom: 0.08em;
  overflow: visible;
  background: var(--flux-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  transform: translateY(8px);
  animation: wordIn 0.7s var(--ease) 0.95s forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hero-wordmark { opacity: 1; transform: none; animation: none; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero h1 {
  max-width: 14ch;
  margin-inline: auto;
}

.hero .lead {
  max-width: 60ch;
  margin: 24px auto 0;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* ======================================================================
   Cards & grids
   ====================================================================== */
.grid {
  display: grid;
  gap: 22px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 139, 255, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.card h3 { margin-bottom: 10px; }

.card p { color: var(--text-muted); font-size: 0.98rem; line-height: 1.55; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 18px;
  background: rgba(0, 87, 255, 0.12);
  border: 1px solid rgba(79, 139, 255, 0.3);
}

.card-icon svg { width: 26px; height: 26px; stroke: var(--cobalt-light); }

/* ======================================================================
   About / split sections
   ====================================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.panel {
  background: linear-gradient(160deg, var(--surface-1), var(--surface-2));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 36px;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 28px;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat .lbl { font-family: var(--font-label); color: var(--text-muted); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }

.feature-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-muted);
}

.feature-list li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border-radius: 6px;
  background: var(--flux-gradient);
}

/* ======================================================================
   CTA band
   ====================================================================== */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: clamp(20px, 4vw, 32px);
  padding: clamp(40px, 7vw, 72px);
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 87, 255, 0.18), rgba(145, 82, 184, 0.16), rgba(255, 107, 74, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: var(--flux-gradient);
  opacity: 0.12;
  z-index: -1;
}

.cta-band h2 { max-width: 18ch; margin-inline: auto; }
.cta-band p { max-width: 52ch; margin: 16px auto 32px; }

/* ======================================================================
   Solutions header rows
   ====================================================================== */
.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.platform-tag svg { width: 22px; height: 22px; }

/* ======================================================================
   Contact
   ====================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}

.contact-info .info-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.contact-info .info-item:last-child { border-bottom: none; }

.contact-info .info-item .card-icon { margin-bottom: 0; }

.contact-info a { color: var(--cobalt-light); }
.contact-info a:hover { text-decoration: underline; }

.form {
  background: linear-gradient(160deg, var(--surface-1), var(--surface-2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 32px;
}

.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 24px; }

.field label {
  display: block;
  font-family: var(--font-label);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  color: var(--text);
}

.field label .req { color: var(--coral-light); }

.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder { color: #6b7488; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cobalt-light);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.22);
}

.field textarea { resize: vertical; min-height: 140px; }

.form-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.form-status {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--turquoise);
  min-height: 1.2em;
}

/* ======================================================================
   Footer
   ====================================================================== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 40px;
  padding-block: 48px 32px;
  background: rgba(11, 15, 26, 0.6);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand { max-width: 320px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--text-muted); font-size: 0.95rem; }

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
}

.footer-col h4 {
  font-family: var(--font-label);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.footer-col ul { list-style: none; display: grid; gap: 9px; }
.footer-col a { color: var(--text-muted); font-size: 0.95rem; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ======================================================================
   Slogan (official Cobsky baseline)
   ====================================================================== */
.slogan {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-slogan {
  display: inline-block;
  margin: 0 auto 22px;
  background: var(--flux-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.footer-slogan {
  display: block;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

/* ======================================================================
   Logo animation (per brand kit — draw-in + bob)
   ====================================================================== */
@keyframes drawIn { to { stroke-dashoffset: 0; } }
@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.78) rotate(-6deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes fluxBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-1.5px) rotate(1.5deg); }
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fluxRun { to { stroke-dashoffset: -84; } }

/* Hero symbol: draw-in on load, then gentle continuous bob */
.hero-symbol {
  transform-box: fill-box;
  transform-origin: center;
  animation: badgeIn 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both,
             fluxBob 3.6s ease-in-out 1.4s infinite;
}
.hero-symbol .flux-path {
  stroke-dasharray: 84;
  stroke-dashoffset: 84;
}
.hero-symbol .flux-d1 { animation: drawIn 1.05s var(--ease) 0.45s forwards; }
.hero-symbol .flux-d2 { animation: drawIn 1.05s var(--ease) 0.65s forwards; }

/* Header / footer marks: continuous gentle bob */
.brand svg {
  transform-box: fill-box;
  transform-origin: center;
  animation: fluxBob 3.6s ease-in-out infinite;
}

/* ======================================================================
   Reveal on scroll
   ====================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ======================================================================
   Responsive
   ====================================================================== */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  /* Mobile nav: the toggle controls a dropdown panel holding links + CTA */
  .nav-toggle { display: flex; order: 2; }

  .nav {
    position: static;
  }

  .nav-panel {
    position: fixed;
    left: 16px;
    right: 16px;
    top: calc(var(--header-h) + 8px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px;
    background: var(--surface-1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-links a { padding: 12px 14px; font-size: 1.02rem; }

  .nav-cta { margin-left: 0; margin-top: 6px; }

  .nav[data-open="true"] .nav-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

@media (max-width: 540px) {
  body { font-size: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .container { padding-inline: 18px; }
  .panel, .form { padding: 24px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-symbol .flux-path { stroke-dashoffset: 0 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body::before { display: none; }
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--turquoise);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ======================================================================
   i18n v2 — Language selector (flag button + dropdown)
   Added after the base design system; follows the same tokens.
   ====================================================================== */
.lang-menu {
  position: relative;
  margin-left: 6px;
  flex: none;
}

/* Trigger: current-language flag + thin chevron. Discreet, nav-like. */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.lang-btn:hover,
.lang-btn:focus-visible,
.lang-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.lang-flag {
  display: block;
  width: 21px;
  height: 14px;
  flex: none;
  border-radius: 3px;
  /* hairline keyline so the white stripe reads on the dark header */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.lang-caret {
  width: 9px;
  height: 6px;
  flex: none;
  stroke: var(--text-muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease), stroke 0.2s var(--ease);
}

.lang-btn:hover .lang-caret,
.lang-btn[aria-expanded="true"] .lang-caret { stroke: var(--text); }
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }

/* Floating panel: dark surface, fine border, soft shadow, short fade/slide. */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 140;
  min-width: 172px;
  padding: 6px;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}

.lang-menu[data-open="true"] .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-family: var(--font-label);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.lang-option:hover,
.lang-option:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.lang-option .lang-flag {
  width: 18px;
  height: 12px;
  border-radius: 2.5px;
}

.lang-option .lang-check {
  width: 13px;
  height: 13px;
  margin-left: auto;
  flex: none;
  stroke: var(--turquoise);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.lang-option.is-current { color: var(--text); }
.lang-option.is-current .lang-check { opacity: 1; }

/* Mobile: keep the flag button in the bar, before the burger; panel stays
   right-aligned under the button so it never overflows the viewport. */
@media (max-width: 760px) {
  .lang-menu { order: 1; margin-left: 0; }
  .lang-dropdown { right: 0; left: auto; }
}
