html {
  overflow-y: scroll;
  scroll-behavior: smooth;
  color-scheme: only light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #000 url('/bg/bg04.gif') repeat;
  color: #000;
  font-family: sans-serif;
  font-size: 100%;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

/* Hide raw content until shell mounts — avoids chrome flash */
body[data-page]:not(.layout-ready) #main-content {
  visibility: hidden;
}

img {
  max-width: 100%;
  height: auto;
  color: #000;
  border: 0;
}

a {
  color: #000;
}

a:hover {
  color: #f00;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: Courier, 'Courier New', monospace;
  font-weight: bold;
}

.w15g {
  font-weight: bold;
}

.hr2 {
  border: 0;
  border-top: 1px solid #000;
  width: 100%;
  margin: 1em 0;
}

/* Splash — solid black, logo right-aligned like classic index.php */
body.splash-page {
  background: #000;
  color: #fff;
}

.splash {
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 12em 0 2rem;
}

.splash a {
  position: relative;
  display: block;
  width: min(468px, 100%);
  line-height: 0;
}

.splash img {
  width: 100%;
  display: block;
}

.splash__bright {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.splash a:hover .splash__bright,
.splash a:focus-visible .splash__bright {
  opacity: 1;
}

/* Shell — 640px classic column, responsive */
.shell {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 5px;
}

.shell__grid {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  background: #000 url('/bg/bg00.jpg') repeat;
  padding: 4px;
  color: #fff;
}

.sidebar__bar {
  display: none;
}

.sidebar__logo {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 4px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.sidebar__nav-link {
  display: block;
  line-height: 0;
  margin: 0;
}

.sidebar__nav-link img {
  display: block;
  width: 128px;
  height: 28px;
}

.sidebar__nav-link .nav-on {
  display: none;
}

.sidebar__nav-link:hover .nav-off,
.sidebar__nav-link:focus-visible .nav-off {
  display: none;
}

.sidebar__nav-link:hover .nav-on,
.sidebar__nav-link:focus-visible .nav-on {
  display: block;
}

.sidebar__rule {
  display: block;
  width: 128px;
  height: 2px;
  margin: 3px 0;
}

.sidebar__news {
  margin-top: 2.5rem;
  text-align: right;
}

.sidebar__news-label {
  display: block;
  width: 15px;
  height: 15px;
  margin: 0 0 0.35rem auto;
}

.sidebar__news-link {
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  text-decoration: none;
  line-height: 1.3;
}

.sidebar__news-link:hover {
  color: #f00;
}

.sidebar__partners {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.sidebar__footer {
  margin-top: 2rem;
  color: #fff;
  font-size: 0.75rem;
  text-align: right;
  line-height: 1.35;
}

/* Content */
.content {
  background: #fff url('/bg/bg05.gif') repeat;
  background-color: #fff;
  color: #000;
  padding: 8px 10px 12px;
  min-width: 0;
}

.content a {
  color: #000;
}

.content a:hover {
  color: #f00;
}

.top-nav {
  text-align: right;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.top-nav a.is-active {
  font-weight: bold;
}

.content__footer {
  margin-top: 1.5rem;
  text-align: right;
}

.content__footer a {
  display: inline-block;
  position: relative;
  width: min(468px, 100%);
  line-height: 0;
}

.content__footer img {
  width: 100%;
  display: block;
}

.content__footer .logo-bright {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.content__footer a:hover .logo-bright {
  opacity: 1;
}

/* Prolog */
.notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
}

.section-map {
  display: grid;
  gap: 1rem;
}

.section-map__item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.section-map__item img {
  width: 64px;
  height: 64px;
  image-rendering: auto;
}

.section-map dt {
  font-style: italic;
  font-weight: bold;
}

.section-map dd {
  margin: 0.2rem 0 0;
}

/* Fest */
.fest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

.fest__quote {
  text-align: right;
}

.fest__quote .label {
  display: inline-block;
  vertical-align: top;
  margin-right: 0.5rem;
}

.fest__quote blockquote {
  display: inline-block;
  margin: 0;
  text-align: right;
}

.fest__quote strong {
  display: block;
}

.fest__quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: italic;
}

.fest__image img {
  width: 180px;
}

/* Gallery */
.gallery-crumb {
  text-align: right;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.gallery-crumb a[aria-current='page'] {
  font-weight: bold;
}

.artist-list {
  display: grid;
  gap: 0;
}

.artist-card {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid #000;
  align-items: start;
}

.artist-card:last-child {
  border-bottom: 1px solid #000;
}

.artist-card__preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.artist-grid a {
  display: block;
  line-height: 0;
}

.artist-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  pointer-events: none;
}

.artwork-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  min-height: 3rem;
}

.artwork-frame {
  display: grid;
  place-items: center;
  margin: 1rem 0;
  view-transition-name: artwork-image;
}

.artwork-frame img {
  border: 1px solid #000;
  max-height: 75vh;
  width: auto;
}

.artwork-frame__link {
  display: inline-block;
  line-height: 0;
  cursor: pointer;
}

.artwork-nav {
  text-align: right;
}

.artwork-nav__controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.artwork-nav__controls a,
.artwork-nav__controls span {
  display: inline-block;
  line-height: 0;
}

.artwork-nav__controls img {
  width: 15px;
  height: 15px;
}

.artwork-meta {
  margin: 1rem auto 0;
  border-collapse: collapse;
}

.artwork-meta td {
  padding: 0.15rem 0.4rem;
  vertical-align: top;
}

.artwork-meta td:first-child {
  text-align: right;
  white-space: nowrap;
}

#gallery-root {
  min-height: 8rem;
}

/* Avoid full-document crossfade (blinks hard on mobile). */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(artwork-image),
::view-transition-new(artwork-image) {
  animation-duration: 0.18s;
  animation-timing-function: ease;
}

::view-transition-old(artwork-image) {
  animation-name: artwork-fade-out;
}

::view-transition-new(artwork-image) {
  animation-name: artwork-fade-in;
}

@keyframes artwork-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes artwork-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Expo */
.expo-menu {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.expo-menu a[aria-current='page'] {
  font-weight: bold;
  color: #f00;
}

.expo-content img {
  margin: 0.35rem;
  display: inline-block;
}

.expo-content center,
.legacy-center {
  text-align: center;
}

.legacy-accent {
  color: #f00;
}

a[href$='.jpg'],
a[href$='.jpeg'],
a[href$='.gif'],
a[href$='.png'],
a[href$='.webp'],
a[href$='.JPG'],
a[href$='.JPEG'],
a[href$='.GIF'],
a[href$='.PNG'],
a[href$='.WEBP'] {
  cursor: zoom-in;
}

.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
}

.lightbox__figure {
  margin: 0;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.lightbox__img {
  display: block;
  max-width: min(100%, 960px);
  max-height: calc(100vh - 5rem);
  width: auto;
  height: auto;
  margin: 0;
  cursor: zoom-in;
}

.lightbox__caption {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #ccc;
}

.lightbox__close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  color: #f00;
}

.lightbox__nav {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
  align-self: center;
}

.lightbox__nav[hidden] {
  visibility: hidden;
}

@media (max-width: 720px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding: 2.75rem 0.75rem 1rem;
  }

  .lightbox__figure {
    grid-column: 1;
    grid-row: 1;
  }

  .lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
  }

  .lightbox__nav--prev {
    left: 0;
  }

  .lightbox__nav--next {
    right: 0;
  }
}

/* Links / message */
.links-list {
  display: grid;
  gap: 1.25rem;
}

.links-list__item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.message-contact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
}

/* Mobile — hamburger over classic sidebar panel */
@media (max-width: 720px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .shell__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sidebar {
    padding: 0;
    background: #000 url('/bg/bg00.jpg') repeat;
  }

  .sidebar__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #333;
  }

  .sidebar__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #999;
    background: #111;
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
  }

  .sidebar__burger {
    position: relative;
    width: 18px;
    height: 2px;
    background: currentColor;
  }

  .sidebar__burger::before,
  .sidebar__burger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
  }

  .sidebar__burger::before {
    top: -6px;
  }

  .sidebar__burger::after {
    top: 6px;
  }

  .sidebar.is-open .sidebar__burger {
    background: transparent;
  }

  .sidebar.is-open .sidebar__burger::before {
    top: 0;
    transform: rotate(45deg);
  }

  .sidebar.is-open .sidebar__burger::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .sidebar__brand {
    display: block;
    line-height: 0;
  }

  .sidebar__mark {
    display: block;
    width: 48px;
    height: 48px;
  }

  .sidebar__panel {
    display: none;
    padding: 0.75rem;
  }

  .sidebar.is-open .sidebar__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .sidebar__logo {
    display: none;
  }

  .sidebar__nav {
    align-items: center;
    width: 128px;
  }

  .sidebar__nav-link img,
  .sidebar__rule {
    width: 128px;
    max-width: 128px;
    margin-left: 0;
  }

  .sidebar__news,
  .sidebar__partners,
  .sidebar__footer {
    width: 128px;
  }

  .sidebar__news {
    margin-top: 1.25rem;
  }

  .sidebar__partners {
    margin-top: 1rem;
  }

  .top-nav {
    display: none;
  }

  .content {
    padding: 1rem;
  }

  .section-map__item {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 0.5rem;
  }

  .section-map__item img {
    width: 128px;
    height: 128px;
  }

  .fest,
  .artist-card,
  .notice,
  .links-list__item {
    grid-template-columns: 1fr;
  }

  .fest__quote {
    text-align: left;
  }

  .notice img:last-of-type {
    display: none;
  }
}

@media (min-width: 721px) {
  .sidebar__panel {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .splash__bright,
  .content__footer .logo-bright {
    transition: none;
  }

  ::view-transition-old(artwork-image),
  ::view-transition-new(artwork-image) {
    animation: none;
  }
}
