/* ============================================================
   FANCY ENHANCEMENTS — iteam1 website
   Extends modern.css, keeps teal/dark theme consistent
   ============================================================ */

/* ---- Font override: Space Grotesk + Inter ---- */
:root {
  --font-primary: 'Inter', sans-serif;
  --font-secondary: 'Space Grotesk', sans-serif;
}
body {
  font-family: var(--font-primary);
  letter-spacing: -0.01em;
}
h1, h2, h3, h4, h5, h6,
.navbar ul li a,
button, .filter-btn {
  font-family: var(--font-secondary);
  letter-spacing: -0.02em;
}

/* ---- Glow orbs (decorative background blobs) ---- */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.12;
  animation: orbFloat 10s ease-in-out infinite;
  z-index: 0;
}
.glow-orb-1 {
  width: 450px; height: 450px;
  background: var(--primary);
  top: -120px; left: -120px;
}
.glow-orb-2 {
  width: 350px; height: 350px;
  background: var(--accent);
  bottom: -80px; right: -80px;
  animation-delay: -5s;
}
@keyframes orbFloat {
  0%,100% { transform: translate(0,0); }
  33%      { transform: translate(30px,-25px); }
  66%      { transform: translate(-20px,20px); }
}

/* ---- Grid background overlay ---- */
.hero-grid-bg {
  position: relative;
  overflow: hidden;
  --grid-mouse-x: -999px;
  --grid-mouse-y: -999px;
}
/* Dim base grid */
.hero-grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,150,136,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,150,136,0.04) 1px, transparent 1px);
  background-size: 55px 55px;
  pointer-events: none;
  z-index: 0;
}
/* Bright grid, masked to cursor area */
.hero-grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,215,0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,215,0.45) 1px, transparent 1px);
  background-size: 55px 55px;
  -webkit-mask-image: radial-gradient(circle 220px at var(--grid-mouse-x) var(--grid-mouse-y), black 0%, transparent 100%);
  mask-image: radial-gradient(circle 220px at var(--grid-mouse-x) var(--grid-mouse-y), black 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  transition: -webkit-mask-image 0.05s, mask-image 0.05s;
}
.hero-grid-bg > *:not(.navbar) {
  position: relative;
  z-index: 1;
}

/* ---- Hero label (small text above h2) ---- */
.hero-label {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--primary-light);
  margin-bottom: 12px;
  opacity: 0.8;
}

/* ---- Scroll indicator ---- */
.scroll-indicator {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 50px;
  opacity: 0.35;
  animation: scrollBounce 2.2s ease-in-out infinite;
  cursor: default;
}
.scroll-indicator .scroll-label {
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-light);
  /* override generic span from style.css */
  background: transparent !important;
  width: auto !important;
  height: auto !important;
  position: static !important;
  border-radius: 0 !important;
  transition: none !important;
  animation: none !important;
}
.scroll-indicator svg {
  width: 20px; height: 20px;
  stroke: var(--accent);
  fill: none;
}
@keyframes scrollBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(9px); }
}

/* ---- Stats bar ---- */
.stats-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 50px 20px 40px;
  position: relative;
}
.stats-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,150,136,0.5), rgba(0,229,215,0.4), transparent);
}
.stats-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,150,136,0.2), transparent);
}
.stat-item {
  text-align: center;
  padding: 10px 50px;
  position: relative;
}
.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0; top: 15%; height: 70%;
  width: 1px;
  background: rgba(0,150,136,0.25);
}
.stat-number {
  display: block !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  font-size: 2.8rem;
  font-weight: 700;
  font-family: var(--font-secondary);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.45);
}

/* ---- "What We Do" preview section ---- */
.preview-section {
  padding: 60px 5% 90px;
  max-width: 1200px;
  margin: 0 auto;
}
.preview-section-title {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: var(--primary-light);
  margin-bottom: 50px;
  opacity: 0.8;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.preview-card {
  background: rgba(30,30,30,0.6);
  border: 1px solid rgba(0,150,136,0.12);
  border-radius: 16px;
  padding: 30px 25px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
  position: relative;
  overflow: hidden;
  --mouse-x: 50%;
  --mouse-y: 50%;
}
/* Top-edge accent line */
.preview-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 1;
}
.preview-card:hover::before { transform: scaleX(1); }
/* Spotlight layer */
.preview-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mouse-x) var(--mouse-y),
    rgba(0,229,215,0.10) 0%,
    rgba(0,150,136,0.05) 35%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.preview-card:hover::after { opacity: 1; }
/* Keep card children above spotlight */
.preview-card > * { position: relative; z-index: 1; }
.preview-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0,150,136,0.35);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 25px rgba(0,150,136,0.08);
  background: rgba(30,30,30,0.9);
}
.preview-card-icon {
  width: 52px; height: 52px;
  background: rgba(0,150,136,0.13);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(0,150,136,0.2);
  transition: all 0.4s;
}
.preview-card:hover .preview-card-icon {
  background: rgba(0,150,136,0.25);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0,150,136,0.2);
}
.preview-card-icon img {
  width: 28px; height: 28px;
  object-fit: contain;
  filter: brightness(1.8) saturate(1.1);
}
.preview-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  font-family: var(--font-secondary);
  color: var(--text-light);
}
.preview-card p {
  font-size: 0.88rem;
  opacity: 0.6;
  line-height: 1.65;
}

/* ---- Section divider line ---- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,150,136,0.3), rgba(0,229,215,0.25), transparent);
  margin: 0;
}

/* ---- Page hero (about / projects / contact) ---- */
.page-hero {
  padding: 70px 5% 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,150,136,0.1) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-secondary);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
  line-height: 1.15;
}
.page-hero p {
  font-size: 1.05rem;
  opacity: 0.65;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.breadcrumb a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.3s;
}
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb .sep { opacity: 0.3; }
.breadcrumb .current { color: var(--primary-light); }

/* ---- About page: stat counters row ---- */
.about-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 30px 0 10px;
}
.about-stat {
  text-align: center;
  padding: 15px 30px;
  background: rgba(0,150,136,0.07);
  border: 1px solid rgba(0,150,136,0.15);
  border-radius: 12px;
  min-width: 110px;
}
.about-stat .stat-number { font-size: 2rem; }
.about-stat .stat-label { font-size: 0.7rem; }

/* ---- Card enhancements ---- */
.card {
  border: 1px solid rgba(0,150,136,0.1) !important;
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.card:hover::after { transform: scaleX(1); }
.card:hover {
  border-color: rgba(0,150,136,0.3) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(0,150,136,0.08) !important;
}

/* ---- Join section enhancement ---- */
.join {
  position: relative;
  overflow: hidden;
}
.join::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(0,150,136,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.join > * { position: relative; z-index: 1; }
.join a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}
.join a:hover { opacity: 0.75; text-decoration: underline; }
.join .button-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* ---- Partners section ---- */
.partner {
  padding: 60px 20px 70px;
}
.partner-coming-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px dashed rgba(0,150,136,0.35);
  border-radius: 30px;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ---- Projects page ---- */
.project-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 20px 30px;
}
.filter-btn {
  padding: 9px 22px;
  border-radius: 30px;
  border: 1px solid rgba(0,150,136,0.35);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  font-family: var(--font-secondary);
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
  overflow: hidden;
}
.filter-btn span { display: none; } /* hide old span fill */
.filter-btn:hover,
.filter-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,150,136,0.3);
}

/* Project item enhancements */
.project-item {
  background: rgba(28,28,28,0.85);
  border: 1px solid rgba(0,150,136,0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  position: relative;
  --mouse-x: 50%;
  --mouse-y: 50%;
}
.project-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mouse-x) var(--mouse-y),
    rgba(0,229,215,0.10) 0%,
    rgba(0,150,136,0.05) 35%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.project-item:hover::after { opacity: 1; }
.project-item > * { position: relative; z-index: 1; }
.project-item:hover {
  border-color: rgba(0,150,136,0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(0,150,136,0.07);
  transform: translateY(-5px);
}
.project-header {
  padding: 20px 22px 0;
}
.project-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0,150,136,0.12);
  border: 1px solid rgba(0,150,136,0.28);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--primary-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.project-item-title {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-secondary);
  color: var(--text-light);
  margin-bottom: 14px;
}
.project-description {
  padding: 14px 22px 22px;
}
.project-description p {
  font-size: 0.92rem;
  line-height: 1.7;
  opacity: 0.65;
}

/* Showcase item enhancements */
.showcase-item {
  background: rgba(30,30,30,0.6);
  border: 1px solid rgba(0,150,136,0.1);
  border-radius: 16px;
  padding: 30px 25px;
  transition: all 0.4s;
  text-align: center;
  position: relative;
  overflow: hidden;
  --mouse-x: 50%;
  --mouse-y: 50%;
}
.showcase-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mouse-x) var(--mouse-y),
    rgba(0,229,215,0.10) 0%,
    rgba(0,150,136,0.05) 35%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.showcase-item:hover::after { opacity: 1; }
.showcase-item > * { position: relative; z-index: 1; }
.showcase-item:hover {
  background: rgba(30,30,30,0.9);
  border-color: rgba(0,150,136,0.32);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 20px rgba(0,150,136,0.1);
}
.showcase-icon {
  width: 68px; height: 68px;
  background: rgba(0,150,136,0.1);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  border: 1px solid rgba(0,150,136,0.2);
  transition: all 0.4s;
}
.showcase-item:hover .showcase-icon {
  background: rgba(0,150,136,0.2);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0,150,136,0.2);
}
.showcase-icon img {
  width: 38px; height: 38px;
  object-fit: contain;
  filter: brightness(1.8) saturate(1.1);
}
.showcase-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  font-family: var(--font-secondary);
  color: var(--text-light);
}
.showcase-item p {
  font-size: 0.875rem;
  opacity: 0.6;
  line-height: 1.65;
}

/* ---- GitHub button ---- */
.projects .button-container,
.content .button-container {
  display: flex;
  justify-content: center;
  padding: 20px 0 40px;
}
.github-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 30px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.35s;
  letter-spacing: 0.5px;
  margin: 10px;
}
.github-button:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,150,136,0.28);
}

/* ---- Contact page ---- */
.contact-box {
  border: 1px solid rgba(0,150,136,0.12) !important;
  border-radius: 16px !important;
  position: relative;
  overflow: hidden;
  --mouse-x: 50%;
  --mouse-y: 50%;
}
.contact-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y),
    rgba(0,229,215,0.07) 0%,
    rgba(0,150,136,0.03) 40%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.contact-box:hover::after { opacity: 1; }
.contact-box > * { position: relative; z-index: 1; }
.contact-left {
  border-right: 1px solid rgba(255,255,255,0.06) !important;
}

/* Floating label wrapper */
.float-group {
  position: relative;
  margin-bottom: 8px;
}
.float-group input,
.float-group textarea {
  width: 100%;
  padding: 22px 15px 8px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px !important;
  color: white !important;
  font-size: 15px !important;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s !important;
  margin-bottom: 0 !important;
  outline: none;
}
.float-group input:focus,
.float-group textarea:focus {
  border-color: var(--primary) !important;
  background: rgba(0,150,136,0.04) !important;
  box-shadow: 0 0 0 3px rgba(0,150,136,0.1) !important;
}
.float-group input::placeholder,
.float-group textarea::placeholder {
  opacity: 0;
}
.float-group label {
  position: absolute;
  left: 15px; top: 15px;
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  transition: all 0.25s ease;
  pointer-events: none;
  margin: 0 !important;
  font-weight: 400;
  display: block;
}
.float-group input:focus + label,
.float-group input:not(:placeholder-shown) + label,
.float-group textarea:focus + label,
.float-group textarea:not(:placeholder-shown) + label {
  top: 6px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary-light);
}
.float-group input.error {
  border-color: #ff5252 !important;
  box-shadow: 0 0 0 3px rgba(255,82,82,0.1) !important;
}

/* Success message */
.success-message {
  background: rgba(0,150,136,0.12);
  border: 1px solid rgba(0,150,136,0.35);
  border-radius: 8px;
  padding: 14px 20px;
  color: var(--primary-light);
  font-size: 0.95rem;
  margin-top: 15px;
  animation: fadeSlideUp 0.4s ease;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Social buttons */
.social-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
  letter-spacing: 0.5px;
}
.social-btn:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,150,136,0.25);
}

/* ---- Active nav link ---- */
.navbar ul li a.active {
  color: var(--primary-light);
}
.navbar ul li a.active::after {
  width: 100%;
}

/* ---- Footer enhancements ---- */
footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,150,136,0.5), rgba(0,229,215,0.4), transparent);
}
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 30px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}
.footer-logo img {
  filter: drop-shadow(0 0 8px rgba(0,150,136,0.25));
}
.footer-links h3,
.footer-contact h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--primary-light);
}
.footer-links ul li a {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  transition: color 0.3s;
  text-decoration: none;
}
.footer-links ul li a:hover { color: var(--primary-light); }
.footer-contact p { color: rgba(255,255,255,0.5); font-size: 0.9rem; }
.footer-bottom {
  text-align: center;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.25);
}

/* ============================================================
   BUG FIXES
   ============================================================ */

/* Fix 1: style.css has `transform: translateY(30%)` on .content which
   pushes the hero section down, creating huge empty space and making
   hero elements miss the checkVisibility threshold. */
.banner .content {
  transform: none !important;
}

/* Fix 2: Make index banner a proper full-screen hero.
   Do NOT use flex on .banner — the sticky navbar breaks inside a flex container.
   Glow orbs with filter:blur() can inflate container height even with overflow:hidden,
   so we use position:fixed for the orbs and a simple padding hero. */
.banner.hero-grid-bg {
  position: relative;
  overflow: visible; /* don't let blur inflate height */
}
/* Reposition orbs as fixed so they don't affect layout flow */
.banner.hero-grid-bg .glow-orb {
  position: fixed;
  z-index: -1;
}
.banner.hero-grid-bg .content {
  padding: 80px 20px 100px;
  margin: 0 !important;
  width: 100% !important;
}

/* Fix 3: Hero elements should animate in via CSS (not JS scroll trigger)
   since they're above the fold. Use CSS keyframe animation instead. */
.banner .content .animate-on-scroll {
  opacity: 0;
  animation: heroFadeUp 0.7s ease forwards;
}
.banner .content .animate-on-scroll:nth-child(1) { animation-delay: 0.1s; }
.banner .content .animate-on-scroll:nth-child(2) { animation-delay: 0.25s; }
.banner .content .animate-on-scroll:nth-child(3) { animation-delay: 0.45s; }
.banner .content .animate-on-scroll:nth-child(4) { animation-delay: 0.65s; }
.banner .content .animate-on-scroll:nth-child(5) { animation-delay: 0.85s; }

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fix 4a: style.css has a global `span { position: absolute; width: 0 }`
   rule intended only for button fill-hover spans. It breaks ALL spans
   (breadcrumb items, stat numbers, labels, tags, etc).
   Reset every span that is NOT a button fill span. */
span {
  position: static;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  z-index: auto;
  transition: none;
}
/* Restore the intended button fill-hover spans */
button > span:first-child:not(.btn-text):not(.scroll-label) {
  position: absolute !important;
  background: var(--gradient-primary) !important;
  height: 100% !important;
  width: 0 !important;
  border-radius: 30px !important;
  left: 0 !important;
  bottom: 0 !important;
  z-index: -1 !important;
  transition: 0.4s !important;
}
button:hover > span:first-child:not(.btn-text):not(.scroll-label) {
  width: 100% !important;
}

/* Fix 4b: .send-button .btn-text is a <span> and gets caught by the
   generic `button span { position: absolute; z-index: -1 }` rule in
   modern.css, making the button text invisible. */
.send-button .btn-text {
  position: relative !important;
  z-index: 2 !important;
  background: transparent !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px;
}

/* Fix 5: page-hero breadcrumb — fix word direction so it reads
   "Home / Page" left to right, and ensure proper centering. */
.breadcrumb {
  direction: ltr;
  unicode-bidi: normal;
}

/* Fix 6: animate-on-scroll threshold — lower it so elements just
   below the fold become visible sooner on real scroll */
.animate-on-scroll {
  transition: opacity 0.7s ease, transform 0.7s ease !important;
}

/* Fix 7: contact-left border override from style.css (was solid white) */
.contact-left {
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: none !important;
}
@media (max-width: 768px) {
  .contact-left {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .page-hero h1 { font-size: 2.2rem; }
  .stat-item { padding: 10px 28px; }
  .stat-number { font-size: 2.2rem; }
  .preview-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .project-filters { gap: 8px; }
  .filter-btn { padding: 7px 16px; font-size: 0.78rem; }
}
@media (max-width: 480px) {
  .stats-bar { flex-direction: column; align-items: center; }
  .stat-item:not(:last-child)::after { display: none; }
  .page-hero h1 { font-size: 1.9rem; }
  .stat-number { font-size: 1.9rem; }
}

/* ============================================================
   MOBILE REVAMP — comprehensive smartphone fixes
   ============================================================ */

/* M1: Remove legacy translateY from .projects wrapper (style.css) */
.projects {
  transform: none !important;
}

/* M2: Navbar — wider container on mobile so hamburger sits properly */
@media (max-width: 768px) {
  .navbar {
    width: 92%;
  }
  /* Navbar dropdown top offset matches actual navbar height */
  .navbar ul {
    top: 60px !important;
  }
}

/* M3: Stats bar — tighter, cleaner on small screens */
@media (max-width: 480px) {
  .stats-bar {
    padding: 24px 12px 20px;
  }
  .stat-item {
    padding: 10px 16px;
    width: 100%;
    max-width: 240px;
  }
}

/* M4: Hero content — reduce excess padding on tiny screens */
@media (max-width: 480px) {
  .banner.hero-grid-bg .content {
    padding: 50px 16px 70px !important;
  }
  .content h2 {
    font-size: 1.75rem !important;
    letter-spacing: 0 !important;
  }
  .content > .content-container > p {
    font-size: 0.95rem;
  }
  .scroll-indicator {
    margin-top: 30px;
  }
}

/* M5: Preview section — single column on small screens */
@media (max-width: 480px) {
  .preview-section {
    padding: 40px 16px 60px;
  }
  .preview-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .preview-card {
    padding: 22px 18px;
  }
}

/* M6: Projects page — layout & padding */
@media (max-width: 768px) {
  .project-grid {
    padding: 16px;
    gap: 20px;
  }
  .project-showcase {
    padding: 0 16px 20px;
  }
  .projects .button-container {
    padding: 10px 0 30px;
  }
}
@media (max-width: 480px) {
  .showcase-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
  }
  .showcase-item {
    padding: 20px 16px;
  }
}

/* M7: Section subtitle — "Featured Projects" label in project.html */
.section-subtitle {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: var(--primary-light);
  opacity: 0.8;
  margin: 40px 0 20px;
  font-family: var(--font-secondary);
  font-weight: 600;
}

/* M8: About page — spacing & text sizes on mobile */
@media (max-width: 768px) {
  .about {
    padding: 40px 0;
  }
  .about .main {
    padding: 20px 16px;
  }
  .about .text h1 {
    font-size: 2rem;
  }
  .about-stats {
    justify-content: center;
    gap: 8px;
  }
  .about-stat {
    padding: 10px 16px;
    min-width: 85px;
  }
  .about-stat .stat-number {
    font-size: 1.7rem;
  }
}

/* M9: Join section — mobile spacing */
@media (max-width: 768px) {
  .join {
    padding: 60px 24px !important;
    margin-top: 0 !important;
  }
  .join h1 {
    font-size: 2rem;
  }
  .join p {
    font-size: 0.95rem;
  }
}

/* M10: Partner section mobile */
@media (max-width: 768px) {
  .partner {
    padding: 40px 20px 50px;
  }
  .partner h1 {
    font-size: 2rem;
  }
}

/* M11: Footer — stack properly on mobile */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px 20px;
    gap: 28px;
  }
  .footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .footer-links h3,
  .footer-contact h3 {
    margin-bottom: 10px;
  }
  .footer-contact p {
    line-height: 1.8;
  }
}

/* M12: Contact page — ensure box stacks and no overflow */
@media (max-width: 768px) {
  .contact {
    width: 94%;
    padding: 20px 0;
  }
  .contact-box {
    margin-top: 20px;
  }
  .contact-left {
    padding: 28px 20px !important;
  }
  .contact-right {
    padding: 28px 20px;
  }
  .input-row {
    flex-direction: column;
    gap: 0;
  }
  .input-row .input-group,
  .input-row .float-group {
    flex-basis: 100%;
    width: 100%;
  }
}

/* M13: Prevent horizontal overflow site-wide */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* M14: Banner on sub-pages — reset min-height, no overflow */
.banner:not(.hero-grid-bg) {
  min-height: 0;
  overflow: visible;
}

/* M15: GitHub button on mobile */
@media (max-width: 480px) {
  .github-button {
    font-size: 0.9rem;
    padding: 12px 22px;
    margin: 5px;
  }
}
