:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.48);
  --quiet: rgba(244, 241, 234, 0.18);
  --faint: rgba(244, 241, 234, 0.075);
  --edge: rgba(244, 241, 234, 0.13);
  --field: rgba(255, 255, 255, 0.035);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.7), var(--bg) 38rem),
    radial-gradient(circle at 50% -20%, rgba(244, 241, 234, 0.065), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, var(--bg), transparent 15%, transparent 77%, var(--bg)),
    linear-gradient(90deg, var(--bg), transparent 13%, transparent 87%, var(--bg));
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 74rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 8rem) clamp(1.25rem, 4vw, 3rem) 8rem;
}

.ask {
  width: min(100%, 43rem);
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}

.line {
  margin: 0 auto 2rem;
  color: rgba(244, 241, 234, 0.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3.3vw, 2.35rem);
  font-weight: 400;
  line-height: 1.32;
}

textarea {
  display: block;
  width: min(100%, 34rem);
  min-height: 5.8rem;
  max-height: 14rem;
  margin: 0 auto;
  padding: 1.1rem 1.2rem;
  resize: vertical;
  border: 1px solid var(--edge);
  border-radius: 0;
  outline: 0;
  background: var(--field);
  color: var(--ink);
  caret-color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
  transition: border-color 240ms ease, background 240ms ease;
}

textarea:focus {
  border-color: rgba(244, 241, 234, 0.38);
  background: rgba(255, 255, 255, 0.052);
}

.featured {
  width: min(100%, 36rem);
  margin: 0 auto 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--quiet);
  text-align: center;
}

.featured span {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.featured p {
  margin: 0;
  color: rgba(244, 241, 234, 0.75);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
  transition: opacity 420ms ease, filter 420ms ease;
}

.featured p.is-changing {
  opacity: 0;
  filter: blur(5px);
}

.wall-wrap {
  position: relative;
  min-height: 42rem;
  overflow: hidden;
  padding-top: 2rem;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 6.5rem,
    #000 calc(100% - 7.5rem),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 6.5rem,
    #000 calc(100% - 7.5rem),
    transparent 100%
  );
}

.wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.3rem, 3vw, 3.6rem) clamp(1rem, 2.8vw, 3.2rem);
  align-items: start;
  padding-bottom: 50vh;
  animation: drift 52s linear infinite;
}

.thought {
  min-height: 4.25rem;
  margin: 0;
  color: rgba(244, 241, 234, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.55vw, 1.45rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
  opacity: var(--tone, 0.72);
  transform: translateY(var(--lift, 0));
}

.thought:nth-child(2n) {
  padding-top: 2.4rem;
}

.thought:nth-child(5n) {
  color: rgba(244, 241, 234, 0.42);
}

.thought:nth-child(7n) {
  padding-top: 4.1rem;
}

.thought.is-new {
  animation: arrive 4s ease both;
}

.regret,
.closing {
  position: fixed;
  z-index: 5;
  bottom: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.regret {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  left: 1rem;
}

.info-button {
  display: inline-grid;
  width: 1rem;
  height: 1rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(244, 241, 234, 0.24);
  border-radius: 50%;
  background: transparent;
  color: rgba(244, 241, 234, 0.46);
  cursor: help;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.68rem;
  line-height: 1;
}

.info-button:focus-visible {
  outline: 1px solid rgba(244, 241, 234, 0.55);
  outline-offset: 3px;
}

.tooltip {
  position: absolute;
  bottom: 1.65rem;
  left: 0;
  width: min(17rem, calc(100vw - 2rem));
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(244, 241, 234, 0.16);
  background: rgba(7, 7, 7, 0.94);
  color: rgba(244, 241, 234, 0.68);
  font-size: 0.76rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.3rem);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: normal;
}

.regret:hover .tooltip,
.regret:focus-within .tooltip {
  opacity: 1;
  transform: translateY(0);
}

.closing {
  right: 1rem;
}

.void {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 900ms ease;
}

.void.is-open {
  opacity: 1;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, -26rem, 0);
  }
}

@keyframes arrive {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(1.3rem);
  }

  100% {
    opacity: var(--tone, 0.72);
    filter: blur(0);
    transform: translateY(var(--lift, 0));
  }
}

@media (max-width: 760px) {
  .shell {
    padding-bottom: 7.5rem;
  }

  .ask {
    margin-bottom: 2.25rem;
  }

  .wall {
    grid-template-columns: 1fr;
    gap: 2.1rem;
    animation-duration: 78s;
  }

  .thought {
    min-height: auto;
    font-size: clamp(1.05rem, 5vw, 1.45rem);
  }

  .thought:nth-child(2n),
  .thought:nth-child(7n) {
    padding-top: 0;
  }

  .regret,
  .closing {
    left: 1rem;
    right: auto;
  }

  .closing {
    bottom: 2.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wall,
  .thought.is-new {
    animation: none;
  }

  .void {
    transition: none;
  }
}
