/* =====================================================================
   HUB — the three-domain chooser (hub.html)
   One tall artwork: sky (Air) · sea (Water) · trench (Plumbing).
   Desktop: the camera rides the cursor up and down the painting.
   Touch:   the painting is the page; scrolling is the choosing.
   ===================================================================== */

.hub-body { background: var(--abyss); color: var(--ivory); padding-top: 0; }   /* the painting itself is offset by --head-h */

/* ---------- artwork (in the document flow: the page IS the painting) ---------- */
.hub-body { overflow: visible; overflow-x: clip; }
.realms { position: absolute; top: var(--head-h, 58px); left: 0; width: 100%; height: auto; overflow: hidden; z-index: 0; background: var(--abyss); }
.realms__img { position: relative; left: 50%; width: 100vw; max-width: none; margin-left: -50vw; height: auto; aspect-ratio: 724 / 2172; display: block; object-fit: cover;
  background: #061a2a url("../assets/art/hub-realms-poster.webp") center top / 100% auto no-repeat;
  transform-origin: 50% 50%; will-change: transform; user-select: none; -webkit-user-drag: none; }
/* viewport scrims: header legibility at the top, card/dock legibility at the bottom */
.hub-body { --zone-dim: .18; }
.hub-body[data-zone="air"] { --zone-dim: .34; }
.hub-body[data-zone="water"] { --zone-dim: .22; }
.hub-body[data-zone="plumbing"] { --zone-dim: .08; }
.realms__dim { position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: background .8s var(--ease);
  background:
    linear-gradient(rgba(3,12,20,var(--zone-dim)), rgba(3,12,20,var(--zone-dim))),
    linear-gradient(to bottom, rgba(3,12,20,.55) 0, rgba(3,12,20,0) 160px),
    linear-gradient(to top, rgba(3,12,20,.72) 0, rgba(3,12,20,0) 42%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(3,12,20,.40) 100%); }

/* enter transition: push the camera into the chosen realm */
.hub-body.is-entering .realms__img { transition: transform .75s var(--ease-out); transform: scale(1.22); }
.hub-body.is-entering .hub-title, .hub-body.is-entering .rail, .hub-body.is-entering .realm-card,
.hub-body.is-entering .zones, .hub-body.is-entering .dock { opacity: 0 !important; transition: opacity .45s; }
.hub-body.is-entering .realms::before { content: ""; position: fixed; inset: 0; background: var(--abyss); opacity: 0; animation: hubFade .75s var(--ease) forwards; z-index: 2; }
@keyframes hubFade { to { opacity: 1; } }

/* ---------- header ---------- */



/* ---------- title ---------- */
.hub-title { position: absolute; left: 0; right: 0; top: clamp(120px, 18vh, 170px); z-index: 20; text-align: center; padding: 0 var(--gutter);
  pointer-events: none; transition: opacity .8s var(--ease), transform .8s var(--ease); text-shadow: 0 2px 6px rgba(0,0,0,.55), 0 4px 28px rgba(0,0,0,.6); }
.hub-title::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(900px, 100%); height: 150%; transform: translate(-50%, -50%); z-index: -1;   /* never wider than the page: a wider halo stretched the layout on phones */
  background: radial-gradient(ellipse at center, rgba(3,12,20,.55) 0%, rgba(3,12,20,.28) 40%, transparent 70%); }
.hub-title__eyebrow { color: #fff; opacity: .85; margin: 0 0 14px; }
.hub-title__h { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.4rem, 6.2vw, 5.6rem); line-height: 1.02; margin: 0; letter-spacing: -.01em; }
.hub-title__h span { display: block; }
.hub-title__h em { display: block; font-style: italic; color: var(--gold-2); }
.hub-title__hint { margin: 22px 0 0; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; opacity: .7; }
.hub-title__hint-touch { display: none; }
.hub-body.is-touch .hub-title__hint-pointer { display: none; }
.hub-body.is-touch .hub-title__hint-touch { display: inline; }
.hub-body.is-exploring .hub-title { opacity: 0; transform: translateY(-14px); }

/* ---------- left rail ---------- */
.rail { position: fixed; left: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 20; display: grid; gap: 26px; text-shadow: 0 1px 4px rgba(0,0,0,.7), 0 2px 18px rgba(0,0,0,.75); }
.rail__item { display: grid; grid-template-columns: 22px 1fr; align-items: baseline; gap: 14px; opacity: .72; transition: opacity .4s, transform .5s var(--ease-out); }
.rail__item:hover, .rail__item.is-active { opacity: 1; }
.rail__item.is-active { transform: translateX(8px); }
.rail__idx { font-size: 10px; letter-spacing: .22em; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail__name { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.3rem, 2vw, 1.9rem); line-height: 1; letter-spacing: .01em; transition: color .4s, font-style .3s; }
.rail__item.is-active .rail__name { font-style: italic; color: var(--gold-2); }
.rail__line { grid-column: 2; height: 1px; width: 42px; background: var(--ivory); opacity: .25; transform-origin: left; transform: scaleX(.4); transition: transform .5s var(--ease-out), opacity .4s; }
.rail__item.is-active .rail__line { transform: scaleX(1); opacity: .8; background: var(--gold-2); }

/* ---------- scroll gauge (desktop) ---------- */
.hub-gauge { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 20; width: 1px; height: 180px; background: rgba(244,240,231,.22); }
.hub-gauge::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: var(--p, 0%); background: var(--gold-2); transition: height .12s linear; }
.hub-gauge::after { content: ""; position: absolute; left: 50%; top: var(--p, 0%); width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); transform: translate(-50%, -50%); box-shadow: 0 0 0 4px rgba(232,209,154,.18); transition: top .12s linear; }

/* ---------- realm card (desktop) ---------- */
.realm-card { position: fixed; left: 50%; bottom: clamp(28px, 6vh, 64px); transform: translateX(-50%); z-index: 20; width: min(620px, 100% - 2*var(--gutter));
  text-align: center; transition: opacity .35s var(--ease), transform .35s var(--ease); text-shadow: 0 1px 4px rgba(0,0,0,.6), 0 3px 22px rgba(0,0,0,.6); }
.realm-card::before { content: ""; position: absolute; left: 50%; top: 50%; width: 170%; height: 190%; transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(3,12,20,.62) 0%, rgba(3,12,20,.32) 45%, transparent 72%); }
.realm-card { opacity: 0; pointer-events: none; }                       /* appears once the visitor starts exploring */
.hub-body.is-exploring .realm-card { opacity: 1; pointer-events: auto; }
.hub-body.is-exploring .realm-card.is-switching { opacity: 0; transform: translate(-50%, 10px); }
.realm-card__eyebrow { margin: 0 0 10px; color: var(--gold-2); }
.realm-card__title { font-family: var(--font-display); font-weight: 300; font-style: italic; font-size: clamp(1.8rem, 3.4vw, 2.9rem); line-height: 1.05; margin: 0 0 12px; }
.realm-card__blurb { margin: 0 auto 20px; max-width: 54ch; color: rgba(244,240,231,.94); font-size: 15px; line-height: 1.6; }
.realm-card__row { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.realm-card__cta { text-shadow: none; }
.realm-card__bundle { margin: 0; font-size: 12px; letter-spacing: .04em; color: var(--muted); opacity: 0; transition: opacity .4s; }
.realm-card__bundle b { color: var(--gold-2); font-weight: 600; }
.hub-body[data-zone="air"] .realm-card__bundle, .hub-body[data-zone="water"] .realm-card__bundle { opacity: 1; }

/* touch-only pieces hidden on pointer devices */
.zones, .dock { display: none; }
/* (old realm pills — now in the site header as .realms-nav) */
.dock { position: fixed; left: 50%; top: 78px; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(5,16,26,.55); border: 1px solid rgba(244,240,231,.16);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.dock__btn { padding: 10px 18px; border-radius: 999px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; opacity: .72; transition: background .3s, opacity .3s, color .3s; }
.dock__btn:hover { opacity: 1; }
.dock__btn.is-active { background: var(--ivory); color: var(--ink); opacity: 1; }

/* =====================================================================
   TOUCH / NO-HOVER: the painting becomes the page
   ===================================================================== */
/* on narrow screens the painting runs wider than the phone (sides cropped) so the scroll is a real journey */
.hub-body.is-touch .realms__img{ --w: max(100%, min(220vw, 860px)); position: relative; left: 50%; width: var(--w); max-width: none; margin-left: calc(var(--w) / -2);
  will-change: auto; }
.hub-body.is-touch .realms__dim{ background:
  linear-gradient(to bottom, rgba(3,12,20,.6) 0, rgba(3,12,20,0) 140px),
  linear-gradient(to top, rgba(3,12,20,.8) 0, rgba(3,12,20,0) 22%); }

.hub-body.is-touch .hub-title{ top: clamp(150px, 22vh, 200px); }

.hub-body.is-touch .rail, .hub-body.is-touch .realm-card, .hub-body.is-touch .hub-gauge{ display: none; }

.hub-body.is-touch .zones{ display: block; position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.hub-body.is-touch .zones:not(.is-placed){ visibility: hidden; }
.hub-body.is-touch .zone{ position: absolute; left: var(--gutter); right: var(--gutter); pointer-events: auto;
  padding: 22px 22px 24px; border-radius: 22px; background: rgba(5,16,26,.42); border: 1px solid rgba(244,240,231,.14);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  opacity: .55; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease-out); }
.hub-body.is-touch .zone.is-active{ opacity: 1; transform: none; }
.hub-body.is-touch .zone__eyebrow{ margin: 0 0 8px; color: var(--gold-2); }
.hub-body.is-touch .zone__title{ font-family: var(--font-display); font-weight: 300; font-style: italic; font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.05; margin: 0 0 10px; }
.hub-body.is-touch .zone__blurb{ margin: 0 0 16px; font-size: 14.5px; line-height: 1.55; color: rgba(244,240,231,.86); }
.hub-body.is-touch .zone__bundle{ margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.hub-body.is-touch .zone__bundle b{ color: var(--gold-2); font-weight: 600; }

.hub-body.is-touch .dock{ position: fixed; left: 50%; top: 72px; bottom: auto; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(5,16,26,.6); border: 1px solid rgba(244,240,231,.16);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.hub-body.is-touch .dock__btn{ padding: 10px 16px; border-radius: 999px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; opacity: .7; transition: background .3s, opacity .3s, color .3s; }
.hub-body.is-touch .dock__btn.is-active{ background: var(--ivory); color: var(--ink); opacity: 1; }


@media (prefers-reduced-motion: reduce) {
  .realms__img { transition: none; }
}

/* current offer banner (S.promo): on phones the title clears it */
@media (max-width: 640px) { .hub-body.is-touch .hub-title { top: calc(clamp(150px, 22vh, 200px) + var(--promo-h, 0px)); } }

/* footer under the painting: hub.js sets its top to the end of the art */
.hub-foot { position: absolute; left: 0; right: 0; top: 300vw; z-index: 12; }
.hub-body .rail, .hub-body .hub-gauge, .hub-body .dock { transition: opacity .4s; }
.hub-body.at-foot .rail, .hub-body.at-foot .hub-gauge, .hub-body.at-foot .realm-card, .hub-body.at-foot .dock { opacity: 0 !important; pointer-events: none !important; }
