:root {
  --page: #EDEDEB;
  --ink: #1A1A1A;
  --ink-soft: #5C5C5A;
  --cursor: #1F4BFF;
  --render-width: clamp(150px, 17vw, 300px);
  --edge: clamp(16px, 2.4vw, 32px);
}

* {
  box-sizing: border-box;
}

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

body {
  /* Blue dot cursor. */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='11' cy='11' r='10.5' fill='%231F4BFF'/%3E%3C/svg%3E") 11 11, crosshair;
  background: var(--page);
  color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
}

#stage {
  position: relative;
  height: 100%;
  /* Lets a finger drag across the page without scrolling it, so touch works like the cursor. */
  touch-action: none;
}

/* Text sits above the renders so name and contacts stay readable. */
.corner {
  position: absolute;
  z-index: 100000;
  margin: 0;
  padding: var(--edge);
  padding-top: max(var(--edge), env(safe-area-inset-top));
  padding-bottom: max(var(--edge), env(safe-area-inset-bottom));
}

.corner-top-left { top: 0; left: 0; }
.corner-top-right { top: 0; right: 0; color: var(--ink-soft); }
.corner-bottom-left { bottom: 0; left: 0; }
.corner-bottom-right { bottom: 0; right: 0; }

.corner p {
  margin: 0;
  color: var(--ink-soft);
}

.name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

a {
  /* On links the dot shrinks to the size of the trailing dot and turns white. */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='4' fill='%23FFFFFF'/%3E%3C/svg%3E") 4 4, pointer;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ink-soft);
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.hint {
  position: absolute;
  z-index: 100000;
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  color: var(--ink-soft);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hint.is-hidden {
  opacity: 0;
}

.render {
  position: absolute;
  width: var(--render-width);
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.6s ease, filter 0.4s ease;
}

.render.is-leaving {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hint,
  .render {
    transition: none;
  }
}

/* On narrow screens the hint sits above the contact links instead of between them. */
@media (max-width: 640px) {
  .hint {
    bottom: calc(max(var(--edge), env(safe-area-inset-bottom)) + 32px);
  }
}

/* Small dot that trails the cursor (see js/cursor.js). */
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100002;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cursor);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.cursor-follower.is-visible {
  opacity: 1;
}

.cursor-follower.is-on-link {
  background: #FFFFFF;
}

/* About section, shown over the renders when the address ends in #about. */
.about {
  position: fixed;
  inset: 0;
  z-index: 99000;
  overflow-y: auto;
  background: var(--page);
}

.about[hidden] {
  display: none;
}

/* In About, contacts live inside the text, and the top corners get a background
   so the text scrolls cleanly underneath them. */
.is-about .hint,
.is-about .corner-bottom-left,
.is-about .corner-bottom-right {
  display: none;
}

.is-about .corner {
  background: var(--page);
}

.about-inner {
  max-width: 880px;
  padding: calc(var(--edge) + 120px) var(--edge) calc(var(--edge) + 120px);
}

.about-label {
  margin: 0 0 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}

.about-label:focus {
  outline: none;
}

.about-lead {
  margin: 0 0 32px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.about-text {
  margin: 0 0 64px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.5;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 32px;
  margin: 0;
}

.about-facts dt {
  margin-bottom: 6px;
  color: var(--ink-soft);
}

.about-facts dd {
  margin: 0;
}

/* While an image is being dragged, the page text is not selected by accident. */
.is-dragging,
.is-dragging * {
  user-select: none;
}
