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

:root {
  --bg: #fafaf9;
  --ink: #16161a;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang TC", "Noto Sans TC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { position: fixed; inset: 0; touch-action: none; }

/* ---- Liquid gradient (WebGL, drawn by bg.js) ---- */
#liquid {
  position: fixed; inset: -6%; width: 112%; height: 112%;
  filter: blur(36px) saturate(1.1);
  pointer-events: none;
}
.gl .horizon { display: none; }

/* ---- Fallback without WebGL: soft glows wandering across the page ----
   Each blob is centred on (0,0) and translated in vw/vh, so the keyframes
   are simply screen positions. Different durations keep them from syncing. */
.horizon { position: fixed; inset: 0; opacity: .55; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute; left: 0; top: 0;
  width: 36vmax; height: 36vmax; margin: -18vmax 0 0 -18vmax;
  border-radius: 50%; filter: blur(64px); will-change: transform;
  animation: ease-in-out infinite;
}
.b1 { background: #ffa48f; animation-name: roam1; animation-duration: 34s; }
.b2 { background: #b29bff; animation-name: roam2; animation-duration: 41s; }
.b3 { background: #86d0f5; animation-name: roam3; animation-duration: 47s; }
@keyframes roam1 {
  0%, 100% { transform: translate(12vw, 88vh) scale(1); }
  25%      { transform: translate(80vw, 70vh) scale(1.15); }
  50%      { transform: translate(85vw, 12vh) scale(.9); }
  75%      { transform: translate(20vw, 18vh) scale(1.05); }
}
@keyframes roam2 {
  0%, 100% { transform: translate(55vw, 95vh) scale(.95); }
  25%      { transform: translate(10vw, 45vh) scale(1.1); }
  50%      { transform: translate(45vw, 5vh) scale(1); }
  75%      { transform: translate(92vw, 50vh) scale(1.12); }
}
@keyframes roam3 {
  0%, 100% { transform: translate(92vw, 85vh) scale(1.05); }
  25%      { transform: translate(60vw, 15vh) scale(.92); }
  50%      { transform: translate(8vw, 10vh) scale(1.1); }
  75%      { transform: translate(30vw, 80vh) scale(1); }
}

/* ---- Links: heavy liquid-glass pills ---- */
main {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}
.links { display: flex; flex-direction: column; gap: 16px; width: min(320px, 100%); }

.link {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 62px;
  padding: 0 24px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  /* fully clear glass: no tint of its own. All color comes from what is behind it,
     amplified by the backdrop saturation. */
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 55%, rgba(255,255,255,.10));
  -webkit-backdrop-filter: blur(14px) saturate(2.6) brightness(1.06);
  backdrop-filter: blur(14px) saturate(2.6) brightness(1.06);
  box-shadow:
    /* thick edge: neutral light and shade only */
    inset 0 0 0 1px rgba(255,255,255,.55),
    inset 0 0 12px 1px rgba(255,255,255,.35),
    inset 0 0 2px 1px rgba(0,0,0,.05),
    /* bright top lip / lit bottom lip */
    inset 0 2px 1px -1px #fff,
    inset 0 -2px 2px -1px rgba(255,255,255,.85),
    /* neutral lift */
    0 1px 2px rgba(0,0,0,.06),
    0 18px 36px -18px rgba(0,0,0,.22);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
}
/* rim: white-only hairline, brightest top-left and bottom-right like light on a glass edge */
.link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,.2) 30%, rgba(255,255,255,.05) 55%, rgba(255,255,255,.2) 75%, rgba(255,255,255,.95) 100%);
  -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 highlight: glossy streak across the top */
.link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 3px;
  height: 42%;
  border-radius: 999px 999px 60% 60% / 999px 999px 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.12) 70%, rgba(255,255,255,0));
  opacity: .7;
  pointer-events: none;
  z-index: -1;
}
.link:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.65),
    inset 0 0 14px 1px rgba(255,255,255,.4),
    inset 0 0 2px 1px rgba(0,0,0,.05),
    inset 0 2px 1px -1px #fff,
    inset 0 -2px 2px -1px rgba(255,255,255,.9),
    0 1px 2px rgba(0,0,0,.06),
    0 24px 44px -18px rgba(0,0,0,.26);
}
.link:active { transform: scale(.97); transition-duration: .1s; }
.link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.link svg, .link span { position: relative; z-index: 2; }
.link svg { width: 22px; height: 22px; flex: none; }

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