/* Butler landing — www.butler3d.com */

:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --rule: rgba(0, 0, 0, 0.08);
  --island-line: rgba(0, 0, 0, 0.1);
  --island-fill: rgba(255, 255, 255, 0.5);
  --island-shadow: 0 30px 60px -30px rgba(40, 48, 90, 0.35), 0 8px 20px -10px rgba(40, 48, 90, 0.12);

  --glass-fill-top: rgba(255, 255, 255, 0.62);
  --glass-fill-bottom: rgba(255, 255, 255, 0.22);
  --glass-rim: rgba(255, 255, 255, 0.85);
  --glass-rim-low: rgba(255, 255, 255, 0.25);
  --glass-edge: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 18px 40px -18px rgba(40, 48, 90, 0.35), 0 4px 12px -4px rgba(40, 48, 90, 0.12);
  --glass-sheen: rgba(255, 255, 255, 0.75);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050507;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --rule: rgba(255, 255, 255, 0.1);
    --island-line: rgba(255, 255, 255, 0.14);
    --island-fill: rgba(28, 28, 32, 0.55);
    --island-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 8px 20px -10px rgba(0, 0, 0, 0.5);

    --glass-fill-top: rgba(255, 255, 255, 0.14);
    --glass-fill-bottom: rgba(255, 255, 255, 0.04);
    --glass-rim: rgba(255, 255, 255, 0.35);
    --glass-rim-low: rgba(255, 255, 255, 0.06);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
    --glass-sheen: rgba(255, 255, 255, 0.28);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------------
   Home: full-viewport hero over the WebGL background
   ------------------------------------------------------------------------ */

.home {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
  /* Fallback if WebGL is unavailable: soft static colour fields. */
  background:
    radial-gradient(60% 40% at 30% 45%, rgba(255, 170, 190, 0.18), transparent 70%),
    radial-gradient(55% 40% at 70% 55%, rgba(140, 190, 255, 0.2), transparent 70%),
    var(--bg);
}

.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.bg.is-ready {
  opacity: 1;
}

.nav,
.hero,
.foot {
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  font-size: 14px;
}

.wordmark {
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.lang {
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lang:hover {
  color: var(--ink);
  background: var(--rule);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 48px 16px 64px;
  text-align: center;
}

.headline {
  margin: 0;
  max-width: 14em;
  /* 10 CJK characters on the first line must fit a 360px-wide phone. */
  font-size: clamp(30px, 8.2vw, 84px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Each phrase stays on its own line when there's room; it can still wrap
   internally on very narrow screens instead of overflowing. */
.headline > span {
  display: inline-block;
}

.headline:lang(en) {
  letter-spacing: -0.035em;
  max-width: 11em;
}

.headline:lang(en) > span + span {
  margin-left: 0.25em;
}

.reveal {
  animation: reveal 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

.reveal-2 {
  animation-delay: 0.18s;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ---------------------------------------------------------------------------
   Liquid glass button
   ------------------------------------------------------------------------ */

.glass-btn {
  --mx: 50%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 34px 18px 28px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(180deg, var(--glass-fill-top), var(--glass-fill-bottom));
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -1px 0 var(--glass-rim-low),
    inset 0 0 0 1px var(--glass-edge),
    inset 0 -10px 20px -12px rgba(255, 255, 255, 0.35),
    var(--glass-shadow);
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Rim light: a thin gradient border that brightens toward the pointer. */
.glass-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(120% 160% at var(--mx) var(--my), var(--glass-rim), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: -1;
}

/* Specular sheen that follows the pointer. */
.glass-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(60% 120% at var(--mx) var(--my), var(--glass-sheen), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 48%);
  opacity: 0.55;
  mix-blend-mode: soft-light;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: -1;
}

.glass-btn:hover {
  transform: translateY(-1px) scale(1.025);
}

.glass-btn:hover::after {
  opacity: 0.9;
}

.glass-btn:active {
  transform: scale(0.975);
  transition-duration: 0.12s;
}

.glass-btn .g-logo {
  width: 22px;
  height: 22px;
  flex: none;
}

/* ---------------------------------------------------------------------------
   Island: a frosted panel framing the next step (sign-in). The label sits in a
   real gap in the top edge (native fieldset/legend), half over the panel and
   half over the page.
   ------------------------------------------------------------------------ */

.island {
  margin: 0;
  min-width: 0;
  padding: 30px 36px 34px;
  border: 1px solid var(--island-line);
  border-radius: 28px;
  background: var(--island-fill);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--island-shadow);
}

.island > legend {
  margin-inline: auto;
  /* letter-spacing adds space after the last glyph; pad the start to match */
  padding: 0 14px 0 calc(14px + 0.14em);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.island > legend:lang(en) {
  letter-spacing: 0.02em;
  padding-inline-start: calc(14px + 0.02em);
}

/* Phones: tighter panel. Chinese labels stay on one line (they would otherwise
   break mid-word); English may wrap between words. */
@media (max-width: 420px) {
  .island {
    padding: 26px 18px 28px;
    border-radius: 24px;
  }
  .island .glass-btn {
    padding: 16px 26px 16px 22px;
    font-size: 17px;
    text-align: start;
  }
  .island .glass-btn:lang(zh) {
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------ */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  font-size: 12px;
  color: var(--ink-3);
}

.foot a {
  color: var(--ink-2);
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Documents: privacy policy, terms, 404
   ------------------------------------------------------------------------ */

.doc .nav {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  max-width: none;
}

.doc main {
  max-width: 692px;
  margin: 0 auto;
  padding: 56px 16px 80px;
}

.doc h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.doc .meta {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0 0 40px;
}

.doc h2 {
  font-size: 21px;
  letter-spacing: -0.015em;
  margin: 40px 0 8px;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc ul {
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 6px;
}

.doc strong {
  color: var(--ink);
  font-weight: 600;
}

.doc main a {
  color: #0066cc;
}

@media (prefers-color-scheme: dark) {
  .doc main a {
    color: #2997ff;
  }
}

.doc .foot {
  border-top: 1px solid var(--rule);
}

.center {
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
  .glass-btn,
  .glass-btn::after,
  .bg {
    transition: none;
  }
}
