:root{
  --brand1:#F28C28; /* orange */
  --brand2:#7B1E1E; /* maroon */
}
/* Reset */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;line-height:1.5;transition:background .3s,color .3s}
a{color:inherit;text-decoration:none}

/* Dark mode base */
body.dark-mode{background:#121212;color:#fff}

/* ===== NAVBAR ===== */
.navbar{
  position:fixed; top:0; left:0; width:100%;
  background:transparent; /* clear on hero (desktop) */
  z-index:1100;
  transition:background .3s, box-shadow .3s, backdrop-filter .3s;
}
.navbar-inner{
  max-width:1200px; margin:auto; padding:12px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.logo img{height:50px; display:block}

/* Desktop nav */
.desktop-nav{display:none; gap:26px; align-items:center}
.desktop-nav a{position:relative; font-weight:600; letter-spacing:.2px}

/* Desktop: white links at top over hero */
/* ===== Fallback (works everywhere): permanent dark navbar on desktop ===== */
@media (min-width:769px){
  .navbar{
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12);
  }
}

/* ===== CSS-only translucent background ON SCROLL (desktop) =====
   This overrides the fallback in browsers that support scroll-driven animations. */
@supports (animation-timeline: scroll()) {
  @media (min-width:769px){

    /* Define a scroll timeline based on the page scroll */
    @scroll-timeline navScroll {
      source: root;           /* use the document scroll */
      orientation: block;     /* vertical scroll */
    }

    /* Start transparent at the very top */
    .navbar{
      background: transparent;
      box-shadow: none;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;

      /* Animate background as the page scrolls from 0 -> 120px */
      animation: navFade 1s linear both;
      animation-timeline: navScroll;
      animation-range: 0 120px;  /* adjust this distance to taste */
    }

    @keyframes navFade {
      from {
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
      }
      to {
        background: rgba(255, 254, 254, 0.92);
        box-shadow: 0 2px 10px rgba(204, 203, 203, 0.12);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
      }
    }
  }
}
@media (min-width:769px){
  .desktop-nav { display: flex; }
  .navbar .desktop-nav a { color: #fff; }
  .navbar .icon-btn { color: #fff; }
}
  /* Permanent gradient background for big screens inspired by logo */
@media (min-width:769px){
  .navbar {
    background: linear-gradient(
      to right,
      var(--brand1) 0%,        /* orange */
      var(--brand2) 25%,       /* maroon */
      rgba(0, 0, 0, 0.92) 80%  /* dark fade */
    ) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
  }
}
/* underline for active/hover */
.desktop-nav a.active::after,
.desktop-nav a:hover::after{
  content:""; position:absolute; left:0; bottom:-6px; height:2px; width:100%;
  background:linear-gradient(45deg,var(--brand1),var(--brand2));
}

/* Actions (dark + hamburger) */
.nav-actions{display:flex; align-items:center; gap:10px; position:relative; z-index:1200}
.icon-btn{
  background:none; border:0; cursor:pointer; font-size:22px; line-height:1; padding:6px 8px;
  color:#fff;  /* visible over hero */
}

/* Hamburger visibility */
.hamburger{display:inline-flex}
@media (min-width:769px){ .hamburger{display:none} }

/* ===== MOBILE DRAWER ===== */
.mobile-drawer{
  position:fixed; top:0; right:0; height:100vh; width:260px;
  transform:translateX(100%);
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
  display:flex; flex-direction:column; align-items:flex-start; gap:20px;
  padding:80px 22px 22px;
  transition:transform .35s ease; z-index:1300;
}
.mobile-drawer.open{ transform:translateX(0) }
.mobile-drawer a{
  font-weight:700;
  background:linear-gradient(45deg,var(--brand1),var(--brand2));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.close-btn{
  position:absolute; top:16px; right:16px; font-size:28px; line-height:1;
  background:none; border:0; cursor:pointer; color:#111;
}
body.dark-mode .mobile-drawer{ background:rgba(18,18,18,.95) }
body.dark-mode .mobile-drawer a{ background:none; -webkit-text-fill-color:#fff }
body.dark-mode .close-btn{ color:#fff }

/* Content demo + section offsets */
section{scroll-margin-top:80px}
#home{height:100vh; background:url('assets/hero.jpg') center/cover no-repeat}
#services{padding:64px 20px; background:#fafafa}
#about{min-height:100vh; background:#f0f0f0}
#contact{min-height:100vh; background:#eaf3ff}
body.dark-mode #services{background:#0f0f0f}
body.dark-mode #about{background:#111}
body.dark-mode #contact{background:#0e1420}

/* Example cards dark-mode */
.card{background:#fff; color:#222; border:1px solid #eee; border-radius:12px; padding:18px; box-shadow:0 1px 4px rgba(0,0,0,.05)}
body.dark-mode .card{background:#1e1e1e; color:#fff; border-color:#2a2a2a; box-shadow:0 1px 6px rgba(0,0,0,.4)}


@media (min-width: 769px) {
  .navbar.dark-on-scroll {
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    transition: background 0.3s ease, box-shadow 0.3s ease;
  }
}


.navbar.scrolled {
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Navbar dark background when scrolled (all screens) */
header.navbar.__dark,
.navbar.__dark {
  background: rgba(20, 20, 20, 0.92) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* (optional) performance hint */
.navbar { will-change: background, box-shadow, backdrop-filter; }


/* ===== NAV ICON ADAPTIVE COLORS ===== */

/* Hamburger (☰) */
body:not(.dark-mode) .icon-btn.hamburger {
  color: #111; /* dark in light mode */
}
body.dark-mode .icon-btn.hamburger {
  color: #fff; /* white in dark mode */
}

/* Drawer Close Button (✕) */
body:not(.dark-mode) .close-btn {
  color: #111; /* dark in light mode */
}
body.dark-mode .close-btn {
  color: #fff; /* white in dark mode */
}

/* Dark Mode Toggle (🌙 / ☀️) */
body:not(.dark-mode) #darkToggle {
  color: #111; /* dark in light mode */
}
body.dark-mode #darkToggle {
  color: #fff; /* white in dark mode */
}

/* active state only for menu links, not the logo */
.desktop-nav a.active,
.mobile-drawer a.active { border-bottom: 3px solid var(--accent); }

/* prevent focus/target outline on the logo */
.logo, .logo img { outline: none; border: 0; }
.logo:focus { outline: none; }
#top:target { outline: none; }
