:root {
  color-scheme: dark;
  --black: #030303;
  --soft-white: #e8e5de;
  --muted-white: rgba(232, 229, 222, 0.78);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.stage,
.hero {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.025), transparent 29%),
    linear-gradient(180deg, #050505 0%, #010101 100%);
}

.hero {
  isolation: isolate;
  touch-action: none;
  cursor: none;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.08) 0 0.7px, transparent 0.9px),
    radial-gradient(circle at 72% 44%, rgba(255, 255, 255, 0.06) 0 0.6px, transparent 0.9px);
  background-size: 39px 43px, 51px 47px;
  mix-blend-mode: screen;
}

.poem-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 96px);
  pointer-events: none;
}

.poem {
  width: min(76vw, 820px);
  margin: 0;
  color: var(--muted-white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.28rem, 2.7vw, 3.05rem);
  font-weight: 400;
  line-height: 1.46;
  letter-spacing: 0;
  text-align: left;
  transform: translate3d(-2vw, -0.5vh, 0);
  opacity: 0.93;
  text-shadow:
    0 0 18px rgba(232, 229, 222, 0.16),
    0 0 1px rgba(232, 229, 222, 0.22);
}

.poem span {
  display: block;
}

.poem span:nth-child(2) {
  margin: 0.75em 0 1.35em;
  font-size: 0.56em;
  opacity: 0.62;
}

.portrait-canvas,
.line-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portrait-canvas {
  z-index: 2;
}

.line-canvas {
  z-index: 3;
  opacity: 1;
}

.signature {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  color: var(--soft-white);
  font-size: clamp(0.78rem, 1.1vw, 1.05rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: 0.16em;
  opacity: 0.88;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 760px) {
  .poem-layer {
    place-items: center;
    padding: 24px;
  }

  .poem {
    width: min(90vw, 460px);
    font-size: clamp(1.04rem, 4.85vw, 1.78rem);
    line-height: 1.5;
    transform: translate3d(-1vw, 1vh, 0);
  }

  .signature {
    top: max(18px, env(safe-area-inset-top));
    right: max(17px, env(safe-area-inset-right));
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    cursor: auto;
  }
}
