:root {
  --bg: #f4f0e7;
  --ink: #211e1a;
  --ink-soft: rgba(33, 30, 26, 0.55);
  --line: rgba(33, 30, 26, 0.85);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
}

main {
  position: fixed;
  inset: 0;
  display: block;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#wordmark {
  position: fixed;
  left: clamp(20px, 3vw, 36px);
  bottom: clamp(20px, 3vw, 36px);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.8s ease;
  user-select: none;
  line-height: 44px;
}

#wordmark.visible {
  opacity: 0.55;
}

#contact {
  position: fixed;
  right: clamp(20px, 3vw, 36px);
  bottom: clamp(20px, 3vw, 36px);
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.6s ease, transform 0.4s ease;
  display: grid;
  place-items: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

#contact.visible {
  opacity: 0.55;
  pointer-events: auto;
}

#contact:hover,
#contact:focus-visible {
  opacity: 1;
  outline: none;
  transform: translateY(-1px);
}

#contact:active {
  transform: translateY(0) scale(0.96);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: clamp(40px, 8vh, 80px);
  transform: translate(-50%, 8px);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: 0.01em;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  white-space: nowrap;
}

#toast.visible {
  opacity: 0.85;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  #contact { transition: opacity 0.3s ease; }
}
