.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(243, 236, 226, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
  overflow: visible;
}

.header-inner {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.logo-mark {
  width: 0.72rem;
  height: 1.7rem;
  background: var(--color-copper);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-text small {
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

.nav-desktop {
  margin-left: auto;
}

.nav-desktop > ul {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
}

.nav-desktop a {
  font-size: 0.92rem;
  position: relative;
  padding: 0.4rem 0;
}

.nav-desktop > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-copper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav-desktop > ul > li > a:hover::after,
.nav-desktop > ul > li > a[aria-current="page"]::after {
  transform: scaleX(1);
}

.has-submenu {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.has-submenu > a {
  display: inline-flex;
  align-items: center;
  min-height: var(--header-h);
  padding: 0;
}

.has-submenu > a::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.55;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 12.5rem;
  padding: 0.35rem 0 0;
  margin: 0;
  list-style: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s var(--ease), visibility 0.15s;
  z-index: 200;
}

/* 填補父選單與下拉之間空隙，避免 hover 斷開 */
.submenu::before {
  content: "";
  display: block;
  height: 0.35rem;
}

.submenu li {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-top: 0;
  box-shadow: var(--shadow-soft);
}

.submenu li:first-child {
  border-top: 1px solid var(--color-line);
}

.submenu a {
  display: block;
  padding: 0.75rem 1rem;
  white-space: nowrap;
  font-size: 0.88rem;
}

.submenu a:hover,
.submenu a[aria-current="page"] {
  background: rgba(139, 74, 49, 0.08);
  color: var(--color-copper);
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.header-cta {
  display: none;
  background: var(--color-copper);
  color: #fbf7f0;
  padding: 0.55rem 1rem;
  min-height: 44px;
  align-items: center;
  letter-spacing: 0.04em;
}

.header-cta:hover {
  background: var(--color-copper-deep);
}

.menu-toggle,
.menu-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-ink);
  position: relative;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-bars::before {
  top: -7px;
}

.menu-toggle-bars::after {
  top: 7px;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  z-index: 3000;
  background: var(--color-night);
  color: var(--color-surface);
  overflow-y: auto;
  padding: 1.2rem 1.2rem 2.5rem;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 2rem;
}

.mobile-nav .logo-text small {
  color: #cbbfaf;
}

.mobile-nav .menu-close {
  margin-left: 0;
  color: var(--color-surface);
  font-size: 0.9rem;
  width: auto;
  min-width: 44px;
  padding: 0 0.4rem;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav-list > a,
.mobile-nav-group > a:first-child {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  border-bottom: 1px solid rgba(251, 247, 240, 0.12);
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(251, 247, 240, 0.12);
}

.mobile-nav-group > a:first-child {
  border-bottom: 0;
}

.mobile-sublink {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0 0.85rem 1rem;
  font-size: 1.05rem;
  color: #d7c8b6;
}

.mobile-nav-cta {
  margin-top: 2rem;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 0 1.2rem;
  background: var(--color-copper);
  color: #fff;
}

.site-footer {
  background: var(--color-night);
  color: #ebe4d8;
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

.footer-grid h2,
.footer-grid h3 {
  color: #fff;
  font-size: 1.35rem;
}

.footer-grid a:hover {
  color: #d7b39e;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #b7aea3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  justify-content: space-between;
}

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border: 0;
  background: var(--color-copper);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (min-width: 980px) {
  .menu-toggle {
    display: none;
  }

  .header-cta {
    display: inline-flex;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
}

@media (max-width: 979px) {
  .nav-desktop,
  .header-cta {
    display: none;
  }
}
