/*
Theme Name: BeMatrx
Theme URI: https://bematrx.com
Author: BeMatrx Team
Author URI: https://bematrx.com
Description: Custom theme for BeMatrx — A social mobile application where you live a chosen life.
Version: 0.1.0
License: All Rights Reserved
Text Domain: bematrx
*/

/*
 * BeMatrx Theme — Design Tokens
 * Single source of truth. See docs/DESIGN.md.
 */
:root {
  /* Typography
   * 2026-05-23 — Per-language CJK/Arabic font stacks. Inter ships no CJK
   * or Arabic glyphs, so on those pages browsers fell back to whatever
   * system font happened to be installed (Microsoft YaHei on Windows,
   * PingFang on macOS, etc.) — producing inconsistent weights/shapes
   * across devices. Header.php now conditionally preloads the matching
   * Noto Sans family from Google Fonts, and the rules below pick it up. */
  --bm-font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  /* 2026-05-23 fix: Inter is placed FIRST in every CJK/Arabic stack so the
   * browser draws Latin glyphs (digits, A-Z, punctuation, Cyrillic) from
   * Inter and only falls through to Noto for the CJK/Arabic characters
   * Inter doesn't ship. Net effect: stat numbers "90 / 54 / 12" and
   * "iOS / Android / 17+" look identical across all 12 locales while
   * native script renders correctly with the proper Noto variant. */
  --bm-font-ar:   "Inter", "Noto Sans Arabic", -apple-system, sans-serif;
  --bm-font-zh-tw:"Inter", "Noto Sans TC", "Noto Sans SC", -apple-system, sans-serif;
  --bm-font-zh-cn:"Inter", "Noto Sans SC", "Noto Sans TC", -apple-system, sans-serif;
  --bm-font-ja:   "Inter", "Noto Sans JP", -apple-system, sans-serif;
  --bm-font-ko:   "Inter", "Noto Sans KR", -apple-system, sans-serif;

  --bm-fs-h1: clamp(2.5rem, 5vw + 1rem, 5rem);
  --bm-fs-h2: clamp(2rem, 3vw + 1rem, 3.5rem);
  --bm-fs-h3: clamp(1.5rem, 1.5vw + 1rem, 2.25rem);
  --bm-fs-h4: clamp(1.25rem, 0.5vw + 1rem, 1.5rem);
  --bm-fs-h5: 1.125rem;
  --bm-fs-h6: 1rem;
  --bm-fs-body-lg: clamp(1.0625rem, 0.3vw + 1rem, 1.25rem);
  --bm-fs-body: 1rem;
  --bm-fs-small: 0.875rem;
  --bm-fs-xs: 0.75rem;

  /* Color */
  --bm-primary: #E8415A;
  --bm-primary-hover: #D63651;
  --bm-primary-soft: #FDEEF1;
  --bm-dark: #1A1A2E;
  --bm-white: #FFFFFF;
  --bm-bg: #FFFFFF;
  --bm-bg-alt: #F5F5FA;
  --bm-text: #1A1A2E;
  /* 2026-05-20 — bumped from #6B7280 (slate-500, 4.45:1 on light bg = AA FAIL)
     to #4B5563 (slate-600, ~7:1 = AA PASS solidly) after live WCAG audit
     showed footer tagline/copyright failing on the #F5F5FA bg. Reaches
     FAQ answer p, footer metrics, hero badge labels — all in one knob.
     --bm-text-subtle was identical (#6B7280) to --bm-text-muted before
     this change; kept in sync so footer__copyright (which uses subtle)
     also benefits without inventing a new variable. */
  --bm-text-muted: #4B5563;
  --bm-text-subtle: #4B5563;
  /* Dark-bg secondary text — replaces hardcoded rgba(255,255,255,0.7-0.75)
     in hero stores-note + CTA subtitle. 0.85 alpha is the readability
     threshold on the hero/CTA dark gradients: still clearly secondary
     (primary text is solid #FFF) but no longer "washed-out / soluk". */
  --bm-text-on-dark-muted: rgba(255, 255, 255, 0.85);
  --bm-border: #E5E7EB;
  --bm-border-strong: #D1D5DB;
  --bm-success: #22C55E;
  --bm-warning: #F59E0B;
  --bm-info: #3B82F6;
  --bm-int: #EC4899;
  --bm-phy: #D97706;
  --bm-inf: #06B6D4;
  --bm-gold: #FFD700;
  --bm-overlay-dark: rgba(26, 26, 46, 0.6);
  --bm-overlay-light: rgba(255, 255, 255, 0.8);

  /* Spacing */
  --bm-space-1: 4px;
  --bm-space-2: 8px;
  --bm-space-3: 16px;
  --bm-space-4: 24px;
  --bm-space-5: 32px;
  --bm-space-6: 48px;
  --bm-space-7: 64px;
  --bm-space-8: 96px;
  --bm-space-9: 128px;

  /* Radius */
  --bm-radius-sm: 6px;
  --bm-radius-md: 12px;
  --bm-radius-lg: 20px;
  --bm-radius-xl: 32px;
  --bm-radius-full: 9999px;

  /* Shadow */
  --bm-shadow-sm: 0 1px 2px rgba(26,26,46,.06), 0 1px 3px rgba(26,26,46,.04);
  --bm-shadow-md: 0 4px 12px rgba(26,26,46,.08), 0 2px 4px rgba(26,26,46,.04);
  --bm-shadow-lg: 0 12px 32px rgba(26,26,46,.10), 0 4px 12px rgba(26,26,46,.06);
  --bm-shadow-xl: 0 24px 64px rgba(26,26,46,.14), 0 8px 24px rgba(26,26,46,.08);
  --bm-shadow-primary: 0 8px 24px rgba(232,65,90,.30);

  /* Motion */
  --bm-dur-fast: 150ms;
  --bm-dur-base: 300ms;
  --bm-dur-slow: 600ms;
  --bm-dur-hero: 1200ms;
  --bm-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --bm-ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --bm-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Breakpoints (reference only — CSS uses min-width media queries) */
  --bm-bp-md: 768px;
  --bm-bp-lg: 1024px;
  --bm-bp-xl: 1280px;

  /* Z-index */
  --bm-z-base: 1;
  --bm-z-dropdown: 100;
  --bm-z-sticky: 200;
  --bm-z-overlay: 300;
  --bm-z-modal: 400;
  --bm-z-toast: 500;

  /* Layout
     --bm-header-height: fixed header'ın yüksekliği.
     --bm-section-height: bölüm yüksekliği = viewport - header. 100vh
     yerine bunu kullanmak header arkasına background taşmasını ve
     "üst boşluk fazla" hissini engeller. */
  --bm-header-height: 72px;
  --bm-section-height: calc(100vh - var(--bm-header-height));
  --bm-section-height-dvh: calc(100dvh - var(--bm-header-height));

  /* Document pages scale (Help Center, Legal, About, etc.)
     — used only inside .bm-help / .bm-legal / .bm-doc-page scopes.
     — ana sayfa (bm-hero, bm-features vb.) bu tokenları kullanmaz. */
  --bm-doc-fs-title:     clamp(1.25rem, 0.5vw + 1rem, 1.5rem);    /* 20–24px */
  --bm-doc-fs-h1:        clamp(1.5rem, 1vw + 1rem, 2rem);         /* 24–32px (body hero h1) */
  --bm-doc-fs-h2:        clamp(1.125rem, 0.25vw + 1rem, 1.25rem); /* 18–20px */
  --bm-doc-fs-h3:        clamp(1rem, 0.15vw + 1rem, 1.0625rem);   /* 16–17px */
  --bm-doc-fs-h4:        1.0625rem;  /* 17px */
  --bm-doc-fs-body:      1rem;       /* 16px */
  --bm-doc-fs-lead:      1.0625rem;  /* 17px */
  --bm-doc-fs-small:     0.875rem;   /* 14px */
  --bm-doc-fs-xs:        0.75rem;    /* 12px */

  --bm-doc-section-gap:  clamp(2rem, 3vw, 3rem);      /* 32–48px */
  --bm-doc-title-gap:    clamp(1rem, 1.5vw, 1.5rem);  /* 16–24px */
  --bm-doc-para-gap:     1rem;                         /* 16px */
  --bm-doc-padding-y:    clamp(1.5rem, 3vw, 3rem);    /* 24–48px */
}

/* RTL + CJK font swaps — explicit per-locale so Traditional Chinese gets
   Noto TC (not SC), Japanese gets JP, Korean gets KR. */
html[lang="ar"]    body { font-family: var(--bm-font-ar); }
html[lang="zh-tw"] body { font-family: var(--bm-font-zh-tw); }
html[lang="zh-cn"] body { font-family: var(--bm-font-zh-cn); }
html[lang="ja"]    body { font-family: var(--bm-font-ja); }
html[lang="ko"]    body { font-family: var(--bm-font-ko); }

/* 2026-05-25 — Inline SVG icon helper (Sprint #23).
   bm_icon('name', extra_class) → `<svg class="bm-icon">...<use/></svg>`.
   Sprite footer'da defined. width/height:1em currentColor inherit ile parent
   font-size'a ölçeklenir; vertical-align baseline ile inline text içinde
   harf gibi davranır. flex-shrink:0 flex container'larda büzülmesin. */
.bm-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}
/* Phosphor "fill" weight'ler — solid shapes, stroke yok */
.bm-icon--fill {
  fill: currentColor;
  stroke: none;
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 2026-05-25 — scroll-behavior:smooth WAS unconditional. Vestibular
   disorder kullanıcıları için reduced-motion'da instant scroll. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* Horizontal-scroll defense — eğer bir element viewport'tan taşarsa
   body x-scroll yaratmasın. `clip` `hidden`'dan farklı: scroll context
   yaratmaz, dolayısıyla position:sticky pattern'lerini bozmaz.
   Tarayıcı destek: Safari 16+, Chrome 90+, Firefox 81+. Eski tarayıcılar
   declaration'ı yoksayar, mevcut davranış (taşma serbest) korunur. */
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--bm-font-sans);
  font-size: var(--bm-fs-body);
  line-height: 1.65;
  color: var(--bm-text);
  background: var(--bm-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--bm-dark); }
h1 { font-size: var(--bm-fs-h1); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: var(--bm-fs-h2); font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
h3 { font-size: var(--bm-fs-h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
h4 { font-size: var(--bm-fs-h4); font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
h5 { font-size: var(--bm-fs-h5); font-weight: 600; line-height: 1.4; }
h6 { font-size: var(--bm-fs-h6); font-weight: 600; line-height: 1.4; }
p  { margin: 0 0 var(--bm-space-3); }
a  { color: var(--bm-primary); text-decoration: none; transition: color var(--bm-dur-fast) var(--bm-ease-out); }
a:hover { color: var(--bm-primary-hover); }
img, svg, video { max-width: 100%; height: auto; display: block; }

/* Container */
.bm-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--bm-space-3);
}
@media (min-width: 1024px) {
  .bm-container { padding-inline: var(--bm-space-5); }
}

/* Section */
.bm-section { padding-block: var(--bm-space-8); }
@media (min-width: 1024px) {
  .bm-section { padding-block: var(--bm-space-9); }
}
.bm-section--alt { background: var(--bm-bg-alt); }

/* ===== Buttons ===== */
.bm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--bm-space-3) var(--bm-space-5);
  font-size: var(--bm-fs-body);
  font-weight: 600;
  border-radius: var(--bm-radius-md);
  text-decoration: none;
  transition: transform var(--bm-dur-fast) var(--bm-ease-out),
              background var(--bm-dur-fast) var(--bm-ease-out),
              box-shadow var(--bm-dur-fast) var(--bm-ease-out);
  border: 1px solid transparent;
  cursor: pointer;
}
.bm-btn--primary {
  background: var(--bm-primary);
  color: var(--bm-white);
  box-shadow: var(--bm-shadow-primary);
}
.bm-btn--primary:hover {
  background: var(--bm-primary-hover);
  color: var(--bm-white);
  transform: translateY(-1px);
}
.bm-btn--ghost {
  background: transparent;
  color: var(--bm-dark);
  border-color: var(--bm-border-strong);
}
.bm-btn--ghost:hover {
  background: var(--bm-bg-alt);
  color: var(--bm-dark);
}

/* ===== Hero ===== */
.bm-hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: var(--bm-space-6);
}
.bm-hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, var(--bm-primary-soft) 0%, transparent 60%);
  z-index: var(--bm-z-base);
  pointer-events: none;
}
.bm-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bm-space-7);
  align-items: center;
}
@media (min-width: 1024px) {
  .bm-hero__inner {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--bm-space-8);
  }
}

.bm-hero__copy { max-width: 36rem; }

.bm-hero__eyebrow {
  display: inline-block;
  padding: var(--bm-space-1) var(--bm-space-3);
  background: var(--bm-primary-soft);
  color: var(--bm-primary);
  font-size: var(--bm-fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: var(--bm-radius-full);
  margin-bottom: var(--bm-space-4);
}
.bm-hero__title {
  font-size: clamp(2.25rem, 3.5vw + 1rem, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--bm-space-4);
}
.bm-hero__lead {
  font-size: var(--bm-fs-body-lg);
  color: var(--bm-text-muted);
  max-width: 36rem;
  margin-bottom: var(--bm-space-5);
}
.bm-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bm-space-3);
}
.bm-hero__stores { display: flex; flex-wrap: wrap; gap: var(--bm-space-3); }
.bm-hero__store { display: inline-block; pointer-events: none; opacity: 0.85; cursor: default; }
.bm-hero__store img { width: 150px; height: auto; display: block; }

.bm-hero__visual {
  position: relative;
  width: 100%;
  max-width: 30rem;
  min-height: 480px;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
}
.bm-hero__phone {
  position: absolute;
  top: 4%; left: 18%; right: 18%; bottom: 4%;
  background: #0A0A15;
  border: 6px solid #0A0A15;
  border-radius: 36px;
  box-shadow: var(--bm-shadow-xl);
  transform: rotate(-4deg);
  overflow: hidden;
}
.bm-hero__phone-notch {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 20px;
  background: #0A0A15;
  border-radius: 0 0 var(--bm-radius-md) var(--bm-radius-md);
  z-index: 3;
}
.bm-hero__phone-screen {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: linear-gradient(165deg, #1A1A2E 0%, #2D1B3D 50%, #1A1A2E 100%);
  overflow: hidden;
}

/* Fake BeMatrx app UI inside hero phone */
.bm-app {
  position: absolute; inset: 0;
  padding: 32px 16px 16px;
  display: flex; flex-direction: column; gap: 12px;
  color: #fff; font-size: 11px;
}
.bm-app__topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: rgba(255,255,255,0.6); padding: 0 4px;
}
.bm-app__time { font-weight: 600; color: #fff; }

.bm-app__stats {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; background: rgba(255,255,255,0.06);
  border-radius: 12px; backdrop-filter: blur(10px);
}
.bm-stat {
  display: grid; grid-template-columns: 28px 1fr 24px;
  align-items: center; gap: 8px;
}
.bm-stat__label { font-size: 9px; font-weight: 700; letter-spacing: 0.05em; }
.bm-stat--int .bm-stat__label { color: var(--bm-int); }
.bm-stat--phy .bm-stat__label { color: var(--bm-phy); }
.bm-stat--inf .bm-stat__label { color: var(--bm-inf); }
.bm-stat__bar {
  height: 5px; background: rgba(255,255,255,0.12);
  border-radius: var(--bm-radius-full); overflow: hidden;
}
.bm-stat__bar span { display: block; height: 100%; border-radius: inherit; }
.bm-stat--int .bm-stat__bar span { background: var(--bm-int); }
.bm-stat--phy .bm-stat__bar span { background: var(--bm-phy); }
.bm-stat--inf .bm-stat__bar span { background: var(--bm-inf); }
.bm-stat__val { font-size: 10px; font-weight: 700; text-align: right; color: #fff; }

.bm-app__hero {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  background: linear-gradient(135deg, rgba(232,65,90,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.bm-app__avatar {
  width: 44px; height: 44px;
  border-radius: var(--bm-radius-full);
  background: linear-gradient(135deg, var(--bm-primary), #8B5CF6);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 12px rgba(232,65,90,0.4);
}
.bm-app__name { font-size: 14px; font-weight: 700; color: #fff; }
.bm-app__tier { font-size: 10px; color: #10B981; font-weight: 600; letter-spacing: 0.03em; }

.bm-app__wallet {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; background: rgba(255,255,255,0.06);
  border-radius: 12px; margin-top: auto;
}
.bm-app__wallet-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 600; color: #fff;
}
.bm-app__wallet-row--muted { font-size: 10px; color: rgba(255,255,255,0.6); font-weight: 500; }
.bm-app__coins { color: var(--bm-gold); font-weight: 700; }
.bm-hero__card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--bm-space-2);
  padding: var(--bm-space-2) var(--bm-space-3);
  background: var(--bm-bg);
  border-radius: var(--bm-radius-md);
  box-shadow: var(--bm-shadow-lg);
  font-size: var(--bm-fs-small);
  font-weight: 600;
  color: var(--bm-dark);
  white-space: nowrap;
}
.bm-hero__card-icon {
  font-size: 1.25rem;
}
.bm-hero__card--xp { top: 6%; right: -4%; }
.bm-hero__card--level { top: 46%; left: -8%; }
.bm-hero__card--job { bottom: 8%; right: -2%; }


/* ===== Header (WhatsApp-style) ===== */
body { padding-top: 72px; }
body.admin-bar { padding-top: 104px; }
.bm-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: var(--bm-z-sticky);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--bm-dur-base) var(--bm-ease-out),
              background var(--bm-dur-base) var(--bm-ease-out);
}
.bm-header.is-scrolled {
  border-bottom-color: var(--bm-border);
  background: rgba(255,255,255,0.98);
}
.bm-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: var(--bm-space-5);
}
.bm-header__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.bm-header__logo-wordmark { height: 24px; width: auto; display: block; }
.bm-header__nav {
  display: none; align-items: center; gap: var(--bm-space-5);
  flex: 1; margin-left: var(--bm-space-6);
}
.bm-header__nav a {
  font-size: 15px; font-weight: 500; color: var(--bm-text-muted);
  text-decoration: none;
  transition: color var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-header__nav a:hover { color: var(--bm-dark); }
@media (min-width: 1024px) { .bm-header__nav { display: flex; } }
.bm-header__right {
  display: flex; align-items: center; gap: var(--bm-space-3); flex-shrink: 0;
}
.bm-header__burger {
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; width: 40px; height: 40px;
  background: transparent; border: 0; cursor: pointer; padding: 8px;
  /* iOS Safari double-tap detection için ~300ms tap delay'i kapatır.
     touch-action touch-handling hint'i; non-touch cihazlarda no-op,
     bu yüzden mobile @media yerine default scope'ta. */
  touch-action: manipulation;
}
.bm-header__burger span {
  display: block; width: 100%; height: 2px;
  background: var(--bm-dark); border-radius: 2px;
  transition: transform var(--bm-dur-fast) var(--bm-ease-out),
              opacity var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bm-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bm-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 1024px) { .bm-header__burger { display: none; } }

/* Mobile (≤768px) — header inceltme: variable + body padding + sizing.
   --bm-header-height variable'ı global cascade — sticky offset, scroll-margin
   gibi türev değerler bu üzerinden hesaplanır, otomatik güncellenir. */
@media (max-width: 768px) {
  :root { --bm-header-height: 56px; }
  body { padding-top: 56px; }
  body.admin-bar { padding-top: 88px; }
  .bm-header__inner { height: 56px; }
  .bm-header__logo-wordmark { height: 18px; }
  .bm-header__burger { width: 36px; height: 36px; padding: 7px; }
}

/* Header language dropdown */
.bm-header__langs { position: relative; display: none; }
@media (min-width: 1024px) { .bm-header__langs { display: block; } }
.bm-header__lang-toggle { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--bm-border); border-radius: var(--bm-radius-md); padding: 12px 20px; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--bm-text-muted); cursor: pointer; transition: all var(--bm-dur-fast) var(--bm-ease-out); }
.bm-header__lang-toggle:hover { color: var(--bm-dark); border-color: var(--bm-border-strong); }
.bm-header__lang-toggle svg { transition: transform var(--bm-dur-fast) var(--bm-ease-out); }
.bm-header__lang-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.bm-header__lang-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px; background: var(--bm-white); border: 1px solid var(--bm-border); border-radius: var(--bm-radius-md); box-shadow: var(--bm-shadow-lg); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all var(--bm-dur-fast) var(--bm-ease-out); z-index: var(--bm-z-dropdown); }
.bm-header__langs.is-open .bm-header__lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.bm-header__lang-item { display: block; padding: 8px 12px; font-size: 14px; color: var(--bm-text); text-decoration: none; border-radius: var(--bm-radius-sm); transition: background var(--bm-dur-fast) var(--bm-ease-out); }
.bm-header__lang-item:hover { background: var(--bm-bg-alt); }
.bm-header__lang-item.is-active { color: var(--bm-primary); font-weight: 600; background: var(--bm-primary-soft); }

/* ===== Mobile drawer — header altından, sol radius, sticky lang bottom-sheet ===== */
.bm-mobile-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: calc(var(--bm-z-dropdown) - 1);
  /* Transparent: no dim/grey effect on page content when menu opens.
   * Backdrop is kept (not removed) so click-outside-to-close still works. */
  background: transparent;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--bm-ease-out);
}
.bm-mobile-backdrop.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 1024px) { .bm-mobile-backdrop { display: none !important; } }

.bm-header__mobile {
  position: fixed;
  top: var(--bm-header-height, 64px); right: 0;
  width: min(65vw, 280px);
  max-height: calc(100vh - var(--bm-header-height, 64px));
  max-height: calc(100dvh - var(--bm-header-height, 64px));
  background: var(--bm-bg);
  box-shadow: var(--bm-shadow-xl);
  border-radius: 0;
  display: none; flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms var(--bm-ease-out);
  z-index: var(--bm-z-dropdown);
  overflow: hidden;
}
.bm-header__mobile:not([hidden]) { display: flex; }
.bm-header__mobile.is-open { transform: translateX(0); }
[dir="rtl"] .bm-header__mobile {
  right: auto; left: 0; transform: translateX(-100%);
  border-radius: 0;
}
[dir="rtl"] .bm-header__mobile.is-open { transform: translateX(0); }
@media (min-width: 1024px) { .bm-header__mobile { display: none !important; } }

.bm-mobile-drawer__nav {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  padding: 0;
  display: flex; flex-direction: column;
}

.bm-mobile-section { border-bottom: 1px solid var(--bm-border); }
.bm-mobile-section:last-child { border-bottom: none; }
.bm-mobile-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 0 var(--bm-space-4);
  height: 48px; min-height: 48px;
  box-sizing: border-box;
  font-size: 16px; font-weight: 600; color: var(--bm-dark);
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--bm-space-3);
  overflow: hidden;
}
.bm-mobile-section > summary::-webkit-details-marker { display: none; }
.bm-mobile-section__label {
  display: inline-flex; align-items: center; gap: var(--bm-space-3);
  min-width: 0; overflow: hidden;
}
.bm-mobile-section__label > span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-mobile-section__icon {
  font-size: 20px; color: var(--bm-text-muted);
  width: 20px; flex-shrink: 0; text-align: center;
  transition: color var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-mobile-section.is-expanded > summary .bm-mobile-section__icon { color: var(--bm-primary); }
.bm-mobile-section__caret {
  font-size: 14px; color: var(--bm-text-muted);
  transition: transform 250ms var(--bm-ease-out);
}
.bm-mobile-section.is-expanded > summary .bm-mobile-section__caret { transform: rotate(180deg); }

/* JS-controlled accordion. 2026-05-20: max-height (LAYOUT, reflow each
   frame) replaced with grid-template-rows 0fr→1fr on the parent
   <details>. fr-unit interpolation is layout but the engine handles it
   natively at near-native speed; opacity is compositor-only. Sibling
   .bm-mobile-section blocks still get pushed down by the expanding
   grid track, preserving the native akordeon flow (transform+opacity
   alone would overlay siblings — wrong UX for vertical menu). */
/* 2026-05-23 fix — switched from `display:grid + grid-template-rows: auto 0fr→1fr`
   pattern to max-height transition. The grid-fr approach is theoretically
   clean (animates intrinsic content height) but on Safari iOS + Chrome
   Android the 1fr track inside a `height:auto` `<details>` parent
   evaluated to 0, so accordion items never grew past the bottom padding
   (~8px). max-height with a generous cap is boring but works everywhere. */
.bm-mobile-section__items {
  overflow: hidden;
  opacity: 0;
  display: flex; flex-direction: column;
  padding: 0 0 var(--bm-space-2) var(--bm-space-5);
  max-height: 0;
  transition: max-height 280ms var(--bm-ease-out),
              opacity   220ms var(--bm-ease-out);
}
.bm-mobile-section.is-expanded > .bm-mobile-section__items {
  opacity: 1;
  /* 600px clears the widest menu (5 items × ~50px + padding) with
     headroom. Caps gracefully if any menu grows beyond — content
     scrolls within because the drawer itself is overflow-y:auto. */
  max-height: 600px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.bm-mobile-section__items a {
  display: block; padding: 14px 12px; font-size: 15px; font-weight: 500;
  color: var(--bm-text-muted); text-decoration: none; border-radius: var(--bm-radius-sm);
  transition: background var(--bm-dur-fast) var(--bm-ease-out), color var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-mobile-section__items a:hover { background: var(--bm-bg-alt); color: var(--bm-dark); }

/* 5th section: language picker — 12 dil var, generic 600px max-height drawer
   yüksekliğini aştığı için son birkaç dil mobilde alta taşıyordu. Dil
   bölümüne özel viewport-relative cap koyup kendi içinde scroll yap. */
.bm-mobile-section--lang.is-expanded > .bm-mobile-section__items {
  max-height: min(48vh, 420px);
}
.bm-mobile-lang-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px;
  color: var(--bm-text); text-decoration: none; font-size: 14px;
  border-radius: var(--bm-radius-sm);
  transition: background var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-mobile-lang-item:hover { background: var(--bm-bg-alt); }
.bm-mobile-lang-item.is-active {
  color: var(--bm-primary); font-weight: 600; background: var(--bm-primary-soft);
}
.bm-mobile-lang-item .ph-check { font-size: 14px; }

/* Section stagger reveal on drawer open — 5 sections (4 nav + 1 lang) */
@keyframes bm-mobile-section-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bm-header__mobile.is-open .bm-mobile-section {
  animation: bm-mobile-section-reveal 250ms var(--bm-ease-out) both;
}
.bm-header__mobile.is-open .bm-mobile-section:nth-child(1) { animation-delay: 150ms; }
.bm-header__mobile.is-open .bm-mobile-section:nth-child(2) { animation-delay: 230ms; }
.bm-header__mobile.is-open .bm-mobile-section:nth-child(3) { animation-delay: 310ms; }
.bm-header__mobile.is-open .bm-mobile-section:nth-child(4) { animation-delay: 390ms; }
.bm-header__mobile.is-open .bm-mobile-section:nth-child(5) { animation-delay: 470ms; }

/* Reduced motion fallback */
@media (prefers-reduced-motion: reduce) {
  .bm-mobile-backdrop,
  .bm-header__mobile,
  .bm-mobile-section,
  .bm-mobile-section__caret,
  .bm-mobile-section__icon,
  .bm-mobile-section__items,
  .bm-mobile-lang-item {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== Header desktop nav dropdowns (4 menus mirroring footer) ===== */
.bm-nav-dropdown { position: relative; }
.bm-nav-dropdown__toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer; padding: 8px 4px;
  font-family: inherit; font-size: 15px; font-weight: 500;
  color: var(--bm-text-muted);
  transition: color var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-nav-dropdown__toggle:hover { color: var(--bm-dark); }
.bm-nav-dropdown__arrow { transition: transform var(--bm-dur-fast) var(--bm-ease-out); }
.bm-nav-dropdown__toggle[aria-expanded="true"] .bm-nav-dropdown__arrow { transform: rotate(180deg); }
.bm-nav-dropdown__toggle[aria-expanded="true"] { color: var(--bm-dark); }
.bm-nav-dropdown__menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 200px;
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-md);
  box-shadow: var(--bm-shadow-lg);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--bm-dur-fast) var(--bm-ease-out),
              transform var(--bm-dur-fast) var(--bm-ease-out),
              visibility var(--bm-dur-fast);
  z-index: var(--bm-z-dropdown);
}
.bm-nav-dropdown.is-open .bm-nav-dropdown__menu,
.bm-nav-dropdown:hover .bm-nav-dropdown__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.bm-nav-dropdown__item {
  display: block; padding: 9px 12px;
  font-size: 14px; color: var(--bm-text);
  text-decoration: none; border-radius: var(--bm-radius-sm);
  white-space: nowrap;
  transition: background var(--bm-dur-fast) var(--bm-ease-out),
              color var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-nav-dropdown__item:hover {
  background: var(--bm-primary-soft);
  color: var(--bm-primary);
}

/* ===== Section shell ===== */
.bm-section-head { text-align: center; max-width: 48rem; margin: 0 auto var(--bm-space-7); }
.bm-section-head__title { margin: var(--bm-space-3) 0; }
.bm-section-head__lead { font-size: clamp(1.0625rem, .3vw + 1rem, 1.25rem); color: var(--bm-text-muted); margin: 0; }

/* ===== Features ===== */
.bm-features { display: grid; grid-template-columns: 1fr; gap: var(--bm-space-4); }
@media (min-width: 768px) { .bm-features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bm-features { grid-template-columns: repeat(3, 1fr); gap: var(--bm-space-5); } }
.bm-feature {
  padding: var(--bm-space-5);
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-lg);
  transition: transform var(--bm-dur-base) var(--bm-ease-out),
              box-shadow var(--bm-dur-base) var(--bm-ease-out);
}
.bm-feature:hover { transform: translateY(-4px); box-shadow: var(--bm-shadow-lg); }
.bm-feature__icon {
  width: 56px; height: 56px;
  border-radius: var(--bm-radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--bm-space-4);
  font-size: 28px;
}
.bm-feature--primary .bm-feature__icon { background: var(--bm-primary-soft); color: var(--bm-primary); }
.bm-feature--int .bm-feature__icon     { background: rgba(236,72,153,0.10); color: var(--bm-int); }
.bm-feature--inf .bm-feature__icon     { background: rgba(6,182,212,0.10);  color: var(--bm-inf); }
.bm-feature--phy .bm-feature__icon     { background: rgba(217,119,6,0.10);  color: var(--bm-phy); }
.bm-feature--success .bm-feature__icon { background: rgba(34,197,94,0.10);  color: var(--bm-success); }
.bm-feature--purple .bm-feature__icon  { background: rgba(139,92,246,0.10); color: #8B5CF6; }
.bm-feature__title { font-size: 1.25rem; font-weight: 600; margin: 0 0 10px; }
.bm-feature__desc { color: var(--bm-text-muted); margin: 0; font-size: 15px; line-height: 1.6; }

/* ===== How it works ===== */
.bm-steps { display: grid; grid-template-columns: 1fr; gap: var(--bm-space-6); max-width: 64rem; margin: 0 auto; }
@media (min-width: 768px) { .bm-steps { grid-template-columns: repeat(3, 1fr); } }
.bm-step { text-align: center; }
.bm-step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border-radius: var(--bm-radius-full);
  background: var(--bm-primary); color: var(--bm-white);
  font-size: 24px; font-weight: 800;
  margin-bottom: var(--bm-space-4);
  box-shadow: var(--bm-shadow-primary);
}
.bm-step__title { font-size: 1.25rem; font-weight: 600; margin: 0 0 10px; }
.bm-step__desc { color: var(--bm-text-muted); font-size: 15px; margin: 0; line-height: 1.6; }

/* ===== Screenshots ===== */
.bm-screens { display: grid; grid-template-columns: 1fr; gap: var(--bm-space-5); align-items: center; max-width: 56rem; margin: 0 auto; }
@media (min-width: 768px) { .bm-screens { grid-template-columns: repeat(3, 1fr); } }
.bm-screen {
  aspect-ratio: 9 / 19;
  border-radius: 36px;
  overflow: hidden;
  background: var(--bm-dark);
  padding: 6px;
  box-shadow: var(--bm-shadow-xl);
}
.bm-screen img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; display: block; }
@media (min-width: 768px) { .bm-screen--lifted { transform: translateY(-24px); } }

/* ===== FAQ ===== */
.bm-faq { max-width: 48rem; margin: 0 auto; }
.bm-faq__item { border-bottom: 1px solid var(--bm-border); }
.bm-faq__q {
  width: 100%; background: transparent; border: 0;
  padding: var(--bm-space-4) 0;
  font-family: inherit; font-size: 1.125rem; font-weight: 600;
  color: var(--bm-dark); text-align: left;
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--bm-space-3); cursor: pointer;
}
.bm-faq__plus {
  font-size: 28px; font-weight: 300; color: var(--bm-text-muted);
  transition: transform var(--bm-dur-base) var(--bm-ease-out);
  flex-shrink: 0;
}
.bm-faq__item.is-open .bm-faq__plus { transform: rotate(45deg); color: var(--bm-primary); }
.bm-faq__a { max-height: 0; overflow: hidden; transition: max-height var(--bm-dur-slow) var(--bm-ease-out); }
.bm-faq__item.is-open .bm-faq__a { max-height: 300px; }
.bm-faq__a p { color: var(--bm-text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 var(--bm-space-4); }

/* ===== Final CTA ===== */
.bm-cta { position: relative; padding: var(--bm-space-7) var(--bm-space-3); text-align: center; overflow: hidden; background: var(--bm-dark); color: var(--bm-white); }
.bm-cta__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(232,65,90,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 80% 70%, rgba(6,182,212,0.20) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 50% 50%, rgba(236,72,153,0.15) 0%, transparent 60%);
}
.bm-cta__inner { position: relative; z-index: 1; max-width: 40rem; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.bm-cta__eyebrow { background: rgba(255,255,255,0.12); color: var(--bm-white); }
.bm-cta__title { color: var(--bm-white); margin: var(--bm-space-3) 0; font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem); }
.bm-cta__lead { color: rgba(255,255,255,0.75); font-size: 1rem; margin-bottom: var(--bm-space-4); }
.bm-cta__stores { display: flex; flex-wrap: wrap; gap: var(--bm-space-3); justify-content: center; }

/* ===== Footer (WhatsApp-style) ===== */
.bm-footer {
  background: var(--bm-bg-alt);
  padding: var(--bm-space-8) 0 var(--bm-space-5);
  border-top: 1px solid var(--bm-border);
}
.bm-footer__grid {
  /* Mobile (default): 2-column grid for the 4 link cols (2×2), brand spans full width.
   * Halves footer height vs single-column stack while preserving touch-target padding. */
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--bm-space-6) var(--bm-space-5); margin-bottom: var(--bm-space-7);
}
.bm-footer__brand { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .bm-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: var(--bm-space-5); }
  .bm-footer__brand { grid-column: auto; }
}
.bm-footer__brand { max-width: 22rem; }
.bm-footer__tagline {
  margin-top: var(--bm-space-3); font-size: 14px;
  color: var(--bm-text-muted); line-height: 1.6;
}
.bm-footer__social {
  display: flex; gap: var(--bm-space-3); margin-top: var(--bm-space-4);
}
.bm-footer__social a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  width: 44px; height: 44px; border-radius: var(--bm-radius-full);
  background: var(--bm-bg); color: var(--bm-text-muted);
  border: 1px solid var(--bm-border);
  transition: color var(--bm-dur-fast) var(--bm-ease-out),
              border-color var(--bm-dur-fast) var(--bm-ease-out),
              transform var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-footer__social a:hover {
  color: var(--bm-primary); border-color: var(--bm-primary);
  transform: translateY(-2px);
}
.bm-footer__col h4 {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--bm-dark);
  margin: 0 0 var(--bm-space-3);
}
.bm-footer__col a {
  display: block; font-size: 14px; color: var(--bm-text-muted);
  text-decoration: none; padding: 14px 0;
  transition: color var(--bm-dur-fast) var(--bm-ease-out);
}
.bm-footer__col a:hover { color: var(--bm-primary); }
/* Footer logo */
.bm-footer__logo { display: inline-block; }
.bm-footer__logo img { height: 22px; width: auto; display: block; }

/* Footer bottom */
.bm-footer__bottom { padding-top: 0; }

.bm-footer__copyright { padding-top: var(--bm-space-4); margin-top: var(--bm-space-4); border-top: 1px solid var(--bm-border); font-size: 13px; color: var(--bm-text-subtle); text-align: center; }

/* ===== Mobile overrides ===== */
@media (max-width: 767px) {
  .bm-hero { padding-block: var(--bm-space-5); min-height: auto; }
  .bm-hero__visual { max-width: 22rem; min-height: 420px; margin-top: var(--bm-space-5); }
  .bm-hero__card--xp   { top: 4%; right: 2%; }
  .bm-hero__card--level{ top: 42%; left: 2%; }
  .bm-hero__card--job  { bottom: 4%; right: 2%; }
  .bm-hero__card { font-size: 12px; padding: 8px 12px; }
  .bm-hero__card-icon { font-size: 16px; }
  .bm-section { padding-block: var(--bm-space-7); }
  .bm-section-head { margin-bottom: var(--bm-space-5); }
  .bm-features { gap: var(--bm-space-3); }
  .bm-feature { padding: var(--bm-space-4); }
  .bm-feature__icon { width: 48px; height: 48px; font-size: 24px; }
  .bm-hero__store img { width: 130px; }
  .bm-footer__grid { gap: var(--bm-space-5); }
  .bm-cta { padding: var(--bm-space-6) var(--bm-space-3); }
  .bm-cta__title { font-size: 1.75rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* iOS Safari URL bar düzeltmesi — Hero için dvh fallback. */
@supports (height: 100dvh) {
  .bm-home-hero {
    min-height: var(--bm-section-height-dvh);
  }
}
