/* ===============================================
   HAKSHAN 客善 — Design tokens
   =============================================== */

/* Brand typeface — Brother 1816 (clean) for body / nav / buttons,
   Brother 1816 Printed (the textured "stamped" cut matching the HAKSHAN
   wordmark) for headings. */
@font-face {
  font-family: "Brother 1816";
  src: url("../fonts/Brother-1816-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brother 1816";
  src: url("../fonts/Brother-1816-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brother 1816";
  src: url("../fonts/Brother-1816-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brother 1816";
  src: url("../fonts/Brother-1816-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Brother 1816 Printed";
  src: url("../fonts/Brother-1816-Printed-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brother 1816 Printed";
  src: url("../fonts/Brother-1816-Printed-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brother 1816 Printed";
  src: url("../fonts/Brother-1816-Printed-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brother 1816 Printed";
  src: url("../fonts/Brother-1816-Printed-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Visually-hidden but available to screen readers and search engines */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  /* Brand palette */
  --cream:   #EBDFC4;  /* Primary */
  --forest:  #4F5D48;  /* Secondary */
  --paper:   #F9F7F2;  /* Tertiary */

  /* Derived ink + accent neutrals */
  --ink:        #2A2E27;
  --ink-soft:   #4F5D48;
  --mute:       #8A8775;
  --line:       #C9BE9F;
  --line-soft:  #DDD2B5;
  --warm-50:    #F4ECD8;
  --shadow:     0 30px 60px -30px rgba(42, 46, 39, 0.35);

  /* Type — Brother 1816 Printed (textured cut, matches the wordmark)
     for headings; clean Brother 1816 for body, nav, buttons, labels. */
  --serif:     "Brother 1816 Printed", "Brother 1816", "Helvetica Neue", Arial, sans-serif;
  --display:   "Brother 1816 Printed", "Brother 1816", "Helvetica Neue", Arial, sans-serif;
  --italic:    "Playfair Display", "Brother 1816", Georgia, serif;
  --sans:      "Brother 1816", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, Menlo, monospace;
  --cn:        "Noto Serif SC", "Brother 1816", serif;

  /* Rhythm */
  --rail: clamp(20px, 4vw, 64px);
  --maxw: 1440px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Brother 1816 has no italic — never let the browser fake-slant it.
     Inherits to all descendants. */
  font-synthesis: none;
}

body[data-lang="zh"] { font-family: var(--cn); }

img { display: block; max-width: 100%; }

/* Featured-image fill: make WP-rendered <img> behave like the .ph placeholder
   inside any aspect-ratio'd card visual, so it covers the slot without
   pushing the card past its intended size. */
.oc-card__visual img,
.sc-card__visual img,
.og-card__visual img,
.dish__visual img,
.anchor__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.oc-card__visual,
.sc-card__visual,
.og-card__visual,
.dish__visual,
.anchor__visual { overflow: hidden; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--forest); color: var(--cream); }

/* ============== Reusable building blocks ============== */

/* Brother 1816 ships only as upright weights, so we disable italic
   synthesis globally on headings — `font-style: italic` declarations
   will render upright instead of being faux-slanted.
   We also lighten the default heading weight from 700 (browser default)
   to 400 so the editorial heading sizes don't feel oppressive. */
h1, h2, h3, h4, h5, h6, .h-display {
  font-synthesis: none;
  font-style: normal;
  font-weight: 400;
}

.h-display {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-wrap: balance;
}

.h-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--forest);
  font-weight: 500;
}

.h-eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--forest);
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 10px;
  transform: translateY(-1px);
}

.h-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 56ch;
  text-wrap: pretty;
}

.h-rule {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* Photo placeholder */
.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgba(79, 93, 72, 0.06) 0 8px,
      rgba(79, 93, 72, 0.02) 8px 16px),
    linear-gradient(180deg, #d8cfb3 0%, #c4ba98 100%);
  color: var(--forest);
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(42, 46, 39, 0.55);
  text-align: center;
  padding: 0 16px;
}

/* ============== Top navigation ============== */

/* Nav-mount + foot-mount act as transparent wrappers so the sticky nav can
   stick relative to the body (sticky only works within its parent's bounds). */
#nav-mount, #foot-mount { display: contents; }

.nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--rail);
  background: rgba(249, 247, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.nav--dark {
  background: rgba(79, 93, 72, 0.92);
  color: var(--cream);
  border-bottom-color: rgba(235, 223, 196, 0.15);
}

.nav__brand {
  display: flex;
  align-items: center;
  height: 44px;
}
.nav__brand img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__links a {
  position: relative;
  padding: 4px 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}
.nav__links a:hover { opacity: 1; }
.nav__links a.is-active { opacity: 1; font-weight: 700; }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
}

.nav__right { display: flex; align-items: center; gap: 18px; }

.lang-toggle {
  display: inline-flex;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.9;
}
.lang-toggle button {
  background: transparent;
  border: none;
  color: inherit;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  opacity: 0.6;
  transition: all 0.2s ease;
}
.lang-toggle button.is-on {
  background: currentColor;
  opacity: 1;
}
.lang-toggle button.is-on span { color: var(--paper); mix-blend-mode: difference; }
.nav--dark .lang-toggle button.is-on { background: var(--cream); color: var(--forest); }
.nav .lang-toggle button.is-on { background: var(--forest); color: var(--paper); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid currentColor;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav__cta:hover { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.nav--dark .nav__cta:hover { background: var(--cream); color: var(--forest); border-color: var(--cream); }

/* ============== Burger (mobile only) ============== */

.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav__burger:hover { border-color: currentColor; }
.nav__burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============== Drawer (mobile slide-out menu) ============== */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
}
.drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}
.drawer__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(42, 46, 39, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  /* Use the dynamic viewport unit on browsers that support it so the
     panel matches the *actual* visible viewport on iOS Safari (which
     shrinks when the bottom URL bar is shown). Fall back to 100% on
     older browsers. */
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  width: min(360px, 92vw);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 28px 28px 32px;
  /* Let the contents scroll when the menu plus the Reserve CTA plus
     the foot info exceed the panel height (small phones, landscape). */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
  box-shadow: -40px 0 80px -40px rgba(42, 46, 39, 0.35);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer__brand {
  display: flex;
  align-items: center;
  height: 36px;
}
.drawer__brand img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}
.drawer__close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  font-family: var(--serif);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.drawer__close:hover {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}
.drawer__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}
.drawer__links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left 0.2s ease, color 0.2s ease;
}
.drawer__links a:hover { padding-left: 8px; color: var(--forest); }
.drawer__links a.is-active { color: var(--forest); }
.drawer__links a [data-zh] {
  font-family: var(--cn);
  font-size: 14px;
  letter-spacing: 0.2em;
  opacity: 0.55;
}
.drawer__divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0 24px;
  display: none; /* spacing handled by nav border already */
}
.drawer__lang {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.drawer__label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--forest);
  font-weight: 500;
}
.drawer__lang .lang-toggle {
  border-color: var(--forest);
  color: var(--forest);
}
.drawer__lang .lang-toggle button.is-on {
  background: var(--forest);
}
.drawer__lang .lang-toggle button.is-on span {
  color: var(--paper);
  mix-blend-mode: difference;
}
.drawer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  background: var(--forest);
  color: var(--cream);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}
.drawer__cta:hover { background: var(--ink); }
.drawer__cta .arr { transition: transform 0.2s ease; }
.drawer__cta:hover .arr { transform: translateX(4px); }
.drawer__foot {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--forest);
  opacity: 0.7;
}
body.drawer-open { overflow: hidden; }

/* ============== Footer ============== */

.foot {
  background: var(--forest);
  color: var(--cream);
  padding: 80px var(--rail) 36px;
  margin-top: 0;
}
.foot__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.foot__brand .word {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.9;
  display: block;
  letter-spacing: -0.02em;
}
.foot__brand .cn {
  font-family: var(--cn);
  font-size: 22px;
  letter-spacing: 0.4em;
  opacity: 0.7;
  margin-top: 18px;
  display: block;
}
.foot h5 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 18px;
  opacity: 0.6;
}
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.foot ul a { opacity: 0.85; transition: opacity 0.2s; }
.foot ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.foot__bottom {
  max-width: var(--maxw);
  margin: 64px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(235, 223, 196, 0.18);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.6;
}
.foot__ver {
  font-family: var(--mono);
  opacity: 0.7;
  margin-left: 4px;
}

/* ============== Buttons ============== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: var(--cream);
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn:hover { background: transparent; color: var(--forest); }
.btn--ghost { background: transparent; color: var(--forest); }
.btn--ghost:hover { background: var(--forest); color: var(--cream); }
.btn--cream { background: var(--cream); color: var(--forest); border-color: var(--cream); }
.btn--cream:hover { background: transparent; color: var(--cream); }
.btn .arr {
  display: inline-block;
  transition: transform 0.25s ease;
}
.btn:hover .arr { transform: translateX(4px); }

/* ============== Utility ============== */

.section { padding: clamp(80px, 12vw, 160px) var(--rail); }
.section--tight { padding: clamp(60px, 8vw, 100px) var(--rail); }
.container { max-width: var(--maxw); margin: 0 auto; }

[data-lang="zh"] [data-en] { display: none; }
[data-lang="en"] [data-zh] { display: none; }

/* ============== Reveal animation ============== */

[data-reveal] {
  /* Auto-fade in on load — does not depend on JS firing. */
  opacity: 0;
  transform: translateY(20px);
  animation: revealFade 0.9s ease 0.05s forwards;
}
@keyframes revealFade {
  to { opacity: 1; transform: translateY(0); }
}
/* If JS adds .is-in (legacy paths), keep visible without retriggering animation */
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

@media (max-width: 800px) {
  .foot__grid { grid-template-columns: 0fr; }
  .nav { padding: 12px 20px; }
  .nav__brand { height: 33px; }
  .nav__links,
  .nav__right { display: none; }
  .nav__burger { display: inline-flex; }
}
