/* Reset */

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

/* Design Tokens */

:root {
  --text: #fff;
  --text-dim: #999;
  --bg: #000;
}

@media (prefers-color-scheme: light) {
  :root {
    --text: #000;
    --text-dim: #666;
    --bg: #fff;
  }
}

/* Base Elements */

body {
  font:
    1.25rem/1.5 "SF Mono",
    ui-monospace,
    monospace;
  color: var(--text);
  background: var(--bg);
  padding: 2rem 1.25rem;
  max-width: 40rem;
  margin: 0 auto;
}

h1 {
  font-size: 2.5rem;
  line-height: 1;
}

h2 {
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
}

address {
  font-size: 1.5rem;
  color: var(--text-dim);
  font-style: normal;
}

a {
  color: var(--text);
  text-decoration: none;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  position: relative;
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

li::before {
  content: "> ";
  color: var(--text-dim);
  position: absolute;
  left: 0;
}

dl {
  margin: 0;
}

dd {
  padding: 0.1rem 0 0;
}

dt,
dd {
  margin: 0;
}

/* Layout */

section {
  margin: 0 0 1rem;
}

nav {
  display: flex;
  gap: 0.75rem;
  margin: 0.25rem 0 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
}

/* Components */

.address {
  font-size: 1.1rem;
  font-weight: 600;
}

.back {
  margin: 0;
  text-decoration: none;
}

.back .icon {
  width: 2.5rem;
  height: 2.5rem;
}

.container {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.container > img {
  max-width: 100%;
  height: auto;
  display: block;
}

.content {
  display: none;
}

.currency {
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text-dim);
}

.details {
  align-items: center;
  gap: 1rem;
  display: flex;
  padding: 0.75rem 0;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.25rem;
}

.header h1,
.header .timestamp {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.icon {
  fill: currentColor;
  display: block;
}

nav .icon {
  width: 2rem;
  height: 2rem;
}

.invert {
  text-decoration: underline;
}

.invert:hover {
  color: var(--bg);
  background: var(--text);
  opacity: 1;
}

.music {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music:empty {
  display: none;
}

.mute {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  display: none;
}

.mute .icon {
  width: 1rem;
  height: 1rem;
  fill: #fff;
}

.mute.muted .icon-muted,
.mute:not(.muted) .icon-unmuted {
  display: inline;
}

.mute.muted .icon-unmuted,
.mute:not(.muted) .icon-muted {
  display: none;
}

.payment {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 0.75rem 0 1rem;
}

.payment .icon {
  width: 2.5rem;
  height: 2.5rem;
  fill: var(--text);
  flex-shrink: 0;
}

.text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thumbnail {
  aspect-ratio: 1;
  overflow: hidden;
  display: block;
  text-decoration: none;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timestamp {
  font-size: 1rem;
  font-weight: 600;
}

.user {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

/* States */

body[data-post-loaded] .content {
  display: block;
}

body[data-has-audio] .mute {
  display: flex;
}
