/* ==========================================================================
   LunaTDM — landing page
   Static, no build step. Brand tokens from brand/README.md.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --night-950: #070a1a;
  --night-900: #0b1026;
  --night-800: #111735;
  --night-700: #182048;
  --night-600: #262f63;
  --text: #e8ebfa;
  --muted: #9aa3c7;
  --luna-400: #8e9bff;
  --luna-500: #6f7dff;
  --violet-400: #b794ff;
  --moon-300: #f6e7ae;
  --moon-400: #e9c86b;
  --success: #3dd6a0;
  --warning: #f5b94f;
  --danger: #ff6b81;

  --grad: linear-gradient(135deg, #6f7dff 0%, #b794ff 100%);
  --grad-text: linear-gradient(120deg, #8e9bff 0%, #b794ff 100%);

  --line: rgba(142, 155, 255, 0.14);
  --line-strong: rgba(142, 155, 255, 0.32);
  --glass: linear-gradient(180deg, rgba(24, 32, 72, 0.55) 0%, rgba(17, 23, 53, 0.55) 100%);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --font-sans: "Segoe UI Variable", "Segoe UI", "Microsoft JhengHei UI", "Microsoft YaHei UI",
    "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

  --gutter: 16px;
  --header-h: 64px;

  color-scheme: dark;
}

/* Simplified Chinese: prefer SC glyph forms */
:root:lang(zh-CN) {
  --font-sans: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC",
    "Microsoft JhengHei UI", system-ui, sans-serif;
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; --header-h: 68px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night-900);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Toggled with the hidden attribute by the scripts, even where a component sets
   display (the mobile menu has its own no-JS fallback below). */
[hidden]:not(.mobile-menu) { display: none !important; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--luna-400); text-underline-offset: 3px; }
a:hover { color: #aab4ff; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.08em 0.4em;
  border-radius: 6px;
  background: rgba(142, 155, 255, 0.12);
  color: var(--text);
  overflow-wrap: anywhere;
}

mark {
  background: rgba(246, 231, 174, 0.16);
  color: var(--moon-300);
  border-radius: 3px;
  padding: 0 2px;
}

::selection { background: rgba(111, 125, 255, 0.4); color: #fff; }

:focus-visible {
  outline: 2px solid var(--moon-300);
  outline-offset: 3px;
  border-radius: 6px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 880px; }

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--moon-300);
  color: #14120a;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); color: #14120a; }

/* Anti-flicker while a non-default language is being applied.
   Reveals itself after 1.5s even if the script never runs. */
.i18n-wait body {
  visibility: hidden;
  animation: i18n-reveal 0s linear 1.5s forwards;
}
@keyframes i18n-reveal { to { visibility: visible; } }

/* ---------- Night sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(111, 125, 255, 0.2), transparent 62%),
    radial-gradient(820px 560px at -6% 6%, rgba(183, 148, 255, 0.11), transparent 60%),
    radial-gradient(900px 500px at 50% 115%, rgba(111, 125, 255, 0.08), transparent 70%),
    linear-gradient(180deg, var(--night-950) 0%, var(--night-900) 38%, var(--night-900) 100%);
}

.stars {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}
.stars--1 {
  opacity: 0.55;
  background-size: 190px 190px;
  background-image:
    radial-gradient(1px 1px at 22px 34px, #dfe4ff, transparent),
    radial-gradient(1px 1px at 96px 12px, #dfe4ff, transparent),
    radial-gradient(1px 1px at 150px 88px, #c9d0ff, transparent),
    radial-gradient(1px 1px at 58px 132px, #dfe4ff, transparent),
    radial-gradient(1px 1px at 132px 166px, #c9d0ff, transparent),
    radial-gradient(1px 1px at 12px 176px, #dfe4ff, transparent);
}
.stars--2 {
  opacity: 0.6;
  background-size: 310px 310px;
  background-image:
    radial-gradient(1.4px 1.4px at 46px 220px, #eef0ff, transparent),
    radial-gradient(1.4px 1.4px at 210px 64px, #eef0ff, transparent),
    radial-gradient(1.2px 1.2px at 270px 250px, #d8dcff, transparent),
    radial-gradient(1.4px 1.4px at 132px 150px, #eef0ff, transparent),
    radial-gradient(1.2px 1.2px at 300px 12px, #d8dcff, transparent);
  animation: twinkle 7s ease-in-out infinite alternate;
  will-change: opacity;
}
.stars--3 {
  opacity: 0.75;
  background-size: 470px 470px;
  background-image:
    radial-gradient(1.8px 1.8px at 88px 60px, #fff8dc, transparent),
    radial-gradient(1.6px 1.6px at 380px 190px, #e8ebff, transparent),
    radial-gradient(1.9px 1.9px at 220px 400px, #d9d0ff, transparent),
    radial-gradient(1.5px 1.5px at 430px 440px, #fff8dc, transparent);
  animation: twinkle 11s ease-in-out -4s infinite alternate;
  will-change: opacity;
}
@keyframes twinkle {
  0% { opacity: 0.25; }
  100% { opacity: 0.85; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.72em 1.25em;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}
.btn svg { flex: none; width: 1.1em; height: 1.1em; }

.btn--primary {
  background: var(--grad);
  color: #0a0e25;
  box-shadow: 0 10px 28px -10px rgba(111, 125, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn--primary:hover {
  color: #0a0e25;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px -10px rgba(150, 125, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: rgba(142, 155, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover {
  color: var(--text);
  background: rgba(142, 155, 255, 0.13);
  border-color: rgba(142, 155, 255, 0.5);
}

.btn--sm { padding: 0.5em 0.95em; font-size: 0.9rem; border-radius: 10px; }
.btn--lg { padding: 0.88em 1.45em; font-size: 1.04rem; }
.btn--block { width: 100%; }

.btn:disabled,
.btn:disabled:hover,
.btn[aria-disabled="true"],
.btn[aria-disabled="true"]:hover {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}
.btn--ghost:disabled:hover,
.btn--ghost[aria-disabled="true"]:hover { background: rgba(142, 155, 255, 0.06); border-color: var(--line-strong); }
/* Waiting for the server: a small spinner in front of the label */
.btn[aria-busy="true"],
.btn[aria-busy="true"]:hover { cursor: progress; opacity: 0.85; }
.btn[aria-busy="true"]::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 38, 0.66);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.site-header.is-scrolled,
.menu-open .site-header {
  background: rgba(11, 16, 38, 0.88);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav { display: none; }
.nav__links { display: flex; gap: 2px; list-style: none; }
.nav__links a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav__links a:hover { color: var(--text); background: rgba(142, 155, 255, 0.08); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header__actions > .lang-switch { display: none; }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 10, 26, 0.5);
}
.lang-switch button {
  min-width: 36px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] {
  background: rgba(142, 155, 255, 0.18);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(142, 155, 255, 0.38);
}
.no-js .lang-switch { display: none !important; }

/* Hamburger */
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(142, 155, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }
.no-js .nav-toggle { display: none; }

/* Mobile sheet */
.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 6px var(--gutter) 22px;
  /* Solid: a nested backdrop-filter can't see past the header's own backdrop root */
  background: linear-gradient(180deg, #0c1129 0%, var(--night-900) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 28px 48px -18px rgba(0, 0, 0, 0.7);
  animation: sheet-in 0.2s ease-out;
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.mobile-menu ul { list-style: none; }
.mobile-menu li a {
  display: block;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(142, 155, 255, 0.08);
  color: var(--text);
  font-size: 1.08rem;
  text-decoration: none;
}
.mobile-menu li a:hover { color: #fff; }
.mobile-menu__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
}
.mobile-menu .lang-switch button { min-width: 48px; height: 38px; font-size: 0.95rem; }
.mobile-menu__label { color: var(--muted); font-size: 0.88rem; }

/* Without JS the sheet is simply shown in flow on small screens */
.no-js .mobile-menu[hidden] {
  display: block;
  position: static;
  animation: none;
  box-shadow: none;
}
.no-js .mobile-menu__foot { display: none; }
@media (max-width: 959.98px) {
  .no-js .site-header { position: relative; }
}

@media (min-width: 960px) {
  .nav { display: block; }
  .header__actions > .lang-switch { display: inline-flex; }
  .nav-toggle,
  .mobile-menu,
  .no-js .mobile-menu[hidden] { display: none !important; }
}
/* Six links plus the language switch: tighten a little until there's room. */
@media (min-width: 960px) and (max-width: 1119.98px) {
  .nav__links a { padding-inline: 9px; }
  .header__inner { gap: 8px; }
}

/* ---------- Shared section typography ---------- */
.section { padding-block: clamp(64px, 9vw, 116px); }

.section__head { max-width: 760px; }
.section__head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--moon-300);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.section__head--center .eyebrow::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section__title {
  font-size: clamp(1.65rem, 1.1rem + 2.1vw, 2.5rem);
  letter-spacing: 0.005em;
}
:lang(en) .section__title { letter-spacing: -0.02em; }

.section__lead {
  margin-top: 16px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}
.section__head--center .section__lead { margin-inline: auto; }

/* Chinese headings: break at punctuation/spaces rather than mid-word;
   overflow-wrap is the safety net on very narrow screens. */
:lang(zh-TW) :is(h1, h2),
:lang(zh-CN) :is(h1, h2) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* CJK glyphs are ~2ch wide: give Chinese copy a comparable measure, and avoid orphans */
p, li, dd, summary { text-wrap: pretty; }
:lang(zh-TW) .section__lead,
:lang(zh-CN) .section__lead { max-width: 38em; }

.grad-text {
  color: var(--violet-400);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--glass-hi), 0 24px 48px -30px rgba(0, 0, 0, 0.7);
}

.ticks {
  display: grid;
  gap: 7px;
  list-style: none;
  font-size: 0.93rem;
}
.ticks li {
  position: relative;
  padding-left: 20px;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 3px rgba(142, 155, 255, 0.12);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(36px, 7vw, 92px) clamp(48px, 7vw, 84px);
  overflow-x: hidden;
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: clamp(40px, 5vw, 64px);
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid rgba(246, 231, 174, 0.28);
  border-radius: 999px;
  background: rgba(246, 231, 174, 0.07);
  color: var(--moon-300);
  font-size: 0.84rem;
  font-weight: 500;
}
.badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--moon-300);
  box-shadow: 0 0 10px rgba(246, 231, 174, 0.9);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(2.1rem, 1.25rem + 3.6vw, 3.4rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
}
:lang(en) .hero__title { letter-spacing: -0.03em; line-height: 1.06; }
.hero__title .grad-text { display: block; }

.hero__lead {
  margin-top: 22px;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
}
:lang(zh-TW) .hero__lead,
:lang(zh-CN) .hero__lead { max-width: 31em; }

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero__ctas .btn { flex: 1 1 auto; }
@media (min-width: 520px) {
  .hero__ctas .btn { flex: 0 0 auto; }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 26px;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}
.chips li { display: inline-flex; align-items: center; gap: 7px; }
.chips svg { width: 15px; height: 15px; color: var(--success); flex: none; }

/* Soft moonlight behind the window */
.hero__visual {
  position: relative;
  margin: 0;
  min-width: 0;
}
.hero__visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -14%;
  right: -12%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 40%, rgba(246, 231, 174, 0.16), rgba(246, 231, 174, 0.04) 45%, transparent 68%);
  pointer-events: none;
}
.hero__visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 4%;
  bottom: -10%;
  width: 70%;
  height: 60%;
  background: radial-gradient(closest-side, rgba(111, 125, 255, 0.28), transparent);
  filter: blur(10px);
  pointer-events: none;
}

.appwin__caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.85;
}

/* ---------- App window mock ---------- */
.appwin {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(142, 155, 255, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 32, 72, 0.82) 0%, rgba(12, 17, 42, 0.9) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow:
    0 44px 90px -34px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 140px -50px rgba(111, 125, 255, 0.55);
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}

.appwin__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 6px 0 12px;
  border-bottom: 1px solid rgba(142, 155, 255, 0.12);
  background: rgba(7, 10, 26, 0.38);
}
.appwin__bar img { width: 16px; height: 16px; border-radius: 4px; }
.appwin__title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.appwin__ctrl { display: flex; margin-left: auto; color: var(--muted); }
.appwin__ctrl svg { width: 38px; height: 28px; }

.appwin__body { display: grid; gap: 10px; padding: 12px; }

.task {
  padding: 14px;
  border: 1px solid rgba(142, 155, 255, 0.13);
  border-radius: 12px;
  background: rgba(7, 10, 26, 0.46);
  transition: opacity 0.35s ease;
}
.task.is-resetting { opacity: 0.35; }

.task__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.task__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(142, 155, 255, 0.13);
  color: var(--luna-400);
}
.task__icon svg { width: 18px; height: 18px; }
.task__name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task__meta {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task__meta .sep { margin: 0 6px; opacity: 0.6; }
.task__state { text-align: right; }
.task__pct {
  display: block;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}
.task__status {
  display: block;
  margin-top: 2px;
  color: var(--luna-400);
  font-size: 11px;
  white-space: nowrap;
}
.task__status.is-verifying { color: var(--moon-300); }
.task__status.is-done { color: var(--success); }

.pbar {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(142, 155, 255, 0.12);
}
.pbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transform-origin: left center;
  box-shadow: 0 0 12px rgba(142, 155, 255, 0.6);
}

.segmap__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 11px;
}
.segmap {
  position: relative;
  height: 18px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(4, 6, 18, 0.9);
  box-shadow: inset 0 0 0 1px rgba(142, 155, 255, 0.16);
}
.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(4, 6, 18, 0.95);
}
.seg:first-child { border-left: 0; }
.seg i {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 100%;
  background: var(--c, var(--luna-400));
  opacity: 0.92;
  transform-origin: left center;
}
.seg.is-new::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 231, 174, 0.28);
  box-shadow: inset 0 0 0 1px var(--moon-300);
  animation: seg-new 0.9s ease-out forwards;
}
@keyframes seg-new {
  from { opacity: 1; }
  to { opacity: 0; }
}

.conns {
  display: grid;
  gap: 5px 16px;
  margin-top: 12px;
  list-style: none;
}
@container (min-width: 430px) {
  .conns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.conn {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 8px;
  height: 19px;
  font-size: 11px;
}
.conn__id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.conn__id::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, var(--luna-400));
}
.conn__bar {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(142, 155, 255, 0.1);
}
.conn__bar i {
  display: block;
  height: 100%;
  background: var(--c, var(--luna-400));
  transform-origin: left center;
}
.conn__spd {
  overflow: hidden;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}
.conn.is-helping .conn__spd { color: var(--moon-300); }
.conn.is-done .conn__spd { color: var(--success); }
.conn.is-done .conn__bar i { opacity: 0.45; }

.task__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(142, 155, 255, 0.16);
  color: var(--muted);
  font-size: 11.5px;
}
.task__foot > div:last-child { text-align: right; }
.task__foot strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.queue { display: grid; gap: 6px; list-style: none; }
.queue li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(142, 155, 255, 0.08);
  border-radius: 10px;
  background: rgba(7, 10, 26, 0.34);
  font-size: 12px;
}
.q-cat {
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(142, 155, 255, 0.13);
  color: var(--luna-400);
  font-size: 10.5px;
  white-space: nowrap;
}
.q-name {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.q-state { font-size: 11px; white-space: nowrap; color: var(--muted); }
.q-state--done { color: var(--success); }

/* ---------- Platforms strip ---------- */
.strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding-block: 22px;
  border-block: 1px solid rgba(142, 155, 255, 0.1);
}
.strip__label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}
.strip__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.strip__list li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 23, 53, 0.55);
  color: var(--text);
  font-size: 0.88rem;
  white-space: nowrap;
}
.strip__list li.strip__more {
  border-color: rgba(246, 231, 174, 0.3);
  background: rgba(246, 231, 174, 0.06);
  color: var(--moon-300);
}

/* ---------- Grids & feature cards ---------- */
.grid { display: grid; gap: 16px; margin-top: 44px; }
@media (min-width: 640px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(142, 155, 255, 0.28);
  border-radius: 13px;
  background: radial-gradient(circle at 30% 20%, rgba(183, 148, 255, 0.26), rgba(111, 125, 255, 0.07));
  color: #b3bcff;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature__title { margin-top: 4px; font-size: 1.16rem; }
.feature__body { color: var(--muted); }
.feature .ticks { margin-top: 2px; padding-top: 14px; border-top: 1px solid rgba(142, 155, 255, 0.09); }

/* ---------- Stats band ---------- */
.stats { padding-block: 8px clamp(8px, 2vw, 16px); }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(142, 155, 255, 0.12);
}
@media (min-width: 820px) {
  .stats__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 8px;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 2.4vw, 28px);
  background: rgba(11, 16, 38, 0.88);
}
.stat-item dd {
  margin: 0;
  font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.3rem);
  font-weight: 600;
  line-height: 1;
  color: var(--violet-400);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-item dt { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* ---------- How it works ---------- */
.how__grid {
  display: grid;
  gap: 28px;
  margin-top: 44px;
}
@media (min-width: 1024px) {
  .how__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 48px;
    align-items: start;
  }
  .diagram { position: sticky; top: calc(var(--header-h) + 28px); }
}

.steps { display: grid; gap: 12px; list-style: none; }
.step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
}
.step__num {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 231, 174, 0.28);
  border-radius: 12px;
  background: rgba(246, 231, 174, 0.06);
  color: var(--moon-300);
  font-size: 0.92rem;
}
.step__title { margin: 2px 0 6px; font-size: 1.08rem; }
.step p { color: var(--muted); }

.diagram { margin: 0; padding: clamp(16px, 2.4vw, 26px); }
.diagram svg { width: 100%; height: auto; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  list-style: none;
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend li::before {
  content: "";
  width: 14px;
  height: 10px;
  border-radius: 3px;
}
.legend__done::before { background: var(--grad); }
.legend__todo::before { background: rgba(4, 6, 18, 0.9); box-shadow: inset 0 0 0 1px rgba(142, 155, 255, 0.35); }
.legend__split::before { width: 3px !important; height: 14px !important; background: var(--moon-300); border-radius: 2px !important; }

/* SVG diagram parts */
.dia-server { fill: var(--night-700); stroke: rgba(142, 155, 255, 0.4); }
.dia-led { fill: var(--success); }
.dia-text { fill: var(--text); font-family: var(--font-sans); font-size: 13px; font-weight: 600; }
.dia-small { fill: var(--muted); font-family: var(--font-sans); font-size: 12.5px; }
.dia-id { fill: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.dia-gold { fill: var(--moon-300); }
.dia-bar { fill: rgba(4, 6, 18, 0.92); stroke: rgba(142, 155, 255, 0.3); }
.dia-fill { fill: url(#dia-grad); }
.dia-fill--gold { fill: url(#dia-grad-gold); }
.dia-div { stroke: #070a1a; stroke-width: 2; }
.dia-head { fill: #f2f4ff; }
.dia-line {
  fill: none;
  stroke: var(--luna-400);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 4 6;
  opacity: 0.85;
  animation: dia-flow 1.1s linear infinite;
}
.dia-line--gold { stroke: var(--moon-300); opacity: 1; }
.dia-tick { stroke: var(--moon-300); stroke-width: 2; stroke-linecap: round; }
@keyframes dia-flow { to { stroke-dashoffset: -20; } }

.note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid rgba(246, 231, 174, 0.24);
  border-radius: var(--radius);
  background: rgba(246, 231, 174, 0.045);
}
.note svg { width: 22px; height: 22px; margin-top: 2px; color: var(--moon-300); }
.note__title { margin-bottom: 4px; color: var(--moon-300); font-size: 0.98rem; }
.note p { font-size: 0.97rem; }

/* ---------- Models spotlight ---------- */
.models__grid {
  display: grid;
  gap: 44px;
  align-items: center;
}
@media (min-width: 1024px) {
  .models__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 60px; }
}
.models__copy .ticks { margin-top: 26px; font-size: 0.98rem; gap: 10px; }

.picker { overflow: hidden; font-size: 0.88rem; line-height: 1.45; user-select: none; }
.picker__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(142, 155, 255, 0.12);
  background: rgba(7, 10, 26, 0.3);
}
.picker__head svg { width: 18px; height: 18px; flex: none; color: var(--moon-300); }
.picker__repo {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.picker__branch {
  flex: none;
  margin-left: auto;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}
.picker__filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 16px 8px;
  padding: 9px 12px;
  border: 1px solid rgba(142, 155, 255, 0.45);
  border-radius: 10px;
  background: rgba(4, 6, 18, 0.6);
  box-shadow: 0 0 0 3px rgba(111, 125, 255, 0.14);
}
.picker__filter svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.picker__filter-label { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.picker__filter-value { color: var(--text); white-space: nowrap; }
.caret {
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.2em;
  background: var(--luna-400);
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.picker__count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.picker__list { padding: 0 8px 10px; list-style: none; }
.picker__list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  opacity: 0.62;
}
.picker__list li.is-match {
  opacity: 1;
  color: var(--text);
  background: rgba(111, 125, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(142, 155, 255, 0.28);
}
.picker__list .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.picker__list .size { font-size: 0.82rem; white-space: nowrap; }
.cbx {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(154, 163, 199, 0.65);
  border-radius: 4px;
}
.is-checked .cbx { border-color: transparent; background: var(--grad); }
.is-checked .cbx::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border-left: 2px solid #0b1026;
  border-bottom: 2px solid #0b1026;
  transform: rotate(-45deg);
}
.picker__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(142, 155, 255, 0.12);
  background: rgba(7, 10, 26, 0.32);
}
.picker__sel { color: var(--text); font-size: 0.86rem; white-space: nowrap; }
.picker__sel .mono { color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}
.pill--ok { border-color: rgba(61, 214, 160, 0.32); color: var(--success); }
.picker__go { margin-left: auto; pointer-events: none; }

/* ---------- Video platforms ---------- */
.plat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 24px;
}
.plat__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.06rem;
}
.plat__name::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(142, 155, 255, 0.7);
}
.plat--moon .plat__name::before { background: var(--moon-300); box-shadow: 0 0 12px rgba(246, 231, 174, 0.6); }
.plat p { color: var(--muted); }

/* ---------- Pricing ---------- */
.pricing__trial { margin-top: 24px; }

.plans {
  display: grid;
  gap: 40px;
  max-width: 920px;
  margin: 40px auto 0;
}
/* Two groups: auto-renew and one-time purchase; each can be hidden on its own. */
.plan-group { display: grid; gap: 16px; }
.plan-group__head { display: grid; gap: 6px; text-align: center; }
.plan-group__title { font-size: 1.15rem; }
.plan-group__note {
  max-width: 62ch;
  margin-inline: auto;
  color: var(--muted);
  font-size: 0.93rem;
}
:lang(zh-TW) .plan-group__note,
:lang(zh-CN) .plan-group__note { max-width: 40em; }
.plan-group__cards { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .plan-group__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .plan-group--single .plan-group__cards { grid-template-columns: minmax(0, 460px); justify-content: center; }
}
.plans__soon { padding: 32px 24px; text-align: center; }
.plans__soon-title { color: var(--muted); font-size: 1.35rem; font-weight: 600; }

.plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
}
.plan--featured {
  border-color: rgba(142, 155, 255, 0.36);
  background: linear-gradient(180deg, rgba(111, 125, 255, 0.15) 0%, rgba(17, 23, 53, 0.62) 100%);
  box-shadow: var(--glass-hi), 0 30px 60px -32px rgba(111, 125, 255, 0.55);
}
.plan__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}
.plan__name { font-size: 1.2rem; }
.plan__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 2px 10px;
  min-height: 3.3rem;
}
.plan__amount {
  color: var(--text);
  font-size: clamp(2.2rem, 1.85rem + 1.4vw, 2.85rem);
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.plan__per { color: var(--muted); }
.plan__note { color: var(--muted); }
.plan__detail { color: var(--moon-300); font-size: 0.93rem; }
.plan .btn { margin-top: auto; }

/* Loading: a soft placeholder where the price will go */
.plans[data-state="loading"] .plan__amount {
  min-width: 4.4em;
  border-radius: 10px;
  color: transparent;
  background: linear-gradient(90deg, rgba(142, 155, 255, 0.07) 0%, rgba(142, 155, 255, 0.2) 50%, rgba(142, 155, 255, 0.07) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.plans[data-state="loading"] .plan__per { visibility: hidden; }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.plans__status,
.plans__nojs {
  max-width: 62ch;
  margin: 18px auto 0;
  color: var(--muted);
  text-align: center;
}
.plans__nojs { display: none; }
.no-js .plans__nojs { display: block; }
.no-js .plans__status { display: none; }

.alert {
  padding: 12px 16px;
  border: 1px solid rgba(255, 107, 129, 0.42);
  border-radius: 12px;
  background: rgba(255, 107, 129, 0.08);
  color: #ffc6cf;
}
.alert--ok {
  border-color: rgba(61, 214, 160, 0.36);
  background: rgba(61, 214, 160, 0.08);
  color: #c4f5e3;
}
/* Live regions stay in the accessibility tree; they only take up space (and flex/grid
   gaps) once they have text. */
.alert:empty { position: absolute; margin: 0; padding: 0; border: 0; }
.plans__error {
  max-width: 560px;
  margin: 18px auto 0;
  text-align: center;
  scroll-margin: 24px;
}

/* Under the plans: how to pay, and where existing customers renew */
.plans__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  max-width: 920px;
  margin: 24px auto 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.93rem;
  text-align: center;
}
.plans__meta li { min-width: 0; }
.plans__meta svg {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 7px;
  vertical-align: -3px;
  color: var(--moon-300);
}
.plans__meta a { white-space: nowrap; }

.included {
  max-width: 920px;
  margin: 16px auto 0;
  padding: 22px 26px;
}
.included__title { font-size: 1rem; }
.included__list { margin-top: 14px; gap: 9px 28px; font-size: 0.97rem; }
@media (min-width: 640px) {
  .included__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pricing__fine {
  max-width: 62ch;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
:lang(zh-TW) .pricing__fine,
:lang(zh-CN) .pricing__fine { max-width: 40em; }
.pricing__fine a { white-space: nowrap; }

/* Small labels */
.tag {
  flex: none;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}
.pill--warn { border-color: rgba(245, 185, 79, 0.42); color: var(--warning); }
.pill--bad { border-color: rgba(255, 107, 129, 0.42); color: var(--danger); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; margin-top: 40px; }
.faq__item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 23, 53, 0.5);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.faq__item[open] { border-color: rgba(142, 155, 255, 0.3); background: rgba(24, 32, 72, 0.5); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: #fff; }
.faq__item summary:focus-visible { outline-offset: -2px; border-radius: 14px; }
.faq__chev {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--luna-400);
  transition: transform 0.2s ease;
}
.faq__item[open] .faq__chev { transform: rotate(180deg); }
.faq__a { padding: 0 20px 20px; color: var(--muted); }
.faq__a p + p { margin-top: 10px; }

/* ---------- Download ---------- */
.dl-grid {
  display: grid;
  gap: 16px;
  max-width: 920px;
  margin: 44px auto 0;
}
@media (min-width: 760px) {
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
.dl-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
}
.dl-card--featured {
  border-color: rgba(142, 155, 255, 0.36);
  background: linear-gradient(180deg, rgba(111, 125, 255, 0.15) 0%, rgba(17, 23, 53, 0.62) 100%);
  box-shadow: var(--glass-hi), 0 30px 60px -32px rgba(111, 125, 255, 0.55);
}
.dl-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dl-card__top svg { width: 26px; height: 26px; color: var(--luna-400); }
.dl-card__title { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; }
.dl-card > p { color: var(--muted); }
.dl-card__file {
  padding: 8px 12px;
  border: 1px solid rgba(142, 155, 255, 0.12);
  border-radius: 8px;
  background: rgba(4, 6, 18, 0.5);
  color: var(--text);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.dl-card .btn { margin-top: auto; }
.badge--moon {
  flex: none;
  padding: 3px 10px;
  border: 0;
  background: var(--moon-300);
  color: #1d1905;
  font-size: 0.76rem;
  font-weight: 700;
}

.reqs {
  max-width: 920px;
  margin: 16px auto 0;
  padding: 22px 26px;
}
.reqs__title { font-size: 1rem; }
.reqs__list {
  display: grid;
  gap: 14px 28px;
  margin: 14px 0 0;
}
@media (min-width: 760px) {
  .reqs__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.reqs__list dt { color: var(--muted); font-size: 0.82rem; }
.reqs__list dd { margin: 2px 0 0; font-size: 0.97rem; }
.reqs__list a { white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(24px, 4vw, 48px);
  padding-block: 40px 30px;
  border-top: 1px solid rgba(142, 155, 255, 0.1);
  background: rgba(7, 10, 26, 0.55);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 40px;
}
.footer__tagline { margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  list-style: none;
}
.footer__links a {
  color: var(--muted);
  font-size: 0.93rem;
  text-decoration: none;
}
.footer__links a:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(142, 155, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}
.footer__legal { max-width: 62ch; }
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}
.footer__policies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
}
.footer__policies a { color: var(--muted); text-decoration: none; }
.footer__policies a:hover { color: var(--text); text-decoration: underline; }
.site-footer a[aria-current="page"] { color: var(--text); }

/* ==========================================================================
   Inner pages: success, account, privacy, terms
   ========================================================================== */
/* Short pages keep the footer at the bottom of the window. */
.inner-page {
  display: flex;
  flex-direction: column;
}
.inner-page > main { flex: 1 0 auto; }

.page { padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 100px); }
.page__head { max-width: 760px; }
.page__title { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem); line-height: 1.2; }
:lang(en) .page__title { letter-spacing: -0.02em; }
.page__lead {
  margin-top: 16px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}
:lang(zh-TW) .page__lead,
:lang(zh-CN) .page__lead { max-width: 38em; }
.page__meta { margin-top: 14px; color: var(--muted); font-size: 0.92rem; }
.page__foot { margin-top: 28px; color: var(--muted); }
.page__help {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(142, 155, 255, 0.1);
  color: var(--muted);
  font-size: 0.95rem;
}
.page__help a { white-space: nowrap; }
[data-success] .page__help { text-align: center; }

/* Headings that receive focus from script don't need a ring. */
[tabindex="-1"]:focus { outline: none; }

/* Pages that need JavaScript say so instead of showing controls that can't work. */
.state-nojs { display: none; }
.no-js .state-nojs { display: block; margin-top: 28px; }
.no-js .needs-js { display: none !important; }

/* ---------- Success page ---------- */
.state-loading {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding-block: 64px 24px;
  text-align: center;
}
.state-loading .state__title { color: var(--muted); font-size: 1.2rem; font-weight: 600; }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(142, 155, 255, 0.22);
  border-top-color: var(--luna-400);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.keycard {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  padding: clamp(18px, 3vw, 28px);
}
.keycard__label { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.keybox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 18px;
  border: 1px solid rgba(246, 231, 174, 0.32);
  border-radius: 14px;
  background: rgba(4, 6, 18, 0.62);
  box-shadow: 0 0 44px -20px rgba(246, 231, 174, 0.45);
}
.keybox__key {
  flex: 1 1 17em;
  min-width: 0;
  color: var(--moon-300);
  font-size: clamp(1.05rem, 0.78rem + 1.45vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.keybox .btn { flex: none; }
.btn .icon-done,
.btn.is-done .icon-copy { display: none; }
.btn.is-done .icon-done { display: block; }
.keycard__warn { color: var(--warning); font-size: 0.92rem; }
.keycard__plan,
.keycard__until { font-weight: 600; }
.keycard__note { color: var(--muted); font-size: 0.95rem; }

.subhead { margin-top: 44px; font-size: 1.15rem; }

.activate {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  list-style: none;
  counter-reset: step;
}
@media (min-width: 720px) {
  .activate { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.activate li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 23, 53, 0.5);
  font-weight: 500;
  line-height: 1.45;
  counter-increment: step;
}
.activate li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(246, 231, 174, 0.3);
  border-radius: 50%;
  background: rgba(246, 231, 174, 0.06);
  color: var(--moon-300);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.getapp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 16px;
  padding: 22px 24px;
}
.getapp__title { font-size: 1.05rem; }
.getapp p { margin-top: 4px; color: var(--muted); font-size: 0.95rem; }
.getapp__btns { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 519.98px) {
  .getapp__btns { width: 100%; }
  .getapp__btns .btn { flex: 1 1 100%; }
}

.msg {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 580px;
  margin-inline: auto;
  padding-block: 48px 8px;
  text-align: center;
}
.msg__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(246, 231, 174, 0.28);
  border-radius: 15px;
  background: rgba(246, 231, 174, 0.06);
  color: var(--moon-300);
}
.msg__icon svg { width: 26px; height: 26px; }
.msg__icon--error {
  border-color: rgba(255, 107, 129, 0.36);
  background: rgba(255, 107, 129, 0.07);
  color: var(--danger);
}
.msg__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.msg p { color: var(--muted); }
.msg .btn { margin-top: 6px; }
.msg .msg__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93rem;
}
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }

/* ---------- Account page ---------- */
.account {
  display: grid;
  gap: 16px;
  margin-top: 36px;
}
.account-grid { display: grid; gap: 16px; }
@media (min-width: 860px) {
  .account { gap: 20px; }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  /* The key card reads left to right: what it is, then the field. */
  .acct.acct--key {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 16px 36px;
    align-items: start;
  }
}
.acct__intro { display: grid; gap: 14px; }
.acct__action { display: grid; gap: 12px; }
.acct__hint { color: var(--muted); font-size: 0.9rem; }

/* Renew: plan choice */
.plan-pick {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.plan-pick legend { margin-bottom: 8px; padding: 0; }
.plan-pick__list { display: grid; gap: 8px; }
.plan-opt.is-off { cursor: not-allowed; opacity: 0.55; }
.plan-opt.is-off:hover { border-color: var(--line-strong); }
.plan-opt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(4, 6, 18, 0.45);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.plan-opt:hover { border-color: rgba(142, 155, 255, 0.5); }
.plan-opt:has(input:checked) { border-color: var(--luna-400); background: rgba(111, 125, 255, 0.12); }
.plan-opt:has(input:focus-visible) { outline: 2px solid var(--moon-300); outline-offset: 2px; }
.plan-opt input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--luna-500); }
.plan-opt input:focus-visible { outline: none; }
.plan-opt__name { font-weight: 600; }
.plan-opt__price { margin-left: auto; white-space: nowrap; }
.plan-opt__price .mono { color: var(--text); font-weight: 600; }
.plan-opt__per { color: var(--muted); font-size: 0.88rem; }
.plan-pick[data-state="loading"] [data-price] { color: var(--muted); }
/* Why the auto-renew plans are off (a live region: collapses while empty) */
.renew__note {
  padding: 10px 12px;
  border: 1px solid rgba(246, 231, 174, 0.3);
  border-radius: 10px;
  background: rgba(246, 231, 174, 0.05);
  color: #f3e6bd;
  font-size: 0.9rem;
}
.renew__note:empty { position: absolute; margin: 0; padding: 0; border: 0; }

/* Billing: expiry, auto-renew, payments */
.billing { display: grid; gap: 14px; }
.billing__facts {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 6, 18, 0.4);
}
.billing__facts > div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 12px;
}
@media (max-width: 479.98px) {
  .billing__facts > div { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 480px) {
  :lang(en) .billing__facts > div { grid-template-columns: 8.2em minmax(0, 1fr); }
}
.billing__facts dt { color: var(--muted); font-size: 0.88rem; }
.billing__facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
}
.billing__actions { display: grid; gap: 10px; }
.billing__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.billing__warn {
  padding: 10px 12px;
  border: 1px solid rgba(245, 185, 79, 0.4);
  border-radius: 10px;
  background: rgba(245, 185, 79, 0.07);
  color: #ffe2a8;
  font-size: 0.92rem;
}
.billing__confirm {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 107, 129, 0.42);
  border-radius: 12px;
  background: rgba(255, 107, 129, 0.05);
}
.billing__confirm p { color: #ffd3d9; font-size: 0.93rem; }
.billing__subhead { margin-top: 4px; font-size: 0.95rem; }
.payments { display: grid; gap: 6px; list-style: none; }
.payment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 6, 18, 0.35);
}
.payment__main { display: grid; gap: 2px; min-width: 0; }
.payment__date { font-size: 0.92rem; font-weight: 600; }
.payment__meta { color: var(--muted); font-size: 0.85rem; }
.payment__side { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.payment__amount { font-weight: 600; }
.payment--refunded .payment__amount { color: var(--muted); text-decoration: line-through; }

/* Devices */
.usage {
  flex: none;
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.usage.is-full { border-color: rgba(245, 185, 79, 0.45); color: var(--warning); }
.devices { display: grid; gap: 8px; list-style: none; }
.device {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 6, 18, 0.4);
}
.device.is-confirming { border-color: rgba(255, 107, 129, 0.42); }
.device__main { flex: 1 1 12em; min-width: 0; }
.device__name { font-weight: 600; overflow-wrap: anywhere; }
.device__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.device__confirm { flex: 1 1 100%; display: grid; gap: 10px; }
.device__confirm p { color: #ffd3d9; font-size: 0.93rem; }
.device__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--danger {
  background: rgba(255, 107, 129, 0.15);
  border-color: rgba(255, 107, 129, 0.55);
  color: #ffd6dc;
}
.btn--danger:hover { background: rgba(255, 107, 129, 0.25); color: #fff; }
.acct {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 3vw, 28px);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.acct__head { display: flex; align-items: center; gap: 14px; }
.acct__title { font-size: 1.2rem; }
.acct__body { color: var(--muted); }
.acct__note {
  padding-top: 14px;
  border-top: 1px solid rgba(142, 155, 255, 0.09);
  color: var(--muted);
  font-size: 0.9rem;
}

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field__label { font-size: 0.93rem; font-weight: 600; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(4, 6, 18, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s ease;
}
.input::placeholder { color: rgba(154, 163, 199, 0.55); }
.input:hover { border-color: rgba(142, 155, 255, 0.5); }
.input:focus { border-color: var(--luna-400); }
.input[aria-invalid="true"] { border-color: rgba(255, 107, 129, 0.8); }
.input--key { font-family: var(--font-mono); letter-spacing: 0.03em; }
.field__hint { color: var(--muted); font-size: 0.88rem; }
.field__error { color: #ffa3b1; font-size: 0.9rem; }

/* ---------- Legal pages ---------- */
.legal-wrap { max-width: 760px; margin-top: 36px; }
.legal { color: #cdd3ee; }
.legal h2 { margin: 44px 0 12px; color: var(--text); font-size: 1.2rem; }
.legal h3 { margin: 22px 0 6px; color: var(--text); font-size: 1rem; }
.legal p + p,
.legal ul + p { margin-top: 10px; }
.legal ul { display: grid; gap: 8px; margin-top: 10px; padding-left: 1.25em; }
.legal li::marker { color: var(--luna-400); }
.legal strong { color: var(--text); font-weight: 600; }
.legal__summary {
  padding: 20px 22px;
  border: 1px solid rgba(246, 231, 174, 0.24);
  border-radius: var(--radius);
  background: rgba(246, 231, 174, 0.045);
}
.legal .legal__summary h2 { margin: 0 0 10px; color: var(--moon-300); font-size: 1rem; }
.legal__contact { margin-top: 10px; font-size: 1.05rem; font-weight: 600; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .stars--2,
  .stars--3,
  .dia-line,
  .caret,
  .mobile-menu,
  .spinner,
  .btn[aria-busy="true"]::before,
  .plans[data-state="loading"] .plan__amount { animation: none !important; }
  .feature:hover,
  .btn--primary:hover { transform: none; }
}
