.site-header {
  position: sticky;
  top: 0;
  z-index: 1500;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px clamp(18px, 3vw, 54px);
  background: linear-gradient(105deg, rgba(61, 5, 11, .98), rgba(126, 5, 15, .97) 48%, rgba(61, 5, 11, .98)), url('pattern.jpg') center/cover;
  border-bottom: 1px solid rgba(229, 181, 82, .52);
  box-shadow: 0 7px 30px rgba(22, 0, 4, .26);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.site-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}

.site-brand-copy {
  min-width: 0;
  color: #fff4df;
  font-size: clamp(18px, 1.55vw, 26px);
  font-weight: 700;
  letter-spacing: .12em;
  white-space: nowrap;
  text-shadow: 0 2px 9px rgba(0, 0, 0, .35);
}

.site-brand-copy span { color: #e5b552; }

.primary-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 1.75vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav li { position: relative; }

.primary-nav a,
.primary-nav button {
  display: block;
  padding: 12px 0;
  border: 0;
  background: none;
  color: #f7dfaa;
  text-decoration: none;
  font: 700 clamp(13px, .82vw, 16px)/1.2 "Noto Serif TC", serif;
  letter-spacing: .08em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .22s ease;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .3);
}

.primary-nav a::after,
.primary-nav button::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 5px;
  height: 1px;
  background: #f7cf75;
  transition: left .22s ease, right .22s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav button:hover,
.primary-nav button:focus-visible { color: #fff8e9; }

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after,
.primary-nav button:hover::after,
.primary-nav button:focus-visible::after { left: 0; right: 0; }

.header-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.tool-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  padding: 5px;
  border: 1px solid rgba(242, 201, 112, .34);
  border-radius: 50%;
  background: rgba(60, 0, 8, .28);
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.tool-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-link.hours-tool {
  color: #ffe36e;
  font: 800 9px/1.05 "Noto Sans TC", sans-serif;
  letter-spacing: 0;
  text-align: center;
}

.tool-link.hours-tool span { display: block; }

.tool-link:hover,
.tool-link:focus-visible {
  z-index: 2;
  transform: translateY(-2px);
  border-color: #f4ce7b;
  background: rgba(255, 255, 255, .12);
  outline: none;
}

.tool-link::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, -4px);
  min-width: max-content;
  max-width: 210px;
  padding: 7px 10px;
  border: 1px solid rgba(229, 181, 82, .38);
  border-radius: 5px;
  background: #21070a;
  color: #fff0cf;
  font: 600 12px/1.35 system-ui, sans-serif;
  letter-spacing: .03em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.tool-link:hover::after,
.tool-link:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.header-menu-toggle {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(242, 201, 112, .45);
  border-radius: 5px;
  background: rgba(62, 0, 8, .35);
  color: #f4d58d;
  font-size: 22px;
  cursor: pointer;
}

.hero-title-mobile { display: none; }

@media (max-width: 1220px) {
  .site-header { grid-template-columns: minmax(190px, 1fr) auto; }
  .primary-nav { order: 3; grid-column: 1 / -1; }
  .header-tools { grid-column: 2; grid-row: 1; }
  .site-header { padding-bottom: 6px; }
  .primary-nav a, .primary-nav button { padding: 8px 0 10px; }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 0;
    grid-template-columns: minmax(112px, 1fr) auto;
    grid-template-areas:
      "brand tools"
      "nav nav";
    column-gap: 6px;
    row-gap: 5px;
    padding: 7px 8px 0;
  }
  .site-brand {
    grid-area: brand;
    gap: 6px;
  }
  .site-brand img { width: 34px; height: 34px; }
  .site-brand-copy {
    font-size: clamp(12px, 3.7vw, 16px);
    letter-spacing: .05em;
  }
  .header-menu-toggle { display: none; }
  .primary-nav {
    grid-area: nav;
    display: block;
    order: 0;
    width: 100%;
  }
  .header-tools {
    grid-area: tools;
    display: flex;
    order: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 0;
  }
  .primary-nav ul {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }
  .primary-nav a,
  .primary-nav button {
    width: 100%;
    padding: 8px 1px 9px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.1);
    font-size: clamp(9.5px, 2.8vw, 12px);
    letter-spacing: 0;
  }
  .tool-link {
    width: 28px;
    height: 28px;
    padding: 3px;
  }
  .tool-link.hours-tool { font-size: 6.6px; }
  .tool-link::after { display: none; }
  .tool-link.tip-open::after {
    display: block;
    min-width: 190px;
    max-width: calc(100vw - 28px);
    text-align: center;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
  .contact-icons .tool-link.tip-open::after {
    top: auto;
    bottom: calc(100% + 10px);
  }
  .hero-title-desktop { display: none; }
  .hero-title-mobile { display: inline; }
}

@media (max-width: 360px) {
  .site-header {
    grid-template-columns: minmax(102px, 1fr) auto;
    column-gap: 4px;
    padding-inline: 6px;
  }
  .site-brand { gap: 4px; }
  .site-brand img { width: 30px; height: 30px; }
  .site-brand-copy { font-size: 12px; }
  .header-tools { gap: 2px; }
  .tool-link { width: 25px; height: 25px; padding: 2px; }
  .tool-link.hours-tool { font-size: 6px; }
}
