:root {
  --sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Georgia, Times, serif;
  --branding: #cd212a;
  --liked: #01a7fe;
  --shared: #ff7b3a;
  --category: #21c5cd;
  --base: hsl(220, 11%, 11%);
  --text: hsl(210, 9%, 97%);
  --accent: hsl(0, 0%, 60%);
  --hover: rgba(255, 255, 255, 0.05);
}

@view-transition {
  navigation: auto;
}

@keyframes move-out {
  to {
    transform: translateX(-25%);
    opacity: 0;
  }
}

@keyframes move-in {
  from {
    transform: translateX(25%);
    opacity: 0;
  }
}

::view-transition-old(root) {
  animation: 200ms ease-in-out both move-out;
}

::view-transition-new(root) {
  animation: 200ms ease-in-out both move-in;
}

* {
  user-select: none;
  scrollbar-width: thin;
}

html {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: var(--sans-serif);
  background: var(--base);
  font-size: 1.625rem;
  color: var(--text);
  transition: background-color 1s ease;
}

body.view-category {
  overflow: hidden;
}

body::after {
  content: "";
  position: absolute;
  width: 100%;
  background: var(--branding);
  top: 0;
  height: 10px;
  left: 0;
}

::selection {
  background: var(--text);
  color: var(--base);
}

nav {
  position: fixed;
  display: flex;
  flex-direction: column;
  z-index: 1;
  text-align: center;
  max-height: 100vh;
  overflow-y: auto;
  width: 100%;
  background: var(--base);
  min-height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  transition: opacity 0.3s ease;
}

body.view-category nav {
  pointer-events: auto;
  opacity: 1;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  flex: 1;
  min-height: 35px;
  transition: color 0.3s ease;
}

nav a:first-child {
  margin-top: 200px;
}

nav a:last-child {
  margin-bottom: 200px;
}

nav a:hover {
  color: var(--text);
}

button {
  width: 40px;
  height: 40px;
  margin: auto;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  fill: var(--text);
  user-select: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
}

button.category {
  position: absolute;
  left: 20px;
  top: 30px;
  z-index: 2;
}

body.view-category .category {
  position: fixed;
  fill: var(--branding);
}

button.refresh {
  position: absolute;
  right: 20px;
  top: 30px;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

button.refresh.active {
  pointer-events: auto;
  opacity: 1;
}

button.refresh.active svg {
  animation: attention 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

button.top {
  position: fixed;
  right: 20px;
  bottom: 50%;
  transform: translateY(50%);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

button.top.active {
  pointer-events: auto;
  opacity: 1;
}

button svg {
  width: 16px;
  height: 16px;
}

main {
  max-width: 33em;
  margin: 0 auto;
  padding: 3em 1em;
  display: flex;
  flex-direction: column;
}

header {
  padding: 8px 0;
  margin: auto auto 25px auto;
}

header a {
  color: var(--accent);
  font-size: 0.75em;
  padding: 6px 12px;
  border-top: none;
  white-space: nowrap;
  text-decoration: none;
}

header a:hover {
  background: var(--hover);
}

#updated {
  text-transform: uppercase;
  font-size: 0.6em;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-align: center;
  margin: 2em 0 0 0;
}

.search {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin: 20px 0 0 0;
}

.search input {
  width: 100%;
  border: none;
  font-size: 0.9em;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: var(--sans-serif);
  text-align: center;
  padding: 30px 0px;
  background: transparent;
  color: var(--text);
  transition: background-color 0.3s ease;
}

.search input:hover,
.search input:focus {
  background: var(--hover);
}

.noResults {
  display: none;
  border-top: 0.5px solid var(--text);
  padding: 2em 1em;
  justify-content: center;
}

section a {
  position: relative;
  text-decoration: none;
  color: var(--text);
  padding: 2em 1em;
  gap: 1em;
  display: flex;
  flex-direction: column;
  border-top: 0.5px solid var(--accent);
  transition: background-color 0.3s ease;
}

section a:hover {
  background: var(--hover);
}

h1 {
  width: fit-content;
  margin: auto;
  font-family: var(--serif);
  font-size: 2em;
  font-weight: 400;
  line-height: 1.2em;
  text-align: center;
  cursor: pointer;
}

h1 span {
  color: var(--branding);
}

h2 {
  font-family: var(--serif);
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1.2em;
  margin: 0;
  border-left: 2px solid var(--highlight);
  padding-left: 10px;
}

section a:first-child h2 {
  font-size: 1.6em;
}

.metadata {
  font-size: 0.7em;
  display: flex;
  justify-content: space-between;
  color: var(--accent);
}

span {
  text-transform: capitalize;
}

.ad {
  font-size: 0.7em;
  color: var(--accent);
  font-family: var(--sans-serif);
  text-transform: uppercase;
  text-align: center;
  user-select: none;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.5s ease;
}

@keyframes attention {
  0% {
    transform: rotate(0deg);
    fill: var(--text);
  }
  30% {
    transform: rotate(180deg);
    fill: var(--branding);
  }
  70% {
    transform: rotate(180deg);
    fill: var(--branding);
  }
  100% {
    transform: rotate(360deg);
    fill: var(--text);
  }
}

@media (min-width: 2560px) {
  body {
    font-size: 1.5rem;
  }
}

@media (max-width: 1920px) {
  body {
    font-size: 1.375rem;
  }
}

@media (max-width: 1680px) {
  body {
    font-size: 1.25rem;
  }
}

@media (max-width: 1280px) {
  body {
    font-size: 1.125rem;
  }
}

@media (max-width: 1024px) {
  body {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 0.875rem;
  }
}

@media (max-width: 275px) {
  body {
    font-size: 0.75rem;
  }
}
