:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #111316;
  --soft-ink: #6f747b;
  --line: #e6e9ed;
  --dot: rgba(17, 19, 22, 0.12);
  --ghost: rgba(17, 19, 22, 0.17);
  --focus: #111316;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle, var(--dot) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.96));
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.98));
}

a {
  color: inherit;
  text-decoration: none;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  isolation: isolate;
}

.centerpiece {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(100%, 900px);
  text-align: center;
}

.kicker,
.subline {
  margin: 0;
  color: var(--soft-ink);
  font-size: clamp(0.72rem, 1.5vw, 0.88rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  min-height: clamp(2.5rem, 8vw, 5.2rem);
  margin: 0;
  color: var(--focus);
  font-size: clamp(1.1rem, 5.2vw, 4.2rem);
  font-weight: 520;
  line-height: 0.98;
  letter-spacing: 0;
  white-space: nowrap;
  text-wrap: nowrap;
  overflow: hidden;
}

.caret {
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  margin-left: 0.06em;
  translate: 0 0.1em;
  background: var(--ink);
  opacity: 1;
  animation: caret-fade 1.15s ease-in-out infinite;
  will-change: opacity;
}

.project-cloud {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.project-cloud span,
.project-link {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: min(72vw, 430px);
  padding: 8px 10px;
  border: 1px solid rgba(17, 19, 22, 0.08);
  border-radius: 8px;
  color: var(--ghost);
  background: rgba(255, 255, 255, 0.52);
  font-size: clamp(0.72rem, 1.6vw, 1rem);
  letter-spacing: 0;
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--fly-x, calc(var(--x) * 1.55)), var(--fly-y, calc(var(--y) * 1.55))) scale(0.92);
  filter: blur(7px);
  transition:
    opacity 1.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 1.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 1.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--delay);
}

html.is-loaded .project-cloud span,
html.is-loaded .project-link {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1);
}

.project-link {
  pointer-events: auto;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(17, 19, 22, 0.08);
  padding: 8px 10px;
}

.project-link:hover {
  text-decoration: underline;
}

.legal {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 5;
  display: flex;
  gap: 18px;
  color: var(--soft-ink);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.toggle-button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.toggle-button:hover {
  border-color: currentColor;
  color: var(--ink);
}

.toggle-button.is-active {
  color: var(--ink);
  border-bottom-color: currentColor;
  font-weight: 700;
}

dialog {
  width: min(92vw, 460px);
  max-height: calc(100vh - 72px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(17, 19, 22, 0.12);
}

dialog:target {
  display: block;
  position: fixed;
  inset: clamp(16px, 3vw, 34px) clamp(16px, 3vw, 34px) clamp(16px, 3vw, 34px) auto;
}

dialog:not(:target) {
  display: none;
}

dialog h2 {
  margin: 0 0 18px;
  font-size: 1rem;
}

dialog p {
  margin: 0 0 12px;
  color: var(--soft-ink);
  font-size: 0.86rem;
  line-height: 1.62;
}

.close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
  padding: 0 0 8px 12px;
  margin-left: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78));
  color: var(--soft-ink);
  font-size: 0.78rem;
}

@keyframes caret-fade {
  0%,
  28% {
    opacity: 1;
  }

  45% {
    opacity: 0.52;
  }

  60% {
    opacity: 0.18;
  }

  72% {
    opacity: 0.46;
  }

  100% {
    opacity: 0.1;
  }
}

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle, var(--dot) 1px, transparent 1.3px) 0 0 / 18px 18px,
      linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.97));
  }

  .stage {
    padding: 18px;
  }

  .project-cloud span,
  .project-link {
    transform: translate(-50%, -50%) translate(calc(var(--x) * 0.55), calc(var(--y) * 0.7)) scale(0.96);
  }

  .legal {
    right: 18px;
    bottom: 16px;
  }

  dialog {
    width: min(100vw - 32px, 460px);
    max-height: calc(100vh - 32px);
  }

  dialog:target {
    inset: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .caret,
  .project-cloud span {
    animation: none;
  }

  .project-cloud span {
    opacity: 1;
    filter: none;
  }
}
