@font-face {
  font-family: "Google Sans";
  src: url("fonts/google_sans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --primary: #82d5c8;
  --primary-container: #005048;
  --on-primary-container: #9ef2e4;
  --bg: #0e1513;
  --on-bg: #dde4e1;
  --muted: #bec9c6;
  --outline: #899390;
  --outline-variant: #3f4947;
  --c-low: #161d1c;
  --c-high: #252b2a;
  --c-highest: #2f3635;
  --online: #4fc3f7;
  color-scheme: dark;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
button, a, .chip { touch-action: manipulation; }
button, .chip { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body:has(.widgets[open]) { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--on-bg);
  font: 16px/1.5 "Google Sans", system-ui, sans-serif;
}

a { color: var(--primary); }

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 64px;
  align-items: center;
}

.stage { display: grid; place-items: center; min-height: 560px; }
.stage .hero { transform: scale(1.35); }

.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
h1 { font-size: 56px; font-weight: 500; line-height: 1.05; margin: 0; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 12px; }

.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.platforms .choice { flex-direction: column; align-items: flex-start; gap: 12px; }

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 26px;
  background: var(--c-high);
  color: var(--on-bg);
  text-decoration: none;
}
.choice.primary { background: var(--primary-container); color: var(--on-primary-container); }
.badge {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: rgb(221 228 225 / 12%);
  display: grid;
  place-items: center;
}
.choice .text { flex: 1; min-width: 0; }
.title { display: block; font-size: 16px; font-weight: 500; }
.hint { display: block; font-size: 14px; opacity: .75; }

svg.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }

.command { display: flex; align-items: center; gap: 4px; margin-top: 10px; border-radius: 12px; background: rgb(0 0 0 / 25%); }
.command code {
  flex: 1;
  min-width: 0;
  padding: 12px 0 12px 14px;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--muted);
  font: 12px/1.5 ui-monospace, "JetBrains Mono", monospace;
  scrollbar-width: none;
}
.command code::-webkit-scrollbar { display: none; }
.command button {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.command button svg.icon { width: 18px; height: 18px; }

.note { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 8px; }
.note svg.icon { width: 18px; height: 18px; fill: var(--primary); }

footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 28px;
  display: flex;
  justify-content: space-between;
  color: var(--outline);
  font-size: 14px;
}
footer a { color: var(--muted); }

.hero { position: relative; width: 320px; height: 400px; flex: none; }
.orbits { position: absolute; inset: 0; overflow: visible; }
.ring, .ping { transform-box: view-box; }
.ring { fill: none; stroke: var(--outline-variant); stroke-width: 1; stroke-dasharray: 4 8; transform-origin: 160px 200px; }
.ring.inner { animation: spin 120s linear infinite; }
.ring.outer { animation: spin 240s linear infinite reverse; }
.ping { fill: none; stroke: var(--primary); stroke-width: 1.5; transform-origin: 160px 200px; animation: ping 4s cubic-bezier(.4, 0, .2, 1) infinite; }

.core {
  position: absolute;
  left: 116px;
  top: 156px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: grid;
  place-items: center;
}
.core svg.icon { width: 40px; height: 40px; }

.chip {
  position: absolute;
  width: max-content;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 28px;
  background: var(--c-low);
  border: 1.5px solid transparent;
  box-shadow: 0 4px 12px rgb(0 0 0 / 35%);
  overflow: hidden;
  transition: opacity .3s;
  animation: bob 6s ease-in-out infinite;
}
.chip.start { left: 0; }
.chip.end { right: 0; }
.chip.offline { opacity: .6; }

.avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--c-highest);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--online);
  border: 3px solid var(--c-low);
}
.avatar.hidden::after { background: var(--muted); }
.avatar.offline::after { display: none; }

.who { min-width: 0; }
.who .name { font-size: 15px; line-height: 1.3; }
.who .line { font-size: 12px; color: var(--outline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .line.enter { animation: line-in .3s ease-out; }
.cover { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none;}
.cover.enter { animation: cover-in .3s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping {
  from { transform: scale(.293); opacity: .5; }
  to { transform: scale(1); opacity: 0; }
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}
@keyframes line-in { from { transform: translateY(100%); opacity: 0; } }
@keyframes cover-in { from { transform: scale(.6); opacity: 0; } }

.chip { cursor: pointer; }
.hero.frozen .chip, .hero.frozen .ring, .hero.frozen .ping { animation-play-state: paused; }
.hero.frozen .chip:not(.peeked) { opacity: .45; }
.chip.peeked { border-color: var(--primary); z-index: 4; }

.peek {
  position: absolute;
  left: 0;
  z-index: 5;
  width: 300px;
  padding: 10px;
  border-radius: 24px;
  background: var(--c-low);
  box-shadow: 0 8px 24px rgb(0 0 0 / 50%);
  opacity: 0;
  transform: scale(.95);
  pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.2, 0, 0, 1);
}
.peek.end { left: auto; right: 0; }
.peek.open { opacity: 1; transform: none; }
.peek .tiles { gap: 6px; }
.peek .tile { padding: 6px; border-radius: 14px; }
.peek .tile .value { font-size: 18px; }
.peek .tile .value.small, .peek .tile .text-big { font-size: 13px; }
.peek .tile .label { font-size: 10px; margin-top: 2px; }
.peek .tile .round { display: none; }
.peek .tile .overlay { padding: 6px 8px; }
.peek .tile svg.gauge text { font-size: 15px; }
.peek .hidden-note { display: none; padding: 6px 8px; color: var(--muted); font-size: 13px; }
.peek.is-hidden .hidden-note { display: block; }

.choice.demo {
  width: 100%;
  border: 1px solid var(--outline-variant);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.widgets {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border: 0;
  outline: none;
  border-radius: 34px;
  background: var(--bg);
  color: var(--on-bg);
  text-align: center;
  box-shadow: 0 12px 40px rgb(0 0 0 / 50%);
}
.widgets[open] { animation: pop .3s cubic-bezier(.2, 0, 0, 1); }
.widgets::backdrop { background: rgb(0 0 0 / 60%); }
.builder { padding: 40px 24px 24px; }
.builder h2 { font-size: 32px; font-weight: 500; margin: 0 0 8px; }
.builder p { color: var(--muted); margin: 0 auto 24px; max-width: 30em; }
.builder .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--c-high);
  color: var(--on-bg);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.builder .card { background: var(--c-low); border-radius: 28px; padding: 16px; }

.friends { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 999px; background: var(--c-low); }
.friends button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.friends button.on { background: var(--primary-container); color: var(--on-primary-container); }
.friends .mini { width: 24px; height: 24px; border-radius: 50%; background: var(--c-highest); color: var(--on-bg); display: grid; place-items: center; font-size: 12px; }

.shapes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.shapes span {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  color: var(--outline);
  font: 12px/1.5 ui-monospace, "JetBrains Mono", monospace;
  transition: .3s;
}
.shapes span.on { border-color: var(--primary); color: var(--primary); background: rgb(130 213 200 / 10%); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative;
  border-radius: 18px;
  background: var(--c-high);
  color: var(--on-bg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.tile.enter { animation: tile-in .35s cubic-bezier(.2, 0, 0, 1) both; }
.tile.row { flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; }
.tile.primary { background: var(--primary-container); color: var(--on-primary-container); }
.tile.secondary { background: #334b47; color: #cce8e2; }
.tile.tertiary { background: #7b2f10; color: #ffdbcf; }
.tile.violet { background: #4a4163; color: #e6deff; }
.tile .label { font-size: 12px; opacity: .75; line-height: 1.2; margin-top: 4px; }
.tile .value { font-size: 30px; line-height: 1.1; font-weight: 500; }
.tile .value.small { font-size: 22px; }
.tile .text-big { font-size: 18px; line-height: 1.2; }
.tile svg.gauge { width: 72%; height: auto; overflow: visible; }
.tile svg.gauge .track { fill: none; stroke: currentColor; opacity: .2; }
.tile svg.gauge .fill { fill: none; stroke: currentColor; stroke-linecap: round; }
.tile svg.gauge text { fill: currentColor; font: 500 17px "Google Sans", sans-serif; text-anchor: middle; dominant-baseline: central; }
.tile .bar { width: 80%; height: 6px; margin-top: 8px; border-radius: 3px; background: rgb(255 255 255 / 15%); overflow: hidden; }
.tile .bar i { display: block; height: 100%; border-radius: 3px; background: currentColor; }
.tile .glyph { width: 32px; height: 32px; }
.tile .round { width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgb(255 255 255 / 10%); display: grid; place-items: center; }
.tile .round svg { width: 18px; height: 18px; fill: currentColor; }
.tile .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; text-align: left; background: linear-gradient(transparent 35%, rgb(0 0 0 / 72%)); color: #fff; }

@media (hover: hover) {
  a.choice:hover { filter: brightness(1.12); }
  .command button:hover { color: var(--on-bg); }
  .choice.demo:hover { background: var(--c-low); }
}

@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes tile-in { from { transform: scale(.85); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; align-content: start; gap: 24px; padding-top: 32px; }
  .stage { min-height: 0; }
  .stage .hero { transform: none; }
  h1 { font-size: 44px; }
}

@media (max-width: 480px) {
  main { padding-inline: 16px; }
  .platforms { grid-template-columns: 1fr; }
  .platforms .choice { flex-direction: row; align-items: center; }
  footer { flex-direction: column; gap: 4px; padding-inline: 16px; }
  .widgets { border-radius: 26px; }
  .builder { padding: 56px 12px 16px; }
  .builder h2 { font-size: 26px; }
  .builder .card { padding: 12px; }
  .friends { display: flex; }
  .friends button { flex: 1; justify-content: center; padding: 8px 4px; }
  .friends .mini { display: none; }
  .builder .tiles { gap: 6px; }
  .builder .tile { padding: 6px; border-radius: 14px; }
  .builder .tile .value { font-size: 20px; }
  .builder .tile .value.small, .builder .tile .text-big { font-size: 14px; }
  .builder .tile .label { font-size: 10px; }
  .builder .tile .round { display: none; }
  .builder .tile .overlay { padding: 8px; }
}

@media (max-width: 351px) {
  .stage .hero { zoom: .88; }
}
