/* ============================================================
   MAJU CONNECT SDN BHD — GLOBAL STYLESHEET
   Light Theme | Red & Black Brand Colors
   ============================================================ */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Brand Colors from Logo */
  --red: #E30613;
  --red-dark: #B30000;
  --red-light: #FF3D3D;
  --red-pale: #FFF0F0;
  --red-faint: #FFF8F8;

  --black: #111111;
  --black-soft: #1E1E1E;
  --charcoal: #2D2D2D;

  /* Background Palette — warm white with slight warm tint */
  --bg-white: #FFFFFF;
  --bg-off: #FAFAFA;
  --bg-light: #F5F5F5;
  --bg-subtle: #F0F0F0;
  --bg-warm: #FDF8F8; /* very faint warm white matching brand */

  /* Text */
  --text-primary: #111111;
  --text-body: #3D3D3D;
  --text-muted: #696969;
  --text-light: #9E9E9E;

  /* Borders */
  --border: #E8E8E8;
  --border-dark: #D0D0D0;
  --border-red: rgba(227, 6, 19, 0.2);

  /* Shadows */
  --shadow-xs: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
  --shadow-red: 0 8px 28px rgba(227, 6, 19, 0.22);
  --shadow-red-sm: 0 4px 14px rgba(227, 6, 19, 0.18);

  /* Gradients */
  --grad-red: linear-gradient(135deg, #E30613, #FF1F1F);
  --grad-dark: linear-gradient(135deg, #111111, #2D2D2D);
  --grad-hero: linear-gradient(135deg, #FFFFFF 0%, #FDF0F0 50%, #FFF5F5 100%);
  --grad-subtle: linear-gradient(180deg, #FAFAFA, #F0F0F0);

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 32px;

  /* Spacing */
  --section-py: 90px;
  --container: 1200px;

  /* Transitions */
  --t-fast: 0.18s ease;
  --t-med: 0.32s ease;
  --t-slow: 0.55s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-white);
  color: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ===== CONTAINER ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ===== SECTION LABEL ===== */
.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--red-pale);
  border: 1px solid var(--border-red);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.label-dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
}

/* ===== SECTION HEADER ===== */
.sec-header { margin-bottom: 56px; }
.sec-header.center { text-align: center; }

.sec-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}

.sec-title .red { color: var(--red); }
.sec-title .underline-red {
  position: relative;
  display: inline-block;
}
.sec-title .underline-red::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 3px;
  background: var(--grad-red);
  border-radius: 3px;
}

.sec-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 560px;
}

.sec-header.center .sec-desc { margin: 0 auto; }

/* ===== DIVIDER ===== */
.divider {
  width: 48px; height: 3px;
  background: var(--grad-red);
  border-radius: 3px;
  margin-bottom: 20px;
}

.divider.center { margin: 0 auto 20px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--r-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all var(--t-fast);
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn-red {
  background: var(--grad-red);
  color: #fff;
  box-shadow: var(--shadow-red-sm);
  border: 2px solid transparent;
}

.btn-red:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
  background: linear-gradient(135deg, #B30000, #E30613);
}

.btn-red svg { transition: transform var(--t-fast); }
.btn-red:hover svg { transform: translateX(4px); }

.btn-outline {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
}

.btn-outline:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-red-sm);
}

.btn-dark {
  background: var(--grad-dark);
  color: #fff;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
}

.btn-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #000, #1E1E1E);
}

.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-2px);
}

.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-sm { padding: 9px 18px; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all var(--t-med);
}

#navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  height: 76px;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-logo img {
  height: 55px;
  width: auto;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-logo-main {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
}

.nav-logo-main span { color: var(--red); }

.nav-logo-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

/* Keep the retired Business link hidden before global.js removes legacy markup. */
.nav-links > a[href="business.html"],
.mobile-nav > a[href="business.html"] { display: none; }

.nav-link {
  padding: 9px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  position: relative;
}

.nav-link:hover { color: var(--text-primary); }

.nav-link.active {
  color: var(--red-dark);
  background: var(--red-pale);
}

.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-chevron {
  font-size: 0.9rem;
  line-height: 1;
  transition: transform var(--t-fast);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 1000;
  width: 210px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.nav-dropdown:hover .nav-chevron,
.nav-dropdown:focus-within .nav-chevron { transform: rotate(180deg); }

.nav-dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-body);
  font-size: 0.84rem;
  font-weight: 600;
  transition: var(--t-fast);
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  color: var(--red);
  background: var(--red-pale);
}

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

/* Language switcher (EN | BM), added by scripts/build.mjs on translated pages */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.lang-switch a {
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--text-muted);
  line-height: 1;
}
.lang-switch a:hover { color: var(--red); }
.lang-switch a.is-active { background: var(--red); color: #fff; }
.lang-switch span { display: none; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
  cursor: pointer;
}

.hamburger span {
  width: 22px; height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: var(--t-fast);
  display: block;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Menu */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 24px 24px;
  gap: 4px;
  max-height: calc(100dvh - 76px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-nav.open { display: flex; }

.mobile-link {
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-body);
  border-radius: var(--r-sm);
  transition: var(--t-fast);
}

.mobile-link:hover, .mobile-link.active {
  color: var(--red-dark);
  background: var(--red-pale);
}

.mobile-subnav {
  display: grid;
  gap: 2px;
  margin: -2px 0 4px 18px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.mobile-sublink {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.mobile-sublink:hover,
.mobile-sublink.active {
  color: var(--red-dark);
  background: var(--red-pale);
}

.mobile-cta {
  margin-top: 8px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--black);
  color: #fff;
}

.footer-main {
  padding: 64px 0 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 56px;
}

.footer-brand-logo {
  height: 56px;
  width: auto;
  margin-bottom: 16px;
  /* invert since footer is dark */
  filter: brightness(0) invert(1);
}

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.75;
  margin-bottom: 24px;
  max-width: 260px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.social-btn {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  transition: var(--t-fast);
}

.social-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-2px);
}

.footer-col h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a, .footer-col span {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  transition: var(--t-fast);
}

.footer-col a:hover { color: #fff; }

.footer-col li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.footer-col li svg { flex-shrink: 0; color: var(--red); margin-top: 2px; }

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  transition: var(--t-fast);
}

.footer-bottom-links a:hover { color: #fff; }

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 46px; height: 46px;
  background: var(--grad-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-red);
  transition: all var(--t-fast);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 900;
  cursor: pointer;
}

.back-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-red);
}

/* ===== REVEAL ANIMATION ===== */
.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-pending.in { opacity: 1; transform: translateY(0); }

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
[id] { scroll-margin-top: 90px; }

@media (min-width: 769px) {
  .mobile-nav.open { display: none; }
}

@media (max-width: 768px) {
  html:not(.navigation-ready) #navbar { position: static; }
  html:not(.navigation-ready) .mobile-nav { display: flex; max-height: none; }
  html:not(.navigation-ready) .hamburger { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .reveal.reveal-pending { opacity: 1; transform: none; }
}

/* ===== HERO SHARED STYLES ===== */
.page-hero {
  padding: 130px 0 80px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(227,6,19,0.06), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.page-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.page-hero-breadcrumb a { color: var(--red); }
.page-hero-breadcrumb span { color: var(--text-light); }

.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
}

/* ===== CARD STYLES ===== */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: all var(--t-med);
}

.card:hover {
  border-color: rgba(227,6,19,0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* ===== ICON BOX ===== */
.icon-box {
  width: 56px; height: 56px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box-red {
  background: var(--red-pale);
  border: 1px solid var(--border-red);
}

.icon-box-red svg { color: var(--red); }

.icon-box-dark {
  background: var(--black);
}

.icon-box-dark svg { color: #fff; }

/* ===== CTA BAND ===== */
.cta-section {
  background: var(--black);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -100px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(227,6,19,0.15), transparent 70%);
  pointer-events: none;
}

.cta-section::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(227,6,19,0.10), transparent 70%);
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.cta-inner h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.cta-inner h2 span { color: var(--red); }
.cta-inner p { color: rgba(255,255,255,0.55); font-size: 0.95rem; }

.cta-actions {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
  .cta-inner { flex-direction: column; text-align: center; }
  .cta-actions { justify-content: center; }
}

@media (max-width: 1120px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .lang-switch { margin-left: auto; }
  .lang-switch + .hamburger { margin-left: 8px; }
}

@media (max-width: 768px) {
  :root { --section-py: 60px; }
  .container { padding: 0 20px; }
  .nav-wrap { gap: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-brand { grid-column: auto; }
}

@media (max-width: 480px) {
  .nav-wrap { padding: 0 16px; gap: 10px; }
  .lang-switch a { padding: 4px 7px; }
  .lang-switch + .hamburger { margin-left: 2px; }
  .nav-logo { gap: 8px; }
  .nav-logo img { height: 44px; }
  .nav-logo-main { font-size: 1rem; }
  .container { padding: 0 16px; }
}

/* Very small phones: logo picture only, so the language switch and menu button fit */
@media (max-width: 359px) {
  .nav-logo-text { display: none; }
}
