@font-face {
  font-family: "Glitch";
  src: url("/CyberformDemo.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #000;
  --panel: rgba(14, 0, 3, 0.72);
  --red: #ff2a3d;
  --red-d: #8f0f1d;
  --red-xd: #3a0710;
  --text: #f3e9ea;
  --muted: #b49a9e;
  --top: 56px;
  --side: 232px;
  --strip: 0px;
  --display: "Glitch", ui-monospace, "Courier New", monospace;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top) + var(--strip) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.6 var(--mono);
}

a { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- space backdrop ---------- */
body::before,
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 140px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 160px 60px, #ff2a3d, transparent),
    radial-gradient(1px 1px at 230px 200px, #fff, transparent),
    radial-gradient(1px 1px at 60px 220px, rgba(255, 120, 130, 0.8), transparent);
  background-size: 250px 250px;
}
body::after {
  background:
    radial-gradient(60% 40% at 85% 0%, rgba(255, 42, 61, 0.2), transparent),
    radial-gradient(50% 45% at 0% 100%, rgba(143, 15, 29, 0.3), transparent);
}
.scan {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(255, 40, 60, 0.035) 2px 3px);
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--red-d);
  box-shadow: 0 0 24px rgba(255, 42, 61, 0.25);
}
.back {
  padding: 6px 14px; border: 2px solid var(--red); color: var(--red);
  font-weight: 700; letter-spacing: 0.06em; text-decoration: none;
  box-shadow: 3px 3px 0 var(--red-d);
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.back:hover, .back:focus-visible { background: var(--red); color: #000; }
.back:active { transform: translate(3px, 3px); box-shadow: none; }
.brand { margin-left: auto; font-family: var(--display); color: var(--muted); font-size: 0.85rem; letter-spacing: 0.08em; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; top: var(--top); bottom: 0; left: 0; z-index: 40; width: var(--side);
  padding: 20px 14px; overflow-y: auto;
  background: rgba(0, 0, 0, 0.72); border-right: 1px solid var(--red-xd);
}
.sidebar h2 { margin: 0 0 12px 10px; font-family: var(--display); font-weight: 400; font-size: 0.9rem; color: var(--red); letter-spacing: 0.08em; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  color: var(--text); text-decoration: none; font-size: 0.9rem;
  border: 1px solid transparent;
}
.sidebar a:hover, .sidebar a[aria-current="true"] {
  border-color: var(--red-d); background: rgba(255, 42, 61, 0.1); color: #fff;
}
.sidebar a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--red); }
.mini { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.count { margin-left: auto; color: var(--muted); font-size: 0.75rem; }

/* ---------- main + hero ---------- */
main {
  margin-left: var(--side);
  padding: calc(var(--top) + 28px) 32px 48px;
  max-width: calc(var(--side) + 1240px);
}
.hero { text-align: center; padding-top: 24px; }
.hero h1 {
  margin: 0 0 24px; font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 4.5vw, 3.1rem); line-height: 1.15;
  text-transform: uppercase; letter-spacing: 0.12em; color: #fff;
  text-shadow: 0 0 16px var(--red), 3px 3px 0 var(--red-d);
}
.commentContainer {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  max-width: 780px; margin: 0 auto 32px; text-align: left;
}
.commentContainer img { width: 96px; height: auto; flex: none; transform: scaleX(-1); }
.comment {
  margin: 0; max-width: 586px; padding: 14px 18px;
  border: 1px solid var(--red-d); background: var(--panel);
}

/* ---------- artist sections ---------- */
.artist {
  position: relative; margin: 0 0 44px; padding: 24px;
  border: 1px solid var(--red-xd); background: var(--panel);
}
.artist::before, .artist::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--red); }
.artist::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.artist::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.artist-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar {
  width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--red); box-shadow: 0 0 0 3px #000, 0 0 16px rgba(255, 42, 61, 0.5);
}
.artist h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.2; color: #fff; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.socials a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: #3b323327; border: 2px solid var(--red-d);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.socials a:hover, .socials a:focus-visible { border-color: var(--red); box-shadow: 0 0 12px var(--red); }
.socials img { width: 22px; height: 22px; object-fit: contain; }
.bio { max-width: 70ch; margin: 16px 0 22px; color: var(--muted); }
.bio b { color: var(--text); }

.art { list-style: none; margin: 0; padding: 0; column-width: 250px; column-gap: 14px; }
.art li { margin: 0 0 14px; break-inside: avoid; }
.piece {
  display: block; line-height: 0; border: 1px solid var(--red-xd); background: #000;
  cursor: zoom-in; transition: border-color 0.15s, box-shadow 0.15s;
}
.piece:hover, .piece:focus-visible { border-color: var(--red); box-shadow: 0 0 18px rgba(255, 42, 61, 0.5); }
.piece img { display: block; width: 100%; height: auto; }

.foot { padding-top: 8px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ---------- viewer ---------- */
#viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--text);
}
#viewer[open] { display: flex; align-items: center; justify-content: center; }
#viewer::backdrop { background: rgba(0, 0, 0, 0.86); backdrop-filter: blur(5px); }
.v-stage { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 92vw; }
.v-stage img {
  max-width: 92vw; max-height: 82vh; object-fit: contain; background: #000;
  border: 1px solid var(--red-d); box-shadow: 0 0 48px rgba(255, 42, 61, 0.3);
  transition: opacity 0.2s;
}
.v-stage img.loading { opacity: 0.25; }
.v-stage figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; }
.v-btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px;
  border: 2px solid var(--red-d); background: rgba(0, 0, 0, 0.7); color: var(--text);
  font: 2rem/1 var(--mono); cursor: pointer;
}
.v-btn:hover, .v-btn:focus-visible { border-color: var(--red); color: var(--red); }
.v-close { top: 16px; right: 16px; }
.v-prev { left: 16px; top: 50%; margin-top: -24px; }
.v-next { right: 16px; top: 50%; margin-top: -24px; }
#viewer.single .v-prev, #viewer.single .v-next { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  :root { --strip: 52px; }
  .brand, .sidebar h2, .count { display: none; }
  .sidebar {
    top: var(--top); bottom: auto; right: 0; width: auto; height: var(--strip);
    padding: 8px 10px; overflow: auto hidden; border-right: 0; border-bottom: 1px solid var(--red-xd);
  }
  .sidebar ul { display: flex; }
  .sidebar a { white-space: nowrap; }
  main { margin-left: 0; padding: calc(var(--top) + var(--strip) + 16px) 14px 40px; }
  .commentContainer { flex-direction: column; text-align: center; }
  .artist { padding: 18px 14px; }
  .v-prev { left: 6px; }
  .v-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}