/* ============================================
   BBHME — Premium Institutional Site
   Light clean + verde tech + dark
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green: #00C853;
  --green-dark: #00A844;
  --green-light: #69F0AE;
  --dark: #0d1117;
  --dark-2: #161b22;
  --dark-3: #1c2333;
  --text: #24292f;
  --text-secondary: #57606a;
  --text-light: #e6edf3;
  --text-light-secondary: #8b949e;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --border: #d0d7de;
  --border-light: #e8ecf0;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.08);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.12);
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
  --transition-slow: 0.6s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Container --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 20px 0;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.nav--scrolled {
  padding: 12px 0;
  border-bottom-color: var(--border-light);
  background: rgba(255,255,255,0.92);
}
.nav__container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
}
.nav__logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--dark); color: var(--green);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.nav__logo-text { color: var(--dark); }
.nav__menu { display: flex; align-items: center; gap: 8px; }
.nav__link {
  padding: 8px 16px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
  transition: var(--transition);
}
.nav__link:hover { color: var(--text); background: var(--bg-alt); }
.nav__link--cta {
  background: var(--dark); color: var(--text-light); margin-left: 8px;
}
.nav__link--cta:hover { background: var(--dark-2); color: var(--green-light); }
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; transition: var(--transition); border-radius: 2px;
}

/* --- Hero --- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
#heroCanvas { width: 100%; height: 100%; opacity: 0.35; }
.hero__content { position: relative; z-index: 1; max-width: 820px; }
.hero__badge {
  display: inline-block; padding: 8px 20px; border-radius: 100px;
  background: rgba(0,200,83,0.08); color: var(--green-dark);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.03em;
  margin-bottom: 32px; border: 1px solid rgba(0,200,83,0.15);
}
.hero__title {
  font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.03em;
  color: var(--dark); margin-bottom: 28px;
}
.hero__title-accent {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__subtitle {
  font-size: 1.2rem; line-height: 1.7; color: var(--text-secondary);
  max-width: 620px; margin-bottom: 44px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  z-index: 1;
}
.hero__scroll-line {
  width: 1px; height: 60px; background: var(--border);
  position: relative; overflow: hidden;
}
.hero__scroll-line::after {
  content: ''; position: absolute; top: -60px; left: 0;
  width: 1px; height: 60px;
  background: linear-gradient(180deg, transparent, var(--green));
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine { 0% { top: -60px; } 100% { top: 60px; } }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; border-radius: 10px;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  transition: var(--transition); cursor: pointer; border: none;
  position: relative; overflow: hidden;
}
.btn--primary {
  background: var(--dark); color: var(--text-light);
}
.btn--primary:hover {
  background: var(--dark-2); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.btn--outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--green); color: var(--green-dark);
  transform: translateY(-2px);
}
.btn--lg { padding: 18px 44px; font-size: 1.05rem; border-radius: 12px; }

/* --- Sections --- */
.section { padding: 120px 0; }
.section--light { background: var(--bg); }
.section--dark { background: var(--dark); color: var(--text-light); }
.section--accent {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-3) 100%);
  color: var(--text-light); padding: 80px 0;
}
.section__header { max-width: 640px; margin-bottom: 72px; }
.section__label {
  display: inline-block; font-size: 0.82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green-dark); margin-bottom: 16px;
}
.section__label--light { color: var(--green-light); }
.section__title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  color: var(--dark);
}
.section__title--light { color: var(--text-light); }
.section__desc {
  margin-top: 20px; font-size: 1.1rem; line-height: 1.75;
  color: var(--text-secondary);
}

/* --- About --- */
.about__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.about__card {
  padding: 40px 32px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.about__card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: rgba(0,200,83,0.2);
}
.about__card-icon {
  width: 48px; height: 48px; margin-bottom: 24px; color: var(--green);
}
.about__card-icon svg { width: 100%; height: 100%; }
.about__card h3 {
  font-family: var(--font-display); font-size: 1.3rem;
  font-weight: 600; margin-bottom: 12px;
}
.about__card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }

/* --- Stats --- */
.stats__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 48px 24px; text-align: center; padding: 40px 0;
}
.stat { }
.stat__number {
  font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700; color: var(--green); line-height: 1;
}
.stat__suffix {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700; color: var(--green-light);
}
.stat__label {
  display: block; margin-top: 8px;
  font-size: 0.9rem; color: var(--text-light-secondary);
}

/* --- Services --- */
.services__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.service {
  padding: 48px 40px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border-light);
  transition: var(--transition); position: relative;
}
.service:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: rgba(0,200,83,0.2);
}
.service__number {
  position: absolute; top: 24px; right: 32px;
  font-family: var(--font-display); font-size: 4rem; font-weight: 700;
  color: rgba(0,0,0,0.03); line-height: 1;
}
.service__icon {
  width: 44px; height: 44px; color: var(--green); margin-bottom: 24px;
}
.service__icon svg { width: 100%; height: 100%; }
.service__title {
  font-family: var(--font-display); font-size: 1.4rem;
  font-weight: 600; margin-bottom: 14px;
}
.service__desc {
  color: var(--text-secondary); font-size: 0.95rem;
  line-height: 1.75; margin-bottom: 24px;
}
.service__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.service__tags li {
  padding: 4px 14px; border-radius: 100px;
  background: rgba(0,200,83,0.06); color: var(--green-dark);
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid rgba(0,200,83,0.12);
}

/* --- Portfolio --- */
.portfolio__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.portfolio__card {
  padding: 40px 32px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border-light);
  transition: var(--transition); height: 100%;
}
.portfolio__card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-xl);
  border-color: rgba(0,200,83,0.2);
}
.portfolio__icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent); margin-bottom: 24px;
}
.portfolio__icon svg { width: 26px; height: 26px; }
.portfolio__card h3 {
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 600; margin-bottom: 10px;
}
.portfolio__card p {
  color: var(--text-secondary); font-size: 0.9rem;
  line-height: 1.65; margin-bottom: 20px;
}
.portfolio__platforms {
  font-size: 0.78rem; font-weight: 600; color: var(--green-dark);
  padding: 4px 14px; border-radius: 100px;
  background: rgba(0,200,83,0.06); display: inline-block;
  border: 1px solid rgba(0,200,83,0.12);
}

/* --- Cases --- */
.cases__list { display: flex; flex-direction: column; gap: 24px; }
.case {
  padding: 48px; border-radius: var(--radius-lg);
  background: var(--dark-2); border: 1px solid rgba(255,255,255,0.06);
  transition: var(--transition);
}
.case:hover {
  transform: translateY(-2px);
  border-color: rgba(0,200,83,0.15);
  box-shadow: 0 12px 48px rgba(0,0,0,.3);
}
.case__header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.case__badge {
  padding: 4px 14px; border-radius: 100px;
  background: rgba(0,200,83,0.1); color: var(--green);
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid rgba(0,200,83,0.2);
}
.case__title {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
}
.case__desc {
  color: var(--text-light-secondary); font-size: 0.95rem;
  line-height: 1.7; margin-bottom: 32px; max-width: 700px;
}
.case__metrics { display: flex; gap: 48px; flex-wrap: wrap; }
.case__metric-value {
  display: block; font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700; color: var(--green);
}
.case__metric-label {
  display: block; font-size: 0.82rem;
  color: var(--text-light-secondary); margin-top: 4px;
}

/* --- Stack --- */
.stack__categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.stack__category-title {
  font-family: var(--font-display); font-size: 0.85rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary); margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.stack__items { display: flex; flex-direction: column; gap: 8px; }
.stack__item {
  padding: 10px 16px; border-radius: 8px;
  background: var(--bg-alt); border: 1px solid var(--border-light);
  font-size: 0.9rem; font-weight: 500; color: var(--text);
  transition: var(--transition);
}
.stack__item:hover {
  border-color: rgba(0,200,83,0.25); background: rgba(0,200,83,0.04);
  transform: translateX(4px);
}

/* --- Formation --- */
.formation__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
.formation__icon {
  width: 48px; height: 48px; color: var(--green); margin: 0 auto 16px;
}
.formation__item h3 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  color: var(--text-light);
}

/* --- CTA --- */
.cta__block {
  text-align: center; padding: 80px; border-radius: var(--radius-xl);
  background: var(--bg-alt); border: 1px solid var(--border-light);
}
.cta__title {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 700; margin-bottom: 16px;
}
.cta__desc { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 36px; }

/* --- Contact --- */
.contact__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact__item {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 48px 32px; border-radius: var(--radius-lg);
  background: var(--dark-2); border: 1px solid rgba(255,255,255,0.06);
  transition: var(--transition);
}
.contact__item:hover {
  transform: translateY(-4px); border-color: rgba(0,200,83,0.2);
}
.contact__item svg {
  width: 32px; height: 32px; color: var(--green); margin-bottom: 20px;
}
.contact__label {
  font-size: 0.82rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-light-secondary); margin-bottom: 8px;
}
.contact__value { font-size: 1rem; font-weight: 500; color: var(--text-light); }

/* --- Footer --- */
.footer {
  padding: 48px 0; background: var(--dark);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer__content { text-align: center; }
.footer__brand {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 20px;
}
.footer__brand .nav__logo-text { color: var(--text-light); }
.footer__info {
  color: var(--text-light-secondary); font-size: 0.85rem;
  line-height: 1.8;
}
.footer__copy {
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--text-light-secondary); font-size: 0.82rem;
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(.4,0,.2,1), transform 0.8s cubic-bezier(.4,0,.2,1);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.15s; }
.reveal:nth-child(6) { transition-delay: 0.25s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .about__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr; }
  .portfolio__grid { grid-template-columns: repeat(2, 1fr); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; }
  .formation__grid { grid-template-columns: 1fr; gap: 24px; }
  .case__metrics { gap: 32px; }
}

@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .section__header { margin-bottom: 48px; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero__subtitle { font-size: 1.05rem; }
  .portfolio__grid { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .case { padding: 32px; }
  .case__title { font-size: 1.2rem; }
  .case__metrics { gap: 24px; }
  .cta__block { padding: 48px 24px; }

  .nav__toggle { display: block; z-index: 1001; }
  .nav__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav__toggle.active span:nth-child(2) { opacity: 0; }
  .nav__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
  .nav__menu {
    position: fixed; top: 0; right: -100%; width: 80%; max-width: 360px;
    height: 100vh; background: var(--bg);
    flex-direction: column; align-items: flex-start;
    padding: 100px 32px 32px; gap: 4px;
    transition: var(--transition-slow);
    box-shadow: -20px 0 60px rgba(0,0,0,.1);
  }
  .nav__menu.active { right: 0; }
  .nav__link { width: 100%; font-size: 1.1rem; padding: 12px 16px; }
  .nav__link--cta { margin-left: 0; margin-top: 16px; text-align: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .stats__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
