@font-face {
  font-family: "Lilita One";
  src: url("/assets/lilita-one.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --navy: #14296a;
  --navy-deep: #0b1947;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #5aa6ee;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  font-family: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

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

/* ---------- the scene ---------- */

.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overflow: clip;   /* clip cannot be scrolled, so focusing a button never shifts the scene */
  touch-action: none;
  /* Shown before the sky is drawn, and when a device cannot draw it. */
  background: linear-gradient(#3f8fea 0%, #86c1f6 34%, #d2eafc var(--hor, 62%), #3f92ea var(--hor, 62%), #1557b9 100%);
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overflow: clip;
  transform-origin: 50% 60%;
}
.js .scene { opacity: 0; transform: scale(1.07); }
.js.is-ready .scene {
  opacity: 1;
  transform: none;
  transition: opacity .7s ease, transform 2.4s cubic-bezier(.16, 1, .3, 1);
}

.layer { position: absolute; inset: 0; pointer-events: none; }
canvas.layer { width: 100%; height: 100%; display: block; }

.shade {
  background:
    linear-gradient(to top, rgba(7, 22, 68, .50) 0%, rgba(7, 22, 68, .16) 22%, rgba(7, 22, 68, 0) 40%),
    radial-gradient(130% 95% at 50% 42%, rgba(8, 24, 70, 0) 58%, rgba(8, 24, 70, .22) 100%);
}

/* ---------- gulls ---------- */

.birds { will-change: transform; }
.bird {
  position: absolute;
  left: 0; top: 0;
  width: var(--s);
  height: calc(var(--s) * .5);
  overflow: visible;
  opacity: .7;
  animation: fly var(--dur) linear var(--delay) infinite backwards;
}
.bird path {
  fill: none;
  stroke: #1b2f63;
  stroke-width: 2.6;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 20px 12px;
}
.bird .wl { animation: flap-l var(--flap) ease-in-out infinite alternate; }
.bird .wr { animation: flap-r var(--flap) ease-in-out infinite alternate; }
.b1 { --s: 26px; --dur: 46s; --delay: -6s;  --flap: .46s; --y0: 21vh; --y1: 13vh; }
.b2 { --s: 18px; --dur: 58s; --delay: -31s; --flap: .40s; --y0: 31vh; --y1: 25vh; }
.b3 { --s: 14px; --dur: 71s; --delay: -50s; --flap: .36s; --y0: 38vh; --y1: 34vh; }
@keyframes fly {
  from { transform: translate3d(-14vw, var(--y0), 0); }
  to   { transform: translate3d(114vw, var(--y1), 0); }
}
@keyframes flap-l { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }
@keyframes flap-r { from { transform: rotate(18deg); }  to { transform: rotate(-22deg); } }

/* ---------- lens ghosts ---------- */

.flare i {
  position: absolute;
  left: 0; top: 0;
  width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 205, .11) 0%, rgba(255, 240, 205, .05) 46%, rgba(255, 240, 205, 0) 70%);
  will-change: transform;
}
.flare i:nth-child(2) { background: radial-gradient(circle, rgba(190, 230, 255, .12) 0%, rgba(190, 230, 255, 0) 68%); }
.flare i:nth-child(3) { background: radial-gradient(circle, rgba(255, 226, 180, .07) 0%, rgba(255, 226, 180, 0) 68%); }

/* ---------- the title ---------- */

.title-wrap {
  position: absolute;
  left: 50%; top: 24%;
  width: 88vw;
  perspective: 900px;
  pointer-events: none;
  will-change: transform;
  transform: translate(-50%, -50%);
}
.title {
  --o: var(--navy);
  margin: 0;
  font-weight: 400;
  font-size: 8vw;
  line-height: 1;
  text-align: center;
  transform-style: preserve-3d;
  transform: rotateZ(-3deg);
  will-change: transform;
}
.line {
  display: block;
  position: relative;
  white-space: nowrap;
  letter-spacing: .01em;
  transform-style: preserve-3d;
}
.l1 { margin-bottom: .16em; }
.l2 { margin-bottom: .13em; }

.pl { display: block; white-space: nowrap; }
.pl.face { position: relative; }
.pl.shadow, .pl.outline, .pl.shine { position: absolute; left: 0; top: 0; width: 100%; }
.pl.outline { color: var(--o); text-shadow: var(--ring); }
.pl.shadow  { --o: var(--navy-deep); color: var(--o); text-shadow: var(--ring); }

.ch { display: inline-block; white-space: pre; }

.face .ch {
  color: #fff;
  background: linear-gradient(#ffffff 35%, #d5e6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.l2 .face .ch {
  color: #ffd23f;
  background: linear-gradient(#fff7bd 4%, #ffdc52 36%, #ffb91f 62%, #ef8a00 98%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pl.shine {
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(104deg, rgba(255, 255, 255, 0) 43%, rgba(255, 255, 255, .92) 50%, rgba(255, 255, 255, 0) 57%) no-repeat;
  background-size: 300% 100%;
  background-position: 85% 0;
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0;
}
.is-done .pl.shine { opacity: 1; animation: shine 6s ease-in-out 1.2s infinite; }
@keyframes shine {
  0%        { background-position: 85% 0; }
  26%, 100% { background-position: 15% 0; }
}

/* letters wait unseen, then pop in one by one */
.js .title:not(.is-built) { visibility: hidden; }
.js .title .ch { opacity: 0; }
.js .title.is-in .ch {
  animation: pop .66s cubic-bezier(.2, .85, .3, 1) both;
  animation-delay: calc(var(--i) * 27ms);
}
.js .title.is-done .ch { opacity: 1; animation: none; }
@keyframes pop {
  0%   { opacity: 0; transform: translateY(.55em) scale(.3) rotate(-14deg); }
  55%  { opacity: 1; transform: translateY(-.09em) scale(1.13) rotate(3deg); }
  78%  { transform: translateY(.02em) scale(.97) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}

/* ---------- the figure ---------- */

.hero {
  position: absolute;
  left: 60%; top: 40%;
  width: 80vw; height: 60vh;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(-50%, 0, 0);
}
.hero-rise {
  position: absolute; inset: 0;
}
.hero canvas {
  position: absolute;
  left: -8%; top: -4%;
  width: 116%; height: 104%;
  display: block;
}
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.js .hero img { visibility: hidden; }
.hero.no-gl canvas { display: none; }
.js .hero.no-gl img { visibility: visible; }

/* ---------- buttons ---------- */

button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.mute {
  position: absolute;
  top: calc(12px + var(--safe-t));
  right: calc(12px + var(--safe-r));
  width: 48px; height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .42);
  background: rgba(13, 32, 84, .52);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 6px 18px rgba(6, 18, 58, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s ease, background .2s ease;
}
.mute:active { transform: scale(.93); }
.mute svg { width: 24px; height: 24px; overflow: visible; }
.mute .spk { fill: #fff; }
.mute .wave, .mute .cross { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; }
.mute .cross { display: none; }
.mute[aria-pressed="true"] .wave { display: none; }
.mute[aria-pressed="true"] .cross { display: block; }
.mute.is-playing .w1 { animation: wave 1.1s ease-in-out infinite; }
.mute.is-playing .w2 { animation: wave 1.1s ease-in-out .18s infinite; }
@keyframes wave { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.hint {
  position: absolute;
  top: calc(20px + var(--safe-t));
  left: 50%;
  padding: 9px 15px 8px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .38);
  background: rgba(13, 32, 84, .56);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 13px;
  letter-spacing: .07em;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  animation: hint 2.4s ease-in-out infinite;
}
.hint[hidden] { display: none; }
@keyframes hint {
  0%, 100% { opacity: .72; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 1;   transform: translateX(-50%) translateY(-3px); }
}

.dock {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  width: min(92vw, 440px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  transform: translateX(-50%);
}

.ca {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 11px;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, .34);
  background: linear-gradient(180deg, rgba(24, 50, 116, .74), rgba(11, 27, 76, .78));
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
  box-shadow: 0 12px 30px rgba(6, 18, 58, .40), inset 0 1px 0 rgba(255, 255, 255, .22);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.ca.is-copied {
  border-color: #ffd84d;
  box-shadow: 0 12px 30px rgba(6, 18, 58, .40), 0 0 0 3px rgba(255, 216, 77, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.ca-tag {
  flex: none;
  padding: 6px 8px 5px;
  border-radius: 9px;
  background: linear-gradient(#ffe680, #ffb81f);
  color: var(--navy-deep);
  font-size: 14px;
  letter-spacing: .06em;
  line-height: 1;
}
.ca-addr {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font: 600 clamp(13px, 3.9vw, 15px)/1.3 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: .03em;
  color: #eef5ff;
  text-align: left;
}
/* only when a browser blocks copying: the whole address, ready to press and hold */
.ca.is-full .ca-addr {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 11.5px;
  letter-spacing: .01em;
  -webkit-user-select: all;
  user-select: all;
}
.ca-copy {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .15);
  font-size: 14px;
  letter-spacing: .06em;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .2s ease, color .2s ease, transform .12s ease;
}
.ca-copy:active { transform: scale(.95); }
.ca-copy svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ca-copy .i-done { display: none; stroke-width: 2.8; }
.ca.is-copied .ca-copy { background: linear-gradient(#ffe680, #ffb81f); color: var(--navy-deep); border-color: transparent; }
.ca.is-copied .i-copy { display: none; }
.ca.is-copied .i-done { display: block; }
.ca-copy-t { padding-top: 1px; min-width: 3.6em; text-align: left; }

.join {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  border-radius: 16px;
  border: 2px solid var(--navy-deep);
  background: linear-gradient(180deg, #ffec94 0%, #ffd13d 46%, #f8a900 100%);
  box-shadow: 0 5px 0 var(--navy-deep), 0 16px 28px rgba(6, 18, 58, .36), inset 0 2px 0 rgba(255, 255, 255, .6);
  color: var(--navy-deep);
  font-size: 18px;
  letter-spacing: .05em;
  line-height: 1;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.join span { padding-top: 2px; }
.join svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.join:hover { filter: brightness(1.05); }
.join:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--navy-deep), 0 8px 16px rgba(6, 18, 58, .32), inset 0 2px 0 rgba(255, 255, 255, .6);
}

/* controls arrive after the scene */
.js .mute, .js .dock > * { opacity: 0; }
.js.is-ready .mute { opacity: 1; transition: opacity .6s ease 1.1s; }
.js.is-ready .dock > * { animation: rise .7s cubic-bezier(.2, .9, .25, 1.15) both; }
.js.is-ready .dock > :nth-child(1) { animation-delay: 1.15s; }
.js.is-ready .dock > :nth-child(2) { animation-delay: 1.28s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 350px) {
  .ca-copy-t { display: none; }
  .join { font-size: 16px; }
}
@media (max-height: 430px) {
  .dock { gap: 9px; }
  .join { height: 44px; font-size: 16px; box-shadow: 0 4px 0 var(--navy-deep), 0 12px 22px rgba(6, 18, 58, .36), inset 0 2px 0 rgba(255, 255, 255, .6); }
  .ca-copy { min-height: 38px; }
  .mute { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .bird, .bird path, .hint, .is-done .pl.shine, .mute.is-playing .wave { animation: none !important; }
  .js .title .ch { opacity: 1 !important; animation: none !important; }
  .js.is-ready .scene { transition: opacity .4s ease; }
  .bird { display: none; }
}
