@font-face {
  font-family: "Gallery Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/gallery-serif.woff") format("woff");
}

:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --card: #fffdfa;
  --ink: #29251f;
  --muted: #665d52;
  --rule: #e4ddd2;
  --accent: #845638;
  --serif: "Gallery Serif", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --sans: "Source Sans 3", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.frame {
  width: min(1280px, calc(100% - 2 * clamp(16px, 4.8vw, 72px)));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header { border-bottom: 1px solid var(--rule); }

.masthead {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  font: 600 22px/1 var(--serif);
  letter-spacing: .08em;
  white-space: nowrap;
}

.wordmark-icon {
  position: relative;
  width: 24px;
  height: 26px;
  border: 1px solid var(--accent);
  border-radius: 50% 50% 1px 1px / 46% 46% 1px 1px;
  color: var(--accent);
}

.wordmark-icon::before {
  content: "";
  position: absolute;
  inset: 5px 5px 0;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
}

.masthead nav {
  display: flex;
  gap: clamp(12px, 2.4vw, 34px);
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.masthead nav a:first-child {
  color: var(--ink);
  font-weight: 600;
}

.studio-contact {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 30px);
  margin-inline-start: auto;
  font-size: 1rem;
  line-height: 1.5;
  font-style: normal;
}

.studio-phone, .studio-address {
  display: grid;
  align-content: center;
  align-items: baseline;
  gap: 2px 9px;
}

.studio-phone {
  min-height: 44px;
  grid-template-columns: max-content max-content;
}

.studio-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.studio-phone strong {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .015em;
  font-variant-numeric: tabular-nums;
}

.studio-wechat { color: var(--muted); font-size: 12px; white-space: nowrap; }
.studio-address {
  min-height: 44px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label hint" "street street";
  padding-inline-start: clamp(18px, 2vw, 30px);
  border-inline-start: 1px solid var(--rule);
}
.studio-address .studio-label { grid-area: label; }
.studio-street { grid-area: street; overflow-wrap: anywhere; }
.studio-unit { display: inline-block; max-width: 100%; }
.studio-map-hint {
  grid-area: hint;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  white-space: nowrap;
}
.studio-map-hint::after, .map-option::after {
  content: "";
  width: .46em;
  height: .46em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

html.map-picker-open { overflow: hidden; scrollbar-gutter: stable; }
.map-picker {
  position: fixed;
  inset: 0;
  width: min(390px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 22px 24px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule);
  border-radius: 16px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 16px 65px rgb(41 37 31 / .17);
}
.map-picker::backdrop { background: rgb(38 32 26 / .42); }
.map-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.map-heading h2 { font: 600 25px/1.3 var(--serif); }
.map-close {
  width: 44px;
  height: 44px;
  margin: -5px -7px -5px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font: 300 27px/1 var(--sans);
  cursor: pointer;
}
.map-address { margin: 9px 0 20px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.map-options { display: grid; gap: 8px; }
.map-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 8px 15px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  font-weight: 600;
}
.map-option:first-child { border-color: var(--accent); color: var(--card); background: var(--accent); }
.map-option:last-child:not(:first-child) { border-color: transparent; color: var(--muted); font-size: 14px; font-weight: 400; }
.map-close:active, .map-option:active { opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .map-picker[open] { animation: map-picker-enter 260ms cubic-bezier(.2,.7,.25,1) both; }
  .map-picker[open]::backdrop { animation: map-backdrop-enter 220ms ease-out both; }
  @keyframes map-picker-enter { from { opacity: 0; transform: translateY(10px); } }
  @keyframes map-backdrop-enter { from { opacity: 0; } }
}

@media (hover: hover) {
  .studio-phone:hover strong { text-decoration: underline; text-underline-offset: .18em; }
  .studio-address:hover .studio-street { text-decoration: underline; text-underline-offset: .18em; }
  .map-close:hover { background: var(--paper); }
  .map-option:hover { border-color: var(--accent); }
  .map-option:first-child:hover { background: #734a30; }
  .map-option:last-child:not(:first-child):hover { text-decoration: underline; text-underline-offset: .2em; }
}

@media (max-width: 900px) {
  .masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; }
  .masthead .wordmark { justify-self: start; min-height: 56px; }
  .masthead nav { justify-self: end; }
  .studio-contact {
    grid-column: 1 / -1;
    width: 100%;
    padding-block: 7px 9px;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 620px) {
  .frame { width: calc(100% - 2 * clamp(14px, 4.1vw, 23px)); }
  .masthead { min-height: 61px; }
  .wordmark { font-size: 19px; gap: 8px; }
  .wordmark-icon { width: 21px; height: 23px; }
  .wordmark-icon::before { inset: 4px 4px 0; }
  .masthead nav { gap: 13px; font-size: 12px; }
  .masthead .wordmark { min-height: 51px; }
  .studio-contact { display: grid; gap: 0; padding-block: 0 4px; font-size: .9375rem; }
  .studio-phone { grid-template-columns: max-content max-content 1fr; align-items: center; }
  .studio-address {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "label street hint";
    align-items: center;
    padding: 0;
    border: 0;
  }
  .studio-label { grid-column: auto; }
  .map-picker {
    inset: auto 0 0;
    width: 100%;
    max-height: calc(100% - 12px);
    margin: 0 auto;
    padding: 18px 20px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
