.public-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 10px 0;
  background: #fff;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(14, 8, 76, 0.14);
  box-shadow: 0 10px 30px rgba(14, 8, 76, 0.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
  transition: background-color 0.25s ease, box-shadow 0.25s ease,
    -webkit-backdrop-filter 0.25s ease, backdrop-filter 0.25s ease;
}

.public-header.is-scrolled {
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 34px rgba(14, 8, 76, 0.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  backdrop-filter: blur(22px) saturate(1.12);
}

.public-header__inner {
  width: min(1200px, calc(100% - 32px));
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.public-header__logo {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  line-height: 0;
}

.public-header__logo picture {
  display: block;
}

.public-header__logo img {
  display: block;
  width: auto;
  height: 54px;
  max-width: min(230px, 45vw);
  object-fit: contain;
}

.public-header__nav {
  margin-left: auto;
}

.public-header__nav ul {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-header__nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 7px 2px;
  color: #0e084c;
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.public-header__nav a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: #0e084c;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.public-header__nav a:hover,
.public-header__nav a:focus-visible {
  color: #0e084c;
  opacity: 0.78;
}

.public-header__nav a:hover::after,
.public-header__nav a:focus-visible::after {
  transform: scaleX(1);
}

.public-header__nav a:focus-visible,
.public-header__toggle:focus-visible {
  outline: 2px solid #0e084c;
  outline-offset: 4px;
}

.public-header__toggle {
  display: none;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0e084c;
  cursor: pointer;
}

.public-header__toggle span {
  display: block;
  width: 25px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.public-header__toggle.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.public-header__toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.public-header__toggle.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.public-header__backdrop {
  display: none;
}

@media (max-width: 768px) {
  .public-header {
    padding: 8px 0;
  }

  .public-header__inner {
    width: min(100% - 28px, 1200px);
    min-height: 52px;
    gap: 16px;
  }

  .public-header__logo img {
    height: 48px;
    max-width: 52px;
  }

  .public-header__toggle {
    position: relative;
    z-index: 1002;
    display: flex;
  }

  .public-header__nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: min(82%, 320px);
    max-width: calc(100% - 52px);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: calc(88px + env(safe-area-inset-top, 0px))
      max(24px, env(safe-area-inset-right, 0px))
      calc(28px + env(safe-area-inset-bottom, 0px)) 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    background: rgba(255, 255, 255, 0.96);
    border-left: 1px solid rgba(14, 8, 76, 0.14);
    box-shadow: -18px 0 42px rgba(14, 8, 76, 0.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.08);
    backdrop-filter: blur(24px) saturate(1.08);
    visibility: hidden;
    pointer-events: none;
    clip-path: inset(0 0 0 100%);
    transition: clip-path 0.28s ease, visibility 0s linear 0.28s;
    contain: layout paint;
  }

  .public-header__nav.is-open {
    visibility: visible;
    pointer-events: auto;
    clip-path: inset(0);
    transition-delay: 0s;
  }

  .public-header__nav ul {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translate3d(28px, 0, 0);
    transition: opacity 0.2s ease, transform 0.28s ease;
  }

  .public-header__nav.is-open ul {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .public-header__nav a {
    width: 100%;
    min-height: 50px;
    padding: 12px 0;
    font-size: 1.12rem;
    white-space: normal;
  }

  .public-header__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.34);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
  }

  .public-header__backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-header,
  .public-header__nav,
  .public-header__backdrop,
  .public-header__nav ul,
  .public-header__nav a,
  .public-header__nav a::after,
  .public-header__toggle span {
    transition: none;
  }
}
