:root {
  color-scheme: dark;
  --bg: #18191b;
  --panel: #222326;
  --line: #393b40;
  --text: #ededee;
  --muted: #adafb6;
  --accent: #c7b3df;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: #d7c5ec;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  outline-offset: 5px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.shell {
  max-width: 1560px;
  margin: auto;
  padding: 0 max(44px, env(safe-area-inset-right)) 0
    max(44px, env(safe-area-inset-left));
}
.topbar {
  height: 93px;
  display: flex;
  align-items: center;
  gap: 36px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 20px;
}
.spark {
  font-size: 33px;
}
.twitch {
  font-size: 17px;
  color: var(--muted);
  border-left: 1px solid #666;
  padding-left: 30px;
  display: flex;
  gap: 13px;
  align-items: center;
}
.twitch span:first-child {
  color: var(--accent);
  font-size: 25px;
}
.twitch-mobile-label,
.viewer-touch-hint {
  display: none;
}
.gallery-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 44px 0 38px;
  gap: 24px;
}
.gallery-heading > div {
  border-left: 6px solid #98969f;
  padding-left: 25px;
}
h1 {
  font-size: clamp(32px, 4vw, 51px);
  letter-spacing: -1.8px;
  line-height: 1.15;
  margin: 0 0 10px;
  font-weight: 650;
}
.gallery-heading p {
  font-size: 24px;
  color: var(--muted);
  margin: 0;
  letter-spacing: -0.4px;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.gallery {
  columns: 3;
  column-gap: 22px;
}
.art-card {
  break-inside: avoid;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  overflow: hidden;
}
.art-image {
  display: block;
  overflow: hidden;
}
.art-image img {
  display: block;
  width: 100%;
  height: auto;
}
.progressive-image {
  position: relative;
}
.progressive-image > picture {
  position: absolute;
  inset: 0;
  display: block;
}
.art-image .quality-image {
  height: 100%;
  object-fit: contain;
  opacity: 0;
}
.progressive-image.is-ready .quality-image {
  opacity: 1;
}
.progressive-image.is-ready .image-placeholder {
  opacity: 0;
}
.art-caption {
  padding: 16px 19px;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.muted {
  color: var(--muted);
  line-height: 1.65;
}
.tiny {
  font-size: 12px;
  color: var(--muted);
}
.footer {
  margin-top: 58px;
  border-top: 1px solid var(--line);
  padding: 25px 0 30px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.empty {
  text-align: center;
  padding: 90px 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.empty-star {
  font-size: 56px;
  color: #8d8799;
  display: block;
}
.empty h2 {
  font-size: 25px;
}
.button {
  background: #e6e2ec;
  color: #202025;
  padding: 13px 19px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 600;
  display: inline-block;
  line-height: 1.4;
  font-size: 14px;
}
.button:hover {
  background: #fff;
  color: #161619;
}
.secondary {
  background: transparent;
  color: var(--text);
  border-color: #56565f;
}
.secondary:hover {
  background: #313136;
  color: #fff;
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
}
.text-button:hover {
  color: #fff;
}
.danger {
  color: #efa8a8;
}
.back {
  display: inline-block;
  color: var(--muted);
  font-size: 14px;
  margin: 25px 0;
}
.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 40px;
}
.single-image img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
}
.single-grid aside {
  padding-top: 30px;
}
.single-grid h1 {
  font-size: 34px;
  margin-top: 12px;
}
.description {
  white-space: pre-wrap;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.admin-nav {
  display: flex;
  gap: 30px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.admin-nav form {
  margin-left: auto;
}
.dev-banner {
  font-size: 12px;
  background: #302b39;
  border: 1px solid #4c405e;
  padding: 12px 16px;
  border-radius: 6px;
  color: #d9caec;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 36px 0 25px;
}
.section-heading h1 {
  font-size: 36px;
  margin: 10px 0;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 26px;
  margin-bottom: 22px;
}
.panel h2 {
  font-size: 21px;
}
.panel p {
  line-height: 1.7;
}
.stats {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
}
.stats strong {
  display: block;
  font-size: 28px;
  margin-top: 17px;
  letter-spacing: -0.7px;
}
.stats small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}
.stats p {
  font-size: 13px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.admin-card {
  padding: 0;
  overflow: hidden;
}
.admin-card img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  background: #151517;
  display: block;
}
.admin-card > div {
  padding: 20px;
}
.admin-card h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.admin-card p,
.admin-card a {
  font-size: 14px;
}
.status {
  display: inline-block;
  background: #35313c;
  color: #d5c7e7;
  border-radius: 4px;
  font-size: 11px;
  padding: 5px 8px;
}
.status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status--published {
  background: #20392d;
  color: #a7dfb9;
}
.status--draft {
  background: #3c3220;
  color: #efcc8c;
}
.status--trash {
  background: #3e292d;
  color: #e6b4bc;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.editor-preview {
  position: sticky;
  top: 22px;
  text-align: center;
}
.editor-preview img {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
}
.editor-preview .actions {
  justify-content: center;
}
label {
  display: block;
  font-size: 14px;
  margin-bottom: 22px;
  line-height: 1.7;
}
input:not([type="hidden"]),
textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid #4d4e56;
  color: var(--text);
  background: #1a1b1e;
  border-radius: 6px;
  padding: 12px;
  resize: vertical;
}
input[type="file"] {
  font-size: 13px;
}
textarea {
  min-height: 110px;
}
.required {
  color: #d9c5ed;
}
.upload-zone {
  border: 1px dashed #696471;
  border-radius: 8px;
  padding: 24px;
  background: #1d1e21;
}
.upload-zone span {
  font-size: 12px;
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.upload-zone.is-dragging {
  border-color: #d6c4ed;
  background: #34303d;
  outline: 2px solid #9d88b5;
  outline-offset: 3px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}
.alert,
.warning {
  color: #f0cf99;
}
.alert {
  border: 1px solid #7a6444;
  padding: 16px 20px;
  background: #322c24;
  border-radius: 7px;
}
.login {
  max-width: 540px;
  margin: 80px auto;
  padding: 42px;
}
.login h1 {
  font-size: 34px;
  margin-top: 20px;
}
.login p {
  color: var(--muted);
}
.login .button {
  margin: 12px 0;
}
.login .back {
  display: block;
}
.narrow {
  max-width: 800px;
  margin: 45px auto;
}
.narrow h1 {
  margin: 15px 0 25px;
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.compare img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: #151517;
}
.form-status {
  color: var(--muted);
}
dialog#viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  padding: 0;
  background: #111214;
  color: #ededee;
  margin: 0;
  inset: 0;
  overflow: hidden;
}
dialog#viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
dialog::backdrop {
  background: #111;
}
.viewer-bar {
  min-height: 64px;
  padding: max(10px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) 10px
    max(24px, env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #333;
}
.viewer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid #333;
}
.viewer-bar button,
.viewer-controls button,
.viewer-stage > button {
  background: #25262b;
  border: 1px solid #41424a;
  color: white;
  border-radius: 6px;
  padding: 9px 14px;
  min-width: 44px;
  min-height: 44px;
}
.viewer-controls a {
  font-size: 13px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
}
#viewer-author {
  min-width: 0;
  overflow-wrap: anywhere;
}
.viewer-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
}
.viewer-stage > button {
  font-size: 30px;
  padding: 12px;
  z-index: 1;
}
#viewer-canvas {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}
.viewer-status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #151515e6;
  color: #ddd;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}
#viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}
.viewer-hint {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  margin: 10px;
  padding-bottom: env(safe-area-inset-bottom);
}
body:has(dialog[open]) {
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1700px) {
  .shell {
    padding: 0 max(20px, env(safe-area-inset-right)) 0
      max(20px, env(safe-area-inset-left));
  }
}
@media (max-width: 1000px) {
  .shell {
    padding: 0 max(24px, env(safe-area-inset-right)) 0
      max(24px, env(safe-area-inset-left));
  }
  .gallery {
    columns: 2;
  }
  .eyebrow {
    font-size: 11px;
  }
  .gallery-heading > .eyebrow {
    display: none;
  }
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .single-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .shell {
    padding: 0 max(16px, env(safe-area-inset-right)) 0
      max(16px, env(safe-area-inset-left));
  }
  .topbar {
    min-height: 76px;
    height: auto;
    padding-top: env(safe-area-inset-top);
    gap: 12px;
    justify-content: space-between;
  }
  .brand {
    font-size: 24px;
    gap: 9px;
    min-height: 44px;
  }
  .spark {
    font-size: 25px;
  }
  .twitch {
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 24px;
    min-height: 44px;
    gap: 7px;
    flex-shrink: 0;
    align-items: center;
  }
  .twitch span:first-child {
    font-size: 18px;
  }
  .twitch-label {
    display: none;
  }
  .twitch-mobile-label {
    display: inline;
  }
  .gallery-heading {
    margin: 30px 0 26px;
  }
  .gallery-heading > div {
    padding-left: 17px;
    border-width: 4px;
  }
  .gallery-heading h1 {
    font-size: 32px;
    letter-spacing: -1px;
  }
  .gallery-heading p {
    font-size: 16px;
  }
  .gallery {
    columns: 1;
    column-gap: 0;
  }
  .art-card {
    border-radius: 12px;
    margin-bottom: 20px;
  }
  .art-caption {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.65;
  }
  .art-caption .tiny {
    display: none;
  }
  .footer {
    font-size: 12px;
    margin-top: 32px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .footer a,
  .back,
  .admin-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  button,
  .button {
    min-height: 44px;
  }
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    min-height: 44px;
    font-size: 16px;
    max-width: 100%;
  }
  .panel,
  .single-grid aside {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .admin-nav {
    gap: 4px 16px;
    font-size: 14px;
    flex-wrap: wrap;
    padding: 12px 0;
  }
  .admin-nav form {
    margin: 0;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .stats,
  .editor-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .editor-preview {
    position: static;
  }
  .panel {
    padding: 20px;
  }
  .admin-card {
    padding: 0;
  }
  .login {
    margin: 35px auto;
    padding: 28px;
  }
  .login h1 {
    font-size: 29px;
  }
  .single-grid {
    gap: 24px;
  }
  .single-grid aside {
    padding-top: 0;
  }
  .single-grid h1 {
    font-size: 28px;
  }
  .single-image img {
    max-height: 70dvh;
    border-radius: 10px;
  }
  .narrow {
    margin-top: 30px;
  }
  .empty {
    padding: 55px 15px;
  }
}
@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  .viewer-bar {
    padding: max(8px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right)) 8px
      max(12px, env(safe-area-inset-left));
    min-height: 60px;
    gap: 12px;
    font-size: 14px;
  }
  .viewer-stage {
    position: relative;
    padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
    gap: 0;
  }
  .viewer-stage > button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    background: #25262bcc;
    font-size: 26px;
  }
  #viewer-prev {
    left: max(6px, env(safe-area-inset-left));
  }
  #viewer-next {
    right: max(6px, env(safe-area-inset-right));
  }
  .viewer-controls {
    padding: 8px max(12px, env(safe-area-inset-right)) 0
      max(12px, env(safe-area-inset-left));
  }
  .viewer-hint {
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    padding: 4px 12px calc(8px + env(safe-area-inset-bottom));
  }
  .viewer-desktop-hint {
    display: none;
  }
  .viewer-touch-hint {
    display: inline;
  }
  .viewer-status {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
