﻿.util-bar {
  background: var(--ink-950);
  color: var(--on-dark-2);
  font-size: var(--fs-micro);
  height: var(--util-h);
}
.util-bar .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.util-bar a {
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color var(--t-fast) var(--ease);
}
.util-bar a:hover,
.util-bar__logout:hover { color: var(--white); }
.util-bar__logout {
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: inherit;
  transition: color var(--t-fast) var(--ease);
}
.util-bar__greet { padding: 6px 10px; }
.util-bar__greet strong { font-weight: 700; color: inherit; }
.util-bar__list { display: flex; align-items: center; gap: 4px; }
.util-bar .sep { width: 1px; height: 12px; background: var(--ink-800); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  position: static;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand img { height: 38px; width: auto; }

.gnb { height: var(--header-h); }
.gnb__list {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.gnb__item {
  position: static;
  display: flex;
  align-items: center;
}
.gnb__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.gnb__link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  background: var(--red-600);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-mid) var(--ease);
}
.gnb__item:hover > .gnb__link,
.gnb__item.is-open > .gnb__link,
.gnb__link[aria-current="page"],
.gnb__item:focus-within > .gnb__link { color: var(--blue-600); }
.gnb__item:hover > .gnb__link::after,
.gnb__item.is-open > .gnb__link::after,
.gnb__link[aria-current="page"]::after,
.gnb__item:focus-within > .gnb__link::after { transform: scaleX(1); }

.mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  transform: translateY(6px);
  width: auto;
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 48px -24px rgba(7, 17, 31, 0.28);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--t-mid) var(--ease),
    transform var(--t-mid) var(--ease),
    visibility 0s linear var(--t-mid);
  pointer-events: none;
}
.gnb__item:hover > .mega,
.gnb__item.is-open > .mega,
.gnb__item:focus-within > .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
  pointer-events: auto;
}
.mega__inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  max-width: 960px;
  margin-inline: auto;
  padding: 32px 36px;
}
.mega__head {
  border-right: 1px solid var(--line);
  padding-right: 32px;
}
.mega__head h2 {
  font-size: var(--fs-h3);
  color: var(--text);
  margin-bottom: 8px;
}
.mega__head p {
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.6;
}
.mega__head .mega__all {
  display: inline-block;
  margin-top: 18px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.mega__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  align-content: start;
}
.mega__list a {
  display: block;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--radius);
  transition: background var(--t-fast) var(--ease);
}
.mega__list a:hover,
.mega__list a:focus-visible { background: var(--paper); }
.mega__list strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.mega__list span {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.5;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.menu-toggle__bar {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: background var(--t-fast);
}
.menu-toggle__bar::before,
.menu-toggle__bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform var(--t-mid) var(--ease);
}
.menu-toggle__bar::before { top: -7px; }
.menu-toggle__bar::after { top: 7px; }
.menu-open .menu-toggle__bar { background: transparent; }
.menu-open .menu-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

.drawer {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}
.btn--primary { background: var(--blue-600); color: var(--white); }
.btn--primary:hover { background: var(--blue-700); }
.btn--light { background: var(--white); color: var(--ink-900); }
.btn--light:hover { background: var(--blue-100); }
.btn--ghost { border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn--ghost-dark { border-color: var(--line-strong); color: var(--text); }
.btn--ghost-dark:hover { border-color: var(--text); }

.site-footer {
  background: var(--ink-900);
  color: var(--on-dark-2);
  padding: 56px 0 36px;
  font-size: var(--fs-small);
}
.site-footer__top {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--ink-800);
}
.site-footer .brand img { filter: brightness(0) invert(1); height: 40px; }
.site-footer__desc { margin-top: 16px; line-height: 1.7; max-width: 34ch; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
}
.footer-nav h3 {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--on-dark);
  margin-bottom: 12px;
}
.footer-nav a {
  display: block;
  padding: 4px 0;
  transition: color var(--t-fast) var(--ease);
}
.footer-nav a:hover { color: var(--white); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: var(--fs-micro);
  color: var(--on-dark-2);
}

@media (max-width: 1180px) {
  .gnb__link { padding: 0 12px; font-size: 1rem; }
  .gnb__link::after { left: 12px; right: 12px; }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .gnb { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-header__inner { gap: 16px; }

  .drawer {
    display: block;
    position: fixed;
    inset: calc(var(--header-h) + var(--util-h)) 0 0 0;
    background: var(--white);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--t-mid) var(--ease);
    visibility: hidden;
    z-index: 90;
  }
  .menu-open .drawer {
    transform: translateX(0);
    visibility: visible;
  }
  .drawer__group { border-bottom: 1px solid var(--line); }
  .drawer__summary {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    padding: 0 var(--gutter);
    font-size: 1.0625rem;
    font-weight: 700;
    text-align: left;
  }
  .drawer__summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text);
    border-bottom: 2px solid var(--text);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--t-mid) var(--ease);
  }
  .drawer__group.is-open .drawer__summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
  }
  .drawer__panel {
    display: none;
    padding: 0 var(--gutter) 16px;
  }
  .drawer__group.is-open .drawer__panel { display: block; }
  .drawer__panel a {
    display: block;
    min-height: 44px;
    line-height: 44px;
    color: var(--text-2);
  }
  .drawer__panel a:hover { color: var(--blue-600); }
  .drawer__single {
    display: block;
    min-height: 56px;
    line-height: 56px;
    padding: 0 var(--gutter);
    font-size: 1.0625rem;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
  }
  .drawer__util {
    display: flex;
    gap: 8px;
    padding: 20px var(--gutter);
  }
  .drawer__util { flex-wrap: wrap; }
  .drawer__util a,
  .drawer__util button { flex: 1; }
  .drawer__greet { flex-basis: 100%; margin-bottom: 4px; font-size: var(--fs-small); color: var(--text-2); }
  .drawer__greet strong { color: var(--text); }

  .site-footer__top { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 640px) {
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .util-bar { display: none; }
  .drawer { inset: var(--header-h) 0 0 0; }
}
