*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: #0D2E3A; color: #fff; overflow-x: hidden; }

/* Grain */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Nav */
.nav-scrolled { background: rgba(13,46,58,0.96) !important; backdrop-filter: blur(14px); box-shadow: 0 2px 32px rgba(0,0,0,0.4); }

/* Tab nav pill */
.tab-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  padding: 7px 18px;
  border-radius: 8px;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  background: none;
  border: none;
}
.tab-btn:hover { color: rgba(255,255,255,0.9); }
.tab-btn.active {
  color: #fff;
  background: rgba(53,197,200,0.12);
  border: 1px solid rgba(53,197,200,0.3);
}
.tab-btn:focus-visible { outline: 2px solid #35C5C8; outline-offset: 2px; }

/* Solutions dropdown item */
.sol-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
}
.sol-dropdown-item:hover {
  background: rgba(53,197,200,0.1);
  color: #35C5C8;
}
.sol-dropdown-item:focus-visible { outline: 2px solid #35C5C8; outline-offset: -2px; }

/* Hero — simplified to navy base; GLSL shader renders on top when WebGL available */
.hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 65% 45%, rgba(26,122,153,0.32) 0%, transparent 62%),
    #0D2E3A;
}

/* Scroll-driven parallax sections — JS sets --px1/--py1/--px2/--py2 each frame */
.parallax-section {
  --px1: 80%; --py1: 15%;
  --px2: 10%; --py2: 78%;
  background-image:
    radial-gradient(ellipse 65% 55% at var(--px1) var(--py1), rgba(53,197,200,0.09) 0%, transparent 62%),
    radial-gradient(ellipse 50% 72% at var(--px2) var(--py2), rgba(26,122,153,0.13) 0%, transparent 58%);
}
/* Section active state — subtle opacity boost when centred in viewport */
.parallax-section { transition: opacity 0.6s ease; }
.parallax-section.section-lit { opacity: 1; }

/* Deeper variant: adds centre vignette so cards appear to float out of darkness */
.parallax-section.depth {
  background-image:
    radial-gradient(ellipse 65% 55% at var(--px1) var(--py1), rgba(53,197,200,0.10) 0%, transparent 62%),
    radial-gradient(ellipse 50% 72% at var(--px2) var(--py2), rgba(26,122,153,0.14) 0%, transparent 58%),
    radial-gradient(ellipse 40% 40% at 50% 52%, rgba(7,24,32,0.55) 0%, transparent 70%);
}

/* Teal section */
.section-teal {
  background:
    radial-gradient(ellipse 70% 80% at 90% 50%, rgba(53,197,200,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 30%, rgba(26,122,153,0.15) 0%, transparent 50%),
    #1A7A99;
}

/* Card hover */
.card-lift {
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  will-change: transform;
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(53,197,200,0.2);
}

/* Buttons */
.btn-primary {
  background: #C8D400;
  color: #0D2E3A;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(200,212,0,0.3);
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background: #D8E420; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(200,212,0,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 3px solid #C8D400; outline-offset: 3px; }

.btn-outline {
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  background: none;
}
.btn-outline:hover { border-color: #35C5C8; background: rgba(53,197,200,0.1); transform: translateY(-2px); }
.btn-outline:active { transform: translateY(0); }
.btn-outline:focus-visible { outline: 3px solid #35C5C8; outline-offset: 3px; }

.btn-cyan {
  background: #35C5C8;
  color: #0D2E3A;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(53,197,200,0.35);
  border: none;
  cursor: pointer;
}
.btn-cyan:hover { background: #5DD5D8; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(53,197,200,0.5); }
.btn-cyan:active { transform: translateY(0); }
.btn-cyan:focus-visible { outline: 3px solid #35C5C8; outline-offset: 3px; }

/* Explore MG Solutions button */
.btn-explore-mg {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #0D2E3A;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 32px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 20px rgba(13,46,58,0.5), 0 0 0 2px rgba(200,212,0,0.5);
  cursor: pointer;
  border: 2px solid rgba(200,212,0,0.4);
}
.btn-explore-mg:hover {
  background: #112F3F;
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(13,46,58,0.6), 0 0 0 2px #C8D400;
  border-color: #C8D400;
}
.btn-explore-mg:active { transform: translateY(0); }
.btn-explore-mg:focus-visible { outline: 3px solid #C8D400; outline-offset: 3px; }
.btn-explore-mg .mg-text {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  color: #C8D400;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.btn-explore-mg .explore-text { font-family: 'Inter', sans-serif; font-weight: 600; color: #fff; }

/* Nav link */
.nav-link {
  transition: color 0.2s ease;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: #35C5C8;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover { color: #35C5C8; }
.nav-link:hover::after { transform: scaleX(1); }

/* Stats */
.stat-number { font-family: 'Sora', sans-serif; font-weight: 800; }

/* Divider */
.divider { width: 56px; height: 4px; border-radius: 2px; background: #C8D400; }

/* Icon circle */
.icon-circle {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(53,197,200,0.15);
  border: 1px solid rgba(53,197,200,0.25);
}

/* Partner card */
.partner-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 32px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  will-change: transform;
}
.partner-card:hover { background: rgba(53,197,200,0.08); border-color: rgba(53,197,200,0.3); transform: translateY(-3px); }

/* Form input */
.form-input {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  padding: 14px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
}
.form-input::placeholder { color: rgba(255,255,255,0.4); }
.form-input:focus { outline: none; border-color: #C8D400; background: rgba(200,212,0,0.04); box-shadow: 0 0 0 2px rgba(200,212,0,0.15); }

/* Mobile nav */
#mobile-menu { transition: max-height 0.35s ease, opacity 0.3s ease; max-height: 0; opacity: 0; overflow: hidden; }
#mobile-menu.open { max-height: 500px; opacity: 1; }

/* Fade-in */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }
.fade-in-delay-6 { transition-delay: 0.6s; }

.fade-left { opacity: 0; transform: translateX(-28px); transition: opacity 0.65s cubic-bezier(0.25,0.46,0.45,0.94), transform 0.65s cubic-bezier(0.25,0.46,0.45,0.94); }
.fade-left.visible { opacity: 1; transform: translateX(0); }

.fade-right { opacity: 0; transform: translateX(28px); transition: opacity 0.65s cubic-bezier(0.25,0.46,0.45,0.94), transform 0.65s cubic-bezier(0.25,0.46,0.45,0.94); }
.fade-right.visible { opacity: 1; transform: translateX(0); }

.fade-scale { opacity: 0; transform: scale(0.94) translateY(16px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.fade-scale.visible { opacity: 1; transform: scale(1) translateY(0); }

/* Solutions card */
.solution-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 32px;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, border-color 0.25s ease, background 0.25s ease;
  will-change: transform;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.solution-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 0 2px #C8D400;
  background: rgba(200,212,0,0.04);
  border-color: #C8D400;
}
.solution-card:hover > a {
  color: #C8D400 !important;
}
.solution-card:hover > a svg {
  stroke: #C8D400 !important;
}

/* Highlight */
.highlight-lime { color: #C8D400; }
.highlight-cyan { color: #35C5C8; }

/* Page entry animation */
@keyframes fadePageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
body > * { animation: fadePageIn 0.35s ease both; }

/* Portfolio info card (non-button) */
.portfolio-card {
  display: block;
  text-decoration: none;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, border-color 0.25s ease, background 0.25s ease;
  will-change: transform;
}
.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 0 2px #C8D400;
  background: rgba(200,212,0,0.04);
  border-color: #C8D400;
}

/* Solution detail feature box */
.detail-feature {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
  margin-bottom: 32px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.back-link:hover { color: #35C5C8; }
.back-link:focus-visible { outline: 2px solid #35C5C8; outline-offset: 3px; border-radius: 4px; }

/* Language switcher */
.lang-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
  background: none;
  border: none;
  padding: 4px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  line-height: 1;
}
.lang-btn:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.06); }
.lang-btn:focus-visible { outline: 2px solid #35C5C8; outline-offset: 2px; }
.lang-btn:active { transform: none; }
.lang-btn-active { color: #35C5C8 !important; background: rgba(53,197,200,0.12) !important; }

/* Flash prevention: hide body until translations are applied */
html.lang-loading body { visibility: hidden; }

/* Footer links */
.footer-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
}
.footer-link:hover { color: rgba(255,255,255,0.9); }
.footer-link:focus-visible { outline: 2px solid #35C5C8; outline-offset: 2px; border-radius: 3px; }

/* Language dropdown */
.lang-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: #071820;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  z-index: 300;
  overflow: hidden;
  padding: 4px 0;
}
.lang-dd-menu-up {
  top: auto;
  bottom: calc(100% + 6px);
  left: 0;
  right: auto;
}

/* FAB shifts up when cookie banner is pending acceptance */
body.cookie-pending #faq-fab {
  bottom: calc(var(--cookie-h, 0px) + 24px) !important;
}
.lang-dd-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.lang-dd-item:hover { background: rgba(53,197,200,0.1); color: #35C5C8; }
.lang-dd-item:focus-visible { outline: 2px solid #35C5C8; outline-offset: -2px; }
.lang-dd-item-active { color: #35C5C8 !important; }
