.moments-page {
  --ink: #f4f3ef;
  --muted: #dededb;
  --moment-line: rgb(236 239 243 / 43%);
  --moment-shadow: 0 1px 2px #12171a, 0 1px 7px #12171a;
  min-height: 100svh;
  isolation: isolate;
  background: #212529;
}
.moments-backdrop {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: url("/assets/f04.webp") center / cover no-repeat;
  pointer-events: none;
}
.moments-flurries span {
  top: 0;
  bottom: auto;
  height: var(--size);
  background: #f1f2ef;
  box-shadow: 0 0 4px #d5dde270;
  animation-name: moment-flurry;
  animation-duration: calc(var(--duration) * 1.6);
  animation-delay: calc(var(--delay) * 1.6);
}
@keyframes moment-flurry {
  0% { opacity: 0; transform: translate(8vw, -5vh) scale(.6); }
  18% { opacity: .55; }
  50% { transform: translate(calc(var(--drift) * .3 - 4vw), 46vh) scale(.9); }
  78% { opacity: .32; }
  100% { opacity: 0; transform: translate(calc(var(--drift) * .5 - 17vw), 105vh) scale(.7); }
}
.moments-header {
  position: relative;
  background: transparent;
  backdrop-filter: none;
}
.moments-header .header-row { --reader-glass: #232a31a6; }
.moments-header .brand-mark { background: #252c33; border-color: #c3cbd6; color: #e9eef6; }

.moments-shell {
  width: min(1080px, calc(100% - 48px));
  margin-inline: auto;
  padding: clamp(40px, 7vw, 76px) 0 72px;
  text-shadow: var(--moment-shadow);
}
.moments-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 780px);
  margin: 0 auto 58px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--moment-line);
}
.moments-mark {
  display: grid;
  flex: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 17px;
}
.moments-intro small { font-size: 10px; letter-spacing: .12em; }
.moments-intro h1 { font: 750 36px/1.12 var(--serif); }
.moments-intro p { margin-inline-start: 16px; color: var(--muted); }
#moments-count { margin-inline-start: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
#moments-status { text-align: center; }

.moment-group + .moment-group { margin-top: 48px; }
.moment-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 28px 28px;
  font: 700 18px var(--serif);
}
.moment-day small { font: 700 10px var(--sans); letter-spacing: .11em; }
.moment-day::after { content: ""; flex: 1; height: 1px; background: var(--moment-line); }
.moment-stack { margin: 0; padding: 0; list-style: none; }
.moment-item {
  position: relative;
  width: 85%;
  margin-inline-end: auto;
  --tilt: -.75deg;
}
.moment-item:nth-child(even) {
  --tilt: .75deg;
  margin-inline: auto 0;
}
.moment-item + .moment-item { margin-top: -19px; }
.moment-item:is(:hover, :focus-within) { z-index: 1; }
.moment-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 158px;
  gap: 12px;
  padding: 16px 26px 32px;
  border: 1px solid var(--moment-line);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: start;
  text-shadow: inherit;
  transform: rotate(var(--tilt));
}
.moment-card:is(:hover, :focus-visible) { border-color: #fff; }
.moment-item.is-linked .moment-card { border-color: #fff; box-shadow: 0 0 18px #e0e5ed40; }
.moment-number {
  position: absolute;
  top: -11px;
  inset-inline-start: 24px;
  padding-inline: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
}
.moment-item:nth-child(even) .moment-number { inset-inline: auto 24px; }
.moment-time { justify-self: end; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.moment-excerpt {
  display: -webkit-box;
  overflow: hidden;
  font: 600 17px/1.7 var(--serif);
  overflow-wrap: anywhere;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.moment-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--moment-line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

html:has(.moment-dialog[open]) { overflow: hidden; }
.moment-dialog {
  --detail-muted: #b9bfbd;
  --detail-line: rgb(210 217 213 / 25%);
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--detail-line);
  border-top: 3px solid #777e7b;
  border-radius: 9px;
  background: linear-gradient(145deg, #343838, #202425);
  color: #f1f1ed;
  box-shadow: 0 22px 70px #10161a80;
}
.moment-dialog::backdrop { background: transparent; }
.moment-dialog-head { display: flex; align-items: center; gap: 12px; }
.moment-dialog-head h2 { font: 750 20px var(--serif); }
.moment-dialog-head time { color: var(--detail-muted); font-size: 12px; }
.moment-dialog-head form { margin-inline-start: auto; }
.moment-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--detail-line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 22px;
}
.moment-close:hover { background: rgb(226 233 230 / 12%); }
.moment-content {
  margin-block: 26px 32px;
  font: 17px/1.95 var(--serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.moment-dialog-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--detail-muted);
  font-size: 10px;
  letter-spacing: .08em;
}
.moment-dialog-foot::before { content: ""; order: 1; flex: 1; height: 1px; background: var(--detail-line); }
#moment-detail-number { order: 2; }
@media (prefers-reduced-motion: no-preference) {
  .moment-card { transition: transform 220ms ease, border-color 220ms ease; }
  .moment-card:focus-visible { transform: translateY(-4px) rotate(0); }
  @keyframes moment-open {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
  }
  .moment-dialog[open] { animation: moment-open 220ms ease-out; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .moment-card:hover { transform: translateY(-5px) rotate(0); }
}
@media (max-width: 640px) {
  .moments-shell { width: calc(100% - 28px); }
  .moments-intro { flex-wrap: wrap; margin-bottom: 40px; }
  .moments-intro p { order: 1; width: 100%; margin-inline-start: 0; }
  .moment-day { margin-inline: 8px; }
  .moment-item { width: 96%; }
  .moment-card { padding-inline: 14px; }
}
