:root {
  --tab-layout-width: 72rem;
  --tab-column-gap: clamp(2rem, 7vw, 6rem);
  --tab-left-column-width: 30rem;
  --tab-right-column-width: 26rem;
  --tab-viewer-padding: 1rem;
}

.tab-page-shell {
  align-items: center;
}

.tab-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--tab-left-column-width)) minmax(
      0,
      var(--tab-right-column-width)
    );
  gap: var(--tab-column-gap);
  width: min(100%, var(--tab-layout-width));
  align-items: start;
}

.tab-background {
  max-width: none;
  text-align: left;
}

.go-home-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--title-color);
  font-weight: 500;
  text-decoration: none;
  filter: none;
  opacity: 1;
  transition: filter var(--transition-duration) ease, opacity var(--transition-duration) ease;
}

.go-home-link:hover,
.go-home-link:focus-visible {
  filter: blur(var(--soft-blur)) url("#soft-grain");
  opacity: 0.78;
  outline: none;
}

.tab-hover-item {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.tab-hover-item.page-link {
  filter: none;
  opacity: 1;
}

.tab-hover-item.page-link:hover,
.tab-hover-item.page-link:focus-visible,
.tab-hover-item.page-link.is-active {
  filter: blur(var(--soft-blur)) url("#soft-grain");
  opacity: 0.78;
}

.tab-viewer {
  min-height: 14rem;
  padding: var(--tab-viewer-padding);
  color: var(--ink);
  font-family: Inconsolata, ui-monospace, monospace;
}

.tab-viewer[hidden] {
  display: none;
}

.tab-viewer-title,
.tab-viewer-content {
  margin: 0;
}

.tab-viewer-title {
  margin-bottom: 1rem;
  color: var(--note-color);
  font-family: Inconsolata, ui-monospace, monospace;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.tab-viewer-content {
  max-width: 38ch;
  color: var(--note-text-color);
  line-height: 1.4;
}

.tab-viewer-content:not([hidden]) + .tab-viewer-gallery {
  margin-top: 0.75rem;
}

.tab-viewer-chat {
  display: block;
  width: min(100%, 30rem);
  height: min(38rem, 62vh);
  margin: 0;
  border: var(--note-border-width) dotted var(--note-color);
  border-radius: var(--note-border-radius);
  background: #ffffff;
}

.tab-viewer-spotify {
  display: block;
  width: min(100%, 30rem);
  height: 352px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

body[data-tab="hai"] {
  --tab-layout-width: 80rem;
  --tab-right-column-width: 34rem;
}

body[data-tab="i-go"],
body[data-tab="i-muse"],
body[data-tab="stuf"] {
  --tab-layout-width: 88rem;
  --tab-right-column-width: 44rem;
}

body[data-tab="i-love-music"] {
  --tab-layout-width: 80rem;
  --tab-right-column-width: 34rem;
}

body[data-tab="i-go"] .tab-viewer,
body[data-tab="i-muse"] .tab-viewer,
body[data-tab="stuf"] .tab-viewer {
  overflow: visible;
}

.tab-viewer-gallery {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gallery-photo-scroll {
  display: flex;
  gap: 1rem;
  width: max-content;
  min-width: 100%;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
}

.gallery-photo-item {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: start;
}

.gallery-photo-item img,
.gallery-photo-item iframe.gallery-youtube {
  display: block;
  width: auto;
  max-width: min(40rem, 85vw);
  height: auto;
  max-height: min(52vh, 32rem);
  border: 0;
  border-radius: var(--note-border-radius);
  background: #ffffff;
}

.gallery-photo-item iframe.gallery-youtube {
  width: min(36rem, 85vw);
  height: min(28rem, 50vh);
  background: #000000;
}

.gallery-item-title {
  margin: 0.5rem 0 0;
  color: var(--note-color);
  font-family: Inconsolata, ui-monospace, monospace;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.gallery-text-file {
  width: min(28rem, 80vw);
  max-height: min(52vh, 32rem);
  overflow: auto;
}

.gallery-text-file .home-popup-content {
  white-space: pre-wrap;
}

.gallery-photo-caption {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 1;
  max-width: min(28rem, 80vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-duration) ease,
    visibility var(--transition-duration) ease;
}

.gallery-photo-item:hover .gallery-photo-caption,
.gallery-photo-item:focus-within .gallery-photo-caption {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 48rem) {
  .tab-layout {
    grid-template-columns: 1fr;
  }

  .tab-viewer {
    min-height: auto;
  }
}
