:root {
  color-scheme: dark;
  --bg: #080808;
  --paper: #f2f1ec;
  --muted: #96958f;
  --line: rgba(255, 255, 255, 0.18);
  --signal: #f2f1ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--paper);
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    radial-gradient(circle at 50% 44%, rgba(44, 44, 42, 0.23), transparent 36%),
    radial-gradient(circle at 50% 50%, transparent 25%, rgba(0, 0, 0, 0.65) 100%);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

body::after {
  position: fixed;
  inset: -50%;
  z-index: 3;
  content: "";
  pointer-events: none;
  opacity: 0.026;
  background-image: repeating-radial-gradient(circle at 17% 32%, #fff 0 0.45px, transparent 0.7px 3px);
  background-size: 5px 5px;
  animation: grain 0.28s steps(2) infinite;
}

#world {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: none;
}

.page-shell {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(26px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  pointer-events: none;
  place-items: center;
}

.identity {
  position: relative;
  display: grid;
  grid-area: 1 / 1;
  width: clamp(290px, 45vw, 640px);
  margin: 0 0 3vh;
  opacity: 0;
  place-items: center;
  animation: identity-in 0.7s ease 0.1s forwards;
}

.signature-lockup {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.4));
}

.signature-name {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  padding-inline: clamp(8px, 1vw, 16px);
}

.signature-will {
  color: #f2f0ea;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: clamp(4.8rem, 11vw, 9.5rem);
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 0.74;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(18px);
  animation: signature-will-in 0.9s cubic-bezier(0.18, 0.76, 0.2, 1) 0.18s forwards;
}

.signature-iam {
  position: relative;
  z-index: 2;
  margin-left: clamp(10px, 1.35vw, 18px);
  padding-right: 0.2em;
  color: rgba(242, 240, 234, 0.78);
  font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.09em;
  line-height: 1;
  opacity: 0;
  transform: translate(-15px, 8px);
  animation: signature-iam-in 0.8s cubic-bezier(0.2, 0.78, 0.2, 1) 0.82s forwards;
}

.socials {
  position: absolute;
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  display: flex;
  gap: 10px;
  pointer-events: auto;
  transform: translateX(-50%);
}

.social-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 142px;
  height: 46px;
  padding: 0 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #deddd8;
  background: rgba(10, 10, 10, 0.76);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.social-link svg {
  width: 16px;
  height: 16px;
  margin-right: 9px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.social-link svg .icon-fill {
  fill: currentColor;
  stroke: none;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--signal);
  color: #080808;
  background: var(--signal);
  outline: none;
  transform: translateY(-2px);
}

.no-script {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 5;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  transform: translateX(-50%);
}

@keyframes identity-in {
  to {
    opacity: 1;
  }
}

@keyframes signature-will-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes signature-iam-in {
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1%, -1%); }
  50% { transform: translate(-1%, 1%); }
  75% { transform: translate(1%, 1%); }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 16px;
  }

  .identity {
    width: min(90vw, 400px);
    margin-bottom: 8vh;
  }

  .signature-will {
    font-size: min(18.5vw, 5.25rem);
  }

  .signature-iam {
    margin-left: clamp(7px, 2.5vw, 11px);
    padding-right: 0.22em;
    font-size: min(10.5vw, 3rem);
  }

  .socials {
    width: calc(100% - 32px);
  }

  .social-link {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding-inline: 10px;
    font-size: 0.66rem;
  }
}

@media (max-width: 370px) {
  .social-link svg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .identity,
  .signature-will,
  .signature-iam {
    animation: none;
  }

  .identity,
  .signature-will,
  .signature-iam {
    opacity: 1;
    transform: none;
  }

  .social-link {
    transition: none;
  }
}
