:root {
  color-scheme: dark;
  --paper: #101012;
  --ink: #a6a6a6;
  --space: clamp(1.5rem, 5vw, 4rem);
  --label-size: clamp(0.625rem, 1.35vw, 0.8rem);
  --label-font: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

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

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    max(var(--space), env(safe-area-inset-top))
    max(var(--space), env(safe-area-inset-right))
    max(var(--space), env(safe-area-inset-bottom))
    max(var(--space), env(safe-area-inset-left));
}

.contact {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  z-index: 1;
  color: #d0d0d0;
  margin-top: 7rem;
  font-family: var(--label-font);
  font-size: var(--label-size);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.3em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 1px solid #a6a6a6;
  outline-offset: 6px;
}

.animation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.contact a { grid-column: 2; justify-self: end; white-space: nowrap; }

/* Keep the real mail link clickable and accessible. The canvas paints its
   visible text above all surfaces, with the same contrast adjustment as the hash. */
.canvas-footer .contact a { color: transparent; }

.block-hash {
  /* Invisible DOM text supplies layout, selection and accessibility.
     Canvas keeps the visible text above the forms and adjusts its contrast. */
  opacity: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
  pointer-events: auto;
  user-select: text;
}

.block-hash:focus-visible {
  opacity: 1;
  color: transparent;
  background: transparent;
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 540px) {
  .contact { gap: 0.75rem; }
  .block-hash {
    width: 100%;
    max-width: none;
    align-self: end;
    padding-bottom: calc((44px - 1.6em) / 2);
  }
}

.circle-count {
  position: absolute;
  top: max(var(--space), env(safe-area-inset-top));
  left: max(var(--space), env(safe-area-inset-left));
  font-family: var(--label-font);
  font-size: var(--label-size);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.canvas-footer .circle-count { opacity: 0; }
