/*
 * Global footer — WWDC-style “Liquid Glass”: blur + saturation do the work; thin rim light;
 * soft frost core; no heavy stacked specular bands (dated iOS 7–12 glass).
 * Themes: light → html[data-theme^="light"]; dark → html[data-theme]:not([data-theme^="light"]).
 */
.hmv-footer {
  /* Same recipe light/dark; only --hmv-lg-* tokens swap */
  --hmv-lg-blur: 32px;
  --hmv-lg-sat: 1.8;
  --hmv-lg-radius: 28px 28px 0 0;
  --hmv-lg-fill: rgba(255, 255, 255, 0.38);
  --hmv-lg-frost-top: rgba(255, 255, 255, 0.22);
  --hmv-lg-border: rgba(255, 255, 255, 0.45);
  --hmv-lg-rim-in-top: rgba(255, 255, 255, 0.72);
  --hmv-lg-rim-in-bot: rgba(255, 255, 255, 0.1);
  --hmv-lg-ambient: rgba(15, 23, 42, 0.06);
  /* One stack for both lines — avoids sub line picking up monospace / tabular font */
  --hmv-footer-font:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "PingFang SC",
    system-ui,
    "Noto Sans SC",
    sans-serif;

  position: fixed;
  left: 50%;
  right: auto;
  width: 100vw;
  max-width: 100vw;
  margin-left: -50vw;
  bottom: 0;
  z-index: 999;
  text-align: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  pointer-events: none;
  border-top-left-radius: var(--hmv-lg-radius);
  border-top-right-radius: var(--hmv-lg-radius);
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  font-family: var(--hmv-footer-font);
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.hmv-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  min-height: 52px;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;

  /* Soft “thick lens” frost + fill — backdrop blur shows through */
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, var(--hmv-lg-frost-top), transparent 58%),
    var(--hmv-lg-fill);

  backdrop-filter: blur(var(--hmv-lg-blur)) saturate(var(--hmv-lg-sat));
  -webkit-backdrop-filter: blur(var(--hmv-lg-blur)) saturate(var(--hmv-lg-sat));

  border-top: 1px solid var(--hmv-lg-border);
  box-shadow:
    inset 0 1px 0 var(--hmv-lg-rim-in-top),
    inset 0 -1px 0 var(--hmv-lg-rim-in-bot),
    0 -8px 40px var(--hmv-lg-ambient),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

/* Hairline rim catch-light (top edge) */
.hmv-footer::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  z-index: 0;
  pointer-events: none;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  opacity: 0.65;
}

.hmv-footer-main {
  position: relative;
  z-index: 1;
  color: rgba(30, 41, 59, 0.78);
  letter-spacing: 0.12em;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 300;
  font-synthesis: none;
  font-family: inherit;
  display: flex;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.hmv-footer-dot {
  color: rgba(71, 85, 105, 0.55);
  text-shadow: none;
}

.hmv-footer-sub {
  position: relative;
  z-index: 1;
  color: rgba(51, 65, 85, 0.72);
  letter-spacing: 0.14em;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 300;
  font-synthesis: none;
  font-family: inherit;
  font-variant-numeric: normal;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

html[data-theme^="light"] .hmv-footer {
  --hmv-lg-blur: 36px;
  --hmv-lg-sat: 1.85;
  --hmv-lg-fill: rgba(255, 255, 255, 0.44);
  --hmv-lg-frost-top: rgba(255, 255, 255, 0.28);
  --hmv-lg-border: rgba(255, 255, 255, 0.52);
  --hmv-lg-rim-in-top: rgba(255, 255, 255, 0.82);
  --hmv-lg-rim-in-bot: rgba(255, 255, 255, 0.14);
  --hmv-lg-ambient: rgba(15, 23, 42, 0.05);
}

/* Dark themes: same liquid recipe, darker frost + cool rim */
html[data-theme]:not([data-theme^="light"]) .hmv-footer {
  --hmv-lg-blur: 32px;
  --hmv-lg-sat: 1.8;
  --hmv-lg-fill: rgba(22, 24, 32, 0.52);
  --hmv-lg-frost-top: rgba(255, 255, 255, 0.1);
  --hmv-lg-border: rgba(255, 255, 255, 0.14);
  --hmv-lg-rim-in-top: rgba(255, 255, 255, 0.28);
  --hmv-lg-rim-in-bot: rgba(0, 0, 0, 0.35);
  --hmv-lg-ambient: rgba(0, 0, 0, 0.28);
}

html[data-theme]:not([data-theme^="light"]) .hmv-footer::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.42) 50%,
    transparent 100%
  );
  opacity: 0.5;
}

html[data-theme]:not([data-theme^="light"]) .hmv-footer-main {
  color: rgba(248, 250, 252, 0.94);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme]:not([data-theme^="light"]) .hmv-footer-dot {
  color: rgba(148, 163, 184, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-theme]:not([data-theme^="light"]) .hmv-footer-sub {
  color: rgba(226, 232, 240, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .hmv-footer {
    --hmv-lg-blur: 32px;
    --hmv-lg-sat: 1.8;
    --hmv-lg-fill: rgba(22, 24, 32, 0.52);
    --hmv-lg-frost-top: rgba(255, 255, 255, 0.1);
    --hmv-lg-border: rgba(255, 255, 255, 0.14);
    --hmv-lg-rim-in-top: rgba(255, 255, 255, 0.28);
    --hmv-lg-rim-in-bot: rgba(0, 0, 0, 0.35);
    --hmv-lg-ambient: rgba(0, 0, 0, 0.28);
  }

  html:not([data-theme]) .hmv-footer::after {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.42) 50%,
      transparent 100%
    );
    opacity: 0.5;
  }

  html:not([data-theme]) .hmv-footer-main {
    color: rgba(248, 250, 252, 0.94);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  }

  html:not([data-theme]) .hmv-footer-dot {
    color: rgba(148, 163, 184, 0.82);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  html:not([data-theme]) .hmv-footer-sub {
    color: rgba(226, 232, 240, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .hmv-footer {
    --hmv-lg-blur: 36px;
    --hmv-lg-sat: 1.85;
    --hmv-lg-fill: rgba(255, 255, 255, 0.44);
    --hmv-lg-frost-top: rgba(255, 255, 255, 0.28);
    --hmv-lg-border: rgba(255, 255, 255, 0.52);
    --hmv-lg-rim-in-top: rgba(255, 255, 255, 0.82);
    --hmv-lg-rim-in-bot: rgba(255, 255, 255, 0.14);
    --hmv-lg-ambient: rgba(15, 23, 42, 0.05);
  }
}

/* No backdrop: opaque frosted strips */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hmv-footer::before {
    background: linear-gradient(180deg, rgba(252, 252, 254, 0.94) 0%, rgba(248, 250, 252, 0.98) 100%);
  }

  html[data-theme]:not([data-theme^="light"]) .hmv-footer::before {
    background: linear-gradient(180deg, rgba(36, 38, 48, 0.96) 0%, rgba(20, 22, 30, 0.99) 100%);
  }
}

@media (prefers-color-scheme: dark) {
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html:not([data-theme]) .hmv-footer::before {
      background: linear-gradient(180deg, rgba(36, 38, 48, 0.96) 0%, rgba(20, 22, 30, 0.99) 100%);
    }
  }
}

body.hmv-has-footer {
  padding-bottom: 56px;
}

/*
 * Subpage end band — plain text (no box), font stack aligned with chat-sims ref
 * `6-social/chat-sims/1602-page-5b317647/page-5b317647.css` (body / muted footer look).
 */
.hmv-sub-end-band {
  --hmv-hint-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --hmv-hint-muted: #a0a0a8;
  --hmv-hint-faint: #8c8c96;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: clamp(118px, 24vh, 280px);
  padding: 0 16px max(68px, calc(18px + env(safe-area-inset-bottom, 0px)));
  pointer-events: none;
}

.hmv-sub-end-band .hmv-sub-scroll-hint-footer.footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: clamp(120px, 22vh, 260px);
  padding: 32px 16px 12px;
  gap: 8px;
  margin: 0;
  box-sizing: border-box;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (width <= 600px) {
  .hmv-sub-end-band .hmv-sub-scroll-hint-footer.footer {
    min-height: clamp(100px, 20vh, 220px);
    padding: 24px 14px 10px;
  }
}

.hmv-sub-end-band .footer-tagline {
  margin: 0;
  font-family: var(--hmv-hint-font);
  color: var(--hmv-hint-muted);
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-shadow: none;
}

.hmv-sub-end-band .footer-clock {
  margin: 0;
  font-family: var(--hmv-hint-font);
  color: var(--hmv-hint-faint);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-shadow: none;
}

/* Light page BG: darken slightly so hint stays legible without a box */
html[data-theme^="light"] .hmv-sub-end-band {
  --hmv-hint-muted: rgba(71, 85, 105, 0.88);
  --hmv-hint-faint: rgba(100, 116, 139, 0.85);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .hmv-sub-end-band {
    --hmv-hint-muted: rgba(71, 85, 105, 0.88);
    --hmv-hint-faint: rgba(100, 116, 139, 0.85);
  }
}

/* One-time session hint: subtle pull-down arrow (global subpage UX; see subpage-footer.js) */
.hmv-uphold-hint {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.85s ease,
    transform 0.85s ease;
}

.hmv-uphold-hint--visible {
  opacity: 0.55;
  transform: translateX(-50%) translateY(0);
}

.hmv-uphold-hint--hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

.hmv-uphold-hint-arrow {
  display: block;
  font-size: 28px;
  font-weight: 200;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(15, 23, 42, 0.12);
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.35));
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-theme]:not([data-theme^="light"]) .hmv-uphold-hint-arrow {
  color: rgba(248, 250, 252, 0.88);
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.22),
    0 1px 3px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .hmv-uphold-hint-arrow {
    color: rgba(248, 250, 252, 0.88);
    text-shadow:
      0 0 14px rgba(255, 255, 255, 0.22),
      0 1px 3px rgba(0, 0, 0, 0.45);
  }
}
