/* ========================================
   Akademi Raihan — base styles
   ======================================== */

:root {
  --header-h: 76px;
  --bg-dark: #0b0f1a;
  --bg-dark-2: #11172a;
  --bg-section: #f7f8fb;
  --accent-orange: #ff6a3d;
  --accent-orange-2: #ff8c5a;
  --accent-blue: #2e6ff2;
  --text-light: #f5f7fa;
  --text-muted: #aab2c5;
  --text-dark: #1a2234;
  --text-dark-muted: #5b6478;
  --border-light: rgba(255, 255, 255, 0.12);
  --radius: 14px;
  --container-w: 1240px;
  --transition: 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-section);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(11, 15, 26, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Fixed, not var(--header-h) — the header's own box must never be sized
     from a variable that JS derives by measuring this same element, or
     every resize/reflow compounds a small rounding drift into runaway
     growth. min-height (not height) still lets it grow to two rows when
     the mobile layout below wraps the social icons. */
  min-height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.3px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.footer-logo .logo-mark {
  width: 36px;
  height: 36px;
}

.logo-text {
  text-transform: uppercase;
}

.logo-text span {
  color: var(--accent-orange);
}

.main-nav > ul {
  display: flex;
  gap: 24px;
}

.main-nav li {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
  transition: color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-light);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-orange);
  border-radius: 2px;
}

/* ---------- Dropdown ---------- */

.caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}

.has-dropdown:hover .caret,
.has-dropdown:focus-within .caret {
  transform: rotate(225deg) translateY(1px);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 260px;
  background: var(--bg-dark-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 10;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
}

.nav-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--accent-orange);
  background: rgba(255, 106, 61, 0.15);
  border: 1px solid rgba(255, 106, 61, 0.3);
}

.header-right {
  /* Groups social icons + language switcher as one unit. On mobile this
     whole block wraps to its own row below logo+hamburger (flex-basis:
     100% in the media query); justify-content:space-between only has an
     effect once that happens — on desktop the box is shrink-to-fit with
     no slack to distribute, so it's a no-op there. */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.social-btn svg {
  width: 16px;
  height: 16px;
}

.social-btn:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  transform: translateY(-2px);
}

/* ---------- Language switcher ---------- */

.lang-switch {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 100%;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-option:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.08);
}

.lang-option.is-active,
.lang-option.is-active:hover {
  background: var(--accent-orange);
  color: #fff;
  font-weight: 700;
}

.lang-option:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-light);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(46, 111, 242, 0.35), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(255, 106, 61, 0.35), transparent 50%),
    linear-gradient(135deg, #0b0f1a 0%, #131a2b 50%, #1a1420 100%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 75%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  padding-top: var(--header-h);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-text {
  /* Grid items default to min-width: auto, which floors their size at the
     content's intrinsic min-content width (e.g. a long nbsp-joined phrase
     in the headline) — that can force the whole grid, and the page, wider
     than the viewport on narrow phones. min-width: 0 removes that floor so
     the column can actually shrink to its 1fr/1-column track. */
  min-width: 0;
  max-width: 620px;
}

/* ---------- Hero media (framed photo) ---------- */

.hero-media {
  position: relative;
  min-width: 0;
}

.hero-media-glow {
  position: absolute;
  inset: -12%;
  z-index: -1;
  background:
    radial-gradient(circle at 25% 20%, rgba(46, 111, 242, 0.5), transparent 60%),
    radial-gradient(circle at 80% 85%, rgba(255, 106, 61, 0.5), transparent 60%);
  filter: blur(50px);
  opacity: 0.9;
}

.hero-media-frame {
  position: relative;
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.hero-media-frame img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.hero-media-caption {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.hero-media-caption strong {
  color: var(--accent-orange-2);
  font-style: normal;
  font-weight: 600;
}

.eyebrow {
  color: var(--accent-orange-2);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.hero h1 {
  color: var(--text-light);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  margin-bottom: 22px;
  /* Headlines use &nbsp; to keep a two-word phrase together (e.g. "Stronger
     Community"). That's fine until the phrase is wider than a narrow phone
     screen at the clamped min font size — break-word lets it wrap there as
     a last resort instead of overflowing the page horizontally. */
  overflow-wrap: break-word;
}

.hero h1 strong {
  font-weight: 800;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-2));
  color: #fff;
  box-shadow: 0 10px 25px rgba(255, 106, 61, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(255, 106, 61, 0.45);
}

.btn-outline {
  border: 1px solid var(--border-light);
  color: var(--text-light);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}

/* ---------- Hero (single-column page variant) ---------- */

.hero-page {
  min-height: 72vh;
}

.hero-single {
  position: relative;
  z-index: 2;
  padding-top: var(--header-h);
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero-single .hero-sub {
  margin-left: auto;
  margin-right: auto;
}

.hero-single .hero-cta {
  justify-content: center;
}

/* ---------- Section shared ---------- */

section {
  padding: 100px 0;
}

.section-tag {
  display: inline-block;
  color: var(--accent-orange);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  color: var(--text-dark);
}

.section-sub {
  color: var(--text-dark-muted);
  max-width: 560px;
  margin: 14px auto 0;
  font-size: 1rem;
}

/* ---------- About ---------- */

.about {
  background: #fff;
}

.about-inner {
  max-width: 760px;
  text-align: center;
  margin: 0 auto;
}

.about-inner p {
  color: var(--text-dark-muted);
  font-size: 1.05rem;
  margin-top: 18px;
}

/* ---------- Core business ---------- */

.core-business {
  background: var(--bg-section);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: 0 10px 30px rgba(17, 23, 42, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(17, 23, 42, 0.1);
}

.card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 22px;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.card p {
  color: var(--text-dark-muted);
  font-size: 0.95rem;
}

/* ---------- Programmes gallery (product page) ---------- */

.programmes {
  background: var(--bg-section);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.gallery-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(17, 23, 42, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(17, 23, 42, 0.1);
}

.gallery-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-card:hover .gallery-img img {
  transform: scale(1.06);
}

.gallery-card figcaption {
  padding: 24px 24px 28px;
}

.gallery-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.gallery-card p {
  color: var(--text-dark-muted);
  font-size: 0.92rem;
}

.gallery-card .btn {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 22px;
  font-size: 0.85rem;
}

/* ---------- Why us (features) ---------- */

.why-us {
  background: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature {
  text-align: center;
  padding: 8px;
}

.feature-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.feature p {
  color: var(--text-dark-muted);
  font-size: 0.88rem;
}

/* ---------- Contact ---------- */

.contact {
  background: var(--bg-dark);
  text-align: center;
}

.contact-inner {
  max-width: 620px;
  margin: 0 auto;
}

.contact h2 {
  color: var(--text-light);
}

.contact p {
  color: var(--text-muted);
  margin: 18px 0 32px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition);
}

.contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-orange-2);
}

.contact-item:hover {
  color: var(--text-light);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-dark-2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 24px;
  border-bottom: 1px solid var(--border-light);
}

.footer-logo { font-size: 1.2rem; }

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

.footer-bottom-inner p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-light);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 10px;
    height: auto;
    padding: 14px 0;
  }

  .header-right {
    flex-basis: 100%;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: calc(var(--header-h) + 34px);
    text-align: center;
  }

  .hero-text {
    max-width: 100%;
    margin: 0 auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-media {
    max-width: 480px;
    margin: 0 auto;
  }

  .cards,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

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

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-light);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .main-nav.open {
    max-height: 460px;
    overflow-y: auto;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 10px 24px 20px;
  }

  .main-nav li {
    border-bottom: 1px solid var(--border-light);
  }

  .main-nav a {
    display: block;
    padding: 14px 0;
  }

  .caret {
    margin-left: auto;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0 0 8px 16px;
    transition: none;
  }

  .dropdown-menu a {
    padding: 10px 0;
    color: var(--text-muted);
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .footer-inner,
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 520px) {
  section { padding: 72px 0; }
  .hero-cta { flex-direction: column; }
  .btn { text-align: center; }
  .features-grid { grid-template-columns: 1fr; }
}
