:root {
  color-scheme: light;
  --page-bg: #ffffff;
  --page-fg: #111111;
  --toggle-bg: #f0f0f0;
  --toggle-fg: #111111;
  --record-fg: rgba(17, 17, 17, 0.38);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #161616;
  --page-fg: #ffffff;
  --toggle-bg: #2d2d2d;
  --toggle-fg: #ffffff;
  --record-fg: rgba(255, 255, 255, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--page-fg);
  background: var(--page-bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  transition:
    background-color 260ms ease,
    color 260ms ease;
}

.stage {
  position: relative;
  display: grid;
  width: 100%;
  height: 100svh;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--page-bg);
  transition: background-color 260ms ease;
}

.antigravity-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--page-fg);
  font-size: clamp(3rem, 10vw, 8.6rem);
  font-weight: 680;
  line-height: 0.98;
  letter-spacing: 0;
  text-align: center;
  transition: color 260ms ease;
  user-select: none;
}

.theme-toggle {
  position: fixed;
  z-index: 4;
  right: 28px;
  bottom: 28px;
  display: inline-grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  color: var(--toggle-fg);
  background: var(--toggle-bg);
  border: 0;
  border-radius: 16px;
  box-shadow: none;
  cursor: pointer;
  transition:
    background-color 260ms ease,
    color 260ms ease,
    transform 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.theme-toggle .icon {
  grid-area: 1 / 1;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.icon-moon {
  opacity: 0;
  transform: scale(0.72) rotate(-18deg);
}

html[data-theme="dark"] .icon-sun {
  opacity: 0;
  transform: scale(0.72) rotate(18deg);
}

html[data-theme="dark"] .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.icp-record {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 24px;
  color: var(--record-fg);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  transform: translateX(-50%);
  transition: color 260ms ease;
  white-space: nowrap;
}

.icp-record:hover {
  color: var(--page-fg);
}

.theme-wipe {
  pointer-events: none;
  display: none;
  opacity: 0;
}

@media (max-width: 560px) {
  .theme-toggle {
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .icp-record {
    bottom: 18px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .stage,
  h1,
  .theme-toggle,
  .theme-toggle .icon,
  .icp-record {
    transition: none;
  }
}
