:root {
  --bg: #0f1115;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f2ea;
  --muted: #f6f2ea;
  --accent: #4b6f96;
  --accent-strong: #728ca9;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 18px;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Figtree", sans-serif;
  background:
    linear-gradient(rgba(8, 10, 14, 0.48), rgba(8, 10, 14, 0.74)),
    url("images/backgrounds/desktop view.JPG")
      center / cover no-repeat fixed;
}

.background-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(243, 199, 122, 0.1), transparent 35%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: calc(100vh - 56px);
}

.hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: "Kings", serif;
  font-size: clamp(3.1rem, 7.2vw, 5.8rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.title-accent {
  display: inline-block;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.1em;
}

.category-toggle {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.toggle-btn,
.shuffle-btn {
  border: 0;
  cursor: pointer;
  transition: color 180ms ease, opacity 180ms ease, border-color 180ms ease;
  font-family: inherit;
}

.toggle-btn {
  padding: 3px 3px 3px 3px;
  /* border: 1.5px solid transparent; */
  background:rgba(58, 69, 92, 0.48);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.76;
}

.toggle-btn:hover,
.toggle-btn:focus-visible {
  color: var(--text);
  opacity: 1;
  outline: none;
}

.toggle-btn.is-active {
  color: var(--text);
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.7);
  color: #4b6f96;
}

.card {
  display: grid;
  grid-template-columns: minmax(150px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.media-wrap {
  position: relative;
  min-height: 420px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.media-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.media-wrap img:not([src]),
.media-wrap img[src=""] {
  opacity: 0;
}

.content-wrap {
  display: grid;
  gap: 2px;
}

.item-tag {
  width: fit-content;
  padding: 0;
  color: var(--accent-strong);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 18px;
}

.content-wrap h2 {
  margin: 0;
  padding: 0 18px;
  font-family: "Figtree", serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
}

.item-title,
.item-creator,
.item-description {
  margin: 0;
  text-align: left;
  padding: 0px 18px;
}

.item-creator {
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 1rem;
}

.item-description {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.72;
  max-width: 46ch;
}

.footer-actions {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

.shuffle-btn {
  min-width: 120px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: "Kings", serif;
  font-size: 2.2rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  transition: transform 0ms, color 120ms ease;
}

.shuffle-btn:hover,
.shuffle-btn:focus-visible {
  outline: none;
  color: var(--accent-strong);
}

.shuffle-btn:active {
  transform: translateY(2px) scale(0.98);
}

@media (max-width: 820px) {
  body {
    padding: 20px 14px 28px;
    background:
      linear-gradient(rgba(8, 10, 14, 0.48), rgba(8, 10, 14, 0.74)),
      url("images/backgrounds/mobile view.JPG") center / cover no-repeat scroll;
  }

  .page-shell {
    gap: 18px;
    min-height: calc(100vh - 48px);
  }

  .card {
    grid-template-columns: 1fr;
    gap: 6px;
    height: 540px;
  }

  .media-wrap {
    min-height: 0;
    width: min(62vw, 220px);
    justify-self: center;
    background: transparent;
  }

  .media-wrap img {
    height: auto;
    object-fit: contain;
  }

  .category-toggle {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: center;
    gap: 12px 16px;
  }

  .content-wrap {
    justify-items: center;
    text-align: center;
  }

  .item-tag {
    display: none;
  }

  .content-wrap h2 {
    padding: 0 22px;
    font-size: clamp(1.9rem, 6.2vw, 2.15rem);
  }

  h1 {
    font-size: clamp(2.35rem, 10vw, 3.2rem);
  }

  .item-creator {
    text-align: center;
  }

  .item-description {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.72;
    max-width: 46ch;
    text-align: center;
    padding-top: 15px;
  }

  .shuffle-btn {
    width: 100%;
    padding-bottom: 20px;
    padding-top: 0px;
  }
}
