/* =====================================
   GLOBAL MOBILE FIXES
===================================== */

html, body{
  width: 100%;
  overflow-x: hidden;
}

/* container kitsamaks */
.container{
  padding-left: 20px;
  padding-right: 20px;
}

/* =====================================
   HEADER / NAV
===================================== */

@media (max-width: 900px){

  .header-inner{
    height: 72px;
  }

  .site-nav{
    display: none; /* hiljem teeme burgeri */
  }
}

/* =====================================
   HERO
===================================== */

@media (max-width: 768px){

  .hero{
    height: auto;
    min-height: 100vh;
    background-attachment: scroll;
  }

  .hero-content{
    padding: 0px 0 0px;
  }

  .hero-title{
    font-size: 32px;
    line-height: 1.15;
  }

  .hero-text{
    font-size: 16px;
  }
}

/* =====================================
   GRIDS → STACK
===================================== */

@media (max-width: 900px){

  .grid-3,
  .services-grid,
  .projects-grid,
  .why-stats-grid{
    grid-template-columns: 1fr !important;
  }
}

/* =====================================
   SERVICES OVERLAP – SAFE
===================================== */

@media (max-width: 900px){
  .services-overlap{
    margin-top: -60px;
  }
}


/* =====================================
   FOOTER
===================================== */

@media (max-width: 640px){

  .footer-inner{
    padding: 72px 20px 64px;
  }

  .footer-brand p{
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px){

  /* HERO – annab ruumi overlapiks */
  .hero{
    height: auto;
    min-height: 100vh;
    padding-bottom: 100px; /* 👈 ruum, kuhu services sisse sõidab */
  }

  /* SERVICES – tõstame hero peale */
  section.services{
    margin-top: -120px;   /* 👈 TEGELIK OVERLAP */
    position: relative;
    z-index: 5;
  }

}

/* hamburger -> X */
.nav-toggle.is-open span:nth-child(1){
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2){
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3){
  transform: translateY(-8px) rotate(-45deg);
}

/* FULLSCREEN MENU RESET */
.mobile-menu-links,
.mobile-menu-links ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-links li{
  list-style: none;
  margin: 18px 0;
}

/* LINK STYLING */
.mobile-menu-links a{
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.mobile-menu-links a:hover{
  color: var(--color-accent);
}



/* FULLSCREEN MENU ALLPOOL HEADERIT */
.mobile-menu{
  z-index: 1500;
}

/* HAMBURGER ALATI PEAL */
.nav-toggle{
  position: relative;
  z-index: 2100;
}

/* =========================
   FULLSCREEN MENU – RESET
========================= */

.mobile-menu nav,
.mobile-menu ul,
.mobile-menu li{
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* keskjoondus */
.mobile-menu-inner{
  text-align: center;
}

/* menüü read */
.mobile-menu li{
  margin: 18px 0;
}

/* LINK STYLING – LUKUS */
.mobile-menu a{
  color: #fff !important;
  font-size: 26px;
  font-weight: 700;
  text-decoration: none !important;
  display: inline-block;
}

.mobile-menu a:hover{
  color: var(--color-accent) !important;
}

/* =========================
   HEADER BACKGROUND LAYER
========================= */

/* taustakiht */
.site-header::before{
  content: "";
  position: absolute;
  inset: 0;

  background: rgba(15,23,42,.55);
  backdrop-filter: blur(12px);

  opacity: 0;
  transition: opacity .3s ease;

  z-index: -1; /* ⬅️ KRIITILINE */
}

.site-header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3000;
}

/* ⛔️ EEMALDA z-index:-1 */
.site-header::before{
  content:"";
  position:absolute;
  inset:0;

  background: rgba(15,23,42,.55);
  backdrop-filter: blur(12px);

  opacity:0;
  transition: opacity .25s ease;

  z-index: 0; /* ✅ MITTE -1 */
}

/* HEADER SISU PEAB OLEMA PEAL */
.site-header > *{
  position: relative;
  z-index: 1;
}

/* AINULT SCROLL */
.site-header.is-scrolled::before{
  opacity:1;
}

/* FULLSCREEN MENU */
.mobile-menu{
  position: fixed;
  inset: 0;
  z-index: 2000;

  background:
    linear-gradient(
      180deg,
      rgba(15,23,42,.95),
      rgba(15,23,42,.85)
    );

  display: none;
}

/* open */
.mobile-menu.is-open{
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header.menu-open::before{
  opacity: 0 !important;
}

/* HEADER PEIDUS MENÜÜ AJAL */
.site-header.menu-open{
  pointer-events: none;
}

.site-header.menu-open .site-logo,
.site-header.menu-open nav{
  opacity: 0;
}

/* X PEAB JÄÄMA */
.site-header.menu-open .nav-toggle{
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   HERO → NEXT SECTION OVERLAP (GLOBAL)
========================= */

/* kõik lehed */
.hero + .section{
  position: relative;
  z-index: 5;
}

/* teenused, esileht, kõik */
.hero + .section .services-overlap{
  margin-top: -180px;
}

/* mobiil */
@media (max-width: 768px){
  .hero + .section .services-overlap{
    margin-top: -80px;
  }
}

@media (max-width: 768px){
  .hero-services{
    min-height: 100vh;
    padding-bottom: 100px;
  }
}

/* ============================
   HERO RESPONSIVE FIX
============================ */

/* Desktop / Large */
@media (min-width: 1200px){
  .hero-content > .container{
    padding-left: 150px;
  }
}

/* Laptop */
@media (max-width: 1199px){
  .hero-content > .container{
    padding-left: 80px;
  }
}

/* Tablet */
@media (max-width: 900px){
  .hero-content > .container{
    padding-left: 40px;
  }
}

/* Mobile */
@media (max-width: 640px){
  .hero-content > .container{
    padding-left: 20px;   /* sama mis .container default */
  }
}

/* HERO – Mobile vertical position fix */
@media (max-width: 640px){

  .hero-content{
    padding-top: 24vh;   
  }

}

/* ============================
   SERVICES – FORCE MOBILE BUTTON FIX
============================ */
@media (max-width: 768px){

  /* pilt peab olema parent */
  .service-image{
    position: relative !important;
    overflow: hidden;
  }

  /* overlay alati nähtav */
  .service-overlay{
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;

    position: absolute !important;
    top: -10px;
    left: 10px;

    z-index: 10 !important;

    pointer-events: auto !important;

    background: none !important;
  }

  /* nupp ise */
  .service-link{
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;

    align-items: center;
    justify-content: center;

    padding: 3px 16px !important;

    border-radius: 12px !important;

    background: rgba(15,23,42,.95) !important;
    color: #fff !important;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none !important;

    border: 1px solid rgba(255,255,255,.15);

    box-shadow: 0 6px 20px rgba(15,23,42,.35);

    backdrop-filter: blur(6px);
  }

  /* eemaldame kõik peitmised */
  .service-image::before,
  .service-image::after,
  .service-overlay::before,
  .service-overlay::after{
    display:none !important;
  }
}

/* ============================
   HERO – MOBILE VERTICAL CONTROL
============================ */

@media (max-width: 768px){

  .hero{
    display: flex;
    align-items: flex-start; 
  }

  .hero-content{
    margin-top: 24vh;
    padding-top: 0 !important;
  }

}

/* Mobiilis veidi vähem */
@media (max-width: 768px){
  .hero.contact-hero .hero-content{
    transform: translateY(-160px) !important;
  }

  body.admin-bar .hero.contact-hero .hero-content{
    transform: translateY(-160px) !important;
  }
}