:root {
  --paper: #f4f1ec;
  --ink: #2c2a26;
  --muted: #6a6560;
  --line: #d9d3cb;
  --pad: 64px;
  --header: 72px;
  --measure: 28em;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

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

::selection {
  background: #e6dfd4;
  color: var(--ink);
}

/* ——— Home: full-bleed carousel ——— */

.page-home {
  background: #111;
  overflow: hidden;
  height: 100svh;
}

.home-stage {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: auto;
  padding: 28px var(--pad) 20px;
  background: var(--paper);
}

.site-header--over {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding-bottom: 36px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.38) 0%,
    rgba(0, 0, 0, 0.12) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  color: #fff;
}

.site-header--over .nav a,
.site-header--over .lang button,
.site-header--over .wordmark {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 18px rgba(0, 0, 0, 0.25);
}

.site-header--over .lang .sep {
  color: rgba(255, 255, 255, 0.45);
}

.site-header--over .nav a span::before,
.site-header--over .lang button span::before {
  background: #fff;
}

.wordmark {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: baseline;
  gap: 36px;
}

.nav a,
.lang button {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.nav a span,
.lang button span {
  display: inline-block;
  position: relative;
}

.nav a span::before,
.lang button span::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.25s ease-out;
}

.nav a:hover span::before,
.nav a:focus-visible span::before,
.nav a[aria-current="page"] span::before,
.lang button:hover span::before,
.lang button:focus-visible span::before,
.lang button[aria-pressed="true"] span::before {
  transform: scaleX(1);
  transform-origin: left center;
}

.lang {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.lang .sep {
  color: var(--line);
  letter-spacing: 0;
  font-size: 12px;
}

.carousel {
  position: absolute;
  inset: 0;
}

.carousel-track {
  position: absolute;
  inset: 0;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: 0;
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-controls {
  position: absolute;
  right: var(--pad);
  bottom: 36px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.carousel-btn:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

/* ——— Membership: wood-grain photo behind copy ——— */

.page-membership {
  background-color: #cbb89a;
  background-image: url("../images/membership-bg.jpg?v=25");
  background-size: cover;
  background-position: 70% center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.page-membership .site-header {
  background: transparent;
  color: #fff;
}

.page-membership .site-header .nav a,
.page-membership .site-header .lang button,
.page-membership .site-header .wordmark {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 18px rgba(0, 0, 0, 0.25);
}

.page-membership .site-header .lang .sep {
  color: rgba(255, 255, 255, 0.45);
}

.page-membership .site-header .nav a span::before,
.page-membership .site-header .lang button span::before {
  background: #fff;
}

/* ——— Inner pages ——— */

.page {
  padding: 72px var(--pad) 120px;
  max-width: calc(var(--measure) + var(--pad) * 2);
}

/* Keep first content where the page title used to sit */
.page--untitled {
  padding-top: calc(72px + 12px * 1.6 + 48px);
}

.page h1 {
  margin: 0 0 48px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
}

.lead {
  margin: 0 0 64px;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.entry h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.entry p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.note {
  margin: 72px 0 0;
  font-size: 14px;
  line-height: 1.8;
}

.note a {
  margin-left: 0.8em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.entries + .contact-block {
  margin-top: 72px;
}

.contact-block {
  margin: 0 0 40px;
}

.contact-block:last-child {
  margin-bottom: 0;
}

.contact-block h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.contact-block p {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
}

.contact-block p + p {
  margin-top: 0.35em;
}

.contact-block a {
  text-decoration: none;
}

.contact-qr {
  display: block;
  width: 120px;
  height: 120px;
  margin-top: 16px;
  object-fit: contain;
}

/* ——— Space page ——— */

.space-page {
  padding: 48px var(--pad) 120px;
  max-width: 1100px;
  margin: 0 auto;
}

.space-title {
  margin: 0 0 72px;
  text-align: center;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.28em;
}

.space-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 24px;
  row-gap: 48px;
}

.space-item {
  margin: 0;
  cursor: default;
}

.space-image {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #e8e2d9;
}

.space-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 0.8s ease;
  pointer-events: none;
}

.space-image--desk img {
  object-position: 48% 42%;
}

.space-item:hover .space-image img {
  transform: scale(1.1);
}

.space-caption {
  margin: 12px 0 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink);
  font-weight: 300;
}

@media (max-width: 720px) {
  :root {
    --pad: 24px;
  }

  .nav {
    gap: 18px;
  }

  .nav a,
  .lang button,
  .wordmark {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .carousel-controls {
    bottom: 24px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .page {
    padding-top: 40px;
    padding-bottom: 88px;
  }

  .page--untitled {
    padding-top: calc(40px + 12px * 1.6 + 48px);
  }

  .lead {
    margin-bottom: 48px;
  }

  .note {
    margin-top: 56px;
  }

  .space-page {
    padding-top: 24px;
    padding-bottom: 88px;
  }

  .space-title {
    margin-bottom: 40px;
    font-size: 18px;
  }

  .space-grid {
    grid-template-columns: 1fr;
    row-gap: 36px;
  }

  .page-membership {
    background-attachment: scroll;
    /* Mobile: crop to warm blur only — wood starts ~40% into the photo */
    background-size: 280% 100%;
    background-position: left center;
  }

  .page-membership .entry p {
    color: var(--ink);
  }
}

/* ——— ICP beian (required for mainland hosting) ——— */

.site-beian {
  padding: 40px var(--pad) 32px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--muted);
}

.site-beian a {
  color: inherit;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.site-beian a:hover {
  opacity: 1;
}

.page-home .site-beian {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 4;
  padding: 0 var(--pad);
  text-align: left;
  pointer-events: none;
}

.page-home .site-beian a {
  pointer-events: auto;
  color: rgba(255, 255, 255, 0.58);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  opacity: 1;
}

.page-home .site-beian a:hover {
  color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 720px) {
  .site-beian {
    padding: 28px 20px 24px;
    font-size: 10px;
  }

  .page-home .site-beian {
    bottom: 10px;
  }
}
