/* ============================================================
   Hotel Earth — passing it on.  One ready-made room key, one button.
   The key is a plain <img> in normal flow: no transform, no filter, nothing layered over it, no
   user-select / touch-callout rules — WeChat and iOS must be able to press and hold it.
   ============================================================ */

/* ---------- the page ---------- */
#passOn.he-pass2 { position: relative; overflow: hidden; overflow: clip; padding-block: 1.25rem clamp(4rem, 8vw, 7rem); background: var(--he-ink); }
/* the glow starts inside the section, so it never gets a hard edge where the header ends */
#passOn.he-pass2::before { content: ""; position: absolute; left: 50%; top: 0; width: min(64rem, 130vw); aspect-ratio: 1; border-radius: 50%; translate: -50% 0;
  background: radial-gradient(closest-side, var(--he-glow-love) 0%, var(--he-glow-violet) 45%, transparent 100%); pointer-events: none; }
.he-pass2 .wrap { position: relative; }
.he-pass2__grid { display: block; max-width: 34rem; margin-inline: auto; --gap: clamp(1.75rem, 4vw, 2.5rem); }
.he-pass2__grid > .he-pass2__key, .he-pass2__grid > .he-pass2__pick { margin-top: var(--gap); }
.he-pass2__head { grid-area: head; text-align: center; }
.he-pass2__head .eyebrow { justify-content: center; display: none; }   /* the menu already says where you are; on a phone the key and its button come first */
.he-pass2__key { grid-area: key; }
.he-pass2__pick { grid-area: pick; }
.he-pass2__who { grid-area: who; }
.he-pass2__mine { grid-area: mine; }
.he-pass2__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.3rem, 1.4rem + 4.2vw, 4.6rem); line-height: 1.02; letter-spacing: -.01em; color: var(--he-porcelain); text-wrap: balance; }
.he-pass2__title em { font-style: italic; background: var(--he-dawn-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
html[lang^='zh'] .he-pass2__title { font-size: clamp(1.9rem, 1.3rem + 3vw, 3.4rem); line-height: 1.22; letter-spacing: .02em; }
html[lang^='zh'] .he-pass2__title em { font-style: normal; }
.he-pass2__p { margin: var(--space-4) auto 0; max-width: 28rem; color: var(--he-silver); font-size: clamp(.95rem, .9rem + .3vw, 1.12rem); line-height: 1.6; }

@media (min-width: 960px) {
  .he-pass2__grid { display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); max-width: 68rem; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); column-gap: clamp(3rem, 7vw, 7rem); align-items: start;
    grid-template-areas: "head key" "pick key" "who key" "mine key"; grid-template-rows: auto auto auto 1fr; }
  .he-pass2__grid > .he-pass2__key, .he-pass2__grid > .he-pass2__pick { margin-top: 0; }
  #passOn.he-pass2 { padding-top: clamp(3.5rem, 8vh, 6rem); }
  #passOn.he-pass2::before { left: auto; right: -12%; translate: none; }
  .he-pass2__head { text-align: left; padding-top: clamp(1rem, 4vw, 3.5rem); }
  .he-pass2__head .eyebrow { display: flex; justify-content: flex-start; margin-bottom: var(--space-4); }
  .he-pass2__p { margin-inline: 0; }
  .he-pass2__key { position: sticky; top: 6.5rem; }
  .he-pass2__key .he-keyblock__fig { max-width: min(26rem, 56vh); }
}

/* ---------- the key + its one control (used on #pass and in context) ---------- */
.he-keyblock { display: grid; gap: var(--space-4); justify-items: center; }
.he-keyblock__fig { width: 100%; max-width: min(26rem, 36vh); max-width: min(26rem, 36svh); border-radius: 20px; background: var(--he-ink-2); box-shadow: 0 34px 80px -28px rgba(0, 0, 0, .9), 0 0 0 1px var(--he-hair); overflow: hidden; }
.he-keyblock__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.he-keyblock__act { width: 100%; max-width: 26rem; display: grid; gap: var(--space-4); justify-items: center; }
.he-keyblock__send { width: 100%; justify-content: center; min-height: 56px; }
.he-keyblock__send svg { width: 1.15em; height: 1.15em; flex: none; }
.he-keyblock__send[disabled] { opacity: .55; cursor: progress; }
.he-keyblock__hold { width: 100%; text-align: center; padding: .95em 1.2em; border: 1px solid var(--he-hair-strong); border-radius: 16px; background: var(--he-panel);
  font-family: var(--font-display); font-size: 1.3rem; line-height: 1.35; color: var(--he-porcelain); }
html[lang^='zh'] .he-keyblock__hold { font-size: 1.12rem; line-height: 1.6; }
.he-keyblock__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.5rem; }
.he-link { background: none; border: 0; padding: .5em .1em; min-height: 40px; font-family: var(--font-body); font-size: .68rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--he-silver); cursor: pointer; border-bottom: 1px solid transparent; transition: color var(--transition), border-color var(--transition); }
html[lang^='zh'] .he-link { font-size: .84rem; letter-spacing: .12em; }
.he-link:hover, .he-link:focus-visible { color: var(--he-porcelain); border-bottom-color: var(--he-love); }

/* in context: under the front-desk result, under today's move, at the end of a chapter */
.he-inlinekey { margin-top: var(--space-8); padding-top: var(--space-8); border-top: 1px solid var(--he-line); animation: heOpen .5s cubic-bezier(.16, 1, .3, 1); }
.he-inlinekey .he-keyblock__fig, .he-inlinekey .he-keyblock__act { max-width: 20rem; }
.he-inlinekey--reader { border-top: 0; padding-top: 0; margin-top: var(--space-6); }
.reader__pass-line { text-align: center; }

/* ---------- the two quiet extras: "Thinking of someone?" and "Make it your own key" ---------- */
.he-pass2__pick, .he-pass2__who, .he-pass2__mine { border-top: 1px solid var(--he-line); }
@media (min-width: 960px) { .he-pass2__who, .he-pass2__mine { margin-top: calc(-1 * clamp(1.75rem, 4vw, 2.5rem)); } }
.he-pass2__mine { border-bottom: 1px solid var(--he-line); }
.he-pass2__pick > summary, .he-pass2__who > summary, .he-pass2__mine > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; padding: .4rem 0;
  font-family: var(--font-display); font-size: clamp(1.35rem, 1.2rem + .6vw, 1.7rem); color: var(--he-porcelain); }
html[lang^='zh'] .he-pass2__pick > summary, html[lang^='zh'] .he-pass2__who > summary, html[lang^='zh'] .he-pass2__mine > summary { font-size: 1.2rem; }
.he-pass2__pick > summary::-webkit-details-marker, .he-pass2__who > summary::-webkit-details-marker, .he-pass2__mine > summary::-webkit-details-marker { display: none; }
.he-pass2__pick > summary::after, .he-pass2__who > summary::after, .he-pass2__mine > summary::after { content: "+"; font-family: var(--font-body); font-weight: 300; font-size: 1.5rem; color: var(--he-faint); transition: transform 320ms cubic-bezier(.16, 1, .3, 1), color var(--transition); }
.he-pass2__pick[open] > summary::after, .he-pass2__who[open] > summary::after, .he-pass2__mine[open] > summary::after { transform: rotate(45deg); color: var(--he-love); }
.he-pass2__pick > summary:focus-visible, .he-pass2__who > summary:focus-visible, .he-pass2__mine > summary:focus-visible { outline: 2px solid var(--he-love); outline-offset: 4px; border-radius: 6px; }
.he-pass2__sub, .he-mine__sub { color: var(--he-silver); font-size: var(--text-sm); line-height: 1.65; max-width: 30rem; }
.he-pass2__desk { margin: var(--space-5) 0 var(--space-6); border-top: 1px solid var(--he-line-soft); }
.he-who { position: relative; width: 100%; display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: baseline; gap: .6rem; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--he-line-soft);
  padding: .95rem 0; min-height: 52px; cursor: pointer; color: var(--he-porcelain); transition: padding-left 320ms cubic-bezier(.16, 1, .3, 1); }
.he-who::after { content: "→"; color: var(--he-faint); transition: transform var(--transition), color var(--transition); }
.he-who::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0; background: var(--he-dawn); transition: width 420ms cubic-bezier(.16, 1, .3, 1); }
.he-who__no { font-size: .66rem; font-weight: 600; letter-spacing: .2em; color: var(--he-faint); font-variant-numeric: tabular-nums lining-nums; }
.he-who__t { font-family: var(--font-display); font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem); line-height: 1.25; }
html[lang^='zh'] .he-who__t { font-size: 1.05rem; line-height: 1.55; }
.he-who:hover, .he-who.is-active { padding-left: .6rem; }
.he-who:hover::before, .he-who.is-active::before { width: 100%; }
.he-who:hover::after, .he-who.is-active::after { transform: translateX(4px); color: var(--he-love); }
.he-who:focus-visible { outline: 2px solid var(--he-love); outline-offset: 2px; }

.he-mine { display: grid; gap: var(--space-5); padding-bottom: var(--space-6); }
.he-mine__row { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.he-mine .field { display: grid; gap: .3rem; }
.he-mine .field > span { font-size: .64rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--he-silver); }
html[lang^='zh'] .he-mine .field > span { font-size: .82rem; letter-spacing: .16em; }
.he-mine .field input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--he-hair-strong); border-radius: 0; padding: .5em 0 .55em; font-family: var(--font-display); font-size: 1.5rem; color: var(--he-porcelain); color-scheme: dark; }
.he-mine .field input[type='date'] { font-family: var(--font-body); font-size: 1.05rem; letter-spacing: .06em; min-height: 2.9rem; }
.he-mine .field input:focus { outline: none; border-bottom-color: var(--he-love); }
.he-mine .field input::placeholder { color: var(--he-faint); opacity: 1; }
.he-mine__privacy { font-size: var(--text-xs); color: var(--he-faint); }
.he-mine .he-link { justify-self: start; }

/* ---------- arriving through a key: "Someone left this room for you." ---------- */
.he-ribbon { display: grid; gap: .25rem; margin: 0 0 var(--space-8); padding: 1rem 1.25rem 1.05rem; border: 1px solid var(--he-hair-strong); border-radius: 16px; position: relative; overflow: hidden; background: var(--he-panel); }
.he-ribbon::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--he-dawn); }
.he-ribbon b { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; line-height: 1.25; color: var(--he-porcelain); }
.he-ribbon span { font-size: var(--text-sm); color: var(--he-silver); }
html[lang^='zh'] .he-ribbon b { font-size: 1.2rem; }

@keyframes heOpen { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .he-inlinekey { animation: none; } .he-who, .he-who::before, .he-who::after { transition: none; } }

/* QA capture (?shot=1): nothing sticky, everything open */
.he-shot .he-pass2__key { position: static; }

/* ---------- pick a line: every line is a room's key ---------- */
.he-lines { margin: var(--space-5) 0 var(--space-6); border-top: 1px solid var(--he-line-soft); }   /* eight lines — short enough to show whole, no scroll box */
.he-lines--inline { width: 100%; margin: 0; text-align: left; border: 1px solid var(--he-line); border-radius: 16px; padding: 0 1rem; background: var(--he-panel); }
.he-line { position: relative; width: 100%; display: grid; grid-template-columns: 2.2rem 1fr; align-items: baseline; gap: .6rem; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--he-line-soft);
  padding: .85rem 0; min-height: 48px; cursor: pointer; color: var(--he-silver); transition: color var(--transition), padding-left 320ms cubic-bezier(.16, 1, .3, 1); }
.he-line:last-child { border-bottom: 0; }
.he-line__no { font-size: .64rem; font-weight: 600; letter-spacing: .2em; color: var(--he-faint); font-variant-numeric: tabular-nums lining-nums; }
.he-line__t { font-family: var(--font-display); font-style: italic; font-size: clamp(1.08rem, 1rem + .4vw, 1.28rem); line-height: 1.3; }
html[lang^='zh'] .he-line__t { font-style: normal; font-size: 1.02rem; line-height: 1.6; }
.he-line:hover, .he-line.is-active { color: var(--he-porcelain); padding-left: .5rem; }
.he-line.is-active .he-line__no { color: var(--he-love); }
.he-line:focus-visible { outline: 2px solid var(--he-love); outline-offset: 2px; }

/* ---------- quick share: the link, to the apps people use most. Opens in a new window; this page stays. ---------- */
.he-quick { width: 100%; display: grid; gap: .7rem; justify-items: center; padding-top: var(--space-4); border-top: 1px solid var(--he-line-soft); }
.he-quick__label { font-size: .6rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--he-faint); }
html[lang^='zh'] .he-quick__label { font-size: .78rem; letter-spacing: .16em; }
.he-quick__row { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
/* round logo buttons: one quiet colour, 48px targets — small on the page, easy to hit with a thumb */
.he-quick__btn { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--he-line); border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--he-silver); text-decoration: none; transition: color var(--transition), border-color var(--transition), transform var(--transition), background var(--transition); }
.he-quick__btn svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.he-quick__btn:hover, .he-quick__btn:focus-visible, .he-quick__btn[aria-expanded='true'] { color: var(--he-ink); background: var(--he-porcelain); border-color: var(--he-porcelain); transform: translateY(-1px); outline: none; }
.he-quick__btn:focus-visible { box-shadow: 0 0 0 2px var(--he-ink), 0 0 0 4px var(--he-love); }
/* the WeChat panel: the room's code + the link */
.he-wx { width: 100%; display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; align-items: center; text-align: left; padding: .9rem; border: 1px solid var(--he-line); border-radius: 16px; background: var(--he-panel); animation: heOpen .4s cubic-bezier(.16, 1, .3, 1); }
.he-wx__qr { width: 100%; height: auto; display: block; border-radius: 10px; }
.he-wx__side { display: grid; gap: .7rem; justify-items: start; }
.he-wx__side p { font-size: var(--text-sm); line-height: 1.6; color: var(--he-silver); }
.he-wx__copy { min-height: 40px; padding: .6em 1.1em; font-size: .64rem; }
@media (max-width: 380px) { .he-wx { grid-template-columns: 1fr; justify-items: center; text-align: center; } .he-wx__qr { max-width: 11rem; } .he-wx__side { justify-items: center; } }
@media (prefers-reduced-motion: reduce) { .he-quick__btn, .he-line { transition: none; } .he-quick__btn:hover { transform: none; } .he-wx { animation: none; } }

/* ---------- phone: the key travels with the reader ----------
   The key block dissolves into the page flow (display: contents) so its picture can stay stuck for the whole section, not
   just inside its own box. --p runs 0 → 1 over the first 240px of travel and drives the size, the backdrop and the button. */
@media (max-width: 959px) {
  .he-keyblock--travels { display: contents; }
  .he-keyblock--travels .he-keyblock__mark { height: 0; margin-top: var(--gap); }
  .he-keyblock--travels .he-keyblock__fig { --p: 0; --h: 300px; --s: calc(1 - .4 * var(--p)); position: sticky; top: calc(4.6rem + 10px); z-index: 6; margin-inline: auto;
    overflow: visible; background: none; box-shadow: none; border-radius: 0; pointer-events: none; }
  /* a soft curtain behind the travelling key, so the options slide away under it instead of showing through */
  .he-keyblock--travels .he-keyblock__fig::before { content: ""; position: absolute; left: 50%; translate: -50% 0; width: 100vw; top: -14px; height: calc(var(--h) * var(--s) + 44px);
    background: linear-gradient(180deg, var(--he-ink) 0%, var(--he-ink) 78%, transparent 100%); opacity: calc(var(--p) * 1.6); pointer-events: none; }
  /* once it is hiding things, the curtain also BLOCKS taps — otherwise the share buttons sliding away under it stay invisibly tappable */
  .he-keyblock--travels .he-keyblock__fig.is-travelling::before { pointer-events: auto; }
  .he-keyblock--travels .he-keyblock__img { position: relative; border-radius: 20px; pointer-events: auto; box-shadow: 0 30px 70px -28px rgba(0, 0, 0, .9), 0 0 0 1px var(--he-hair); }
  /* only while it is actually travelling — at rest the picture is a plain, untouched image (what WeChat's press-and-hold wants) */
  .he-keyblock--travels .he-keyblock__fig.is-travelling .he-keyblock__img { transform: scale(var(--s)); transform-origin: 50% 0; }
  .he-keyblock--travels .he-keyblock__act { margin: var(--space-4) auto 0; }
  .he-keyblock__mini { position: absolute; right: 0; top: calc(var(--h) * var(--s) / 2 - 26px); width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
    background: var(--he-porcelain); color: var(--he-ink); cursor: pointer; pointer-events: auto; opacity: clamp(0, calc(var(--p) * 2.5 - 1.5), 1); transform: scale(calc(.8 + .2 * var(--p))); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .9); }
  .he-keyblock__fig:not(.is-travelling) .he-keyblock__mini { visibility: hidden; }
  .he-keyblock__mini svg { width: 20px; height: 20px; }
  .he-keyblock__mini:focus-visible { outline: 2px solid var(--he-love); outline-offset: 3px; }
}
@media (min-width: 960px) { .he-keyblock__mark, .he-keyblock__mini { display: none; } }
.he-shot .he-keyblock--travels .he-keyblock__fig { position: relative; top: auto; }
