/* ==========================================================================
   Lebegő üvegfejléc (pirula alakú sáv, mobilon lenyíló menü)
   Jelölés: src/sections/header.html · Viselkedés: js/main.js
   Állapotok a .site-header elemen: .is-scrolled, .is-menu-open
   ========================================================================== */

.site-header {
  --hdr-top: 14px;
  --hdr-bar-h: calc(var(--header-h) - 4px);
  position: fixed; z-index: 1000;
  top: calc(env(safe-area-inset-top, 0px) + var(--hdr-top));
  left: 0; right: 0;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  pointer-events: none;
  transition: top .5s var(--ease);
}
.site-header.is-scrolled { --hdr-top: 10px; --hdr-bar-h: calc(var(--header-h) - 10px); }

.site-header__bar {
  pointer-events: auto; position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  max-width: 1080px; height: var(--hdr-bar-h); margin-inline: auto;
  padding: 0 9px 0 10px; border-radius: var(--r-pill);
  background: rgba(12, 20, 25, .46);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .2);
  transition: height .5s var(--ease), background-color .5s var(--ease), box-shadow .5s var(--ease);
}
/* Üvegperem: fényesebb a bal felső és a jobb alsó sarokban */
.site-header__bar::before, .site-menu::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .07) 22%, rgba(255, 255, 255, .03) 55%, rgba(255, 255, 255, .12) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.site-header.is-scrolled .site-header__bar,
.site-header.is-menu-open .site-header__bar { background: rgba(9, 15, 19, .74); box-shadow: 0 14px 44px rgba(0, 0, 0, .42), 0 1px 2px rgba(0, 0, 0, .25); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; font-size: 1.02rem; justify-self: start; white-space: nowrap; }
.brand__jel { width: 30px; height: 30px; flex: none; }

.site-header__bal { display: flex; align-items: center; gap: 6px; justify-self: start; }
.site-nav { display: flex; align-items: center; gap: 2px; }

/* A szem a fejléc közepén: a főoldalon a nyitóképernyő szeme érkezik ide (js/fooldal.js), az aloldalakon itt ül */
.site-header__kozep { display: grid; place-items: center; width: 52px; height: 30px; }
.fej-szem { display: block; width: 52px; color: var(--accent); transition: transform .3s var(--ease), color .3s var(--ease); }
.fej-szem:hover { transform: scale(1.08); color: var(--accent-bright); }
.site-nav a {
  display: inline-flex; align-items: center; height: 36px; padding-inline: 14px; border-radius: var(--r-pill);
  font-size: .9375rem; font-weight: 500; color: var(--text-muted);
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .06); }

.site-header__veg { display: flex; align-items: center; gap: 8px; justify-self: end; }
.menu-gomb {
  display: none; flex: none; width: 40px; height: 40px; border-radius: 50%; place-items: center;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
}
.menu-gomb svg { width: 18px; height: 18px; }
.menu-gomb .ikon-zar { display: none; }
.is-menu-open .menu-gomb .ikon-nyit { display: none; }
.is-menu-open .menu-gomb .ikon-zar { display: block; }

/* Mobil menü */
.site-menu {
  pointer-events: auto; position: relative; display: none;
  max-width: 1080px; margin: 8px auto 0; padding: 10px; border-radius: 28px;
  background: rgba(9, 15, 19, .86);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.site-menu a {
  display: flex; align-items: center; justify-content: space-between; height: 52px; padding-inline: 18px; border-radius: 18px;
  font-size: 1.05rem; font-weight: 500;
}
.site-menu a:active { background: rgba(255, 255, 255, .06); }
.site-menu .btn { width: 100%; margin-top: 6px; }

/* A Kódszem rajza és a pislogás (a nyitóképernyő nagy szeme és a fejléc kis szeme ugyanaz a rajz) */
.szem__rajz { display: block; width: 100%; height: auto; aspect-ratio: 680 / 460; animation: pislogas 6.4s linear infinite; }
.fej-szem .szem__rajz { animation-delay: -2.1s; }
@keyframes szem-be { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
/* Pislogás: a szemhéj egy függőlegesen összezáródó ellipszis-kivágás; a pupilla közben nem torzul */
@keyframes pislogas {
  0%, 44%, 49.500%, 88%, 91.500%, 93.500%, 97%, 100% { clip-path: ellipse(52% 52% at 50% 50%); }
  46.500% { clip-path: ellipse(52% 1.500% at 50% 50%); }
  89.700% { clip-path: ellipse(52% 1.500% at 50% 50%); }
  95.200% { clip-path: ellipse(52% 1.500% at 50% 50%); }
}

@media (max-width: 700px) {
  .site-header__bar { padding: 0 8px; }
  .site-nav { display: none; }
  .menu-gomb { display: grid; }
  .is-menu-open .site-menu { display: block; }
  .site-header__kozep, .fej-szem { width: 46px; }
}
