/* MooLight landing — black canvas, one red accent, system type (Apple-style restraint) */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #121212;
  --surface: #161616;
  --t1: #fafafa;
  --t2: #a3a3a3;
  --t3: #737373;
  --brand: #ff2d31;
  --brand4: #ff4747;
  --brand-deep: #c41e22;
  --gold: #e8c37a;
  --b1: rgba(255, 255, 255, 0.08);
  --b2: rgba(255, 255, 255, 0.14);
  --ov: rgba(0, 0, 0, 0.78);
  --glass: rgba(18, 18, 18, 0.88);
  --grad-brand: linear-gradient(180deg, #ff5c5c 0%, #ff2d31 55%, #c41e22 100%);
  --grad-hero-mobile: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.05) 18%,
    rgba(10, 10, 10, 0.45) 58%,
    rgba(10, 10, 10, 0.88) 82%,
    #0a0a0a 100%
  );
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* Apple marketing-page curve: quick start, long soft landing */
  --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);
  --radius: 12px;
  --zh: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "PingFang SC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  /* Headlines: same family as body, hierarchy comes from size and weight */
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", "PingFang SC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --t-soft: rgba(255, 255, 255, 0.72);
  --t-faint: rgba(255, 255, 255, 0.5);
  --hairline: rgba(255, 255, 255, 0.12);
  --material: rgba(30, 30, 32, 0.55);
  --en: Inter, "SF Pro Display", -apple-system, system-ui, sans-serif;
  --accent: var(--brand4);
  --accent-hot: var(--brand);
  --accent-soft: rgba(255, 45, 49, 0.22);
  --fg: var(--t1);
  --fg-muted: var(--t2);
  --line: var(--b1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  color: var(--t1);
  font-family: var(--zh);
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background-color: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

@media (hover: hover) {
  a:hover,
  button:hover {
    opacity: 0.9;
  }
}

.show-on-desktop {
  display: block;
}

.show-on-mobile {
  display: none;
}

.main {
  position: relative;
  background: var(--bg);
}

/* —— Brand copy —— */
.brand-copy {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 440px;
  padding: 0 16px;
  animation: brand-in 1s var(--ease-apple) 0.08s both;
}

.brand-copy__eyebrow,
.kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--t-faint);
  font-weight: 600;
}

.brand-copy__title {
  font-family: var(--display);
  font-size: clamp(44px, 4.6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--t1);
}

.brand-copy__sub {
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--t-soft);
  max-width: 340px;
}

.brand-copy--mobile .brand-copy__title {
  /* ~42px on a 390px phone, never wider than 5 CJK glyphs per line allows */
  font-size: clamp(36px, 10.8vw, 46px);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.brand-copy--mobile .brand-copy__sub {
  font-size: 15px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* Latin copy runs longer per line than CJK — keep headlines from wrapping into 3+ lines */
html[lang="en"] .brand-copy__title {
  font-size: clamp(36px, 3.4vw, 52px);
  letter-spacing: -0.025em;
}

html[lang="en"] .brand-copy--mobile .brand-copy__title {
  font-size: clamp(30px, 8.6vw, 38px);
}

/* —— Language toggle (zh ⇄ en) —— */
.lang-toggle {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  z-index: 999;
  min-width: 44px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline);
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: var(--t1);
  font-family: var(--en);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.25s var(--ease-apple);
}

.lang-toggle:active {
  transform: scale(0.94);
}

/* —— Desktop —— */
.main-desktop {
  position: relative;
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 720px;
  background: var(--bg);
}

.main-desktop__promotion {
  width: 40%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 24px 28px;
  z-index: 2;
}

.main-desktop__promotion--content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.main-desktop__promotion--logo {
  width: min(180px, 60%);
  height: auto;
  animation: brand-in 0.9s var(--ease-apple) both;
}

.sell-points--desktop {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  animation: brand-in 0.95s var(--ease) 0.12s both;
}

.sell-points--desktop .sell-points__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--t-soft);
}

.sell-points__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--t-faint);
}

.main-desktop__promotion--qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 180px;
  animation: brand-in 1s var(--ease) 0.16s both;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-ken {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}

.main-desktop__promotion--qrcode-loading {
  animation: rotate 2s linear infinite;
  display: block;
  width: 40px;
  height: 40px;
}

.main-desktop__promotion--qrcode-container {
  display: none;
}

.main-desktop__promotion--qrcode-wrapper {
  padding: 14px;
  background-color: #fff;
  border-radius: 18px;
  height: 176px;
}

.qrcode-hint {
  width: 180px;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--t-faint);
}

.desktop-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-size: 12px;
  color: var(--t3);
}

.desktop-footer__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--t3);
}

.main-desktop__bg {
  position: relative;
  width: 60%;
  height: 100%;
  background-color: var(--bg);
  overflow: hidden;
}

.main-desktop__bg--cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-position: center top;
  object-fit: cover;
  animation: hero-ken 1.8s var(--ease-apple) both;
}

/* Hero video sits over the image and only fades in once it is really playing */
video.hero-video {
  opacity: 0;
  animation: none;
  pointer-events: none;
  transition: opacity 1s var(--ease-apple);
}

video.hero-video.is-playing {
  opacity: 1;
}

/* Hot-drama covers row on a frosted material; tap a cover to jump the hero carousel to its clip */
.hero-covers[hidden] {
  display: none;
}

.hero-covers {
  width: 100%;
  animation: brand-in 1.1s var(--ease-apple) 0.16s both;
}

.hero-covers__label {
  margin-bottom: 10px;
  font-size: 12px;
}

.hero-covers__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: var(--material);
  border: 0.5px solid var(--hairline);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

.hero-covers__item {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  appearance: none;
  /* Keeps rounded corners clipping the image during the scale transition in Safari */
  isolation: isolate;
  transition: transform 0.5s var(--ease-apple), opacity 0.5s var(--ease-apple);
}

button.hero-covers__item {
  cursor: pointer;
  opacity: 0.45;
  transform: scale(0.92);
}

button.hero-covers__item:active {
  transform: scale(0.88);
}

.hero-covers__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button.hero-covers__item.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Playback progress of the active clip, driven by --progress (0..1) */
.hero-covers__progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.4s var(--ease-apple);
}

.hero-covers__progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
}

.hero-covers__item.is-active .hero-covers__progress {
  opacity: 1;
}

.hero-covers__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 4px 12px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
}

.hero-covers--mobile {
  max-width: 400px;
  padding: 0 16px;
  text-align: center;
}

.hero-covers--desktop {
  max-width: 400px;
  text-align: center;
}

.main-desktop__bg--gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(10, 10, 10, 0.35) 22%, transparent 52%),
    linear-gradient(0deg, #0a0a0a 0%, rgba(10, 10, 10, 0) 38%);
  pointer-events: none;
}

.main-desktop__bg--vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.main-mobile__shadow {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9;
  width: 100%;
  height: 180px;
  pointer-events: none;
  display: none;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 14%, #0a0a0a 48%);
  transition: opacity 0.3s var(--ease);
}

@media only screen and (max-width: 1023px) {
  .show-on-desktop {
    display: none;
  }

  .show-on-mobile {
    display: block;
  }

  .main-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg);
    overflow: hidden;
  }

  .main-mobile__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
  }

  .main-mobile__bg--cover {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-position: top center;
    object-fit: cover;
    animation: hero-ken 1.35s var(--ease) both;
  }

  .main-mobile__gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--grad-hero-mobile);
    pointer-events: none;
  }

  .main-mobile__promotion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
    z-index: 10;
    width: 100%;
    animation: brand-in 1s var(--ease-apple) both;
  }

  .main-mobile__logo {
    width: 132px;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
  }

  .main-mobile__cta-container {
    height: 120px;
    width: 100%;
  }

  .main-mobile__cta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s var(--ease);
    position: fixed;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .main-mobile__button {
    width: 100%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
  }

  .main-mobile__cta--loading-container {
    position: relative;
    width: 100%;
    max-width: 400px;
  }

  .main-mobile__cta--loading {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    animation: rotate 2s linear infinite;
    display: none;
  }

  .main-mobile__cta--btn {
    width: 100%;
  }

  .cta-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 24px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: transform 0.25s var(--ease-apple), background-color 0.25s var(--ease-apple);
  }

  .main-mobile__button:active .cta-pill {
    transform: scale(0.97);
    background: var(--brand-deep);
  }

  .cta-pill--dark {
    border-radius: 999px;
  }

  .cta-link,
  .main-mobile__cta--notice {
    display: inline-flex;
    margin-top: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--t-soft);
    background: transparent;
  }

  .cta-link::after,
  .main-mobile__cta--notice::after {
    content: "\203A";
    margin-left: 4px;
  }

  .footer {
    width: 100%;
    background-color: var(--bg);
    text-align: center;
    padding: 8px 24px 160px;
  }

  .footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--b1);
    padding-top: 28px;
  }

  .footer__logo {
    width: 140px;
    opacity: 0.92;
  }

  .footer__tag {
    font-size: 12px;
    color: var(--t3);
    letter-spacing: 0.06em;
  }

  .footer__copy {
    font-size: 11px;
    color: #555;
  }

  .modal {
    position: fixed;
    inset: 0;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  }

  .modal.show {
    opacity: 1;
    visibility: visible;
  }

  .modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--ov);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
  }

  .modal.show .modal__backdrop {
    opacity: 1;
  }

  .modal__content {
    position: absolute;
    border-radius: 16px;
    background: #161616;
    color: var(--t1);
    border: 1px solid var(--b1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    width: min(320px, calc(100vw - 40px));
    padding: 28px 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }

  .modal.show .modal__content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .modal__content--body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .modal-brand {
    width: 150px;
    margin-bottom: 4px;
  }

  .modal-title {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
  }

  .modal-desc {
    font-size: 13px;
    color: var(--t2);
  }

  .modal__content--button {
    width: 100%;
    border: none;
    border-radius: 999px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 54px;
    background: transparent;
  }

  .modal__content--button.is-countdown {
    cursor: wait;
  }

  .modal__content--button.is-countdown .modal-countdown-label {
    opacity: 0.85;
  }

  .modal__content--button--text--container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .modal-countdown-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--t1);
  }

  .modal__content--button--text--loading {
    animation: rotate 2s linear infinite;
    width: 18px;
    height: 18px;
    filter: invert(1) brightness(1.4);
  }

  .modal__content--button--container {
    position: relative;
    display: none;
    width: 100%;
  }

  .modal__content--footer {
    position: relative;
  }

  .modal__content--loading {
    animation: rotate 2s linear infinite;
    display: none;
    height: 18px;
    width: 18px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .modal__progress {
    display: none;
    width: 100%;
    position: absolute;
    left: 0;
    right: 0;
    bottom: -18px;
    padding: 0 2px;
    pointer-events: none;
    z-index: 2;
  }

  .modal__progress--bar-wrap {
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
  }

  .modal__progress--bar {
    width: 0%;
    height: 100%;
    background: var(--grad-brand);
    transition: width 0.2s var(--ease);
  }

  .modal__progress--text {
    display: none;
  }

  .modal-error {
    position: fixed;
    inset: 0;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  }

  .modal-error.show {
    opacity: 1;
    visibility: visible;
  }

  .modal-error__backdrop {
    position: absolute;
    inset: 0;
    background: var(--ov);
  }

  .modal-error__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100vw - 40px));
    background: #161616;
    border: 1px solid var(--b1);
    border-radius: 16px;
    padding: 28px 24px;
  }

  .modal-error__content--body {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .modal-error__lead {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
  }

  .modal-error__text {
    font-size: 13px;
    color: var(--t2);
    line-height: 1.55;
  }

  .modal-error__content--button {
    width: 100%;
    margin-top: 8px;
  }

  .modal-error__content--button--img {
    width: 100%;
  }

  .sell-strip {
    background: var(--bg);
    padding: 36px 16px 44px;
  }

  /* Three unboxed columns split by hairlines */
  .sell-points {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
  }

  .sell-points__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 2px 8px;
  }

  .sell-points__item + .sell-points__item {
    border-left: 0.5px solid var(--hairline);
  }

  .sell-points__item strong {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--t1);
  }

  .sell-points__item span {
    font-size: 13px;
    color: var(--t-faint);
  }

  .main-mobile__install-guide {
    background-color: #121212;
    padding-top: 8px;
  }

  .main-mobile__install-guide--content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .guide-brand-picker {
    width: 100%;
    max-width: 400px;
    padding: 20px 16px 12px;
  }

  .guide-brand-picker__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }

  .guide-brand-picker__title {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 700;
  }

  .guide-brand-picker__guess {
    font-size: 11px;
    color: var(--t3);
    white-space: nowrap;
  }

  .guide-brand-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-chip {
    appearance: none;
    border: 1px solid var(--b1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--t2);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
  }

  .brand-chip.is-active {
    color: #000;
    background: #fff;
    border-color: transparent;
  }

  .guide-brand-picker__tip {
    margin-top: 10px;
    font-size: 12px;
    color: var(--t3);
  }

  .guide-brand-picker__switch {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--t1);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }

  .guide-brand-chips[hidden] {
    display: none;
  }

  .main-mobile__install-guide--content--wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    margin-bottom: 48px;
    width: 100%;
  }

  #guide-android-steps {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .main-mobile__install-guide--content--img {
    width: 100%;
    height: auto;
  }

  .ios-step {
    display: none;
  }

  .apk-step {
    display: block;
  }

  .main-mobile__install-guide--go-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: fixed;
    right: 16px;
    bottom: 120px;
    z-index: 1001;
    pointer-events: none;
  }

  .main-mobile__install-guide--go-top--img,
  .go-top-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--b1);
    color: var(--t1);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
  }
}
