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

/* ─── DARK THEME (default) ──────────────────────────────────── */
:root {
  --bg-page:          #0a0f1e;
  --bg-mid:           #0f1a2e;
  --bg-card:          #0d1829;
  --text:             #e8f4f8;
  --text-muted:       #7a9ab5;
  --border:           rgba(0, 207, 255, 0.15);
  --accent1:          #00ff88;
  --accent2:          #00cfff;
  --nav-bg:           rgba(10, 15, 30, 0.92);
  --nav-link:         #7a9ab5;
  --badge-bg:         rgba(0, 255, 136, 0.05);
  --badge-border:     rgba(0, 255, 136, 0.3);
  --badge-text:       #00ff88;
  --btn-primary-text: #0a0f1e;
  --footer-bg:        #060c19;
  --toggle-bg:        rgba(255, 255, 255, 0.07);
  --toggle-border:    rgba(255, 255, 255, 0.18);
  --toggle-text:      rgba(255, 255, 255, 0.6);
  --toggle-active:    #ffffff;
  --stat-num:         #00ff88;
}

/* ─── LIGHT THEME ────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-page:          #f4f8ff;
  --bg-mid:           #e6eef8;
  --bg-card:          #ffffff;
  --text:             #1a2540;
  --text-muted:       #4a6280;
  --border:           rgba(0, 100, 180, 0.14);
  --accent1:          #00966a;
  --accent2:          #0076a8;
  --nav-bg:           rgba(244, 248, 255, 0.94);
  --nav-link:         #4a6280;
  --badge-bg:         rgba(0, 150, 106, 0.07);
  --badge-border:     rgba(0, 150, 106, 0.3);
  --badge-text:       #00966a;
  --btn-primary-text: #ffffff;
  --footer-bg:        #d8e6f6;
  --toggle-bg:        rgba(0, 0, 0, 0.05);
  --toggle-border:    rgba(0, 0, 0, 0.16);
  --toggle-text:      rgba(26, 37, 64, 0.55);
  --toggle-active:    #1a2540;
  --stat-num:         #00966a;
}

/* ─── THEME TRANSITIONS ──────────────────────────────────────── */
/* Only structural containers — color is inherited, so p/h3/h4 follow body */
body, nav, section, footer, .stats-bar,
.service-card, .contact-card, .industry-item,
.about-text, .footer-inner {
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease;
}

/* ─── BASE ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0.6;
}
[data-theme="light"] #bg-canvas {
  opacity: 0.08;
  mix-blend-mode: multiply;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-page);
  color: var(--text);
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── NAVBAR ─────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 14px 0;
  /* постоянный тёмный скрим — навбар читаем на любом фоне */
  background: linear-gradient(to bottom, rgba(6,10,22,0.72) 0%, transparent 100%);
  transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}
#navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center;
}
.nav-logo img { height: 44px; object-fit: contain; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.nav-links {
  display: flex; list-style: none; gap: 28px;
  margin-left: 32px;
}
.nav-links a {
  font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 600;
  color: #c8dff0;          /* всегда светлый — читаем на любом фоне */
  text-decoration: none; letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent1); }
/* после скролла — подстраиваемся под тему */
#navbar.scrolled .nav-links a {
  color: var(--nav-link);
  text-shadow: none;
}

/* ─── HAMBURGER ──────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  width: 36px; height: 34px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  border-radius: 6px; cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── MOBILE NAV DROPDOWN ────────────────────────────────────── */
.mobile-nav {
  position: fixed;
  top: 72px; left: 0; right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  z-index: 98;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  display: none;
}
.mobile-nav a {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px; font-weight: 600;
  color: var(--nav-link);
  text-decoration: none;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.03em;
  transition: color 0.2s, background 0.2s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover, .mobile-nav a:active { color: var(--accent1); background: rgba(0,255,136,0.05); }
.mobile-nav .mob-whatsapp { color: var(--accent1); }
[data-theme="light"] .mobile-nav a:hover { background: rgba(0,150,106,0.06); }

/* кнопки навбара — всегда читаемы до скролла */
#navbar:not(.scrolled) .lang-toggle,
#navbar:not(.scrolled) .theme-toggle {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  color: #ffffff;
}
#navbar:not(.scrolled) .lang-opt { color: rgba(255,255,255,0.7); }
#navbar:not(.scrolled) .lang-opt.active { color: #ffffff; }
#navbar:not(.scrolled) .btn-nav {
  background: rgba(0,255,136,0.15);
  border-color: rgba(0,255,136,0.7);
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0,255,136,0.4);
}
#navbar:not(.scrolled) .hamburger {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
}
#navbar:not(.scrolled) .hamburger span { background: #ffffff; }

/* controls block pushed to right */
.nav-controls {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
}

/* language toggle */
.lang-toggle {
  display: flex; align-items: center; gap: 5px;
  background: var(--toggle-bg); border: 1px solid var(--toggle-border);
  border-radius: 6px; padding: 6px 11px; cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--toggle-text);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.lang-toggle:hover { border-color: var(--accent1); }
.lang-sep { opacity: 0.4; }
.lang-opt { transition: color 0.2s; cursor: pointer; padding: 2px 3px; border-radius: 3px; }
.lang-opt:hover { color: var(--accent1); }
.lang-opt.active { color: var(--toggle-active); }

/* theme toggle */
.theme-toggle {
  background: rgba(255,200,40,0.10);
  border: 1px solid rgba(255,200,40,0.45);
  border-radius: 6px; width: 36px; height: 34px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #ffc828;
  box-shadow: 0 0 8px 1px rgba(255,200,40,0.18);
  transition: border-color 0.25s, color 0.25s, background 0.25s, box-shadow 0.25s;
}
.theme-toggle:hover {
  background: rgba(255,200,40,0.20);
  border-color: rgba(255,200,40,0.9);
  color: #ffe566;
  box-shadow: 0 0 14px 3px rgba(255,200,40,0.50), 0 0 32px 6px rgba(255,160,0,0.25);
}
.theme-toggle svg {
  width: 17px; height: 17px;
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.theme-toggle:hover svg { transform: rotate(25deg) scale(1.15); }

/* light mode — moon: blue-violet */
[data-theme="light"] .theme-toggle {
  background: rgba(110,120,255,0.10);
  border-color: rgba(110,120,255,0.45);
  color: #8090ff;
  box-shadow: 0 0 8px 1px rgba(110,120,255,0.20);
}
[data-theme="light"] .theme-toggle:hover {
  background: rgba(110,120,255,0.20);
  border-color: rgba(130,140,255,0.90);
  color: #aab4ff;
  box-shadow: 0 0 14px 3px rgba(110,120,255,0.55), 0 0 32px 6px rgba(80,90,220,0.28);
}

/* sun visible in dark mode, moon visible in light mode */
.icon-sun  { display: block; }
.icon-moon { display: none;  }
[data-theme="light"] .icon-sun  { display: none;  }
[data-theme="light"] .icon-moon { display: block; }

.btn-nav {
  padding: 8px 18px; border-radius: 6px;
  background: rgba(0,255,136,0.1); border: 1px solid var(--accent1);
  color: var(--accent1); font-weight: 600; font-size: 14px;
  text-decoration: none; font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.04em;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-nav:hover {
  background: rgba(0,255,136,0.2);
  box-shadow: 0 0 12px rgba(0,255,136,0.25);
}

/* fast tap on all interactive elements — removes 300ms delay */
.btn-primary, .btn-outline, .btn-nav,
.hamburger, .lang-toggle, .lang-opt,
.theme-toggle, .lb-arrow, .lb-close,
.tg-item, .chess-item {
  touch-action: manipulation;
}
[data-theme="light"] .btn-nav {
  background: rgba(0, 150, 106, 0.08);
  border-color: var(--accent1);
}

/* ─── HERO ───────────────────────────────────────────────────── */
#hero {
  position: relative; height: 100vh; min-height: 640px;
  display: flex; align-items: center; justify-content: flex-start;
  background: #0a0f1e; overflow: hidden;
}

/* background image with Ken Burns zoom */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('image/Gemini_Generated.png') center center / cover no-repeat;
  animation: kenBurns 22s ease-in-out infinite alternate;
  will-change: transform;
  filter: brightness(1.55) contrast(1.05);
}
[data-theme="light"] .hero-bg {
  background-image: url('image/Gemini_Generated_white.png');
  filter: brightness(0.88) contrast(1.6) saturate(1.3);
}
@keyframes kenBurns {
  from { transform: scale(1);    }
  to   { transform: scale(1.07); }
}

/* gradient overlay — dark on left for text, transparent on right for image */
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(
    100deg,
    rgba(10,15,30,0.93) 0%,
    rgba(10,15,30,0.82) 30%,
    rgba(10,15,30,0.55) 52%,
    rgba(10,15,30,0.18) 72%,
    rgba(10,15,30,0.05) 100%
  );
}
[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    100deg,
    rgba(8,14,38,0.96) 0%,
    rgba(8,14,38,0.90) 28%,
    rgba(8,14,38,0.70) 50%,
    rgba(8,14,38,0.22) 72%,
    transparent 100%
  );
}

#circuit-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 2; pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.75;
  will-change: transform;
}
/* on light image screen→white, use multiply so traces darken the light board */
[data-theme="light"] #circuit-canvas {
  mix-blend-mode: normal;
  opacity: 0.92;
}

.hero-content {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left;
  padding: 0 0 0 8%;
  max-width: 640px;
  animation: heroFadeUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-logo-wrap {
  width: 120px; height: 120px; border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(0,255,136,0.25);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 40px rgba(0,255,136,0.15), 0 0 80px rgba(0,207,255,0.08);
}
.hero-logo { width: 90px; height: 90px; object-fit: contain; }
.hero-sub {
  font-family: 'Rajdhani', sans-serif; font-size: 13px;
  letter-spacing: 0.25em; color: #00cfff; text-transform: uppercase;
  margin-bottom: 16px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.8);
}
.hero-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(48px, 8vw, 86px);
  font-weight: 700; line-height: 1.05; color: #fff; margin-bottom: 18px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}
.hero-title .line1 { display: block; color: #00ff88; }
.hero-title .line2 { display: block; }
.hero-desc {
  font-size: 17px; color: rgba(232,244,248,0.85);
  max-width: 520px; line-height: 1.7; margin-bottom: 36px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-start; }
.btn-primary {
  padding: 14px 32px; border-radius: 8px;
  background: linear-gradient(135deg, #00ff88, #00d4a0);
  color: #0a0f1e; font-weight: 700; font-size: 15px;
  text-decoration: none; font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.05em; transition: box-shadow 0.25s, transform 0.2s;
}
.btn-primary:hover {
  box-shadow: 0 0 28px rgba(0,255,136,0.5);
  transform: translateY(-2px);
}
.btn-outline {
  padding: 14px 32px; border-radius: 8px;
  border: 1.5px solid rgba(0,207,255,0.55);
  color: #00cfff; font-weight: 600; font-size: 15px;
  text-decoration: none; font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.05em; transition: border-color 0.2s, box-shadow 0.25s;
}
.btn-outline:hover {
  border-color: #00cfff;
  box-shadow: 0 0 18px rgba(0,207,255,0.25);
}
.hero-scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 10;
}
.hero-scroll-hint span {
  display: block; width: 2px; height: 48px;
  background: linear-gradient(to bottom, #00ff88, transparent);
  animation: scrollPulse 1.8s ease-in-out infinite; margin: 0 auto;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.2; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.3); }
}

/* ─── STATS BAR ──────────────────────────────────────────────── */
.stats-bar {
  background: var(--bg-mid);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; justify-content: center; align-items: center;
  padding: 28px 24px; flex-wrap: wrap;
}
.stat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 48px; gap: 4px;
}
.stat-num {
  font-family: 'Rajdhani', sans-serif; font-size: 44px;
  font-weight: 700; color: var(--stat-num); line-height: 1;
}
.stat-plus {
  font-size: 28px; color: var(--stat-num);
  font-weight: 700; vertical-align: super;
}
.stat-label {
  font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.stat-divider { width: 1px; height: 48px; background: var(--border); flex-shrink: 0; }

/* ─── SECTIONS ───────────────────────────────────────────────── */
section { padding: 96px 0; background: var(--bg-page); }
.alt-section { background: var(--bg-mid); }

.section-label {
  font-family: 'Rajdhani', sans-serif; font-size: 12px;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent2); margin-bottom: 16px;
}
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700; line-height: 1.1;
  color: var(--text); margin-bottom: 56px;
}
.highlight { color: var(--accent1); }

/* ─── ABOUT ──────────────────────────────────────────────────── */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center;
}
.about-text .lead-text {
  font-size: 18px; line-height: 1.75; color: var(--text); margin-bottom: 20px;
}
.about-text p { font-size: 15px; color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }
.about-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.badge {
  padding: 5px 14px; border-radius: 100px;
  border: 1px solid var(--badge-border); color: var(--badge-text);
  font-size: 12px; font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.06em; background: var(--badge-bg);
}

/* About photo magazine layout */
.about-chess {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  width: 100%;
  height: 400px;
}
.chess-item {
  border-radius: 14px;
  overflow: visible;
  border: 1.5px solid rgba(0,255,136,0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.28);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.chess-item > img {
  border-radius: 13px;
}
.chess-item--1 { grid-column: 1; grid-row: 1; }
.chess-item--2 { grid-column: 1; grid-row: 2; }
.chess-item--3 { grid-column: 2; grid-row: 1 / 3; }
.chess-item:hover {
  transform: scale(1.03);
  border-color: rgba(0,255,136,0.9);
  box-shadow:
    0 0 0 1px rgba(0,255,136,0.6),
    0 0 18px 4px rgba(0,255,136,0.55),
    0 0 48px 12px rgba(0,255,136,0.25),
    0 0 90px 24px rgba(0,207,255,0.15),
    0 12px 40px rgba(0,0,0,0.4);
  z-index: 2;
}
[data-theme="light"] .chess-item:hover {
  border-color: rgba(0,160,80,0.95);
  box-shadow:
    0 0 0 1px rgba(0,160,80,0.7),
    0 0 16px 4px rgba(0,160,80,0.50),
    0 0 40px 10px rgba(0,160,80,0.25),
    0 0 70px 20px rgba(0,120,200,0.15),
    0 12px 40px rgba(0,0,0,0.18);
}
.chess-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.08) brightness(1.02);
  transition: filter 0.35s ease;
}
.chess-item:hover img {
  filter: contrast(1.15) brightness(1.05) saturate(1.1);
}

/* PCB card — always dark */
.about-visual { display: flex; justify-content: center; }
.pcb-card {
  position: relative; width: 360px; height: 320px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(0,207,255,0.2);
  background: #060d1a;
}
.pcb-glow {
  position: absolute; inset: -40px;
  background: radial-gradient(ellipse at center, rgba(0,207,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
#mini-canvas { width: 100%; height: 100%; }
.pcb-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.pcb-chip { position: relative; width: 80px; height: 64px; }
.chip-inner {
  position: absolute; inset: 0; background: #0d2040;
  border: 2px solid #00cfff; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 18px; color: #00cfff;
  text-shadow: 0 0 12px #00cfff; z-index: 1;
}
.chip-pins { position: absolute; }
.chip-pins.top    { top:-8px;    left:8px; right:8px;  height:8px; background: repeating-linear-gradient(90deg,  #00ff88 0, #00ff88 4px, transparent 4px, transparent 10px); }
.chip-pins.bottom { bottom:-8px; left:8px; right:8px;  height:8px; background: repeating-linear-gradient(90deg,  #00ff88 0, #00ff88 4px, transparent 4px, transparent 10px); }
.chip-pins.left   { left:-8px;   top:8px; bottom:8px;  width:8px;  background: repeating-linear-gradient(180deg, #00ff88 0, #00ff88 4px, transparent 4px, transparent 10px); }
.chip-pins.right  { right:-8px;  top:8px; bottom:8px;  width:8px;  background: repeating-linear-gradient(180deg, #00ff88 0, #00ff88 4px, transparent 4px, transparent 10px); }

/* ─── SERVICES ───────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.service-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px 28px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s,
              background-color 0.35s;
}
.service-card:hover {
  border-color: var(--accent1);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.service-icon { width: 52px; height: 52px; margin-bottom: 20px; }
.service-icon svg { width: 100%; height: 100%; }
.service-card h3 {
  font-family: 'Rajdhani', sans-serif; font-size: 20px;
  font-weight: 700; color: var(--text); margin-bottom: 10px;
}
.service-card p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ─── INDUSTRIES ─────────────────────────────────────────────── */
.industries-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.industry-item {
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px 20px;
  transition: border-color 0.25s, background-color 0.35s;
}
.industry-item:hover { border-color: var(--accent2); }
.industry-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent2); flex-shrink: 0; margin-top: 6px;
  box-shadow: 0 0 8px var(--accent2);
}
.industry-info h4 {
  font-family: 'Rajdhani', sans-serif; font-size: 17px;
  font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.industry-info p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
  transition: border-color 0.25s, background-color 0.35s;
}
.contact-card:hover { border-color: var(--accent1); }
.contact-icon { width: 36px; height: 36px; flex-shrink: 0; }
.contact-icon svg { width: 100%; height: 100%; }
.contact-label {
  display: block; font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px;
}
.contact-value { font-size: 15px; color: var(--text); text-decoration: none; font-weight: 500; }
a.contact-value:hover { color: var(--accent1); }
.map-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }

/* ─── TEAM / PEOPLE & CULTURE ───────────────────────────────── */
#team { background: var(--bg-page); padding: 100px 0; }

.team-desc {
  max-width: 660px; margin: 0 auto 52px;
  font-size: 17px; color: var(--text-muted);
  line-height: 1.8; text-align: center;
}

/* 5-photo magazine grid:
   left  — tall photo spans both rows
   right — 2×2 grid of 4 photos           */
.team-gallery {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr;
  grid-template-rows: 260px 250px;
  gap: 12px;
}

.tg-item {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
}
.tg-item.tg-tall { grid-row: span 2; }

.tg-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
}
.tg-item:hover img { transform: scale(1.06); }

/* subtle overlay on hover */
.tg-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,207,255,0.18) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}
.tg-item:hover::after { opacity: 1; }
[data-theme="light"] .tg-item::after {
  background: linear-gradient(to top, rgba(0,100,180,0.14) 0%, transparent 55%);
}

/* pointer cursor — indicates clickable */
.tg-item { cursor: pointer; }

/* responsive */
@media (max-width: 768px) {
  .team-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 180px 180px 180px;
  }
  .tg-item.tg-tall {
    grid-row: span 1;
    grid-column: span 2;
  }
}
@media (max-width: 480px) {
  .team-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 220px);
  }
  .tg-item.tg-tall { grid-column: span 1; }
}

/* ─── EMPLOYEE SPOTLIGHT ─────────────────────────────────────── */
#spotlight { padding: 100px 0; }

.spotlight-card {
  display: flex; align-items: center; gap: 64px;
  max-width: 860px; margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 52px 56px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.18);
}

/* ── photo side ── */
.spot-photo-wrap {
  position: relative; flex-shrink: 0;
  width: 260px;
  border-radius: 18px;
  overflow: hidden;
}
.spot-photo {
  width: 260px; height: auto;
  border-radius: 18px;
  object-fit: contain;
  display: block;
  border: 3px solid var(--accent1);
  box-shadow: 0 0 0 6px rgba(0,255,136,0.10), 0 8px 40px rgba(0,255,136,0.15);
  cursor: zoom-in;
  filter: contrast(1.08) brightness(1.02);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.45s ease,
              filter 0.45s ease;
}
.spot-photo-wrap:hover .spot-photo {
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(0,255,136,0.22), 0 16px 56px rgba(0,255,136,0.28);
}
[data-theme="light"] .spot-photo-wrap:hover .spot-photo {
  box-shadow: 0 0 0 6px rgba(0,150,106,0.22), 0 16px 48px rgba(0,0,0,0.22);
}
[data-theme="light"] .spot-photo {
  box-shadow: 0 0 0 6px rgba(0,150,106,0.10), 0 8px 32px rgba(0,0,0,0.12);
}

/* star badge */
.spot-award {
  position: absolute; top: -14px; right: -14px;
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #ffcc00, #ff8c00);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(255,160,0,0.5);
  color: #fff;
}
.spot-award svg { width: 22px; height: 22px; }

/* ── text side ── */
.spot-content { flex: 1; position: relative; }

.spot-quote-icon {
  position: absolute; top: -8px; left: -4px;
  color: var(--accent2);
  pointer-events: none;
}
.spot-quote-icon svg { width: 48px; height: 36px; }

.spot-text {
  font-size: 16px; line-height: 1.8;
  color: var(--text); margin-bottom: 28px;
  padding-top: 16px;
}

.spot-person {
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.spot-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--accent1);
}
.spot-role {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* responsive */
@media (max-width: 700px) {
  .spotlight-card {
    flex-direction: column; text-align: center;
    padding: 40px 28px; gap: 32px;
  }
  .spot-quote-icon { left: 50%; transform: translateX(-50%); }
  .spot-person { align-items: center; }
}

/* ─── LIGHTBOX ───────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(4, 7, 18, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active {
  opacity: 1; pointer-events: all;
}

.lb-stage {
  display: flex; align-items: center; justify-content: center;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 80px);
}
#lb-img {
  max-width: 100%; max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.9);
  transition: opacity 0.2s ease;
  user-select: none;
}

/* close button */
.lb-close {
  position: absolute; top: 18px; right: 20px;
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.lb-close svg { width: 20px; height: 20px; }
.lb-close:hover { background: rgba(255,255,255,0.22); transform: scale(1.1) rotate(90deg); }

/* prev / next arrows */
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
  user-select: none;
}
.lb-arrow svg { width: 22px; height: 22px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-prev:hover { background: rgba(255,255,255,0.2); transform: translateY(-50%) scale(1.1); }
.lb-next:hover { background: rgba(255,255,255,0.2); transform: translateY(-50%) scale(1.1); }

/* counter */
.lb-counter {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: 'Rajdhani', sans-serif; font-size: 14px;
  letter-spacing: 0.15em; color: rgba(255,255,255,0.55);
  pointer-events: none;
}

/* mobile: smaller arrows */
@media (max-width: 600px) {
  .lb-stage { max-width: calc(100vw - 96px); }
  .lb-arrow { width: 40px; height: 40px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
footer { background: var(--footer-bg); border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner {
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap; justify-content: space-between;
}
.footer-logo { height: 36px; object-fit: contain; opacity: 0.7; }
.footer-copy { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent1); }

/* ─── FADE-IN ────────────────────────────────────────────────── */
.fade-in {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22,1,0.36,1),
              transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { display: flex; }
  .about-chess { height: 300px; }
  .chess-item--1 { grid-column: 1; grid-row: 1; }
  .chess-item--2 { grid-column: 1; grid-row: 2; }
  .chess-item--3 { grid-column: 2; grid-row: 1 / 3; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .industries-list { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
  .stat-item { padding: 8px 20px; }
  .stat-divider { display: none; }
  .nav-links { display: none; }
  .btn-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }
  .mobile-nav.open { max-height: 420px; }
  .hero-title { font-size: 38px; }
  /* mobile: text block pinned to bottom */
  #hero { justify-content: center; align-items: flex-end; }
  .hero-content {
    align-items: center; text-align: center;
    padding: 0 20px 12px;
    width: 100%; max-width: 100%;
  }
  .hero-actions { justify-content: center; }
  /* gradient from bottom so text is always readable */
  .hero-overlay {
    background: linear-gradient(to top,
      rgba(10,15,30,0.95) 0%,
      rgba(10,15,30,0.70) 35%,
      rgba(10,15,30,0.20) 65%,
      transparent 100%);
  }
  [data-theme="light"] .hero-overlay {
    background: linear-gradient(to top,
      rgba(8,14,38,0.96) 0%,
      rgba(8,14,38,0.72) 35%,
      rgba(8,14,38,0.18) 65%,
      transparent 100%);
  }
}

/* ─── MOBILE PERFORMANCE ─────────────────────────────────────── */
@media (max-width: 768px) {
  /* kill the full-viewport bg animation — biggest mobile win */
  #bg-canvas { display: none !important; }

  /* kill canvas animation on mobile — Ken Burns bg already provides motion */
  #circuit-canvas { display: none; }

  /* backdrop-filter is GPU-expensive; solid bg is fast */
  #navbar.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .lightbox {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(4, 7, 18, 0.97);
  }
}

/* ═══ RTL — Hebrew ════════════════════════════════════════════ */
[dir="rtl"] {
  font-family: 'Inter', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
}

/* LTR: logo is last in DOM, pull it to front with order */
.nav-logo { order: -1; }

/* LTR: controls HTML order is [WhatsApp][Theme][Lang][Hamburger] — restore to [Lang][Theme][WhatsApp] */
.lang-toggle { order: 1; }
.theme-toggle { order: 2; }
.btn-nav      { order: 3; }
.hamburger    { order: 4; }

/* RTL: logo stays last in DOM = far RIGHT; controls pushed LEFT */
[dir="rtl"] .nav-controls { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .nav-links    { margin-left: 0 !important; margin-right: 32px; flex-direction: row-reverse; }

/* Hero text: align right */
[dir="rtl"] .hero-content    { text-align: right; }
[dir="rtl"] .hero-actions    { justify-content: flex-end; }
[dir="rtl"] .hero-sub        { text-align: right; }

/* Stats: flip divider order */
[dir="rtl"] .stats-row       { flex-direction: row-reverse; }

/* About: text right-aligned */
[dir="rtl"] .about-text      { text-align: right; }
[dir="rtl"] .about-badges    { justify-content: flex-end; }

/* Section labels & titles */
[dir="rtl"] .section-label,
[dir="rtl"] .section-title   { text-align: right; }
[dir="rtl"] .section-desc    { text-align: right; }

/* Cards: icon + title align right */
[dir="rtl"] .service-card,
[dir="rtl"] .industry-card   { text-align: right; }
[dir="rtl"] .card-icon       { margin-left: auto; margin-right: 0; }

/* Spotlight card */
[dir="rtl"] .spotlight-card  { flex-direction: row-reverse; }
[dir="rtl"] .spot-info       { text-align: right; }
[dir="rtl"] .spot-sig        { flex-direction: row-reverse; }

/* Contact list */
[dir="rtl"] .contact-list    { direction: rtl; }
[dir="rtl"] .cl-item         { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .cl-icon         { margin-left: 0; margin-right: 0; }

/* Footer */
[dir="rtl"] footer            { direction: rtl; }
[dir="rtl"] .footer-copy     { text-align: right; }
[dir="rtl"] .footer-links a  { text-align: right; }

/* Team section */
[dir="rtl"] .team-desc       { text-align: right; }

/* Hero overlay: dark on the RIGHT (where Hebrew text sits) */
[dir="rtl"] .hero-overlay {
  background: linear-gradient(
    to left,
    rgba(10,15,30,0.93) 0%,
    rgba(10,15,30,0.82) 30%,
    rgba(10,15,30,0.55) 52%,
    rgba(10,15,30,0.18) 72%,
    rgba(10,15,30,0.05) 100%
  );
}
[dir="rtl"][data-theme="light"] .hero-overlay {
  background: linear-gradient(
    to left,
    rgba(8,14,38,0.96) 0%,
    rgba(8,14,38,0.90) 28%,
    rgba(8,14,38,0.70) 50%,
    rgba(8,14,38,0.22) 72%,
    transparent 100%
  );
}
