:root {
  --nano-green: #1b5e20;
  --nano-green-deep: #123d15;
  --nano-brown: #5d4037;
  --nano-blue: #4fc3f7;
  --nano-sand: #f4a261;
  --nano-cream: #f7f4ee;
  --nano-ink: #17211b;
  --nano-muted: #617265;
  --nano-border: rgba(27, 94, 32, 0.12);
  --nano-panel: rgba(255, 255, 255, 0.72);
  --nano-shadow: 0 24px 80px rgba(17, 37, 22, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--nano-ink);
  background:
    radial-gradient(circle at top left, rgba(79, 195, 247, 0.12), transparent 34%),
    radial-gradient(circle at top right, rgba(244, 162, 97, 0.08), transparent 28%),
    linear-gradient(180deg, #f8faf9 0%, #f2f5f3 100%);
}

.dark body,
body.dark {
  background:
    radial-gradient(circle at top left, rgba(79, 195, 247, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(244, 162, 97, 0.08), transparent 24%),
    linear-gradient(180deg, #0f1a12 0%, #131e16 100%);
  color: #e8efe7;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: "Poppins", sans-serif;
}

.pattern-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../images/pattern.svg");
  background-size: 420px;
  opacity: 0.08;
  pointer-events: none;
}

/* ensure decorative overlays do not intercept footer clicks */
.pattern-overlay {
  pointer-events: none;
}

.glass-panel {
  background: var(--nano-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--nano-shadow);
}

.dark .glass-panel,
body.dark .glass-panel {
  background: rgba(15, 26, 18, 0.58);
  border-color: rgba(255, 255, 255, 0.08);
}

.section-shell {
  position: relative;
  overflow: hidden;
}

.section-shell::after {
  content: "";
  position: absolute;
  inset: auto -8% -140px auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(79, 195, 247, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-scene {
  position: relative;
  overflow: hidden;
  border-radius: 1.55rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.14) 32%, rgba(255, 255, 255, 0.04) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.16)),
    url("../images/herobg.png") center/cover no-repeat;
  box-shadow: 0 18px 55px rgba(17, 37, 22, 0.09);
}

.hero-scene::before,
.hero-scene::after {
  content: "";
  position: absolute;
  inset: auto;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  border-radius: 999px;
  filter: blur(32px);
  opacity: 0.32;
  animation: floatOrb 12s ease-in-out infinite;
  pointer-events: none;
}

.hero-scene::before {
  top: -16%;
  right: -10%;
  background: rgba(79, 195, 247, 0.45);
}

.hero-scene::after {
  bottom: -22%;
  left: -12%;
  background: rgba(244, 162, 97, 0.28);
  animation-delay: -4s;
}

.dust-particles span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255, 247, 221, 0.32);
  animation: driftUp linear infinite;
}

.nav-solid {
  background: rgba(247, 244, 238, 0.92);
  box-shadow: 0 18px 60px rgba(13, 30, 18, 0.08);
  border-bottom: 1px solid rgba(27, 94, 32, 0.08);
  backdrop-filter: blur(16px);
}

.topbar-shell {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(27, 94, 32, 0.08);
}

.hero-card {
  background: rgba(244, 247, 249, 0.73);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(17, 37, 22, 0.1);
}

.hero-cta-dark {
  box-shadow: inset 0 0 0 2px rgba(231, 213, 171, 0.8), 0 10px 24px rgba(27, 94, 32, 0.18);
}

.side-motif {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 84px;
  opacity: 0.14;
  background-image: url("../images/pattern.svg");
  background-size: 240px;
  background-repeat: repeat-y;
  pointer-events: none;
}

.side-motif.left {
  left: -34px;
}

.side-motif.right {
  right: -34px;
  transform: scaleX(-1);
}

.hero-card-pattern {
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 100%;
  opacity: 0.12;
  background-image: url("../images/pattern.svg");
  background-size: 220px;
  background-position: right center;
  pointer-events: none;
}

.hero-card-tint {
  background: linear-gradient(180deg, rgba(248, 245, 231, 0.12), rgba(230, 206, 141, 0.22));
}

/* Shift hero cards to the right on large screens and ensure smooth layout
   The hero background spans the full width (hero-scene is full width),
   while the inner container remains centered with max-width. */
@media (min-width: 1024px) {
  .hero-scene .reveal > .ml-auto {
    transform: translateX(12vw);
    transition: transform 320ms cubic-bezier(.2,.9,.2,1);
  }
}

@media (min-width: 1280px) {
  .hero-scene .reveal > .ml-auto {
    transform: translateX(18vw);
  }
}

/* Prevent the cards from causing horizontal scroll when shifted */
.hero-scene {
  overflow: hidden;
}

.nav-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}

/* Ensure header logo scales responsively without breaking navigation layout */
#site-navbar img,
.topbar-shell img {
  max-height: 64px;
  height: auto;
  display: block;
}

/* Floating logo: let the logo overlap the header and the page content */
.site-logo-wrapper {
  position: relative;
  display: inline-block;
}
/* Fix the logo to the top-left of the viewport so it always floats above the navbar */

.site-logo {
  position: fixed;
  top: 6px;
  left: 2px; /* near flush to the left edge */
  width: 182px; /* base size increased by 30% */
  height: auto;
  border-radius: 6px;
  background: transparent; /* remove white backing */
  padding: 0; /* remove inner padding */
  box-shadow: 0 12px 28px rgba(8, 34, 12, 0.12);
  z-index: 160;
  transition: transform 160ms ease, left 160ms ease, top 160ms ease;
}

@media (min-width: 640px) {
  .site-logo { width: 286px; top: 8px; left: 4px; }
}
@media (min-width: 1024px) {
  .site-logo { width: 390px; top: 10px; left: 6px; }
}

/* Ensure the fixed navbar stays below the logo's z-index so the logo appears on top */
#site-navbar { z-index: 100; }

/* Reduce transient white/rect artifacts during scroll by promoting
   heavy elements to their own GPU layer and hinting the renderer. */
.hero-scene,
.topbar-shell,
.section-shell,
.glass-panel,
.pattern-overlay,
.nav-wrap {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform, opacity;
}

.nav-menu {
  justify-self: center;
}

.dark .nav-solid,
body.dark .nav-solid {
  background: rgba(11, 19, 14, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
  background: linear-gradient(90deg, var(--nano-green), var(--nano-blue));
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.dropdown-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.22s ease;
}

.group:hover > .dropdown-panel,
.group:focus-within > .dropdown-panel,
.dropdown-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

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

.parallax {
  will-change: transform;
}

.metric-bar {
  position: relative;
  overflow: hidden;
}

.metric-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nano-green), var(--nano-blue));
}

.before-after {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
}

.before-after-after {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid rgba(255, 255, 255, 0.8);
}

.before-after-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.18);
}

.dark-card {
  background: linear-gradient(145deg, rgba(18, 61, 21, 0.94), rgba(23, 33, 27, 0.92));
}

.page-hero {
  background:
    linear-gradient(180deg, rgba(8, 24, 18, 0.58), rgba(8, 24, 18, 0.72)),
    url("../images/chalbi-project.svg") center/cover no-repeat;
}

.page-hero.soft-water {
  background:
    linear-gradient(180deg, rgba(7, 32, 42, 0.56), rgba(8, 24, 18, 0.78)),
    url("../images/water-infra.svg") center/cover no-repeat;
}

.page-hero.soft-trees {
  background:
    linear-gradient(180deg, rgba(20, 52, 24, 0.54), rgba(8, 24, 18, 0.76)),
    url("../images/tree-initiative.svg") center/cover no-repeat;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
}

.dark .chip,
body.dark .chip {
  background: rgba(255, 255, 255, 0.05);
}

input, textarea, select {
  background: rgba(255, 255, 255, 0.72);
}

.dark input,
.dark textarea,
.dark select,
body.dark input,
body.dark textarea,
body.dark select {
  background: rgba(255, 255, 255, 0.06);
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, 18px, 0) scale(1.04); }
}

@keyframes driftUp {
  from { transform: translate3d(0, 0, 0); opacity: 0; }
  10%, 90% { opacity: 1; }
  to { transform: translate3d(0, -130px, 0); opacity: 0; }
}

@media (max-width: 1024px) {
  .dropdown-panel {
    position: static !important;
    visibility: visible;
    opacity: 1;
    transform: none;
    display: none;
    box-shadow: none;
    background: transparent;
    border: 0;
    padding: 0.25rem 0 0 1rem;
  }

  .dropdown-panel.open {
    display: block;
  }

  .hero-scene {
    min-height: 38rem;
    border-radius: 0;
  }

  .side-motif {
    display: none;
  }

  .nav-wrap {
    display: flex;
    justify-content: space-between;
  }
}
