:root {
  --page: #ffffff;
  --text: #1f1f1f;
  --muted: #777777;
  --active: #7bbba8;
  --placeholder: #f1f0ec;
  --placeholder-glint: rgba(0, 0, 0, 0.045);
  --sidebar-left: 80px;
  --sidebar-top: 101px;
  --sidebar-width: 170px;
  font-family: Arial, Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root.is-darkroom {
  --page: #090909;
  --text: #ededed;
  --muted: #8f8f8f;
  --active: #8bcbb9;
  --placeholder: #161616;
  --placeholder-glint: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--page);
  transition: background-color 220ms ease;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--page);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  transition: background-color 220ms ease, color 220ms ease;
}

body.is-darkroom {
  color-scheme: dark;
}

.is-loading .sidebar,
.is-loading .portfolio {
  opacity: 0;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

a {
  text-decoration: none;
}

img {
  display: block;
}

.sidebar,
.portfolio {
  opacity: 1;
  transition: opacity 160ms ease;
}

.is-loading .sidebar,
.is-loading .portfolio {
  opacity: 0;
}

.sidebar {
  position: fixed;
  top: var(--sidebar-top);
  left: var(--sidebar-left);
  z-index: 10;
  width: var(--sidebar-width);
}

.name {
  display: inline-block;
  margin-bottom: 42px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.main-nav {
  display: grid;
  gap: 12px;
  justify-items: start;
  color: var(--text);
}

.main-nav a,
.main-nav button,
.collection-nav button,
.slide-controls button {
  transition: color 160ms ease, opacity 160ms ease;
}

.main-nav .is-active,
.collection-nav .is-active {
  color: var(--active);
}

.main-nav a:hover,
.main-nav button:hover,
.collection-nav button:hover,
.slide-controls button:hover {
  color: var(--active);
}

.collection-nav {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.collection-nav-group,
.nav-actions {
  display: contents;
}

.mobile-nav-label {
  display: none;
}

.mobile-nav-actions {
  display: none;
}

.mobile-bottom-row {
  display: block;
  width: 100%;
}

.photo-stack {
  display: inline-block;
  max-width: 100%;
}

.showcase {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}

.collection-description {
  position: absolute;
  top: 100%;
  right: 0;
  max-width: 220px;
  margin: 17px 0 0;
  color: var(--muted);
  text-align: right;
  white-space: pre-line;
}

.random-photo {
  margin-top: 18px;
  color: var(--muted);
}

.theme-toggle {
  color: var(--muted);
}

.portfolio {
  min-height: 100svh;
}

.slideshow {
  position: relative;
  min-height: 100svh;
  padding: 104px 72px 92px calc(var(--sidebar-left) + var(--sidebar-width) + 62px);
}

.photo-frame {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  position: relative;
  min-height: 120px;
}

.photo-frame img {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 575px;
  height: auto;
  max-height: calc(100svh - 196px);
  object-fit: contain;
  object-position: center top;
  opacity: 1;
  cursor: pointer;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.photo-frame img:not([src]) {
  visibility: hidden;
}

.slide-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 17px;
  width: 100%;
  justify-content: flex-start;
  color: var(--muted);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 160ms ease;
}

.slideshow:hover .slide-controls,
.slide-controls:focus-within {
  opacity: 1;
}

.slide-controls button {
  color: var(--text);
}

@media (max-width: 760px) {
  :root {
    --sidebar-left: 18px;
    --sidebar-top: 56px;
    --sidebar-width: 88px;
  }

  .sidebar {
    position: static;
    width: auto;
    padding: max(var(--sidebar-top), env(safe-area-inset-top)) max(18px, env(safe-area-inset-left)) 0;
  }

  .name {
    margin-bottom: 22px;
  }

  .main-nav {
    display: grid;
    gap: 16px;
    width: 100%;
  }

  .collection-nav-group {
    display: grid;
    gap: 12px;
  }

  .collection-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    max-width: 100%;
    overflow: visible;
    padding-bottom: 4px;
  }

  .collection-nav button {
    flex: 0 0 auto;
    min-height: 28px;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  .random-photo {
    margin-top: 0;
  }

  .nav-actions {
    display: none;
  }

  .mobile-nav-actions {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  .mobile-nav-actions .random-photo,
  .mobile-nav-actions .theme-toggle {
    margin: 0;
  }

  .slideshow {
    min-height: auto;
    padding: 28px max(18px, env(safe-area-inset-left)) 18px max(18px, env(safe-area-inset-right));
  }

  .photo-frame {
    width: 100%;
  }

  .photo-stack {
    display: block;
    width: 100%;
  }

  .showcase {
    display: block;
    width: 100%;
  }

  .collection-description {
    position: static;
    max-width: 100%;
    margin: 18px 0 0;
    text-align: left;
  }

  .photo-frame img {
    width: 100%;
    max-width: 100%;
    max-height: calc(100svh - 190px);
  }

  .slide-controls {
    width: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0;
    opacity: 1;
  }

  .mobile-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0 calc(38px + env(safe-area-inset-bottom));
  }

  .mobile-nav-actions {
    gap: 16px;
    flex-shrink: 0;
  }

  .slide-controls {
    min-width: 0;
    text-align: right;
  }

}
