:root {
  --text-color: #000;
  --background-color: #fff;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: var(--background-color);
  color: var(--text-color);
  font-family: Georgia, "Times New Roman", Times, serif;
}

.letter-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-letter {
  position: absolute;
  color: var(--text-color);
  font-size: var(--size);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--rotation));
  animation-name: background-letter-pulse;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  user-select: none;
}

.page-shell {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
  padding: 24px;
}

.text-block {
  width: 60vw;
  height: 60vh;
  color: var(--text-color);
  overflow: visible;
}

.text-block h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6.5vw, 104px);
  font-weight: 700;
  line-height: 0.95;
}

.text-block h2 {
  margin: 0 0 24px;
  font-size: clamp(18px, 2.2vw, 34px);
  font-weight: 500;
  line-height: 1.15;
}

.text-block p {
  max-width: 72ch;
  margin: 0;
  font-size: clamp(16px, 1.65vw, 26px);
  line-height: 1.38;
}

.text-block .small-copy {
  max-width: 54ch;
  margin-top: 22px;
  font-size: clamp(11px, 0.85vw, 14px);
  line-height: 1.5;
}

.ghost-char {
  display: inline-block;
  position: relative;
  cursor: default;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ghost-char::after {
  content: attr(data-character);
  position: absolute;
  inset: 0;
  color: var(--background-color);
  opacity: 0;
  pointer-events: none;
}

.ghost-char.is-dimming::after {
  animation: source-letter-dim 0.5s ease-in-out;
  will-change: opacity;
}

.ghost-clone {
  position: fixed;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text-color);
  line-height: inherit;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  animation: ghost-expand 0.5s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes ghost-expand {
  from {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--ghost-scale, 20));
  }
}

@keyframes source-letter-dim {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes background-letter-pulse {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 0.05;
  }

  100% {
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 20px;
  }

  .text-block {
    width: 60vw;
    height: 60vh;
  }

  .text-block h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 11vw, 58px);
  }

  .text-block h2 {
    margin-bottom: 16px;
    font-size: clamp(16px, 5.4vw, 24px);
  }

  .text-block p {
    font-size: clamp(14px, 4.1vw, 18px);
  }

  .text-block .small-copy {
    margin-top: 16px;
    font-size: clamp(10px, 3.1vw, 12px);
  }
}
