html, body {
  background-color: var(--background);
  display: flex;
  flex-direction: row;
  font-family: var(--font);
  margin: 0;
  padding: 0;
  width: 100%;
}

:root {
  --font: "Geist", "Noto Sans JP";
}

body {
  display: flex;
}

.hidden {
  display: none;
}

.sidebar {
  background-color: var(--sidebar);
  border-right: 1px solid var(--accent-2);
  color: var(--sidebar-text);
  height: calc(100vh - 40px);
  padding: 20px;
  view-transition-name: none;
  white-space: nowrap;
  width: 200px;
}

.sidebar-close {
  border-radius: 8px;
  cursor: pointer;
  display: none;
  height: 28px;
  margin-left: 10px;
  padding: 5px;
  width: 28px;
}

.sidebar-close:hover {
  background-color: var(--accent-3);
}

hr {
  border: none;
  border-top: 1px solid var(--accent-2);
  margin: 10px;
}

.sidebar-logo {
  align-items: center;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 28px;
  font-weight: 150;
  gap: 10px;
  letter-spacing: -0.04em;
  padding: 5px;
  transition: background-color 0.1s ease;
}

.sidebar-logo:hover {
  background-color: var(--accent-3);
}

.sidebar-logo svg {
  height: 40px;
  width: 40px;
}

.sidebar-button {
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 200;
  padding: 10px;
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
}

.sidebar-button + .sidebar-button {
  margin-top: 5px;
}

.sidebar-button:hover {
  background-color: var(--accent-3);
  color: var(--accent-1);
}

.sidebar-button svg {
  height: 24px;
  margin-right: 10px;
  vertical-align: -0.3em;
  width: 24px;
  transition: fill 0.1s ease;
}

@media (max-width: 768px) {
  .sidebar {
    padding: 20px 0;
    pointer-events: none;
    position: fixed;
    opacity: 0;
    overflow: hidden;
    transition:
      padding 0.7s cubic-bezier(0.25, 1, 0.5, 1),
      width 0.7s cubic-bezier(0.25, 1, 0.5, 1),
      opacity 0.4s ease;
    width: 0;
    z-index: 2;
  }

  .sidebar.open {
    opacity: 1;
    pointer-events: auto;
    padding: 20px;
    width: 200px;
  }

  .shadow {
    height: 100%;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition:
      backdrop-filter 0.4s ease,
      opacity 0.4s ease;
    width: 100%;
    z-index: 1;
  }

  .sidebar.open + .shadow {
    backdrop-filter: blur(5px);
    background-color: color-mix(
      in srgb,
      var(--accent-1) 10%,
      transparent 90%
    );
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close {
    display: inline;
  }

  .sidebar-logo {
    display: none;
  }
}

.content {
  flex: 1;
  letter-spacing: -0.06em;
}

.main-content {
  padding: 20px;
  view-transition-name: content;
}

::view-transition-old(content) {
  animation: fade-out 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
}

::view-transition-new(content) {
  animation: fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.header {
  align-items: center;
  background-color: var(--sidebar);
  border-bottom: 1px solid var(--accent-2);
  display: none;
  gap: 10px;
  padding: 10px 30px;
  view-transition-name: none;
}

@media (max-width: 768px) {
  .header {
    display: flex;
  }
}

.header-menu {
  border-radius: 8px;
  cursor: pointer;
  display: inline;
  height: 28px;
  padding: 5px;
  width: 28px;
}

.header-menu:hover {
  background-color: var(--accent-3);
}

.header-logo {
  align-items: center;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 28px;
  font-weight: 150;
  gap: 10px;
  letter-spacing: -0.04em;
  padding: 5px;
  transition: background-color 0.1s ease;
}

.header-logo:hover {
  background-color: var(--accent-3);
}

.header-logo svg {
  height: 40px;
  width: 40px;
}

.page-title {
  color: var(--text);
  font-size: 32px;
  font-weight: 100;
  padding: 20px;
}

.deck-item {
  animation: appear 0.3s ease;
  background-color: var(--sidebar);
  border: 1px solid var(--accent-2);
  border-radius: 15px;
  color: var(--text);
  cursor: pointer;
  font-weight: 300;
  padding: 25px;
  position: relative;
  transition: background-color 0.1s ease;
}

@keyframes appear {
  from {
    filter: blur(5px);
    transform: scale(0.97);
  }
}

.deck-item:hover {
  background-color: var(--accent-3);
}

.deck-item-title {
  font-size: 24px;
  font-weight: 150;
  margin: 2px 0 5px 0;
}

.deck-item-desc {
  font-size: 18px;
  margin: 10px 0 20px 0;
}

.deck-item-dots {
  font-size: 14px;
  position: absolute;
  right: 20px;
  top: 20px;
}

.deck-item-dots svg {
  border-radius: 32px;
  fill: var(--sidebar-text);
  height: 32px;
  padding: 5px;
  transition: background-color 0.1s ease;
  width: 32px;
}

.deck-item-dots svg:hover {
  background-color: var(--accent-2);
}

.deck-item-progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.deck-item-progress-bar {
  background-color: var(--background);
  border-radius: 5px;
  height: 5px;
  overflow: hidden;
}

.deck-item-progress-bar-inner {
  animation: grow 0.5s ease;
  animation-delay: 0.2s;
  animation-fill-mode: forwards;
  background-color: var(--accent-1);
  height: 100%;
  opacity: 0;
  width: calc(var(--i) * 100%);
}

@keyframes grow {
  from {
    opacity: 0.6;
    width: 0;
  }

  to {
    opacity: 1;
  }
}