:root {
  --ink: #101521;
  --muted: #65748a;
  --blue-strong: #2f79ff;
  --cyan: #6ee7ff;
  --pink: #ffbfd2;
  --line: rgba(93, 145, 196, 0.28);
  --surface: rgba(255, 255, 255, 0.82);
  --mono: "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(93, 145, 196, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 145, 196, 0.04) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page {
  display: grid;
  min-height: 100svh;
  min-height: 100dvh;
  place-items: start center;
  padding: 10px 10px max(58px, env(safe-area-inset-bottom));
}

.phone {
  position: relative;
  width: min(100%, 420px);
  min-height: 0;
  padding: 13px 14px 12px;
  border: 1px solid rgba(93, 145, 196, 0.24);
  background:
    repeating-linear-gradient(180deg, transparent 0 16px, rgba(47, 121, 255, 0.035) 16px 17px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.9));
  box-shadow: 0 24px 70px rgba(34, 64, 96, 0.13);
  overflow: hidden;
}

.phone::before {
  position: absolute;
  inset: 10px;
  content: "";
  border: 1px solid rgba(93, 145, 196, 0.18);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  font-size: 12px;
}

.time,
.status,
.handle,
.rail small,
.links small {
  font-family: var(--mono);
}

.time,
.status {
  font-size: 11px;
}

.status {
  text-align: right;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 13px;
}

.tabs span {
  position: relative;
  color: var(--muted);
}

.tabs .active {
  color: var(--ink);
  font-weight: 700;
}

.tabs .active::after {
  position: absolute;
  right: 12%;
  bottom: -8px;
  left: 12%;
  height: 2px;
  content: "";
  background: var(--ink);
}

.profile {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  padding-top: 15px;
  text-align: center;
}

.signal-frame {
  position: relative;
  display: grid;
  width: 109px;
  height: 79px;
  place-items: center;
  margin: 4px auto 2px;
  transform: translate(48px, 5px);
}

.signal-frame::before,
.signal-frame::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.signal-frame::before {
  width: 87px;
  height: 87px;
  border: 1px dashed rgba(93, 145, 196, 0.34);
  animation: drift 9s ease-in-out infinite;
}

.signal-frame::after {
  width: 71px;
  height: 71px;
  border: 1px solid rgba(110, 231, 255, 0.78);
  box-shadow: 0 0 36px rgba(110, 231, 255, 0.2);
}

.main-avatar {
  position: relative;
  z-index: 1;
  width: 57px;
  height: 57px;
  border-radius: 50%;
  box-shadow: 0 16px 42px rgba(34, 64, 96, 0.1);
}

.ebi-charm {
  position: absolute;
  z-index: 3;
  bottom: 12px;
  left: calc(50% + 40px);
  width: 37px;
  height: 37px;
  opacity: 0.78;
  animation: ebi-hop 60s linear infinite;
}

.glitch {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--cyan), transparent);
  opacity: 0.72;
}

.g1 {
  top: 36px;
  left: 8px;
  width: 76px;
}

.g2 {
  top: 68px;
  right: 10px;
  width: 96px;
}

.g3 {
  bottom: 30px;
  left: 28px;
  width: 118px;
}

.name-logo {
  width: min(100%, 410px);
  height: 106px;
  margin: -22px auto -3px;
  filter: saturate(1.04);
  object-fit: contain;
}

.handle {
  margin: 0;
  color: #385d88;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.clip-area {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 150px;
  place-items: center;
  margin-top: 4px;
  overflow: visible;
  background:
    linear-gradient(rgba(93, 145, 196, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 145, 196, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(245, 251, 255, 0.62));
  background-size: 18px 18px, 18px 18px, auto;
}

.clip-area::before,
.clip-area::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.clip-area::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 16%, rgba(255, 255, 255, 0) 84%, rgba(255, 255, 255, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0) 78%, rgba(255, 255, 255, 0.98));
}

.clip-area::after {
  background: repeating-linear-gradient(180deg, rgba(47, 121, 255, 0.035) 0 1px, transparent 1px 7px);
  opacity: 0.72;
}

.character-video {
  position: relative;
  z-index: 0;
  width: min(100%, 345px);
  height: 178px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
  transform: translateY(-5px);
}

.rail {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 0;
  display: grid;
  gap: 7px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 32px rgba(34, 64, 96, 0.09);
}

.rail a {
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
}

.rail small {
  margin-top: 4px;
  color: var(--ink);
  font-size: 8px;
}

.rail .heart-link {
  color: #ff3b5f;
}

.rail .youtube-link {
  color: #f6c343;
}

.links {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.links a {
  display: grid;
  grid-template-columns: 28px 88px 1fr 18px;
  min-height: 39px;
  align-items: center;
  column-gap: 8px;
  padding: 7px 11px 7px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(34, 64, 96, 0.045);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.links a::after {
  color: var(--blue-strong);
  content: ">";
  font-family: var(--mono);
  font-size: 18px;
  text-align: right;
}

.platform-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.links a:hover,
.links a:focus-visible {
  border-color: var(--blue-strong);
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(47, 121, 255, 0.12);
}

.links a:active {
  transform: translateY(0) scale(0.988);
}

.links span {
  font-size: 13px;
  font-weight: 750;
}

.links small {
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.caption {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(16, 21, 33, 0.78);
  color: #fff;
  font-size: 11px;
}

.caption strong {
  font-weight: 650;
}

.chaos-chick {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 37px;
  height: 37px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  will-change: transform;
  border-radius: 50%;
}

@keyframes drift {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.78;
  }

  50% {
    transform: translateX(8px);
    opacity: 0.42;
  }
}

@keyframes ebi-hop {
  0%,
  16.24%,
  17.09%,
  32.9%,
  33.75%,
  49.57%,
  50.42%,
  66.24%,
  67.09%,
  82.9%,
  83.75%,
  99.16%,
  100% {
    transform: translateY(0);
  }

  16.46%,
  33.12%,
  49.79%,
  66.46%,
  83.12% {
    transform: translateY(-8px);
  }

  99.58% {
    transform: translateY(-30px);
  }
}

@media (max-width: 380px) {
  .page {
    padding: 10px 8px max(56px, env(safe-area-inset-bottom));
  }

  .phone {
    padding: 12px 11px 11px;
  }

  .signal-frame {
    width: 104px;
    height: 77px;
  }

  .main-avatar {
    width: 53px;
    height: 53px;
  }

  .character-video {
    height: 167px;
  }

  .links a {
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chaos-chick {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
