/* Butcher Boy homepage (v1.25.0) — loaded on / and /zh/ only (inc/home.php).
   Uses the theme tokens in style.css; adds five element colours for the chart:
   the calculator's .bz-el-* hues (style.css), lifted to read on the ink stage.
   Keep in step with EL_HEX in assets/js/home.js. */

.bbh {
  --wood: #86A57E; --fire: #CC4B3F; --earth: #B98A4E; --metal: #D2D1CB; --water: #6E92B4;
  --stage: #1A1A1A; --lacquer: #2A2824;
}

/* ---------- header: ink glass on the homepage ---------- */
.bbh .site-header {
  --paper: #1A1A1A; --ink: #F0EBE2; --ink-soft: rgba(240,235,226,.82); --mist: rgba(240,235,226,.62);
  --line: rgba(240,235,226,.18); --line-soft: rgba(240,235,226,.1);
  color: var(--ink);
  background: color-mix(in srgb, #1A1A1A 86%, transparent);
}
.bbh .primary-nav li.nav-app > a, .bbh .primary-nav li.nav-app > a:hover { color: var(--gold); }
.bbh .primary-nav .sub-menu a:hover { color: var(--gold); }

/* ---------- stage: hero + scroll story ---------- */
.bbh-stage { position: relative; color: var(--band-text); background: radial-gradient(110% 80% at 72% 32%, #2b2721 0%, var(--stage) 58%, #121211 100%); }
.bbh-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; pointer-events: none; }
.bbh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s ease; }
.bbh-gl .bbh-canvas { opacity: 1; }
.bbh-grain { position: absolute; inset: 0; opacity: .06; background-image: repeating-linear-gradient(98deg, rgba(255,255,255,.5) 0 1px, transparent 1px 9px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent); }
.bbh-flow { position: relative; margin-top: -100vh; margin-top: -100svh; }

.bbh-fallback { position: absolute; right: 7vw; top: 50%; transform: translateY(-46%); display: flex; gap: 14px; transition: opacity .6s; }
.bbh-gl .bbh-fallback { opacity: 0; }
.bbh-fallback div { display: flex; flex-direction: column; gap: 10px; }
.bbh-fallback span { width: clamp(56px, 6.6vw, 92px); aspect-ratio: .68; display: grid; place-items: center; background: var(--lacquer); border: 1px solid rgba(198,161,91,.35); border-radius: 3px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; }

.bbh-tag { position: absolute; left: 0; top: 0; opacity: 0; transform: translate(-50%, -50%); transition: opacity .35s; white-space: nowrap; background: var(--vermillion); color: #FFFDF7; padding: 7px 11px 8px; border-radius: 2px; font: 500 13px/1.3 var(--sans); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.bbh-tag b { display: block; font: 600 17px/1.15 var(--cjk); }
.bbh-tag::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.bbh-tag.is-on { opacity: 1; }
.bbh-tag--now { background: var(--gold); color: #1A1A1A; }

.bbh-panel { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 110px 0 70px; }
.bbh-panel > .wrap { width: 100%; }
.bbh-copy { max-width: 31rem; pointer-events: auto; }
.bbh-panel--hero .bbh-copy { max-width: 36rem; }
.bbh-stage h2, .bbh-stage h3 { color: var(--band-text); }
.bbh-stage p { color: var(--band-text-soft); }
.bbh-stage .device span { color: rgba(240,235,226,.7); }
.bbh-title { font-size: clamp(42px, 6.2vw, 80px); line-height: 1.02; font-weight: 340; margin: 0; color: var(--band-text); }
.bbh-title em { display: block; font-style: italic; font-weight: 320; color: var(--gold); }
.bbh-tagline { margin: 20px 0 8px; font: 400 20px/1.4 var(--serif); color: var(--band-text) !important; }
.bbh-lede { max-width: 33rem; margin: 0 0 30px; }
.bbh-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.bbh-panel--hero .bbh-actions { margin-top: 0; }
.bbh-stage .btn-ghost, .bbh-readings .btn-ghost { border-color: var(--band-text); color: var(--band-text); }
.bbh-stage .btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.bbh-finder { margin-top: 34px; padding: 18px 20px 20px; border: 1px solid rgba(240,235,226,.16); border-top: 2px solid var(--gold); border-radius: 2px; background: rgba(26,26,26,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); max-width: 30rem; }
.bbh-finder label { display: block; font-weight: 600; margin-bottom: 9px; color: var(--band-text); }
.bbh-finder__row { display: flex; gap: 8px; }
.bbh-finder input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 2px; border: 1px solid rgba(240,235,226,.25); background: rgba(250,247,242,.06); color: var(--band-text); font: 500 17px var(--sans); }
.bbh-finder input::placeholder { color: rgba(240,235,226,.45); }
.bbh-finder .btn { padding: 0 18px; min-height: 48px; }
.bbh-finder__out { margin: 12px 0 0 !important; font-size: 15px; min-height: 1.5em; }
.bbh-finder__out strong { color: var(--band-text); }
.bbh-finder__out a { color: var(--gold); }
.bbh-cue { margin-top: 34px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.bbh-cue i { width: 1px; height: 34px; display: block; background: linear-gradient(var(--gold), transparent); animation: bbh-cue 2.2s ease-in-out infinite; }
@keyframes bbh-cue { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); } }

.bbh-panel--pillars { min-height: 260vh; align-items: flex-start; }
.bbh-panel--story { min-height: 150vh; align-items: flex-start; }
.bbh-panel--pillars .bbh-sticky { position: sticky; top: 16vh; }
.bbh-panel--story .bbh-sticky { position: sticky; top: 20vh; }

.bbh-palaces { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 4px; }
.bbh-palaces li { display: grid; grid-template-columns: 3rem 1fr; gap: 2px 14px; padding: 12px 14px; border-radius: 2px; border: 1px solid transparent; opacity: .55; transition: background .35s, border-color .35s, opacity .35s; }
.bbh-palaces li.is-on { opacity: 1; background: rgba(240,235,226,.05); border-color: rgba(198,161,91,.45); }
.bbh-palaces .hanzi { grid-row: span 2; font-size: 32px; line-height: 1.1; color: var(--gold); }
.bbh-palaces strong { font-weight: 600; color: var(--band-text); }
.bbh-palaces span:last-child { color: var(--band-text-soft); font-size: 15.5px; }
.bbh-note { font-size: 13.5px; margin-top: 16px; }

.bbh-elements { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; }
.bbh-elements li { display: grid; grid-template-columns: 6rem 1fr 1.5rem; align-items: center; gap: 12px; font-weight: 500; color: var(--band-text); }
.bbh-elements i { display: block; height: 8px; border-radius: 4px; background: var(--c); width: calc(var(--n) * 25%); transform-origin: left; transform: scaleX(var(--grow, 0)); transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.bbh-elements .hanzi { color: var(--c); }
.bbh-elements b { font-weight: 600; text-align: right; }
.is-wood { --c: var(--wood); } .is-fire { --c: var(--fire); } .is-earth { --c: var(--earth); } .is-metal { --c: var(--metal); } .is-water { --c: var(--water); }

.bbh-decades { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; list-style: none; }
.bbh-decades li { padding: 6px 9px; border-radius: 2px; border: 1px solid rgba(240,235,226,.15); font-size: 13px; color: var(--band-text-soft); text-align: center; line-height: 1.3; }
.bbh-decades .hanzi { display: block; font-size: 18px; color: var(--band-text); }
.bbh-decades li.is-now { border-color: var(--gold); background: rgba(198,161,91,.14); color: var(--band-text); }

@media (max-width: 760px) {
  .bbh-panel, .bbh-panel--pillars, .bbh-panel--story { align-items: flex-end; padding-bottom: 5vh; }
  .bbh-panel--pillars .bbh-sticky, .bbh-panel--story .bbh-sticky { top: auto; bottom: 3vh; }
  .bbh-copy { background: rgba(26,26,26,.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); padding: 18px; border: 1px solid rgba(240,235,226,.1); border-top: 2px solid var(--gold); border-radius: 2px; }
  .bbh-panel--hero .bbh-copy { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; padding: 0; margin-top: 42svh; }
  .bbh-palaces li:not(.is-on) { display: none; }
  .bbh-fallback { right: 50%; transform: translate(50%, 0); top: 14svh; }
  .bbh-finder__row { flex-wrap: wrap; }
  .bbh-finder .btn { flex: 1 1 100%; }
}

/* ---------- shared section head ---------- */
.bbh-head { display: grid; grid-template-columns: 1fr minmax(0, 26rem); gap: 12px 48px; align-items: end; margin-bottom: 40px; }
.bbh-head h2 { margin: 0; }
.bbh-head p { margin: 0; color: var(--ink-soft); }
@media (max-width: 820px) { .bbh-head { grid-template-columns: 1fr; } }

/* ---------- app ---------- */
.bbh-app__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.bbh-app p { color: var(--ink-soft); max-width: 36rem; }
.bbh-actions--note { align-items: center; }
.bbh-actions--note span { font-size: 13px; color: var(--mist); }
.bbh-chartcard { background: var(--band); color: var(--band-text); border-radius: 3px; border-top: 2px solid var(--gold); padding: 24px; box-shadow: 0 30px 60px -30px rgba(26,24,20,.5); }
.bbh-chartcard__top { display: flex; justify-content: space-between; font-size: 13px; color: var(--band-text-soft); margin-bottom: 16px; }
.bbh-chartcard__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.bbh-chartcard__grid div { background: var(--lacquer); border-radius: 2px; padding: 10px 0 9px; }
.bbh-chartcard__grid small { display: block; font-size: 11.5px; color: var(--band-text-soft); margin-bottom: 4px; }
.bbh-chartcard__grid .hanzi { display: block; font-size: 30px; line-height: 1.2; color: var(--c); }
.bbh-chat { margin-top: 18px; display: grid; gap: 9px; font-size: 15px; }
.bbh-bubble { padding: 10px 14px; border-radius: 12px; max-width: 88%; }
.bbh-bubble--q { justify-self: end; background: var(--gold); color: #1A1A1A; border-bottom-right-radius: 3px; }
.bbh-bubble--a { background: #232220; border-bottom-left-radius: 3px; min-height: 2.6em; }
.bbh-caret { display: inline-block; width: .5ch; height: 1em; background: var(--gold); vertical-align: -.12em; margin-left: 2px; animation: bbh-blink 1s steps(1) infinite; }
@keyframes bbh-blink { 50% { opacity: 0; } }
@media (max-width: 860px) { .bbh-app__grid { grid-template-columns: 1fr; } }

/* ---------- guides: editorial index ---------- */
.bbh-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.bbh-index li { border-bottom: 1px solid var(--line); }
.bbh-index a { display: grid; grid-template-columns: 8.5rem 1fr 9rem; gap: 24px; align-items: center; padding: 20px 0; text-decoration: none; transition: padding .3s; }
.bbh-index a:hover, .bbh-index a:focus-visible { padding-left: 12px; color: inherit; }
.bbh-index h3 { margin: 0; font-size: clamp(21px, 2.3vw, 28px); transition: color .2s; }
.bbh-index a:hover h3 { color: var(--gold-deep); }
.bbh-index__excerpt { margin: 6px 0 0; color: var(--ink-soft); font-size: 15.5px; max-width: 44rem; }
.bbh-index__meta { font-size: 13px; color: var(--mist); text-align: right; }
.bbh-thumb { aspect-ratio: 16 / 10; border-radius: 2px; overflow: hidden; display: grid; place-items: center; background: var(--band); color: var(--gold); font-size: 34px; }
.bbh-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bbh-more { margin-top: 30px; }
.bbh-follow { position: fixed; left: 0; top: 0; width: 300px; pointer-events: none; z-index: 40; opacity: 0; transition: opacity .25s; }
.bbh-follow.is-on { opacity: 1; }
.bbh-follow .bbh-thumb { font-size: 96px; box-shadow: 0 30px 50px -20px rgba(0,0,0,.45); }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .bbh-index a { grid-template-columns: 1fr 9rem; }
  .bbh-index .bbh-thumb { display: none; }
}
@media (max-width: 640px) {
  .bbh-index a { grid-template-columns: 6rem 1fr; gap: 14px; }
  .bbh-index__meta { grid-column: 2; text-align: left; }
  .bbh-index__excerpt { display: none; }
}

/* ---------- readings: blade across the quote ---------- */
.bbh-services { list-style: none; padding: 0; margin: 22px 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.bbh-services a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border: 1px solid rgba(240,235,226,.25); border-radius: 2px; text-decoration: none; font-size: 14.5px; }
.bbh-services a:hover { border-color: var(--gold); color: var(--gold); }
.bbh-cut { position: relative; margin: 0; padding: 36px 0; }
.bbh-cut blockquote { margin: 0; padding: 0; border: 0; font: italic 340 clamp(24px, 2.8vw, 34px)/1.32 var(--serif); color: var(--band-text); }
.bbh-cut figcaption { margin-top: 16px; font-size: 13px; color: var(--band-text-soft); }
.bbh-cut__blade { position: absolute; left: -4%; right: -4%; top: 52%; height: 2px; background: var(--vermillion); transform: scaleX(0) rotate(-4deg); transform-origin: left; transition: transform 1.1s cubic-bezier(.7,0,.2,1); }
.bbh-cut.is-cut .bbh-cut__blade { transform: scaleX(1) rotate(-4deg); }

/* ---------- library shelf ---------- */
.bbh-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.bbh-filters[hidden] { display: none; }
.bbh-filters button { min-height: 44px; padding: 6px 16px; border-radius: 2px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.bbh-filters button:hover { border-color: var(--gold-deep); }
.bbh-filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bbh-shelf { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 22px; }
.bbh-shelf li.is-dim { display: none; }
.bbh-shelf a { display: block; text-decoration: none; }
.bbh-shelf__img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 2px; background: var(--band); color: var(--gold); }
.bbh-shelf__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1), filter .4s; filter: saturate(.9); }
.bbh-shelf__img > .hanzi { font-size: 44px; line-height: 1; }
.bbh-shelf__img::after { content: ""; position: absolute; inset: 0; border-bottom: 2px solid var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.bbh-shelf__img small { position: absolute; left: 10px; top: 10px; padding: 3px 8px; border-radius: 2px; background: rgba(26,26,26,.72); color: var(--band-text); font: 600 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.bbh-shelf__title { display: block; margin-top: 12px; font: 420 19px/1.3 var(--serif); text-wrap: balance; transition: color .2s; }
.bbh-shelf a:hover .bbh-shelf__title, .bbh-shelf a:focus-visible .bbh-shelf__title { color: var(--gold-deep); }
.bbh-shelf a:hover .bbh-shelf__img img { transform: scale(1.05); filter: saturate(1.05); }
.bbh-shelf a:hover .bbh-shelf__img::after, .bbh-shelf a:focus-visible .bbh-shelf__img::after { transform: scaleX(1); }
@media (max-width: 1000px) { .bbh-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bbh-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } .bbh-shelf__title { font-size: 16.5px; } }

/* ---------- five arts + luopan ---------- */
.bbh-arts__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.bbh-luopan { width: 100%; max-width: 470px; aspect-ratio: 1; margin-inline: auto; color: var(--ink-soft); }
.bbh-luopan svg { width: 100%; height: 100%; display: block; }
.bbh-artgroups { display: grid; gap: 26px; }
.bbh-artgroups h3 { font: 600 12px/1.3 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--mist); margin: 0 0 8px; }
.bbh-artgroups ul { list-style: none; margin: 0; padding: 0; }
.bbh-artgroups a { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; text-decoration: none; font: 380 25px/1.2 var(--serif); border-bottom: 1px solid var(--line); }
.bbh-artgroups a:hover { color: var(--gold-deep); }
.bbh-artgroups .hanzi { font-size: 17px; color: var(--mist); }
@media (max-width: 860px) { .bbh-arts__grid { grid-template-columns: 1fr; } .bbh-luopan { max-width: 320px; } }

/* ---------- faq ---------- */
.bbh-faq__list { max-width: 52rem; }
.bbh-faq details { border-top: 1px solid var(--line); }
.bbh-faq details:last-child { border-bottom: 1px solid var(--line); }
.bbh-faq summary { list-style: none; cursor: pointer; padding: 19px 40px 19px 0; position: relative; font: 400 22px/1.3 var(--serif); }
.bbh-faq summary::-webkit-details-marker { display: none; }
.bbh-faq summary:hover { color: var(--gold-deep); }
.bbh-faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .25s; }
.bbh-faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.bbh-faq details p { margin: 0 0 20px; color: var(--ink-soft); max-width: 44rem; }

/* ---------- Chinese page typography ---------- */
html[lang^="zh"] .bbh { line-height: 1.85; }
html[lang^="zh"] .bbh .device span,
html[lang^="zh"] .bbh-artgroups h3,
html[lang^="zh"] .bbh-filters button { letter-spacing: .12em; text-transform: none; font-size: 13px; }
html[lang^="zh"] .bbh h1, html[lang^="zh"] .bbh h2, html[lang^="zh"] .bbh h3,
html[lang^="zh"] .bbh-tagline, html[lang^="zh"] .bbh-cut blockquote,
html[lang^="zh"] .bbh-faq summary, html[lang^="zh"] .bbh-artgroups a, html[lang^="zh"] .bbh-shelf__title { font-family: var(--cjk); font-style: normal; letter-spacing: .02em; }
html[lang^="zh"] .bbh-title { font-size: clamp(38px, 5.4vw, 68px); line-height: 1.2; font-weight: 600; }
html[lang^="zh"] .bbh-title em { font-style: normal; font-weight: 600; }
html[lang^="zh"] .bbh h2 { font-weight: 600; line-height: 1.3; }
html[lang^="zh"] .bbh h3, html[lang^="zh"] .bbh-faq summary, html[lang^="zh"] .bbh-artgroups a { font-weight: 600; line-height: 1.4; }
html[lang^="zh"] .bbh-cut blockquote { font-weight: 600; line-height: 1.6; }
html[lang^="zh"] .bbh-elements li { grid-template-columns: 2.5rem 1fr 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .bbh-cue i, .bbh-caret { animation: none; }
  .bbh-cut__blade { transition: none; }
}
