/* Shared site header / nav — one source of truth for all pages */

html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--teal) 65%, var(--cream)) transparent;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--teal) 65%, var(--cream));
  border-radius: var(--pill);
  border: 3px solid var(--cream);
}
::-webkit-scrollbar-thumb:hover { background: var(--teal-600); }

/* Nav shell width matches every page */
.nav.wrap,
.nav.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 74px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -.01em;
}
.site-header .brand img {
  display: block;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 28%;
  flex: none;
  object-fit: contain;
}
.site-header .brand .k { color: var(--teal); }
.site-header .brand .k span { color: var(--pink-500); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 0;
  list-style: none;
}
.nav-links a {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--pill);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .96rem;
  color: var(--ink-soft);
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--teal-700); background: var(--teal-tint); }
.nav-links a.active { color: var(--teal-700); background: var(--teal-tint); }

.nav-social { display: inline-flex; gap: 6px; margin-left: 6px; }
.nav-social a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all .2s;
}
.nav-social a svg,
.nav-ig svg {
  width: 20px;
  height: 20px;
  max-width: none;
  flex: none;
  display: block;
}
.nav-social a:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  transform: translateY(-2px);
}

.nav-ig {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-left: auto;
  transition: all .2s;
}
.nav-ig:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

.nav-toggle { display: none; }

.kk-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  justify-content: space-around;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(76, 116, 128, .10);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
}
.kk-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  min-height: 46px;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .66rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color .25s ease;
}
.kk-tabbar a svg { width: 22px; height: 22px; position: relative; z-index: 1; }
.kk-tabbar a span { position: relative; z-index: 1; }
.kk-tabbar a.active { color: var(--teal-700); }
.kk-tabbar a.active svg { stroke: var(--teal); }
.kk-tabbar a::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 32% 28%,
    color-mix(in srgb, var(--pink) 88%, #fff) 0%,
    color-mix(in srgb, var(--pink) 62%, var(--pink-tint)) 52%,
    color-mix(in srgb, var(--teal) 18%, var(--pink-tint)) 100%);
  box-shadow:
    inset 0 -3px 10px color-mix(in srgb, var(--pink-500) 22%, transparent),
    inset 0 2px 6px color-mix(in srgb, #fff 55%, transparent);
  transform: scale(0);
  opacity: 0;
}
@keyframes kk-tab-bubble {
  0%   { transform: scale(0); opacity: .92; }
  28%  { transform: scale(1.08); opacity: .78; }
  52%  { transform: scale(1.28); opacity: .55; }
  76%  { transform: scale(1.55); opacity: .22; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes kk-tab-bubble-lift {
  0%   { transform: scale(1) translateY(0); }
  26%  { transform: scale(1.1) translateY(-3px); }
  52%  { transform: scale(1.04) translateY(-1px); }
  72%  { transform: scale(.98) translateY(1px); }
  100% { transform: scale(1) translateY(0); }
}
.kk-tabbar a.pop::before {
  animation: kk-tab-bubble .88s cubic-bezier(.22, 1, .36, 1) forwards;
}
.kk-tabbar a.pop svg,
.kk-tabbar a.pop span {
  animation: kk-tab-bubble-lift .88s cubic-bezier(.22, 1, .36, 1) forwards;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-ig { display: flex; }
  .kk-tabbar { display: flex; }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .kk-tabbar a.pop::before,
  .kk-tabbar a.pop svg,
  .kk-tabbar a.pop span { animation: none; }
}
