:root {
  --bg-base: #1a1a1c;
  --bg-lift: #232326;
  --fg: #eae8e3;
  --fg-muted: #86868c;
  --rule: #303034;
  --font-stack: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Inter, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 2rem;
  overflow-x: clip;
  background-color: var(--bg-base);
  background-image: radial-gradient(120% 120% at 50% 32%, var(--bg-lift) 0%, var(--bg-base) 62%);
  color: var(--fg);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 2rem);
  animation: fade-up 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 9vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

hr {
  width: 2.5rem;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--rule);
}

.tagline {
  margin: 0;
  font-size: clamp(0.7rem, 2.2vw, 0.8125rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

[data-glitch] { position: relative; }

.is-glitching > .original { opacity: 0; }

.glyph-layer {
  position: absolute;
  z-index: 1;
  overflow: clip;
  pointer-events: none;
  user-select: none;
}

h1.is-glitching { z-index: 1; }

.glyph {
  position: absolute;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: pre;
}

.glyph.is-moving { will-change: transform; }

.impact-mark {
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  border-radius: 1px;
  background: currentColor;
  pointer-events: none;
}

.about-toggle {
  position: absolute;
  z-index: 2;
  inset-block-start: calc(100% + 0.8rem);
  inset-inline-start: 50%;
  translate: -50%;
  border: 0;
  padding: 0.4rem 0.6rem;
  background: transparent;
  color: #4d4d52;
  font: 400 0.66rem/1.15 var(--font-stack);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.about-toggle:hover, .about-toggle:focus-visible { color: #aaaab0; }
.about-toggle:focus-visible { outline: 1px solid #77777d; outline-offset: 2px; }
.about-toggle.is-arriving { animation: about-in 440ms linear both; }
.about-toggle.is-leaving { animation: about-out 370ms linear both; }
.about-toggle:focus-visible { animation: none; }

.about {
  width: min(20rem, calc(100% - 2rem));
  padding: 1.35rem 1.5rem 1.2rem;
  border: 1px solid #3e3e43;
  border-radius: 0.5rem;
  background: #252528;
  color: var(--fg);
  font: 400 0.9rem/1.5 var(--font-stack);
}

.about::backdrop { background: rgb(14 14 16 / 65%); }
.about h2 { margin: 0; font-size: 1.15rem; font-weight: 500; }
.about p { margin: 0.55rem 0 1rem; color: #b3b3b8; }
.about-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }

.about-devices {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #87878d;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.device-icon { display: block; position: relative; width: 12px; height: 16px; }
.device-icon::before, .device-icon::after { position: absolute; content: ""; }

.device-icon.watch::before {
  inset: 3px 1px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.device-icon.watch::after {
  inset: 0 4px auto;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 14px currentColor;
}

.device-icon.phone {
  width: 8px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.device-icon.phone::before {
  inset: 1px 2px auto;
  height: 1px;
  background: currentColor;
}

.device-icon.tablet {
  width: 11px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.device-icon.mac { width: 17px; }

.device-icon.mac::before {
  inset: 1px 0 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.device-icon.mac::after {
  inset: auto 5px 0;
  height: 4px;
  background:
    linear-gradient(currentColor, currentColor) center top / 1px 3px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 7px 1px no-repeat;
}

.about button {
  color: inherit;
  background: transparent;
  border: 1px solid #54545a;
  border-radius: 0.25rem;
  padding: 0.24rem 0.55rem;
  font: inherit;
  cursor: pointer;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: none; }
}

@keyframes about-in {
  0% { opacity: 0; transform: translate(-1px, 1px); }
  15% { opacity: 0.9; transform: translate(1px, 0); }
  27% { opacity: 0.18; transform: translate(0, -1px); }
  43% { opacity: 0.82; transform: translate(-1px, 0); }
  58% { opacity: 0.46; transform: translate(0, 1px); }
  86%, 100% { opacity: 1; transform: none; }
}

@keyframes about-out {
  0% { opacity: 1; transform: none; }
  24% { opacity: 0.43; transform: translate(1px, 0); }
  37% { opacity: 0.74; transform: translate(-1px, 0); }
  66% { opacity: 0.12; transform: translate(0, 1px); }
  80% { opacity: 0.33; transform: translate(1px, -1px); }
  100% { opacity: 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  main, .about-toggle.is-arriving, .about-toggle.is-leaving { animation: none; }
  .is-glitching > .original { opacity: 1; }
  .glyph-layer { display: none; }
}
