/* ==========================================================
   site.css — 瑞祥真人会馆 共享外壳
   1. Reset  2. Tokens  3. Typography  4. Layout
   5. Atoms  6. Figure  7. Header  8. Footer  9. Motion
   ========================================================== */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body { margin: 0; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

button, input, select, textarea { font: inherit; color: inherit; }

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

table { border-collapse: collapse; }

:focus-visible {
  outline: 2px solid #3F6F6A;
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #14100E;
  --ink-soft: #2C2622;
  --cinnabar: #B23A2F;
  --cinnabar-soft: #D9694F;
  --cinnabar-deep: #9B2F25;
  --gold: #D9A85C;
  --jade: #3F6F6A;
  --jade-soft: #8FB3AE;
  --paper: #F5EFE4;
  --sand: #FBF7F0;
  --line: #E2D8C8;
  --deep: #23423F;

  --font-display: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1200px;
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;

  --ink-08: rgba(20, 16, 14, .08);
  --ink-14: rgba(20, 16, 14, .14);
  --paper-12: rgba(245, 239, 228, .12);
  --paper-22: rgba(245, 239, 228, .22);
  --paper-55: rgba(245, 239, 228, .55);
  --paper-62: rgba(245, 239, 228, .62);
}

/* ---------- 3. Typography ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

main { display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(32px, 5.2vw, 76px); }
h2 { font-size: clamp(28px, 3.4vw, 52px); }
h3 { font-size: clamp(21px, 2vw, 28px); }
h4 { font-size: 19px; }

[id] { scroll-margin-top: 110px; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .28em;
  color: var(--cinnabar);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background-color: currentColor;
  flex: 0 0 auto;
}

.v-note {
  writing-mode: vertical-rl;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .3em;
  color: var(--cinnabar);
  user-select: none;
}

.prose { font-size: 17px; color: var(--ink-soft); }
.prose p { max-width: 34em; }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--ink); font-weight: 700; }

.prose a {
  color: var(--jade);
  border-bottom: 1px solid var(--jade-soft);
}

/* ---------- 4. Layout ---------- */
.wrap {
  width: min(var(--wrap), 100% - clamp(28px, 6vw, 72px));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(880px, 100% - clamp(28px, 6vw, 72px));
  margin-inline: auto;
}

.section { padding-block: clamp(64px, 9vw, 128px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }

/* ---------- 5. Atoms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: .82em 1.6em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .22s var(--ease);
}

.btn--primary {
  background-color: var(--cinnabar);
  color: #FDF7EE;
  box-shadow: 0 14px 30px -18px rgba(178, 58, 47, .95);
}
.btn--primary:hover { background-color: var(--cinnabar-deep); transform: translateY(-1px); }

.btn--ghost {
  background-color: var(--sand);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--cinnabar-soft); color: var(--cinnabar); }

.btn--jade {
  background-color: var(--jade);
  color: #F2F7F5;
}
.btn--jade:hover { background-color: var(--deep); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .34em .95em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--sand);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tag--num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: .08em;
  color: #FDF7EE;
  background-color: var(--cinnabar);
  border-color: transparent;
}

/* ---------- 6. Figure (responsive image container) ---------- */
.figure {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: #EDE3D3;
  background-image:
    radial-gradient(120% 90% at 18% 0%, rgba(217, 168, 92, .32), transparent 62%),
    radial-gradient(90% 80% at 92% 100%, rgba(63, 111, 106, .28), transparent 66%),
    repeating-linear-gradient(90deg, rgba(20, 16, 14, .07) 0 1px, transparent 1px 16px),
    linear-gradient(155deg, #F1E8D9, #E1D5C1);
}

.figure--tall { aspect-ratio: 3 / 4; }
.figure--wide { aspect-ratio: 16 / 10; }
.figure--square { aspect-ratio: 1 / 1; }

.figure__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure__cap {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: .08em;
  color: rgba(20, 16, 14, .66);
}

/* ---------- 7. Header ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -180%);
  padding: 12px 24px;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: .04em;
  transition: transform .22s var(--ease);
}

.skip-link:focus { transform: translate(-50%, 0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  padding: 16px clamp(12px, 3vw, 28px) 0;
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
  width: 100%;
  max-width: 1240px;
  padding: 9px 9px 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: rgba(251, 247, 240, .84);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 16px 42px -26px rgba(20, 16, 14, .55);
  transition: padding .28s var(--ease), box-shadow .28s var(--ease),
              border-color .28s var(--ease);
}

.site-header.is-scrolled .site-header__inner {
  padding-block: 5px;
  border-color: rgba(226, 216, 200, .92);
  box-shadow: 0 20px 46px -24px rgba(20, 16, 14, .62);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand__seal {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background-color: var(--cinnabar);
  background-image:
    radial-gradient(circle at 28% 22%, rgba(217, 105, 79, .95), transparent 62%),
    linear-gradient(145deg, #B23A2F, #8C2A22);
  box-shadow: inset 0 0 0 1px rgba(245, 239, 228, .35);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16.5px;
  letter-spacing: .02em;
  color: var(--ink);
  white-space: nowrap;
}

.brand__place {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  color: var(--cinnabar);
  white-space: nowrap;
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav__link {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color .22s var(--ease), background-color .22s var(--ease);
}

.site-nav__link:hover {
  color: var(--deep);
  background-color: rgba(63, 111, 106, .1);
}

.site-nav__link[aria-current="page"] {
  color: var(--paper);
  background-color: var(--ink);
}

.site-header__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 999px;
  background-color: var(--cinnabar);
  color: #FDF7EE;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 12px 26px -16px rgba(178, 58, 47, .95);
  transition: background-color .22s var(--ease), transform .22s var(--ease);
}

.cta-pill:hover {
  background-color: var(--cinnabar-deep);
  transform: translateY(-1px);
}

.cta-pill__year {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  letter-spacing: .1em;
  padding: 2px 6px;
  border-radius: 7px;
  background-color: rgba(253, 247, 238, .2);
}

.cta-pill__text { display: inline-block; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--sand);
  color: var(--ink-soft);
  font-size: 13.5px;
  letter-spacing: .08em;
  line-height: 1.2;
  cursor: pointer;
}

.nav-toggle__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background-color: currentColor;
  transition: transform .24s var(--ease);
}

.site-header[data-open] .nav-toggle__bar:first-child { transform: translateY(2.75px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bar:last-child { transform: translateY(-2.75px) rotate(-45deg); }

/* ---------- 8. Footer ---------- */
.site-footer {
  margin-top: clamp(72px, 9vw, 140px);
  padding-top: clamp(38px, 5vw, 60px);
  border-radius: 44px 44px 0 0;
  background-color: var(--ink);
  color: var(--paper);
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
}

.footer-belt {
  padding: clamp(18px, 2.4vw, 26px) clamp(18px, 2.4vw, 28px);
  border-radius: 30px;
  background-color: var(--deep);
  background-image:
    radial-gradient(120% 140% at 0% 0%, rgba(217, 168, 92, .14), transparent 60%),
    repeating-linear-gradient(90deg, rgba(245, 239, 228, .05) 0 1px, transparent 1px 22px);
}

.footer-belt__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 14px;
}

.footer-belt__title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .32em;
  line-height: 1.4;
  color: var(--gold);
}

.footer-belt__hint {
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--paper-55);
}

.footer-belt__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.footer-belt__track::-webkit-scrollbar { display: none; }

.belt-link {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--paper-22);
  border-radius: 999px;
  background-color: rgba(245, 239, 228, .05);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: .02em;
  color: var(--paper);
  white-space: nowrap;
  transition: border-color .22s var(--ease), color .22s var(--ease), background-color .22s var(--ease);
}

.belt-link::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-color: var(--gold);
}

.belt-link:hover {
  border-color: var(--gold);
  color: var(--gold);
  background-color: rgba(217, 168, 92, .1);
}

.footer-belt__note {
  margin-top: 16px;
  max-width: 46em;
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: .02em;
  color: var(--paper-55);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.5fr .85fr 1.15fr;
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(30px, 4vw, 48px);
  padding-block: clamp(30px, 4vw, 52px);
  border-top: 1px solid var(--paper-12);
}

.footer-brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--paper);
}

.footer-brand__line {
  margin-top: 12px;
  max-width: 26em;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--paper-62);
}

.footer-brand__meta {
  margin-top: 18px;
  font-size: 11.5px;
  letter-spacing: .24em;
  color: var(--gold);
}

.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .3em;
  line-height: 1.4;
  color: var(--gold);
}

.footer-nav__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.footer-link {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--paper-62);
  border-bottom: 1px solid transparent;
  transition: color .22s var(--ease), border-color .22s var(--ease);
}

.footer-link:hover {
  color: var(--paper);
  border-bottom-color: var(--gold);
}

.footer-contact__row {
  display: grid;
  grid-template-columns: 3.2em minmax(0, 1fr);
  gap: 10px;
  padding-block: 5px;
  font-size: 14.5px;
  line-height: 1.7;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .18em;
  line-height: 2.1;
  color: rgba(245, 239, 228, .42);
}

.footer-contact__val {
  color: var(--paper-62);
  overflow-wrap: anywhere;
}

.footer-base {
  border-top: 1px solid var(--paper-12);
}

.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  width: min(var(--wrap), 100% - clamp(28px, 6vw, 72px));
  margin-inline: auto;
  padding-block: 22px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: .06em;
  color: var(--paper-55);
}

.footer-base__icp { color: var(--paper-55); }
.footer-base__ver { color: var(--paper-55); }

/* ---------- 9. Motion & injected UI ---------- */
.site-totop {
  position: fixed;
  right: clamp(14px, 3vw, 30px);
  bottom: clamp(14px, 3vw, 30px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 18px 40px -20px rgba(20, 16, 14, .95);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .24s var(--ease), transform .24s var(--ease),
              visibility .24s, background-color .2s var(--ease);
}

.site-totop:hover { background-color: var(--deep); }

.site-totop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.site-totop span[aria-hidden] {
  font-size: 14px;
  line-height: 1;
  color: var(--gold);
}

.site-totop__text { display: inline-block; }

html[data-js="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

html[data-js="on"] [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 10. Responsive ---------- */
@media (max-width: 1180px) {
  .site-nav__link { padding: 9px 10px; font-size: 13.5px; }
  .brand__name { font-size: 15.5px; }
  .cta-pill { padding: 9px 14px; font-size: 13.5px; }
}

@media (max-width: 900px) {
  .site-header { padding-top: 12px; }

  .site-header__inner {
    padding: 8px 8px 8px 16px;
    gap: 10px;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: block;
    flex: none;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background-color: var(--sand);
    box-shadow: 0 28px 60px -26px rgba(20, 16, 14, .6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .24s var(--ease), transform .24s var(--ease), visibility .24s;
  }

  .site-header[data-open] .site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .site-nav__link {
    display: block;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 16px;
  }

  .nav-toggle { display: inline-flex; }

  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-header__inner { border-radius: 26px; }
  .brand__place { display: none; }
  .cta-pill { padding: 9px 13px; font-size: 13px; }
  .cta-pill__year { display: none; }

  .footer-main { grid-template-columns: 1fr; }
  .footer-nav__list { grid-template-columns: 1fr; }
  .footer-contact__row { grid-template-columns: 1fr; gap: 0; }
  .footer-contact__key { line-height: 1.6; }
  .footer-base__inner { justify-content: flex-start; }
  .site-footer { border-radius: 28px 28px 0 0; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  html[data-js="on"] [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .site-totop {
    transform: none;
  }
}
