/* Theme — align with main portfolio; edit :root to match your logo */
:root {
  --color-bg: #04060d;
  --color-surface: #0a0f1a;
  --color-elevated: #111827;
  --color-border: rgba(148, 163, 184, 0.12);
  --color-foreground: #f8fafc;
  --color-muted: #94a3b8;
  --color-accent: #2dd4bf;
  --color-accent-soft: rgba(45, 212, 191, 0.15);
  --color-gold: #e8b86d;
  --color-gold-soft: rgba(232, 184, 109, 0.12);
  --bs-body-bg: var(--color-bg);
  --bs-body-color: var(--color-foreground);
  --bs-border-color: var(--color-border);
  --bs-secondary-color: var(--color-muted);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1100;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-bg);
  background: var(--color-accent);
  border-radius: 0.375rem;
  text-decoration: none;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Below .site-header--menu-open (z-index 1040); captures taps on page when mobile drawer is open */
.nav-mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  background: transparent;
  pointer-events: none;
}

.nav-mobile-backdrop.is-active {
  pointer-events: auto;
  touch-action: none;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Horizontal overflow at the root (not on body) — avoids breaking
     position:fixed viewport anchoring for the navbar on some engines. */
  overflow-x: hidden;
  max-width: 100%;
  /* Fixed navbar: anchor targets and hash links land below the header */
  scroll-padding-top: 5.75rem;
}

@media (min-width: 992px) {
  html {
    scroll-padding-top: 5.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-foreground);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  margin: 0;
  /* Intentionally no overflow-x here — pairs with html { overflow-x: hidden } */
  min-width: 0;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

.font-display {
  font-family: "Outfit", system-ui, sans-serif;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-foreground);
}

/* Navbar — premium single row (desktop): brand | links (center) | lang + CTA */
.site-header.navbar.fixed-top {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  margin: 0;
  /* Stay above page content; Bootstrap also sets z-index on .fixed-top */
  z-index: 1030;
}

/* Phones / small tablets: pin bar to the visual top; avoid backface hacks (they can clip WebKit paint) */
@media (max-width: 991.98px) {
  .site-header.navbar.fixed-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
  }
}

.site-header {
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: 0.35rem;
}

/*
 * Two independent states:
 * - .is-scrolled — scrollY > threshold (initHeader)
 * - .site-header--menu-open — mobile drawer open/animating (collapse + MutationObserver)
 * Either applies chrome; menu-open must work at scrollY === 0 without waiting for scroll.
 */
.site-header.is-scrolled,
.site-header.site-header--menu-open {
  background: rgba(4, 6, 13, 0.88) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--color-border) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Slightly stronger bar when only menu-open at top (same blur; avoids hero bleed-through) */
.site-header.site-header--menu-open:not(.is-scrolled) {
  background: rgba(4, 6, 13, 0.92) !important;
}

.nav-shell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  min-height: 3.35rem;
}

.nav-shell__brand {
  margin-right: 0;
  z-index: 2;
}

.nav-shell__brand > span.font-display {
  line-height: 1.15;
  white-space: nowrap;
}

.nav-shell__brand-accent {
  color: var(--color-accent);
}

.nav-shell__toggler {
  padding: 0.35rem 0.5rem;
}

@media (max-width: 380px) {
  .nav-shell__brand > span.font-display {
    font-size: 0.68rem !important;
  }

  .nav-shell__logo {
    width: 34px !important;
    height: 34px !important;
  }
}

/* Desktop ≥lg: collapse is flex grow; inner row = links centered + actions end */
@media (min-width: 992px) {
  .site-header.navbar-expand-lg .nav-shell__collapse {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
  }

  .nav-shell__inner {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem 0.65rem;
    width: 100%;
    min-width: 0;
  }

  .nav-shell__links {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .nav-shell__links .nav-item {
    flex: 0 0 auto;
  }

  .nav-shell__link {
    color: var(--color-muted) !important;
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    padding: 0.45rem 0.35rem !important;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 0.375rem;
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .nav-shell__link:hover,
  .nav-shell__link:focus {
    color: var(--color-foreground) !important;
    background-color: rgba(255, 255, 255, 0.055);
  }

  .nav-shell__actions {
    flex: 0 0 auto;
    padding-top: 0 !important;
    margin-top: 0 !important;
    border-top: none !important;
    width: auto !important;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .nav-shell__link {
    font-size: 0.75rem;
    padding-inline: 0.28rem !important;
  }
}

@media (min-width: 1400px) {
  .nav-shell__link {
    font-size: 0.875rem;
    padding-inline: 0.42rem !important;
  }
}

/* Compact language control */
.btn-lang-pill {
  --bs-btn-padding-y: 0.32rem;
  --bs-btn-padding-x: 0.55rem;
  --bs-btn-font-size: 0.72rem;
  --bs-btn-font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(10, 15, 26, 0.55);
  color: var(--color-foreground) !important;
  letter-spacing: 0.06em;
  line-height: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-lang-pill:hover,
.btn-lang-pill:focus,
.btn-lang-pill.show {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(17, 24, 39, 0.85);
  color: var(--color-foreground) !important;
}

.btn-lang-pill::after {
  margin-inline-start: 0.2rem;
  vertical-align: 0.1em;
}

.btn-lang-pill__icon {
  font-size: 0.95rem;
  opacity: 0.88;
  margin-inline-end: 0.15rem;
}

.btn-lang-pill__code {
  min-width: 1.35rem;
  text-align: center;
}

.nav-shell__lang-menu {
  min-width: 11rem;
  padding: 0.4rem;
  border-radius: 0.65rem;
  border: 1px solid var(--color-border);
  background: rgba(10, 15, 26, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.nav-shell__lang-menu .dropdown-item {
  border-radius: 0.4rem;
  font-size: 0.875rem;
  padding: 0.45rem 0.65rem;
}

.nav-shell__lang-menu .dropdown-item:hover,
.nav-shell__lang-menu .dropdown-item:focus {
  background: rgba(45, 212, 191, 0.12);
  color: var(--color-foreground);
}

.nav-shell__lang-menu .dropdown-item.active {
  background: rgba(45, 212, 191, 0.2);
  color: var(--color-foreground);
  font-weight: 600;
}

/* Language menu rows: short code + full label (mobile-first touch targets) */
.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  text-align: start;
}

.lang-menu-item__code {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  min-width: 2rem;
}

.lang-menu-item__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 992px) {
  .lang-menu-item {
    min-height: unset;
  }

  .lang-menu-item__code {
    display: none;
  }
}

[dir="rtl"] .lang-menu-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-menu-item__label {
  text-align: right;
}

/* CTA — visible but not oversized */
.btn-nav-cta {
  padding: 0.42rem 0.95rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  border-radius: 0.65rem !important;
  line-height: 1.25 !important;
  box-shadow: 0 6px 20px rgba(45, 212, 191, 0.18) !important;
  white-space: nowrap;
}

.btn-nav-cta:hover {
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.28) !important;
}

/* Mobile / tablet collapsed */
@media (max-width: 991.98px) {
  /*
   * iOS / Chrome Android: backdrop-filter on a fixed navbar often corrupts compositing
   * while scrolling (top half of the bar disappears). Use solid tint on small screens;
   * desktop keeps glass blur above.
   */
  .site-header.is-scrolled,
  .site-header.site-header--menu-open {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(4, 6, 13, 0.96) !important;
  }

  .site-header.site-header--menu-open:not(.is-scrolled) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(4, 6, 13, 0.97) !important;
  }

  /* Layer above page while drawer is open or mid-transition (.collapsing) */
  .site-header.navbar.fixed-top.site-header--menu-open {
    z-index: 1040;
    background: rgba(4, 6, 13, 0.97) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  }

  /* Drawer surface: includes .collapsing — no backdrop-filter on mobile */
  .site-header.site-header--menu-open .nav-shell__collapse.show .nav-shell__inner,
  .site-header.site-header--menu-open .nav-shell__collapse.collapsing .nav-shell__inner {
    background: rgba(10, 15, 26, 0.99);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 1.15rem 1.15rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    padding-bottom: 0.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .nav-shell {
    flex-wrap: wrap;
  }

  /* Let the language dropdown paint outside the collapse box (no clipping / “detached” menu) */
  .site-header.navbar > .container.nav-shell {
    overflow: visible;
  }

  .nav-shell__collapse,
  .nav-shell__collapse.show,
  .navbar-collapse.nav-shell__collapse {
    overflow: visible !important;
  }

  .nav-shell__inner {
    overflow: visible !important;
  }

  .nav-shell__collapse {
    width: 100%;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }

  .nav-shell__links .nav-item {
    text-align: center;
  }

  .nav-shell__link {
    color: rgba(248, 250, 252, 0.92) !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.9rem;
  }

  .nav-shell__link:hover,
  .nav-shell__link:focus {
    color: var(--color-foreground) !important;
  }

  /* Stack language + CTA: menu opens in-flow under the pill (no overlap with CTA or page) */
  .nav-shell__actions {
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    gap: 0.875rem;
    width: 100%;
    max-width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
  }

  .nav-shell__lang.dropdown {
    display: block;
    width: 100%;
    max-width: 17.5rem;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1080;
  }

  .nav-shell__lang .btn-lang-pill {
    width: 100%;
    justify-content: center;
    --bs-btn-padding-y: 0.45rem;
    min-height: 2.75rem;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 15, 26, 0.92) !important;
  }

  /* In-flow menu: stays in viewport, aligned with trigger, premium card */
  .nav-shell__lang .dropdown-menu.nav-shell__lang-menu {
    position: static !important;
    float: none !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    inset: auto !important;
    margin: 0.5rem 0 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    z-index: 1080;
  }

  .nav-shell__lang-menu {
    padding: 0.5rem;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 15, 26, 0.99) !important;
  }

  .nav-shell__lang-menu .dropdown-item {
    font-size: 0.9375rem;
    padding: 0.55rem 0.75rem;
  }

  .btn-nav-cta {
    min-width: 0 !important;
    width: 100%;
    max-width: 17.5rem;
    margin-left: auto;
    margin-right: auto;
    min-height: 2.75rem;
    justify-content: center;
  }

  [dir="rtl"] .nav-shell__lang .nav-shell__lang-menu.dropdown-menu-end {
    left: auto !important;
    right: auto !important;
  }
}

.navbar-brand img,
.nav-shell__logo {
  border-radius: 0.65rem;
}

/* Buttons */
.btn-brand {
  background: linear-gradient(135deg, var(--color-accent), #5eead4);
  border: none;
  color: #04060d !important;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.55rem 1.35rem;
  box-shadow: 0 8px 28px rgba(45, 212, 191, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(45, 212, 191, 0.32);
  color: #04060d !important;
}

.btn-outline-brand {
  border: 1px solid var(--color-border);
  color: var(--color-foreground) !important;
  background: rgba(10, 15, 26, 0.65);
  border-radius: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.btn-outline-brand:hover {
  border-color: rgba(45, 212, 191, 0.45);
  background: var(--color-elevated);
  color: var(--color-foreground) !important;
}

/* Main flow: each block stacks cleanly (no bleed-through from decorations) */
main {
  position: relative;
  z-index: 0;
}

/* Sections */
.section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  border-top: 1px solid var(--color-border);
  position: relative;
  z-index: 1;
  isolation: isolate;
}

@media (max-width: 575.98px) {
  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
}

@media (min-width: 768px) {
  .section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

.section-alt {
  background: rgba(10, 15, 26, 0.35);
}

/* In-page anchors: extra offset backup for older browsers */
main section[id] {
  scroll-margin-top: 5.75rem;
}

@media (min-width: 992px) {
  main section[id] {
    scroll-margin-top: 5.35rem;
  }
}

/* Bootstrap flex grid: allow columns to shrink so content never forces horizontal overlap */
.container .row > [class*="col"] {
  min-width: 0;
}

/* Hero: clip decorative layers so they never paint into the next section */
.hero-section {
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-glow,
.hero-grid {
  z-index: 0;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.section-sub {
  color: var(--color-muted);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* Hero */
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 50% at 50% -20%,
    var(--color-accent-soft),
    transparent
  );
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: linear-gradient(
      to right,
      rgba(148, 163, 184, 0.4) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.4) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-badge {
  border: 1px solid var(--color-border);
  background: rgba(10, 15, 26, 0.55);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--color-muted);
  max-width: 100%;
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

@media (max-width: 575.98px) {
  .hero-badge {
    font-size: 0.7rem;
    border-radius: 1rem;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
}

/* Hero headline scales down on phones */
.hero-display-title {
  font-size: clamp(1.65rem, 7.5vw, 3rem);
  line-height: 1.1;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Hero CTAs: full-width on very small screens for tap targets */
@media (max-width: 575.98px) {
  .hero-section {
    padding-top: 5.75rem !important;
    padding-bottom: 2.5rem !important;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }
}

.stat-card {
  border: 1px solid var(--color-border);
  background: rgba(10, 15, 26, 0.4);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.stat-card:hover {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(17, 24, 39, 0.55);
}

.stat-bar {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-gold));
  min-height: 2rem;
  margin-top: 0.2rem;
}

.hero-photo-wrap {
  border-radius: 2rem;
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  position: relative;
}

.hero-photo-wrap::before {
  content: "";
  position: absolute;
  inset: -2rem;
  background: linear-gradient(
    135deg,
    rgba(45, 212, 191, 0.2),
    transparent,
    rgba(232, 184, 109, 0.12)
  );
  filter: blur(24px);
  z-index: -1;
}

/* Cards */
.card-premium {
  border: 1px solid var(--color-border);
  background: rgba(17, 24, 39, 0.35);
  border-radius: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 0;
}

.card-premium h3 {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.card-premium:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

@media (max-width: 575.98px) {
  .card-premium:hover {
    transform: translateY(-2px);
  }
}

.service-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.22);
  color: var(--color-accent);
  font-size: 1.35rem;
}

/* Skill bars */
.skill-card {
  border: 1px solid var(--color-border);
  background: rgba(10, 15, 26, 0.45);
  border-radius: 1rem;
  padding: 1.5rem;
  height: 100%;
}

/* Skills section: clear grid tiers (no stacked columns fighting the same row) */
#skills .skills-grid > [class*="col"] {
  display: flex;
}

#skills .skills-grid .skill-card.flex-fill {
  width: 100%;
  min-width: 0;
  height: auto;
}

#skills .skill-card .d-flex.justify-content-between.small {
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 0.15rem;
  column-gap: 0.5rem;
}

#skills .skill-card .d-flex.justify-content-between.small > .text-white {
  flex: 1 1 8rem;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  padding-right: 0.35rem;
}

#skills .skill-card .d-flex.justify-content-between.small > .text-secondary {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 575.98px) {
  #skills .skill-card {
    padding: 1.15rem;
  }
}

.progress-skill {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.progress-skill .skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), #5eead4);
  width: 0;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-skill.is-visible .skill-bar-fill {
  width: var(--target, 0%);
}

/* Project featured */
.project-featured {
  border-radius: 1.5rem;
  border: 1px solid var(--color-border);
  background: rgba(10, 15, 26, 0.5);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.project-featured:hover {
  border-color: rgba(45, 212, 191, 0.25);
}

.project-featured .pf-head {
  height: 11rem;
  position: relative;
}

.project-featured .pf-head.teal {
  background: linear-gradient(
    135deg,
    rgba(45, 212, 191, 0.22),
    rgba(45, 212, 191, 0.04)
  );
}

.project-featured .pf-head.gold {
  background: linear-gradient(
    135deg,
    rgba(232, 184, 109, 0.22),
    rgba(232, 184, 109, 0.05)
  );
}

.project-featured .pf-head.slate {
  background: linear-gradient(
    135deg,
    rgba(148, 163, 184, 0.18),
    rgba(71, 85, 105, 0.08)
  );
}

.project-small {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(17, 24, 39, 0.28);
  height: 100%;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.project-small:hover {
  border-color: rgba(45, 212, 191, 0.22);
  background: rgba(17, 24, 39, 0.45);
}

.badge-soft {
  background: rgba(4, 6, 13, 0.72);
  border: 1px solid rgba(45, 212, 191, 0.28);
  color: var(--color-accent);
  font-weight: 500;
  font-size: 0.7rem;
}

.tag-tech {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

/* Teaching */
.stat-gold {
  border: 1px solid rgba(232, 184, 109, 0.25);
  background: rgba(17, 24, 39, 0.45);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.stat-gold .num {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-gold);
}

/* Testimonial placeholders */
.card-dashed {
  border: 1px dashed var(--color-border);
  background: rgba(10, 15, 26, 0.35);
  border-radius: 1rem;
}

/* Graduate certificate gallery */
.certificate-tile {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: rgba(10, 15, 26, 0.55);
  padding: 0.75rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  height: auto;
  align-self: flex-start;
}

.certificate-tile:hover {
  border-color: rgba(45, 212, 191, 0.28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(-3px);
}

@media (max-width: 575.98px) {
  .certificate-tile:hover {
    transform: translateY(-1px);
  }
}

.certificate-tile-link {
  display: block;
  border-radius: 0.65rem;
  overflow: hidden;
  background: rgba(4, 6, 13, 0.6);
  line-height: 0;
}

.certificate-tile-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.certificate-tile-img {
  width: 100%;
  height: auto;
  display: block;
}

.certificate-tile-caption {
  padding-top: 0.65rem;
  text-align: center;
  line-height: 1.4;
}

/* Live lecture session captures */
.session-screen-card {
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 1rem;
  background: rgba(10, 15, 26, 0.55);
  padding: 0.65rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  align-self: flex-start;
}

.session-screen-card:hover {
  border-color: rgba(212, 175, 55, 0.48);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

@media (max-width: 575.98px) {
  .session-screen-card:hover {
    transform: translateY(-1px);
  }
}

.session-screen-link {
  display: block;
  border-radius: 0.65rem;
  overflow: hidden;
  background: rgba(4, 6, 13, 0.65);
  line-height: 0;
}

.session-screen-link:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

.session-screen-img {
  width: 100%;
  height: auto;
  display: block;
}

.session-screen-caption {
  padding-top: 0.55rem;
  text-align: center;
  line-height: 1.35;
}

/* Group brand logos */
.brand-logo-card {
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  background: rgba(17, 24, 39, 0.35);
  padding: 1.75rem 1.5rem;
}

.brand-logo-img {
  max-height: clamp(4.5rem, 12vw, 7.5rem);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Social */
.social-tile {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(17, 24, 39, 0.35);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
  min-width: 0;
}

.social-tile > span:last-child {
  min-width: 0;
}

.social-tile .small {
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.social-tile:hover {
  border-color: rgba(45, 212, 191, 0.32);
  background: rgba(17, 24, 39, 0.55);
  transform: translateY(-2px);
  color: inherit;
}

.social-tile .icon-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.22);
  color: var(--color-accent);
  font-size: 1.25rem;
}

/* Contact form */
.form-control,
.form-select {
  background: rgba(4, 6, 13, 0.65) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-foreground) !important;
  border-radius: 0.75rem !important;
  padding: 0.65rem 1rem !important;
}

.form-control:focus {
  border-color: rgba(45, 212, 191, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15) !important;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: rgba(10, 15, 26, 0.4);
  padding: 3.5rem 0 2rem;
  position: relative;
  z-index: 2;
}

.footer-link {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.footer-link:hover {
  color: var(--color-accent);
}

.text-gradient-name {
  background: linear-gradient(90deg, var(--color-foreground), var(--color-accent), #5eead4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.navbar-toggler {
  border-color: var(--color-border);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

/* Long URLs and monospace hints */
.break-anywhere,
.overflow-wrap-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Impact stat tiles: tighter on narrow phones */
@media (max-width: 575.98px) {
  .stat-impact-tile {
    padding: 0.85rem 0.65rem !important;
  }

  .stat-impact-tile .small {
    font-size: 0.62rem !important;
    letter-spacing: 0.02em !important;
    line-height: 1.35;
  }

  .stat-impact-tile .font-display.fs-3 {
    font-size: 1.35rem !important;
  }
}

/* Project cards: avoid overflow from long categories / titles */
.project-featured h3,
.project-small h4 {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.project-featured .badge,
.project-small .badge {
  max-width: 100%;
  white-space: normal !important;
  text-align: start;
  line-height: 1.35;
}

/* Forms: 16px+ font on iOS to avoid zoom-on-focus */
@media (max-width: 575.98px) {
  .form-control,
  .form-select {
    font-size: 1rem !important;
  }
}

/* RTL — Arabic (Bootstrap CSS is LTR; tweak layout where needed) */
body.is-rtl {
  font-family: "Noto Sans Arabic", "Inter", system-ui, sans-serif;
}

[dir="rtl"] .dropdown-menu-end {
  --bs-position: end;
  right: auto;
  left: 0;
}

[dir="rtl"] .stat-card,
[dir="rtl"] .hero-badge {
  flex-direction: row-reverse;
}

[dir="rtl"] .text-lg-end {
  text-align: left !important;
}
