:root {
  --paper: #F5E9C9;
  --paper-deep: #EFDFB4;
  --ink: #16130D;
  --red: #E63417;
  --red-deep: #B8240C;
  --line: #16130D;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--red);
  color: var(--paper);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

/* HEADER */
header {
  border-bottom: 3px solid var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo {
  font-family: 'Unbounded';
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.logo b {
  color: var(--red);
}

.nav small {
  font-family: 'Unbounded';
  font-weight: 400;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.65;
}

/* HERO */
.hero {
  padding: 64px 0 52px;
  border-bottom: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-family: 'Unbounded';
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero p {
  margin-top: 22px;
  font-size: 1.12rem;
  max-width: 46ch;
  font-weight: 500;
}

.hero .hint {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Unbounded';
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 2px solid var(--ink);
  padding: 9px 15px;
  border-radius: 40px;
}

.hint .dot {
  width: 9px;
  height: 9px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.7);
    opacity: 0.4;
  }
}

/* CATEGORY BAR */
.cats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 26px 0;
  border-bottom: 3px solid var(--ink);
}

.cat-btn {
  font-family: 'Unbounded';
  font-weight: 600;
  font-size: 0.82rem;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}

.cat-btn:hover {
  background: var(--paper-deep);
}

.cat-btn.active {
  background: var(--ink);
  color: var(--paper);
}

.cat-btn .count {
  font-size: 0.65rem;
  opacity: 0.6;
}

/* GRID */
.grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 40px 0 30px;
  max-width: 800px;
}

.joke-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 30px 20px;
  border-bottom: 4px dashed var(--ink);
}

.joke-card:last-child {
  border-bottom: none;
}

.joke-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid rgba(22, 19, 13, 0.2);
}

.joke-share {
  font-family: 'Unbounded';
  font-weight: 600;
  font-size: 0.8rem;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}

.joke-share:hover {
  background: var(--ink);
  color: var(--paper);
}

/* BUBBLES */
.joke-bubbles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  border: 3px solid var(--ink);
  background: var(--paper);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 4px 0 var(--ink);
  transition: all 0.15s;
  position: relative;
  max-width: 75%;
}

.bubble-story {
  background: var(--paper);
}

.bubble-dialog-odd {
  background: #E8D4B8;
}

.bubble-dialog-even {
  background: #D9C9A8;
}

.bubble-left {
  margin-right: auto;
  border-radius: 4px 18px 18px 18px;
}

.bubble-right {
  margin-left: auto;
  border-radius: 18px 4px 18px 18px;
}

.bubble:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.bubble-tag {
  font-family: 'Unbounded';
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.6;
  margin-bottom: 10px;
  font-weight: 600;
}

.bubble-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
}

.bubble-dialog-odd .bubble-text,
.bubble-dialog-even .bubble-text {
  font-size: 1.1rem;
  font-style: italic;
  opacity: 0.85;
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 30px 0 20px;
  flex-wrap: wrap;
}

.pagination a {
  font-family: 'Unbounded';
  font-weight: 600;
  font-size: 0.78rem;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}

.pagination a:hover {
  background: var(--paper-deep);
}

.pagination a.active {
  background: var(--ink);
  color: var(--paper);
}

.pagination a:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination .info {
  font-family: 'Unbounded';
  font-size: 0.75rem;
  opacity: 0.7;
  margin: 0 10px;
}

.cats-link {
  display: flex;
  justify-content: center;
  padding: 30px 0 20px;
}

/* FOOTER */
footer {
  border-top: 3px solid var(--ink);
  padding: 40px 0;
  margin-top: 30px;
}

.foot-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

footer .logo {
  font-size: 1.1rem;
}

footer small {
  font-size: 0.8rem;
  opacity: 0.6;
  max-width: 40ch;
}

/* MISC */
.empty {
  padding: 60px 0;
  text-align: center;
  font-family: 'Unbounded';
  font-weight: 600;
  opacity: 0.5;
}

.all-cats-btn {
  font-family: 'Unbounded';
  font-weight: 600;
  font-size: 0.78rem;
  background: var(--red);
  border: 2px solid var(--red);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
  margin-left: 10px;
}

.all-cats-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* CATEGORIES GRID */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 40px 0;
}

.cat-card {
  border: 2px solid var(--ink);
  padding: 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
  background: var(--paper);
  font-family: 'Unbounded';
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cat-card:hover {
  background: var(--ink);
  color: var(--paper);
}

.cat-card .count {
  font-size: 0.65rem;
  opacity: 0.6;
  font-weight: 400;
}

.back-btn {
  font-family: 'Unbounded';
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  padding: 9px 16px;
  border-radius: 40px;
  display: inline-block;
  margin: 30px 0 0;
}

.back-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.section-title {
  font-family: 'Unbounded';
  font-weight: 800;
  font-size: 1.6rem;
  padding: 40px 0 0;
}
