/* Shared home navigation. Keep every brand rule inside the header. */
#header {
  --navigation-gutter: clamp(24px, 6.4vw, 112px);
  position: absolute;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  width: 100%;
  max-width: none;
  height: 100px;
  min-height: 0;
  margin: 0;
  padding: 0 var(--navigation-gutter);
  border: 0;
  border-bottom: 1px solid #ffffff12;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-family: Pretendard, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
  word-break: keep-all;
  transition: background .35s, box-shadow .35s, transform .35s;
}

#header, #header *, #header *::before, #header *::after { box-sizing: border-box; }
#header a { color: inherit; text-decoration: none; }
#header a, #header button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#header a:focus-visible, #header button:focus-visible { outline: 2px solid #63abdc; outline-offset: 6px; }

#header.is-fixed {
  position: fixed;
  height: 80px;
  background: #fbfcfdef;
  color: #17212d;
  box-shadow: 0 1px 0 #1c27351a;
  backdrop-filter: blur(18px);
  animation: navigation-header-in .3s cubic-bezier(.22, 1, .36, 1);
}

#header .brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  white-space: nowrap;
  line-height: normal;
}
#header .brand img {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 36px;
  max-width: 100%;
  margin: 0;
  object-fit: contain;
  filter: none;
  opacity: 1;
}
#header:not(.is-fixed) .brand img { filter: brightness(0) invert(1); opacity: .94; }
#header .brand > span { font-size: 22px; font-weight: 780; letter-spacing: -.7px; line-height: normal; }
#header .brand > span > span { font-weight: 450; }

#header .nav {
  position: static;
  inset: auto;
  display: flex;
  flex: 0 1 auto;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  order: 0;
  gap: 38px;
  width: auto;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-size: 13px;
  line-height: normal;
}
#header .nav a {
  position: relative;
  display: block;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 480;
  line-height: normal;
  letter-spacing: normal;
  white-space: nowrap;
  opacity: .83;
}
#header .nav a::after {
  position: absolute;
  display: block;
  content: '';
  left: 0;
  right: 100%;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transition: right .3s;
}
#header .nav a:hover::after, #header .nav a[aria-current]::after { right: 0; }

#header .header-contact {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  margin: 0 0 0 45px;
  padding: 13px 17px;
  border: 1px solid #ffffff43;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: normal;
  white-space: nowrap;
}
#header .header-contact span { margin: 0; font-size: 18px; font-weight: 400; line-height: normal; }
#header.is-fixed .header-contact { border-color: #1f354c55; }

#header .menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 35px;
  margin: 0;
  padding: 10px 0 10px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font: inherit;
  cursor: pointer;
  appearance: none;
}
#header .menu-toggle span {
  display: block;
  flex: 0 0 auto;
  width: 21px;
  height: 1px;
  margin: 0;
  padding: 0;
  background: currentColor;
  transform: none;
  transition: transform .2s;
}

/* These pages previously reserved a header row in normal document flow. */
#header ~ main .guide-hero { padding-top: 100px; }
#header ~ main .chapter-nav { top: 80px; }
#header ~ main > .chapter-nav ~ section[id] { scroll-margin-top: 60px; }
#header ~ main .diagnosis-hero { min-height: 480px; padding-top: 163px; }
#header ~ main #results-title, #header ~ main #measurements-title { scroll-margin-top: 75px; }

@keyframes navigation-header-in {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

@media (min-width: 1800px) {
  #header { --navigation-gutter: max(100px, calc((100vw - 1540px) / 2)); }
}
@media (max-width: 1100px) {
  #header .nav { gap: 25px; }
  #header .header-contact { margin-left: 15px; }
}
@media (max-width: 760px) {
  #header { --navigation-gutter: 25px; height: 80px; gap: 18px; }
  #header.is-fixed { height: 70px; }
  #header .brand { gap: 7px; }
  #header .brand img { width: 32px; height: 28px; }
  #header .brand > span { font-size: 18px; }
  #header .header-contact { margin: 0 0 0 auto; font-size: 10px; padding: 10px 12px; gap: 10px; }
  #header .header-contact span { font-size: 15px; }
  #header .menu-toggle { display: flex; flex-direction: column; gap: 5px; }
  #header .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
  #header .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
  #header .nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 20px 25px 28px;
    background: #f7fafc;
    color: #162536;
    box-shadow: 0 14px 18px #0a122015;
  }
  #header .nav.is-open { display: flex; }
  #header .nav a { font-size: 16px; padding: 13px 0; }
  #header .nav a::after { display: none; }
  #header ~ main .guide-hero { padding-top: 80px; }
  #header ~ main .chapter-nav { top: 70px; }
  #header ~ main > .chapter-nav ~ section[id] { scroll-margin-top: 40px; }
  #header ~ main .diagnosis-hero { min-height: 460px; padding-top: 143px; }
  #header ~ main #results-title, #header ~ main #measurements-title { scroll-margin-top: 55px; }
}
@media (max-width: 700px) {
  #header ~ main .diagnosis-hero { min-height: 410px; padding-top: 125px; }
  #header ~ main .diagnosis-hero .hero-orbit { top: 150px; }
}
@media (max-width: 380px) {
  #header { --navigation-gutter: 21px; gap: 12px; }
  #header .brand > span { font-size: 16px; }
  #header .brand img { width: 28px; }
  #header .header-contact { font-size: 9px; gap: 7px; padding: 9px; }
  #header ~ main .diagnosis-hero { min-height: 390px; }
}
@media (prefers-reduced-motion: reduce) {
  #header, #header *, #header *::after { animation: none !important; transition: none !important; }
}
@media print {
  #header { display: none !important; }
  #header ~ main .guide-hero { padding-top: 0; }
}
