/* Homepage "editorial gallery" sections (Task F5B). Loaded by home.html after the page's own tokens (:root in home.html).
   Hero, buttons, links and the closing statement keep their existing styles in home.html. Classes are prefixed hm-. */

main { counter-reset: hm 1; }   /* the hero is 01; each .hm-label then takes the next number, so a missing section never leaves a gap */

.hm-wrap { max-width: 1220px; margin: 0 auto; padding: clamp(64px, 8vw, 112px) max(var(--page-pad-x), env(safe-area-inset-left)) clamp(64px, 8vw, 112px) max(var(--page-pad-x), env(safe-area-inset-right)); }
.hm-label { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--accent-ink); }
.hm-num::before { counter-increment: hm; content: counter(hm, decimal-leading-zero); letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.hm-label::after { content: ''; flex: 0 0 56px; height: 1px; background: var(--line); }
.hm-lede { margin-top: 18px; font-size: 15.5px; font-weight: 300; line-height: 1.75; color: var(--ink-soft); max-width: 520px; }
.hm-sub { margin-top: 12px; font-family: 'Cormorant Garamond', serif; font-size: clamp(20px, 2.2vw, 26px); font-weight: 400; color: var(--ink-soft); line-height: 1.3; }
.hm-tag { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 9px; border-radius: 2px; }
.hm-sec h2 { margin-top: 18px; }

/* ================= 02 THE FIVE ELEMENTS ================= */
.hm-elements { background: var(--card); border-bottom: 1px solid var(--line-soft); }
.hm-elements-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: end; }
.hm-elements-head .hm-lede { margin-top: 0; }
.hm-elements-head .link { margin-top: 18px; }
.hm-gallery { margin-top: clamp(24px, 3.2vw, 44px); }
.hm-tabs, .hm-controls { display: none; }
.hm-track { list-style: none; display: grid; grid-template-columns: minmax(0, 1.9fr) repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.hm-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.hm-slide { min-width: 0; }
.hm-slide--feature { grid-column: 1; grid-row: 1 / span 2; }
.hm-tile { height: 100%; min-height: 250px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: clamp(20px, 2.2vw, 30px); background: var(--paper); border: 1px solid var(--line); }
.hm-tile h3, .hm-feature-text h3 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.08; color: var(--ink); }
.hm-state { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.hm-tile .link, .hm-feature-text .link { margin-top: 14px; }
.hm-tile-media, .hm-feature-media { display: block; overflow: hidden; background: #e9e1d0; border: 1px solid var(--line); }
.hm-tile-media { aspect-ratio: 4 / 3; margin-bottom: 18px; }
.hm-tile-media img, .hm-feature-media img, .hm-detail img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; display: block; transition: transform .7s var(--ease); }
a:hover > .hm-feature-media img, a:focus-visible > .hm-feature-media img { transform: scale(1.03); }
.hm-feature { height: 100%; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: stretch; }
.hm-feature-media { position: relative; min-height: 380px; }
.hm-feature-media img { position: absolute; inset: 0; }
.hm-feature-text { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding-top: 4px; }
.hm-feature-kicker { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); }
.hm-feature-text h3 { margin-top: 10px; }
.hm-feature-line { margin-top: 14px; font-size: 15px; font-weight: 300; line-height: 1.7; color: var(--ink-soft); }
.hm-feature-product { display: block; margin-top: 16px; font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.hm-feature-product:hover { border-bottom-color: var(--accent); }
.hm-detail { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e9e1d0; border: 1px solid var(--line); margin-top: auto; }
.hm-feature--plain { grid-template-columns: 1fr; }
.hm-feature--plain .hm-feature-text { justify-content: space-between; min-height: 320px; padding: clamp(22px, 3vw, 40px); background: var(--paper); border: 1px solid var(--line); }
.hm-feature--plain .hm-feature-text h3 { font-size: clamp(44px, 6vw, 84px); }
.hm-values { list-style: none; margin-top: clamp(44px, 6vw, 84px); padding-top: 28px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); }
.hm-values h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 21px; color: var(--ink); }
.hm-values p { margin-top: 6px; font-size: 13.5px; font-weight: 300; line-height: 1.65; color: var(--ink-soft); }

/* ================= 03 THE I-CHING SCENT COLLECTION (private preview only) ================= */
.hm-scent { background: var(--paper); border-bottom: 1px solid var(--line-soft); }
.hm-scent-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: end; }
.hm-scent-head .hm-lede { margin-top: 0; }
.hm-concept-note { margin-top: 16px; font-size: 12.5px; letter-spacing: .02em; color: var(--muted); font-style: italic; }
.hm-scent-list { list-style: none; margin-top: clamp(32px, 4.5vw, 60px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); }
.hm-trigram { aspect-ratio: 4 / 5; display: grid; place-items: center; background: #efe7d6; border: 1px solid var(--line); }
.hm-trigram svg { width: 38%; height: auto; display: block; }
.hm-trigram rect { fill: #9a7b45; }
.hm-scent-item h3 { margin-top: 16px; font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 26px; color: var(--ink); }
.hm-scent-note { display: block; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.hm-scent-prompt { margin-top: clamp(32px, 4vw, 52px); padding: 24px clamp(20px, 3vw, 36px); border: 1px solid var(--line); background: var(--card); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.hm-scent-prompt strong { display: block; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 22px; color: var(--ink); }
.hm-scent-prompt p { margin-top: 6px; font-size: 14px; font-weight: 300; line-height: 1.6; color: var(--ink-soft); max-width: 480px; }

/* ================= MAKERS ================= */
.hm-makers { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hm-makers-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px) clamp(16px, 2vw, 28px); align-items: center; }
.hm-makers-head { grid-column: 1 / span 5; }
.hm-makers-copy { grid-column: 7 / span 6; }
.hm-makers-copy p { font-size: 15.5px; font-weight: 300; line-height: 1.8; color: var(--ink-soft); max-width: 520px; }
.hm-sec [lang="zh"] { white-space: nowrap; }
.hm-makers-copy .hm-credit { margin-top: 18px; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 21px; color: var(--ink); line-height: 1.4; }
.hm-makers-copy .link { margin-top: 24px; }
.hm-makers--photo .hm-makers-head { grid-column: 1 / span 5; }
.hm-makers--photo .hm-makers-copy { grid-column: 1 / span 5; }
.hm-makers-figure { grid-column: 7 / span 6; grid-row: 1 / span 2; margin: 0; }
.hm-makers-figure .hm-detail { margin: 0; aspect-ratio: 4 / 3; }
.hm-makers-figure figcaption { margin-top: 10px; font-size: 12.5px; color: var(--muted); font-style: italic; }

/* ================= IDEAS ================= */
.hm-ideas { background: var(--paper); }
.hm-ideas-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px) clamp(16px, 2vw, 28px); align-items: start; }
.hm-ideas-intro { grid-column: 1 / span 5; }
.hm-ideas-intro .link { margin-top: 22px; }
.hm-essay { grid-column: 7 / span 6; }
.hm-essay-media { display: block; aspect-ratio: 16 / 9.3; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.hm-essay-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-essay .hm-tag { margin-top: 22px; }
.hm-essay h3 { margin-top: 10px; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; }
.hm-essay h3 a { color: var(--ink); text-decoration: none; }
.hm-essay p { margin-top: 10px; font-size: 14.5px; font-weight: 300; line-height: 1.65; color: var(--ink-soft); max-width: 460px; }
.hm-essay .link { margin-top: 16px; }
.hm-tool-list { list-style: none; }
.hm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 19px; line-height: 1.25; }
.hm-row small { display: block; margin-top: 3px; font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 300; color: var(--ink-soft); }
.hm-row .arr { flex: none; font-family: 'Inter', sans-serif; font-weight: 400; }
.hm-row:hover { color: var(--accent-ink); }
.hm-tools { margin-top: clamp(36px, 5vw, 60px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px clamp(24px, 4vw, 64px); align-items: start; }
.hm-tools h3 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 28px; color: var(--ink); }
.hm-tools > div > p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.hm-tool-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 40px); border-top: 1px solid var(--line); }

/* ================= RESPONSIVE ================= */
@media (max-width: 999px) {
  .hm-elements-head, .hm-scent-head { grid-template-columns: 1fr; gap: 18px; }
  .hm-elements-head .hm-lede, .hm-scent-head .hm-lede { margin-top: 12px; }

  /* the five Elements become a swipeable gallery with Element tabs, arrows and a counter */
  .hm-tabs { display: flex; gap: 2px 10px; list-style: none; margin: 0 0 18px; padding: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
  .hm-tabs::-webkit-scrollbar { display: none; }
  .hm-tabs a { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 8px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
  .hm-tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }
  .hm-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; margin: 0 calc(-1 * max(var(--page-pad-x), env(safe-area-inset-left))); padding: 0 max(var(--page-pad-x), env(safe-area-inset-left)); scroll-padding: 0 max(var(--page-pad-x), env(safe-area-inset-left)); }
  .hm-track::-webkit-scrollbar { display: none; }
  .hm-slide, .hm-slide--feature { flex: 0 0 min(86%, 440px); scroll-snap-align: start; grid-column: auto; grid-row: auto; }
  .hm-feature { grid-template-columns: 1fr; gap: 18px; }
  .hm-feature-media { aspect-ratio: 1; min-height: 0; }
  .hm-slide { display: flex; }
  .hm-slide > * { flex: 1; min-width: 0; }
  .hm-feature-text { gap: 14px; }
  .hm-feature-text .hm-detail { display: none; }
  .hm-feature--plain .hm-feature-text { min-height: 280px; }
  .hm-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 16px; }
  .hm-controls[hidden] { display: none; }
  .hm-controls button { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font: 400 18px/1 'Inter', sans-serif; cursor: pointer; }
  .hm-controls button:disabled { opacity: .35; cursor: default; }
  .hm-count { min-width: 52px; text-align: center; font-size: 13px; letter-spacing: .08em; color: var(--ink-soft); }
  .hm-values { gap: 18px 24px; padding-top: 22px; }

  .hm-makers-figure { max-width: 460px; }
  .hm-makers-head, .hm-makers-copy, .hm-makers--photo .hm-makers-head, .hm-makers--photo .hm-makers-copy, .hm-makers-figure, .hm-ideas-intro, .hm-essay { grid-column: 1 / -1; grid-row: auto; }
  .hm-makers-figure { order: 3; }
  .hm-tools { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .hm-scent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hm-tool-list { grid-template-columns: 1fr; }
  .hm-scent-prompt .link { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-tile-media img, .hm-feature-media img, .hm-detail img { transition: none; }
  .hm-track { scroll-behavior: auto; }
}

/* ================= Photographs (F5C, refined in F5D). All are public editorial images; purchasing is not enabled. ================= */
.hm-tile-media picture, .hm-feature-media picture, .hm-value-media picture, .hm-scent-photo picture, .hm-process-main picture, .hm-process-second picture, .hm-detail picture { display: block; width: 100%; height: 100%; }
.hm-feature-media img, .hm-tile-media img, .hm-detail img, .hm-value-media img, .hm-scent-photo img, .hm-process-main img, .hm-process-second img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-tile--photo { padding: 0; gap: 0; justify-content: flex-start; overflow: hidden; }
.hm-tile--photo .hm-tile-media { margin: 0; aspect-ratio: 4 / 3; border: 0; border-bottom: 1px solid var(--line); }
.hm-tile--photo .hm-tile-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 14px clamp(14px, 1.6vw, 20px) 16px; }
.hm-tile--photo h3 { font-size: clamp(24px, 2.3vw, 30px); }
.hm-tile--photo .link { margin-top: 0; }
@media (min-width: 1000px) { .hm-feature--editorial { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.hm-feature--editorial .hm-feature-text h3 { font-size: clamp(34px, 3.6vw, 48px); }
.hm-feature--editorial .hm-detail { aspect-ratio: 3 / 4; }
.hm-gallery-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.hm-value-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e9e1d0; border: 1px solid var(--line); margin-bottom: 14px; }
.hm-values { margin-top: clamp(32px, 4.5vw, 60px); }

.hm-makers-figure--process { position: relative; display: block; padding-bottom: 40px; }
.hm-process-main { display: block; width: 78%; aspect-ratio: 4 / 5; overflow: hidden; background: #e9e1d0; border: 1px solid var(--line); }
.hm-process-second { position: absolute; right: 0; bottom: 64px; display: block; width: 40%; aspect-ratio: 4 / 3; overflow: hidden; background: #e9e1d0; border: 6px solid var(--paper-deep); box-shadow: 0 8px 24px rgba(32, 29, 24, .14); }
.hm-makers-figure--process figcaption { position: absolute; left: 0; bottom: 0; margin: 0; }

.hm-label--status { color: var(--accent-ink); }
.hm-label--status > span:last-child { padding: 7px 12px; background: var(--accent-soft); border: 1px solid rgba(69, 88, 59, .35); border-radius: 2px; letter-spacing: .16em; }
.hm-label--status::after { display: none; }
.hm-concept-note { margin-top: 14px; font-size: 14px; font-style: normal; font-weight: 500; line-height: 1.6; color: var(--ink); }
.hm-scent-photo { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #efe7d6; border: 1px solid var(--line); }
.hm-concept-badge { position: absolute; left: 10px; bottom: 10px; padding: 6px 8px; background: rgba(251, 249, 244, .94); color: var(--ink); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.hm-tri svg { width: 20px; height: 18px; display: inline-block; margin-right: 10px; vertical-align: -1px; }
.hm-tri rect { fill: #9a7b45; }
.hm-char { margin-left: 6px; font-size: .78em; color: var(--muted); }

@media (max-width: 999px) {
  .hm-tile--photo .hm-tile-media { aspect-ratio: 1; }
  .hm-scent-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hm-values { grid-template-columns: 1fr; }
  .hm-values li:has(.hm-value-media) { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 16px; align-items: start; }
  .hm-values .hm-value-media { grid-row: 1 / span 2; aspect-ratio: 1; margin: 0; }
  .hm-values li:has(.hm-value-media) h3 { align-self: end; }
  .hm-process-main { width: 82%; }
  .hm-process-second { width: 44%; bottom: 58px; }
}
@media (max-width: 599px) {
  /* compact 2 x 2 concept grid */
  .hm-scent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .hm-scent-item h3 { margin-top: 12px; font-size: 20px; line-height: 1.2; }
  .hm-scent-note { font-size: 12.5px; line-height: 1.4; }
  .hm-concept-badge { left: 6px; bottom: 6px; padding: 5px 6px; font-size: 9px; letter-spacing: .1em; }
  .hm-tri svg { width: 16px; height: 14px; margin-right: 6px; }
}

/* ================= F5E: phone density (photographs are not shrunk) ================= */
@media (max-width: 640px) {
  .hm-wrap { padding-top: 52px; padding-bottom: 52px; }
  .hm-sec h2 { margin-top: 12px; }
  .hm-sub { margin-top: 8px; font-size: 20px; line-height: 1.35; }
  .hm-elements-head .hm-lede { margin-top: 10px; }
  .hm-elements-head .link, .hm-ideas-intro .link { margin-top: 14px; }
  .hm-concept-note { margin-top: 10px; }
  .hm-scent-prompt { margin-top: 24px; padding: 18px 18px; }
  .hm-makers-grid { gap: 22px; }
  .hm-ideas-grid { gap: 28px; }
  .hm-tools { margin-top: 32px; gap: 10px; }
  .hm-values { margin-top: 28px; padding-top: 18px; }
}
