:root {
  color-scheme: dark;
  --ink: #f9f4e8;
  --muted: #c8c0b2;
  --paper: #17120e;
  --panel: #080706;
  --stroke: #f9f4e8;
  --hot: #ff4d6d;
  --mint: #18c29c;
  --gold: #ffd166;
  --blue: #4d7cff;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Heavy",
    system-ui, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(255, 77, 109, 0.24) 0 12%, transparent 12% 22%),
    linear-gradient(45deg, rgba(24, 194, 156, 0.22) 0 10%, transparent 10% 24%),
    linear-gradient(115deg, transparent 0 64%, rgba(255, 209, 102, 0.25) 64% 76%, transparent 76%),
    #16100c;
}

button,
img {
  font: inherit;
}

.page-shell {
  min-height: calc(100svh - 44px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.party-board {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  align-items: center;
  gap: 32px;
}

.brand-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.brand-strip span {
  border: 2px solid var(--stroke);
  color: var(--panel);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--panel);
  padding: 8px 10px;
}

.brand-strip span:nth-child(2) {
  background: var(--blue);
  color: var(--ink);
}

.brand-strip span:nth-child(3) {
  background: var(--mint);
}

.brand-strip span:nth-child(4) {
  background: var(--hot);
  color: var(--ink);
}

.hero-copy {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  width: fit-content;
  padding: 8px 12px;
  color: var(--panel);
  background: var(--mint);
  border: 3px solid var(--stroke);
  box-shadow: 6px 6px 0 var(--panel);
  font-size: 1.1rem;
  text-transform: uppercase;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: 5.4rem;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow:
    4px 4px 0 var(--panel),
    8px 8px 0 var(--hot);
}

.tagline {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.6;
  text-transform: uppercase;
}

.meme-panel {
  width: min(100%, 560px);
  justify-self: end;
  border: 5px solid var(--stroke);
  background: var(--panel);
  box-shadow: 14px 14px 0 var(--shadow);
}

.meme-caption {
  min-height: 82px;
  display: grid;
  place-items: center;
  padding: 14px 18px;
  color: #ffffff;
  background: #050505;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  font-size: 2rem;
  line-height: 1.05;
  text-shadow:
    2px 2px 0 #000000,
    -2px 2px 0 #000000,
    2px -2px 0 #000000,
    -2px -2px 0 #000000;
}

.meme-caption-top {
  border-bottom: 5px solid var(--stroke);
}

.meme-caption-bottom {
  border-top: 5px solid var(--stroke);
}

.meme-stage {
  width: 100%;
  height: min(48svh, 470px);
  min-height: 280px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(77, 124, 255, 0.16), transparent 28% 72%, rgba(255, 77, 109, 0.16)),
    #0b0b0b;
}

.meme-gif {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}

.actions {
  grid-column: 2;
  justify-self: end;
  width: min(100%, 560px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.again-button {
  min-height: 46px;
  border: 3px solid var(--stroke);
  color: var(--panel);
  background: var(--gold);
  box-shadow: 6px 6px 0 var(--panel);
  cursor: pointer;
  padding: 8px 20px;
  text-transform: uppercase;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.again-button:hover,
.again-button:focus-visible {
  background: var(--mint);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--panel);
}

.again-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--panel);
}

.refresh-note {
  margin: 0;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.site-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .page-shell {
    min-height: auto;
    padding: 18px;
  }

  .party-board {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  h1 {
    max-width: 12ch;
    font-size: 3.4rem;
    text-shadow:
      3px 3px 0 var(--panel),
      6px 6px 0 var(--hot);
  }

  .meme-panel,
  .actions {
    justify-self: stretch;
    width: 100%;
  }

  .actions {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 14px;
  }

  .brand-strip {
    gap: 8px;
  }

  .brand-strip span {
    flex: 1 1 140px;
    text-align: center;
  }

  h1 {
    font-size: 2.65rem;
  }

  .tagline {
    font-size: 0.86rem;
  }

  .meme-panel {
    border-width: 4px;
    box-shadow: 8px 8px 0 var(--shadow);
  }

  .meme-caption {
    min-height: 68px;
    padding: 10px 12px;
    font-size: 1.36rem;
  }

  .meme-caption-top {
    border-bottom-width: 4px;
  }

  .meme-caption-bottom {
    border-top-width: 4px;
  }

  .meme-stage {
    height: 42svh;
    min-height: 230px;
  }

  .actions {
    align-items: stretch;
  }

  .again-button,
  .refresh-note {
    width: 100%;
    text-align: center;
  }
}

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