.ticker {
  overflow: hidden;
  border-bottom: 2px solid #aaa;
  background: #e6dfd2;
  color: #617670;
  white-space: nowrap;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  --ticker-duration: 70s;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll var(--ticker-duration) linear infinite;
}

.ticker-message {
  flex: 0 0 100vw;
  text-align: center;
  padding: 0.4rem 1rem;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.links-intro {
  text-align: center;
  margin: 0 0 0.6rem;
}

/* base */
body {
  margin: 10;
  font-family: "Serif", monospace;
  color: #617670;
  padding-top: 2.2rem;
  background: url("assets/bg.png") top center / cover no-repeat;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -30%;
  background: url("assets/pattern.png") center / 400px repeat;
  background-position: 0 0;
  transform: rotate(30deg) scale(1.15);
  transform-origin: center;
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
  animation: pattern-slide 180s linear infinite;
}

@keyframes pattern-slide {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 900px;
  }
}

/* floating nav */
.floating-nav {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0.7rem;
  border: 2px solid #aaa;
  background: #e6dfd2;
  backdrop-filter: blur(2px);
  font-size: 14px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.floating-nav a {
  color: #617670;
  text-decoration: none;
  border: 1px solid #333;
  padding: 0.25rem 0.4rem;
  background: rgba(230, 223, 210, 0.08);
}

.floating-nav a:hover {
  background: rgba(230, 223, 210, 0.18);
  text-decoration: underline;
}

/* top bar */
.top {
  text-align: center;
  padding: 1rem 0;
  border-bottom: 1px solid #333;
}

.tagline {
  margin: 0;
  font-size: 13px;
}

/* frame */
.frame {
  max-width: 760px;
  margin: 0 auto;
  margin-bottom: 2rem;
  padding: 5rem 1.5rem;
  background: #e6dfd2;
  border: 2px solid #aaa;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 1;
}

/* ascii */
.ascii-section {
  text-align: left;
  margin-bottom: 1.5rem;
}

pre.ascii {
  color: #617670;
  font-size: 12px;
  line-height: 1.1;
  font-variant-ligatures: none;
  white-space: pre;
  margin: 0;
}

/* links */
.links {
  text-align: center;
  margin-bottom: 2rem;
}

.links a {
  text-decoration: none;
  color: #617670;
  margin: 0 0.3rem;
}

.links a:hover {
  text-decoration: underline;
}

/* content blocks */
.block {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  scroll-margin-top: 4rem;
}

h2 {
  margin-top: 0;
  font-size: 18px;
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 10px;
  gap: 1.2rem;
  grid-auto-flow: dense;
}

.tile {
  --offset: 0px;
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid #333;
  background: #1f1f1f;
  text-decoration: none;
  color: #617670;
  transform: translateY(var(--offset));
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

.tile.landscape {
  grid-column: span 3;
}

.tile.portrait {
  grid-column: span 2;
}

.tile.square {
  grid-column: span 2;
}

.tile.featured {
  grid-column: 1 / span 4;
  grid-row-start: 1;
  --offset: 0px;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.15) contrast(1.05);
  transition:
    transform 300ms ease,
    filter 300ms ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.65)
  );
  opacity: 0;
  transition: opacity 200ms ease;
}

.tile-label {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.6rem;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbb;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
  z-index: 1;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(calc(var(--offset) - 6px)) scale(1.01);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.05);
  filter: grayscale(0) contrast(1.1) saturate(1.1);
}

.tile:hover::after,
.tile:focus-visible::after,
.tile:hover .tile-label,
.tile:focus-visible .tile-label {
  opacity: 1;
}

.tile:hover .tile-label,
.tile:focus-visible .tile-label {
  transform: translateY(0);
}

.tile:nth-child(2n) {
  --offset: 6px;
}

.tile:nth-child(3n) {
  --offset: -4px;
}

/* lightbox */
.no-scroll {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: #1f1f1f;
  border: 1px solid #333;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 1rem;
}

.lightbox-figure {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.lightbox-figure img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid #333;
  background: #111;
}

.lightbox-meta h3 {
  margin: 0 0 0.5rem;
  font-size: 16px;
}

.lightbox-meta p {
  margin: 0 0 0.8rem;
  font-size: 13px;
  color: #617670;
}

.lightbox-link {
  display: inline-block;
  border: 1px solid #bbb;
  padding: 0.4rem 0.7rem;
  color: #617670;
  text-decoration: none;
  background: #2a2a2a;
}

.lightbox-link:hover {
  background: #3a3a3a;
}

/* panels */
.panel {
  border: 1px solid #333;
  padding: 1rem;
}

h3 {
  margin-top: 0;
  font-size: 14px;
}

/* tags */
.tags span {
  display: inline-block;
  border: 1px solid #333;
  padding: 0.2rem 0.5rem;
  margin: 0.2rem;
  font-size: 12px;
}

.influence-intro {
  margin: 0 0 0.8rem;
}

.influence-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}

.influence-list li {
  line-height: 1.35;
}

.influence-rotator-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem;
  overflow: hidden;
  position: relative;
  transition: height 0.5s ease;
}

.influence-rotator-list li {
  border: 1px solid #333;
  padding: 0.65rem;
  background: rgba(230, 223, 210, 0.35);
}

.influence-rotator-list li.is-current,
.influence-rotator-list li.is-next {
  position: absolute;
  inset: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.influence-rotator-list li.is-next {
  transform: translateY(110%);
  opacity: 0;
}

.influence-rotator-list.is-sliding li.is-current {
  transform: translateY(-110%);
  opacity: 0;
}

.influence-rotator-list.is-sliding li.is-next {
  transform: translateY(0);
  opacity: 1;
}

.influence-list a {
  color: #617670;
}

.influence-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 12px;
  opacity: 0.8;
}

.more-influences {
  margin-bottom: 1rem;
}

.more-influences summary {
  cursor: pointer;
  color: #617670;
  margin-bottom: 0.75rem;
}

.more-influences[open] summary {
  margin-bottom: 0.55rem;
}

@media (max-width: 700px) {
  .influence-rotator-list li {
    padding: 0.6rem;
  }
}

/* github */
.github-intro {
  margin: 0 0 1rem;
  font-size: 13px;
}

.github-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.repo-card {
  border: 1px solid #333;
  padding: 1rem;
  background: rgba(230, 223, 210, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.repo-thumb {
  border: 1px solid #333;
  background: #1f1f1f;
  height: 160px;
  overflow: hidden;
}

.repo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.1) contrast(1.05);
}

.repo-card p {
  margin: 0;
  font-size: 13px;
}

.repo-link {
  align-self: flex-start;
  border: 1px solid #333;
  padding: 0.3rem 0.6rem;
  text-decoration: none;
  color: #617670;
  background: rgba(230, 223, 210, 0.6);
}

.repo-link:hover {
  text-decoration: underline;
  background: rgba(230, 223, 210, 0.8);
}

/* bandcamp */
.bandcamp-intro {
  margin: 0 0 1rem;
  font-size: 13px;
}

.bandcamp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.bandcamp-embed {
  width: 100%;
  height: 120px;
  border: 1px solid #333;
  background: #111;
}

.bandcamp-embed.tall {
  height: 472px;
}

.bandcamp-placeholder {
  border: 1px dashed #333;
  padding: 1rem;
  font-size: 13px;
  text-align: center;
  color: #617670;
  background: rgba(230, 223, 210, 0.35);
}

/* footer */
.footer {
  text-align: center;
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 12px;
}

/* mobile */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tile.featured {
    grid-column: 1 / span 4;
  }

  .tile.landscape {
    grid-column: span 3;
  }

  .tile.portrait,
  .tile.square {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .floating-nav {
    position: static;
    transform: none;
    margin: 1rem auto 0;
    width: fit-content;
  }

  .gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }

  .tile.featured,
  .tile.landscape,
  .tile.portrait,
  .tile.square {
    grid-column: span 1;
    grid-row-start: auto;
  }

  .tile.featured {
    order: -1;
  }

  .tile {
    transform: none;
  }

  .tile img {
    height: auto;
  }

  .tile::after,
  .tile-label {
    opacity: 1;
  }

  .tile-label {
    transform: translateY(0);
  }

  .lightbox-panel {
    width: min(560px, 92vw);
    padding: 0.8rem;
  }

  .lightbox-figure {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .github-grid {
    grid-template-columns: 1fr;
  }

  pre.ascii {
    font-size: 12px;
  }
}
