/**
 * JADE — original Tunai theme for TCM halls, acupuncture & heritage wellness.
 * The night counterpart to Meridian: deep-pine room, jade & antique gold,
 * window-lattice bands, a giant calligraphy watermark, octagon hero frame.
 * Scoped under .jade-theme.
 */

.jade-theme {
  --jd-bg: #0e1c15;
  --jd-panel: #142720;
  --jd-ink: #ece4d2;
  --jd-muted: #96a396;
  --jd-jade: #46d6a0;
  --jd-gold: #c9a86a;
  --jd-line: rgba(201, 168, 106, 0.24);
  --jd-deep: #2ea77b;
  --fx-accent: var(--jd-jade);
  --fx-spot: rgba(70, 214, 160, 0.08);
  --jd-display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --jd-body: "Noto Sans SC", sans-serif;

  background: var(--jd-bg);
  color: var(--jd-ink);
  font-family: var(--jd-body);
  font-size: 16.5px;
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

.jade-theme a {
  color: inherit;
  text-decoration: none;
}

.jd-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Deep glow pockets. */
.jade-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 44% 32% at 90% 4%, rgba(70, 214, 160, 0.07), transparent),
    radial-gradient(ellipse 40% 30% at 4% 94%, rgba(201, 168, 106, 0.06), transparent);
}

.jade-theme > * {
  position: relative;
  z-index: 1;
}

/* Window-lattice band — the heritage divider. */
.jd-lattice {
  height: 22px;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, var(--jd-line) 9px 10px),
    repeating-linear-gradient(-45deg, transparent 0 9px, var(--jd-line) 9px 10px);
  border-block: 1px solid var(--jd-line);
  opacity: 0.9;
}

/* ── Nav ── */
.jd-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 30px;
  background: rgba(14, 28, 21, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--jd-line);
}

.jd-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--jd-display);
  font-size: 21px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Octagonal jade token. */
.jd-token {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--jd-deep), var(--jd-jade));
  color: #0b241a;
  font-family: var(--jd-display);
  font-size: 19px;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}

.jd-nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  letter-spacing: 0.14em;
}

.jd-nav-links a {
  color: var(--jd-muted);
  transition: color 0.25s;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.jd-nav-links a:hover {
  color: var(--jd-jade);
  border-bottom-color: var(--jd-jade);
}

/* Buttons: jade fill / gold line. */
.jd-btn {
  display: inline-block;
  padding: 13px 34px;
  background: linear-gradient(135deg, var(--jd-deep), var(--jd-jade));
  color: #0b241a;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  border: 0;
  border-radius: 3px;
  transition: box-shadow 0.25s, transform 0.2s;
  cursor: pointer;
}

.jd-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(70, 214, 160, 0.3);
}

.jd-btn--line {
  background: transparent;
  color: var(--jd-gold);
  box-shadow: inset 0 0 0 1px var(--jd-gold);
}

.jd-btn--line:hover {
  background: var(--jd-gold);
  color: #17130a;
  box-shadow: 0 12px 30px rgba(201, 168, 106, 0.25);
}

/* ── Hero ── */
.jd-hero {
  position: relative;
  padding: 96px 0 88px;
  overflow: hidden;
}

/* Giant calligraphy watermark behind the hero. */
.jd-watermark {
  position: absolute;
  right: -3%;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--jd-display);
  font-size: clamp(280px, 40vw, 540px);
  line-height: 1;
  color: rgba(70, 214, 160, 0.05);
  pointer-events: none;
  user-select: none;
}

.jd-hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.jd-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 12.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--jd-gold);
}

.jd-kicker::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--jd-gold);
}

.jd-hero h1 {
  margin: 0 0 20px;
  font-family: var(--jd-display);
  font-weight: 400;
  font-size: clamp(40px, 5.8vw, 74px);
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.jd-hero h1 em {
  font-style: normal;
  color: var(--jd-jade);
}

.jd-hero-motto {
  margin: 0 0 36px;
  color: var(--jd-muted);
  font-size: 17.5px;
  max-width: 44ch;
}

.jd-hero-cta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Octagon hero image in a gold double frame. */
.jd-oct {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1;
  margin-left: auto;
}

.jd-oct-img {
  position: absolute;
  inset: 4%;
  overflow: hidden;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: var(--jd-panel);
}

.jd-oct-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jd-oct::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: var(--jd-gold);
  opacity: 0.5;
}

.jd-oct::after {
  content: "";
  position: absolute;
  inset: 2%;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: var(--jd-bg);
}

.jd-oct-img {
  z-index: 1;
}

.jd-oct .jd-token {
  position: absolute;
  z-index: 2;
  right: 4%;
  bottom: 8%;
  width: 52px;
  height: 52px;
  font-size: 24px;
}

/* ── Sections ── */
.jd-section {
  padding: 104px 0;
}

.jd-section--alt {
  background: var(--jd-panel);
  border-block: 1px solid var(--jd-line);
}

.jd-sec-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 54px;
}

.jd-sec-head::after {
  content: "";
  flex: 1;
  height: 5px;
  border-block: 1px solid var(--jd-line);
}

.jd-sec-head h2 {
  margin: 0;
  font-family: var(--jd-display);
  font-weight: 400;
  font-size: clamp(28px, 3.8vw, 44px);
  white-space: nowrap;
}

.jd-sec-cn {
  font-family: var(--jd-display);
  color: var(--jd-jade);
  font-size: 15px;
  letter-spacing: 0.4em;
  writing-mode: vertical-rl;
  line-height: 1;
  flex: 0 0 auto;
}

/* ── Services ── */
.jd-services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 60px;
}

.jd-service {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 23px 6px;
  border-bottom: 1px solid var(--jd-line);
  transition: background 0.25s, padding 0.25s;
}

.jd-service:hover {
  background: rgba(70, 214, 160, 0.05);
  padding-left: 16px;
}

.jd-service-idx {
  font-family: var(--jd-display);
  color: var(--jd-gold);
  font-size: 14px;
  white-space: nowrap;
}

.jd-service-name {
  font-family: var(--jd-display);
  font-size: 19px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.jd-service-meta {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--jd-muted);
}

.jd-service-tail {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.jd-service-price {
  font-family: var(--jd-display);
  color: var(--jd-jade);
  font-size: 17px;
}

.jd-service-book {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--jd-gold);
  opacity: 0;
  transition: opacity 0.25s;
}

.jd-service:hover .jd-service-book {
  opacity: 1;
}

/* ── Gallery: lantern panels ── */
.jd-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
}

.jd-lantern {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--jd-line);
  border-radius: 60px 60px 6px 6px;
  background: var(--jd-panel);
  padding: 8px;
  transition: transform 0.3s, border-color 0.3s;
}

.jd-lantern:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 168, 106, 0.55);
}

.jd-lantern img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 54px 54px 4px 4px;
}

.jd-lantern:nth-child(even) {
  margin-top: 32px;
}

/* ── Team ── */
.jd-team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px;
}

.jd-member {
  background: var(--jd-bg);
  border: 1px solid var(--jd-line);
  padding: 30px 24px;
  text-align: center;
  position: relative;
  transition: transform 0.25s, border-color 0.25s;
}

.jd-member::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(201, 168, 106, 0.18);
  pointer-events: none;
}

.jd-member:hover {
  transform: translateY(-5px);
  border-color: rgba(70, 214, 160, 0.5);
}

.jd-member img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  margin: 0 auto 16px;
}

.jd-member h3 {
  margin: 0 0 4px;
  font-family: var(--jd-display);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.jd-member p {
  margin: 0;
  color: var(--jd-muted);
  font-size: 13px;
  letter-spacing: 0.14em;
}

/* ── Classes ── */
.jd-classes {
  max-width: 820px;
  margin: 0 auto;
}

.jd-class {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 6px;
  border-bottom: 1px solid var(--jd-line);
  transition: background 0.25s, padding 0.25s;
}

.jd-class:hover {
  background: rgba(201, 168, 106, 0.05);
  padding-left: 16px;
}

.jd-class b {
  font-family: var(--jd-display);
  font-size: 18px;
}

.jd-class-when {
  display: block;
  color: var(--jd-muted);
  font-size: 13px;
  margin-top: 3px;
}

.jd-class-seats {
  font-family: var(--jd-display);
  color: var(--jd-jade);
  font-size: 14px;
  white-space: nowrap;
}

.jd-class-seats.is-full {
  color: var(--jd-muted);
}

/* ── Visit ── */
.jd-visit {
  padding: 104px 0;
}

.jd-visit-panel {
  position: relative;
  border: 1px solid var(--jd-line);
  background: var(--jd-panel);
  padding: 54px 50px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 44px;
  align-items: center;
}

.jd-visit-panel::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(201, 168, 106, 0.2);
  pointer-events: none;
}

.jd-visit-panel h2 {
  margin: 0 0 16px;
  font-family: var(--jd-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.2;
}

.jd-visit-panel h2 em {
  font-style: normal;
  color: var(--jd-jade);
}

.jd-visit-panel p {
  margin: 0 0 8px;
  color: var(--jd-muted);
}

.jd-visit-panel a:not(.jd-btn) {
  color: var(--jd-ink);
  border-bottom: 1px solid var(--jd-gold);
}

.jd-visit-panel .jd-btn {
  position: relative;
  z-index: 1;
}

.jd-outlets {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 14px;
}

.jd-outlets li {
  margin-bottom: 5px;
}

.jd-outlets a {
  border-bottom: 0 !important;
  color: var(--jd-muted) !important;
}

.jd-outlets a:hover {
  color: var(--jd-jade) !important;
}

/* ── Footer ── */
.jd-footer {
  border-top: 1px solid var(--jd-line);
  padding: 30px 0 42px;
  color: var(--jd-muted);
  font-size: 13.5px;
}

.jd-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.jd-footer a:hover {
  color: var(--jd-jade);
}

.jd-footer-social {
  display: flex;
  gap: 20px;
  letter-spacing: 0.18em;
  font-size: 12px;
}

/* ── Motion ── */
.tfx .jade-theme [data-reveal] {
  opacity: 0;
  translate: 0 22px;
  filter: blur(3px);
  transition: opacity 0.8s ease, translate 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease;
}

.tfx .jade-theme [data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
}

.jade-theme .jd-hero-grid > div:first-child > * {
  animation: jd-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.jade-theme .jd-hero-grid > div:first-child > *:nth-child(2) { animation-delay: 0.1s; }
.jade-theme .jd-hero-grid > div:first-child > *:nth-child(3) { animation-delay: 0.2s; }
.jade-theme .jd-hero-grid > div:first-child > *:nth-child(4) { animation-delay: 0.3s; }

.jade-theme .jd-oct {
  animation: jd-oct-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}

@keyframes jd-rise {
  from {
    opacity: 0;
    translate: 0 26px;
  }
}

@keyframes jd-oct-in {
  from {
    opacity: 0;
    scale: 0.92;
  }
}

.jade-theme ::selection {
  background: var(--jd-jade);
  color: #0b241a;
}

/* ── Mobile ── */
.jd-mobile-bar {
  display: none;
}

@media (max-width: 940px) {
  .jd-nav-links,
  .jd-nav > .jd-btn {
    display: none;
  }

  .jd-watermark {
    display: none;
  }

  .jd-hero {
    padding: 56px 0 64px;
  }

  .jd-hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .jd-oct {
    margin: 0 auto;
  }

  .jd-section,
  .jd-visit {
    padding: 72px 0;
  }

  .jd-services {
    grid-template-columns: 1fr;
  }

  .jd-lantern:nth-child(even) {
    margin-top: 0;
  }

  .jd-visit-panel {
    grid-template-columns: 1fr;
    padding: 38px 28px;
  }

  .jd-mobile-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(14, 28, 21, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--jd-line);
    justify-content: center;
  }

  .jd-mobile-bar .jd-btn {
    width: 100%;
    text-align: center;
  }

  .jd-footer {
    padding-bottom: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jade-theme .jd-hero-grid > div:first-child > *,
  .jade-theme .jd-oct {
    animation: none;
  }
  .tfx .jade-theme [data-reveal] {
    opacity: 1;
    translate: 0 0;
    filter: none;
    transition: none;
  }
}

/* Specificity guard: `.jade-theme a` outranks `.jd-btn`; re-state colours. */
.jade-theme .jd-btn {
  color: #0b241a;
}

.jade-theme .jd-btn--line {
  color: var(--jd-gold);
}

.jade-theme .jd-btn--line:hover {
  color: #17130a;
}
