:root {
  color-scheme: dark;
  --paper: 244, 235, 232;
  --rose: 221, 153, 169;
  --rose-deep: 185, 96, 121;
  --cream: 252, 245, 238;
  --muted: 164, 149, 155;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #100d0f;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: rgb(var(--paper));
  background:
    radial-gradient(circle at 15% 18%, rgba(126, 65, 83, .13), transparent 27%),
    radial-gradient(circle at 82% 70%, rgba(139, 100, 89, .1), transparent 28%),
    linear-gradient(145deg, #100d0f, #1a1518 50%, #0d0b0d);
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.76' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient__glow {
  position: absolute;
  border: 1px solid rgba(var(--rose), .08);
  border-radius: 50%;
  animation: float 14s ease-in-out infinite alternate;
}

.ambient__glow--one {
  top: -24vw;
  left: -18vw;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(var(--rose-deep), .09), transparent 66%);
}

.ambient__glow--two {
  right: -25vw;
  bottom: -27vw;
  width: 60vw;
  height: 60vw;
  animation-delay: -7s;
}

.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(calc(100% - 40px), 1180px);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 auto;
  padding: 28px 0;
  border-bottom: 1px solid rgba(var(--paper), .07);
}

.back-link,
.owner-button {
  color: rgba(var(--paper), .45);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-decoration: none;
  text-transform: uppercase;
}

.back-link {
  justify-self: start;
  transition: color .2s, transform .2s;
}

.back-link span {
  margin-right: 7px;
  color: rgb(var(--rose));
}

.back-link:hover {
  color: rgb(var(--cream));
  transform: translateX(-2px);
}

.site-mark {
  margin: 0;
  color: rgba(var(--paper), .28);
  font-family: Consolas, monospace;
  font-size: 8px;
  letter-spacing: .25em;
}

.owner-button,
.text-button {
  justify-self: end;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: color .2s;
}

.owner-button:hover,
.text-button:hover {
  color: rgb(var(--rose));
}

.memes-page {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto;
}

.hero {
  position: relative;
  padding: clamp(60px, 9vw, 120px) 0 clamp(55px, 8vw, 100px);
}

.eyebrow {
  margin: 0 0 18px;
  color: rgb(var(--rose));
  font-family: Consolas, monospace;
  font-size: 8px;
  letter-spacing: .2em;
}

.hero h1 {
  margin: 0;
  color: rgb(var(--cream));
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(62px, 12vw, 150px);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .77;
}

.hero h1 em {
  color: rgba(var(--paper), .3);
  font-weight: 400;
}

.hero h1 span {
  color: rgb(var(--rose));
}

.hero-copy {
  margin: 28px 0 0 8px;
  color: rgba(var(--paper), .44);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 1.5vw, 15px);
  font-style: italic;
}

.hero-line {
  position: absolute;
  right: 0;
  bottom: 26%;
  width: 29%;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--rose), .36), transparent);
}

.admin-panel {
  margin-bottom: 65px;
  padding: 22px;
  border: 1px solid rgba(var(--rose), .15);
  border-radius: 24px;
  background: rgba(255, 255, 255, .028);
  box-shadow: 0 25px 65px rgba(0, 0, 0, .18);
  backdrop-filter: blur(20px);
}

.admin-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-panel__heading small,
.admin-panel__heading strong {
  display: block;
}

.admin-panel__heading small {
  margin-bottom: 5px;
  color: rgb(var(--rose));
  font-size: 7px;
  letter-spacing: .2em;
}

.admin-panel__heading strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.text-button {
  color: rgba(var(--paper), .35);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(200px, 1fr) auto;
  gap: 12px;
}

.drop-zone {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  border: 1px dashed rgba(var(--paper), .15);
  border-radius: 15px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}

.drop-zone.is-over,
.drop-zone:hover {
  border-color: rgba(var(--rose), .5);
  background: rgba(var(--rose), .045);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-zone__icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: rgb(var(--rose));
  border: 1px solid rgba(var(--rose), .18);
  border-radius: 10px;
  background: rgba(var(--rose), .06);
  font-size: 19px;
  font-weight: 300;
}

.drop-zone strong,
.drop-zone small {
  display: block;
}

.drop-zone strong {
  max-width: 270px;
  overflow: hidden;
  color: rgba(var(--paper), .72);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone small {
  margin-top: 5px;
  color: rgba(var(--paper), .28);
  font-size: 8px;
}

.caption-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid rgba(var(--paper), .09);
  border-radius: 15px;
  background: rgba(255, 255, 255, .02);
}

.caption-field span {
  color: rgba(var(--paper), .3);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.caption-field input {
  min-width: 0;
  padding: 8px 0;
  color: rgb(var(--paper));
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.caption-field input::placeholder {
  color: rgba(var(--paper), .2);
}

.upload-button,
.login-dialog form button {
  padding: 0 24px;
  color: #261c20;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, rgb(var(--cream)), rgb(var(--rose)));
  box-shadow: 0 10px 27px rgba(var(--rose-deep), .16);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}

.upload-button:hover,
.login-dialog form button:hover {
  box-shadow: 0 13px 34px rgba(var(--rose-deep), .25);
  transform: translateY(-1px);
}

.upload-button:disabled {
  cursor: wait;
  opacity: .55;
}

.upload-progress {
  height: 2px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(var(--paper), .07);
}

.upload-progress span {
  display: block;
  width: 30%;
  height: 100%;
  background: rgb(var(--rose));
  animation: progress 1.1s ease-in-out infinite alternate;
}

.gallery-section {
  padding-bottom: 80px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(var(--paper), .07);
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
}

.section-heading span {
  color: rgba(var(--paper), .28);
  font-family: Consolas, monospace;
  font-size: 8px;
}

.gallery {
  columns: 3 280px;
  column-gap: 16px;
}

.meme-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid rgba(var(--paper), .08);
  border-radius: 19px;
  background: rgba(255, 255, 255, .025);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  break-inside: avoid;
  opacity: 0;
  transform: translateY(15px);
  animation: item-enter .6s cubic-bezier(.16, 1, .3, 1) forwards;
}

.meme-card img,
.meme-card video {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: cover;
  background: #0a090a;
}

.meme-card video {
  min-height: 180px;
}

.meme-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
}

.meme-card__meta p {
  margin: 0;
  color: rgba(var(--paper), .68);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.4;
}

.meme-card__meta time {
  display: block;
  margin-top: 5px;
  color: rgba(var(--paper), .25);
  font-family: Consolas, monospace;
  font-size: 7px;
}

.delete-button {
  flex: 0 0 auto;
  padding: 4px 0;
  color: rgba(var(--paper), .3);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s;
}

.delete-button:hover {
  color: #ef8d9e;
}

.empty-state,
.server-notice {
  padding: 75px 20px;
  color: rgba(var(--paper), .4);
  border: 1px dashed rgba(var(--paper), .09);
  border-radius: 22px;
  text-align: center;
}

.empty-state > span {
  color: rgb(var(--rose));
}

.empty-state p {
  margin: 12px 0 6px;
  color: rgba(var(--paper), .65);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.empty-state small,
.server-notice p {
  color: rgba(var(--paper), .28);
  font-size: 9px;
}

.server-notice strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 400;
}

.server-notice code {
  color: rgb(var(--rose));
}

.loading {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 70px 0;
}

.loading span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(var(--rose));
  animation: loading .8s ease-in-out infinite alternate;
}

.loading span:nth-child(2) { animation-delay: .18s; }
.loading span:nth-child(3) { animation-delay: .36s; }

.site-footer {
  display: flex;
  width: min(calc(100% - 40px), 1180px);
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 0 auto;
  padding: 24px 0 35px;
  color: rgba(var(--paper), .2);
  border-top: 1px solid rgba(var(--paper), .06);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  font-style: italic;
  letter-spacing: .08em;
}

.site-footer span:nth-child(2) {
  color: rgba(var(--rose), .55);
  font-style: normal;
}

.login-dialog {
  width: min(calc(100% - 32px), 390px);
  padding: 28px;
  color: rgb(var(--paper));
  border: 1px solid rgba(var(--paper), .12);
  border-radius: 25px;
  outline: 0;
  background: rgba(23, 19, 22, .96);
  box-shadow: 0 35px 100px rgba(0, 0, 0, .65);
  backdrop-filter: blur(25px);
}

.login-dialog::backdrop {
  background: rgba(7, 6, 7, .7);
  backdrop-filter: blur(7px);
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 17px;
  padding: 0;
  color: rgba(var(--paper), .35);
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 20px;
}

.login-dialog h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.login-dialog > p:not(.eyebrow) {
  margin: 12px 0 22px;
  color: rgba(var(--paper), .38);
  font-size: 10px;
  line-height: 1.6;
}

.login-dialog form label span {
  display: block;
  margin-bottom: 7px;
  color: rgba(var(--paper), .35);
  font-size: 8px;
}

.login-dialog form input {
  width: 100%;
  padding: 12px;
  color: rgb(var(--paper));
  border: 1px solid rgba(var(--paper), .11);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, .035);
}

.login-dialog form input:focus {
  border-color: rgba(var(--rose), .45);
}

.login-dialog form button {
  width: 100%;
  margin-top: 11px;
  padding: 13px;
}

.form-message {
  display: block;
  min-height: 14px;
  margin-top: 10px;
  color: #ee899a;
  font-size: 9px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  max-width: calc(100% - 30px);
  padding: 10px 14px;
  color: rgba(var(--paper), .8);
  border: 1px solid rgba(var(--paper), .1);
  border-radius: 12px;
  background: rgba(20, 17, 20, .94);
  box-shadow: 0 15px 40px rgba(0, 0, 0, .4);
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 9px);
  transition: opacity .25s, transform .25s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

@keyframes float {
  to { transform: translate3d(2%, 2%, 0) scale(1.04); }
}

@keyframes item-enter {
  to { opacity: 1; transform: none; }
}

@keyframes loading {
  to { opacity: .25; transform: translateY(-4px); }
}

@keyframes progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(330%); }
}

@media (max-width: 760px) {
  .site-header,
  .memes-page,
  .site-footer {
    width: min(calc(100% - 28px), 1180px);
  }

  .site-mark {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    padding: 72px 0 65px;
  }

  .hero h1 {
    line-height: .83;
  }

  .hero h1 em {
    display: block;
    margin-left: 14%;
  }

  .hero-line {
    display: none;
  }

  .upload-form {
    grid-template-columns: 1fr;
  }

  .upload-button {
    min-height: 49px;
  }

  .gallery {
    columns: 2 150px;
    column-gap: 10px;
  }

  .meme-card {
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .meme-card__meta {
    padding: 10px;
  }
}

@media (max-width: 430px) {
  .gallery {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
