:root {
  color-scheme: light;
  --ink: #000000;
  --paper: #fffbd1;
  --hot: #ff00cc;
  --acid: #ccff00;
  --aqua: #00ffff;
  --blue: #0000ff;
  --sun: #ffff00;
  --danger: #ff0000;
  --shadow: 6px 6px 0 #000000;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-width: 320px;
  background-color: var(--aqua);
  background-image: url("/static/tile.png");
  background-repeat: repeat;
}

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: "Times New Roman", Arial, "Comic Sans MS", sans-serif;
  line-height: 1.35;
  letter-spacing: 0;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

body.chill-body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--aqua);
  background-image: url("/static/tile.png");
  background-repeat: repeat;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 5;
  transform: translateY(-140%);
  padding: 8px 12px;
  border: 4px outset var(--sun);
  background: var(--acid);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px clamp(10px, 4vw, 36px);
  border-bottom: 8px ridge var(--danger);
  outline: 4px solid var(--blue);
  background: var(--sun);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 5px outset var(--hot);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.brand-text {
  overflow-wrap: anywhere;
  color: var(--blue);
  text-shadow: 2px 2px 0 #ffffff;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.main-nav a,
.loud-link,
.suggest-form button,
.mod-actions button,
.logout-band button {
  min-height: 42px;
  border: 4px outset #ffffff;
  border-radius: 0;
  background: var(--hot);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: Arial, "Comic Sans MS", sans-serif;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.main-nav a {
  padding: 8px 12px;
}

.main-nav a:nth-child(2) {
  background: var(--acid);
}

.main-nav a:nth-child(3) {
  background: var(--aqua);
}

.main-nav a[aria-current="page"] {
  color: #ffffff;
  background: var(--danger);
}

.loud-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px;
  background: var(--danger);
  color: #ffffff;
  font-size: 22px;
}

.main-nav a:hover,
.loud-link:hover,
.suggest-form button:hover,
.mod-actions button:hover,
.logout-band button:hover,
.reaction-form button:hover {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.ad-strip {
  display: flex;
  justify-content: center;
  padding: 12px clamp(12px, 5vw, 64px) 0;
  background-color: var(--aqua);
  background-image: url("/static/tile.png");
  background-repeat: repeat;
}

.ad-banners {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 1480px;
}

.ad-banner {
  display: block;
  flex: 0 1 468px;
  width: 468px;
  max-width: 100%;
  padding: 4px;
  overflow: visible;
  border: 4px solid var(--danger);
  border-radius: 6px;
  background: var(--danger);
  box-shadow: 5px 5px 0 var(--ink);
}

.ad-banner img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2124 / 388;
  border-radius: 3px;
  object-fit: contain;
  background: var(--paper);
}

@media (max-width: 1500px) {
  .ad-banner:nth-child(n + 3) {
    display: none;
  }
}

@media (max-width: 1020px) {
  .ad-banner:nth-child(n + 2) {
    display: none;
  }
}

.ad-banner:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 480px);
  gap: 22px;
  align-items: center;
  min-height: min(700px, calc(100vh - 74px));
  padding: 26px clamp(12px, 5vw, 64px);
  border-bottom: 12px ridge var(--danger);
  background-color: var(--sun);
  background-image: url("/static/tile.png");
  background-repeat: repeat;
}

.hero-copy {
  max-width: 760px;
}

.kicker {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 8px;
  border: 3px dashed var(--ink);
  background: var(--acid);
  color: var(--danger);
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  animation: blink 0.9s steps(2, start) infinite;
}

h1,
h2 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: 0;
}

h1 {
  max-width: min(100%, 9ch);
  padding: 8px;
  border: 6px double var(--ink);
  background: #ffffff;
  color: var(--danger);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 78px;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--sun);
  overflow-wrap: normal;
  word-break: normal;
}

.page-head h1 {
  max-width: min(100%, 14ch);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero h1 {
  max-width: min(100%, 13ch);
}

h2 {
  color: var(--blue);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 48px;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--sun);
}

.hero p:not(.kicker),
.page-head p:not(.kicker) {
  max-width: 760px;
  padding: 8px;
  border: 4px solid var(--ink);
  background: var(--paper);
  font-family: Arial, "Comic Sans MS", sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.hero-sticker {
  width: 100%;
  max-width: 600px;
  height: auto;
  justify-self: center;
  border: 7px ridge var(--blue);
  box-shadow: 12px 12px 0 var(--ink);
  image-rendering: pixelated;
}

.ticker {
  overflow: hidden;
  border-block: 5px solid var(--ink);
  background: var(--danger);
  color: var(--sun);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker span {
  display: inline-block;
  min-width: 100%;
  padding: 8px 0;
  animation: ticker 14s linear infinite;
}

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

@keyframes blink {
  50% {
    visibility: hidden;
  }
}

.content-band,
.submit-band,
.page-head {
  padding: 28px clamp(12px, 5vw, 64px);
}

.content-band {
  background: var(--aqua);
}

.content-band:nth-of-type(odd) {
  background: var(--hot);
}

.submit-band,
.page-head {
  background-color: var(--sun);
  background-image: url("/static/tile.png");
  background-repeat: repeat;
}

.text-page {
  min-height: 58vh;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  border-bottom: 7px double var(--ink);
}

.joke-grid {
  column-gap: 18px;
  columns: 320px;
}

.joke-card {
  display: grid;
  gap: 12px;
  break-inside: avoid;
  min-height: 220px;
  margin: 0 0 18px;
  padding: 14px;
  border: 5px outset #ffffff;
  border-radius: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.mod-joke-item {
  break-inside: avoid;
  display: block;
  margin: 0 0 18px;
}

.mod-joke-item .joke-card {
  margin-bottom: 10px;
}

.joke-card:nth-child(3n + 1) {
  background: #ffffff;
}

.joke-card:nth-child(3n + 2) {
  background: var(--acid);
}

.joke-card:nth-child(3n + 3) {
  background: #ff99dd;
}

.joke-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-family: Arial, "Comic Sans MS", sans-serif;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge,
.joke-author {
  padding: 2px 7px;
  border: 3px solid var(--ink);
  background: var(--sun);
}

.joke-text {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 24px;
  font-weight: 900;
}

.reaction-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  align-self: start;
  margin-top: 2px;
}

.reaction-form {
  margin: 0;
}

.reaction-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 78px;
  min-height: 42px;
  padding: 8px 10px;
  border: 4px outset #ffffff;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
}

.reaction-form button:disabled {
  cursor: wait;
  filter: contrast(160%);
}

.reaction-flash {
  animation: reaction-pop 0.35s steps(2, start);
}

@keyframes reaction-pop {
  50% {
    transform: rotate(-5deg) scale(1.12);
    outline: 5px solid var(--danger);
  }
}

.reaction-row .reaction-form:nth-child(1) button {
  background: var(--sun);
}

.reaction-row .reaction-form:nth-child(2) button {
  background: var(--acid);
}

.reaction-row .reaction-form:nth-child(3) button {
  background: #b875ff;
}

.reaction-form span {
  font-size: 22px;
}

.suggest-form {
  display: grid;
  gap: 10px;
  max-width: 840px;
  padding: 12px;
  border: 5px dotted var(--danger);
  background: var(--paper);
}

.suggest-form label {
  font-family: Arial, "Comic Sans MS", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.suggest-form textarea,
.suggest-form input,
.suggest-form select {
  width: 100%;
  border: 4px inset #ffffff;
  border-radius: 0;
  background: #ffffff;
  padding: 12px;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.28);
}

.suggest-form textarea {
  resize: vertical;
}

.suggest-form button,
.logout-band button {
  justify-self: start;
  padding: 10px 18px;
  background: var(--danger);
  color: #ffffff;
}

.notice,
.empty-state {
  max-width: 840px;
  padding: 12px 14px;
  border: 5px outset #ffffff;
  background: var(--acid);
  box-shadow: var(--shadow);
  font-family: Arial, "Comic Sans MS", sans-serif;
  font-weight: 900;
}

.notice-bad {
  background: #ff9999;
}

.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: -8px;
  margin-bottom: 12px;
}

.mod-actions form,
.logout-band form {
  margin: 0;
}

.mod-actions button {
  padding: 8px 12px;
  background: var(--sun);
}

.mod-actions .danger {
  background: var(--danger);
  color: #ffffff;
}

.site-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(12px, 5vw, 64px);
  border-top: 9px ridge var(--danger);
  background: var(--ink);
  color: #ffffff;
  font-family: Arial, "Comic Sans MS", sans-serif;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chill-page {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 16px;
  color: var(--ink);
  background-color: var(--aqua);
  background-image: url("/static/tile.png");
  background-repeat: repeat;
  animation: chill-fade 0.85s ease-out both;
}

.chill-page h1 {
  max-width: 10ch;
  color: var(--danger);
  text-align: center;
}

.chill-page img {
  display: block;
  width: min(86vw, 420px);
  height: auto;
  max-height: 70vh;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

@keyframes chill-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 761px) {
  .joke-grid > .joke-card:nth-child(2n),
  .mod-joke-item:nth-child(2n) {
    transform: rotate(0.35deg);
  }

  .joke-grid > .joke-card:nth-child(2n + 1),
  .mod-joke-item:nth-child(2n + 1) {
    transform: rotate(-0.35deg);
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .main-nav {
    justify-content: stretch;
  }

  .main-nav a {
    flex: 1 1 130px;
    text-align: center;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  h1 {
    max-width: min(100%, 10ch);
    font-size: 48px;
    text-shadow: 3px 3px 0 var(--ink), -1px -1px 0 var(--sun);
  }

  .page-head h1 {
    max-width: 100%;
  }

  .hero h1 {
    max-width: 100%;
  }

  h2 {
    font-size: 36px;
  }

  .hero p:not(.kicker),
  .page-head p:not(.kicker),
  .joke-text {
    font-size: 20px;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .hero-sticker {
    max-width: 420px;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .ad-banner {
    width: 100%;
    max-width: 468px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker span,
  .kicker,
  .chill-page {
    animation: none;
  }

  .main-nav a:hover,
  .loud-link:hover,
  .suggest-form button:hover,
  .mod-actions button:hover,
  .logout-band button:hover,
  .reaction-form button:hover {
    transform: none;
  }
}
