:root {
  color-scheme: dark;
  font-family: "Golos Text", system-ui, sans-serif;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --background: #181a16;
  --panel: #22251e;
  --border: #41463a;
  --ink: #f4efe4;
  --muted: #c2bfb0;
  --rust: #ef956d;
  --rust-hover: #ffad87;
  --gutter: clamp(1.25rem, 5.55vw, 5rem);
  background: var(--background);
  color: var(--ink);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; min-width: 18rem; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--rust); color: var(--background); }

:focus-visible {
  outline: 2px solid #ffc18e;
  outline-offset: 4px;
}

.shell {
  width: min(100% - 2 * var(--gutter), 78rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  inset: .75rem auto auto .75rem;
  z-index: 10;
  padding: .7rem 1rem;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--background);
}

.skip-link:focus { transform: none; }

.site-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: #141611;
}

.header-content, .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  flex: none;
}

.avatar { width: 2.8rem; height: auto; }

.logo-plate {
  display: block;
  width: 8.5rem;
}

.logo-plate img {
  width: 100%;
  height: auto;
}

.corner-painter {
  position: fixed;
  inset: auto 0 0 auto;
  z-index: 2;
  width: clamp(6.2rem, 9.7vw, 9rem);
  height: auto;
  max-width: 28vw;
  clip-path: inset(0 1rem 1.35rem 0);
  transform: translate(1rem, 1.35rem);
  pointer-events: none;
}

body:has(dialog[open]) .corner-painter { visibility: hidden; }

.section-character {
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.main-nav, .header-social, .social-links {
  display: flex;
  gap: clamp(1rem, 2.65vw, 2.4rem);
}

.main-nav { gap: .25rem; }

.main-nav a, .header-social a, .social-links a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
}

.social-links a { gap: .45rem; }
.social-links img { flex: none; }

.main-nav a {
  padding-inline: clamp(.6rem, 1.25vw, 1.12rem);
  color: var(--ink);
}

nav a[aria-current="page"] { color: var(--rust); }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: #282a22; }
nav a:hover { color: var(--rust); }

.hero {
  display: grid;
  align-items: center;
  min-height: clamp(29rem, 43vw, 39rem);
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #555246;
  background: #131611;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #14160f91 0%, #14160f28 45%, transparent 75%),
    linear-gradient(0deg, #11130eb3 0%, transparent 38%),
    url("assets/workshop.webp") center 49% / cover no-repeat;
}

.hero-content { position: relative; z-index: 1; padding-block: 4.6rem 5rem; }

.hero-character {
  position: absolute;
  right: clamp(1rem, 4.6vw, 4.25rem);
  bottom: clamp(-2.5rem, -2.4vw, -1rem);
  width: clamp(12rem, 29vw, 28rem);
  filter: drop-shadow(0 .35rem 1rem #0b0908b0);
}

.hero h1 {
  width: min(100%, clamp(19rem, 42vw, 38.5rem));
}

.hero p {
  width: fit-content;
  margin-block: 1.6rem 2rem;
  color: #ede5d9;
  font-size: clamp(1.2rem, 2.05vw, 1.65rem);
  line-height: 1.4;
}

.hero strong { color: #f9a17c; font-weight: 600; }

.hero-social { width: fit-content; margin-top: .85rem; }
.hero-social a { color: #ede5d9; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  min-height: 3rem;
  padding: .68rem 1.06rem;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  transition: color .18s, background-color .18s, border-color .18s;
}

.button-primary {
  border-color: #f5ad8e;
  background: var(--rust);
  color: #231711;
}
.button-primary:hover { background: var(--rust-hover); }
.button-outline { background: #252821; border-color: #666b5a; color: var(--ink); }
.button-outline:hover { background: #343529; border-color: var(--rust); color: var(--rust-hover); }

.gallery { padding-block: clamp(3.3rem, 6vw, 5.3rem); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.7rem;
}

.section-header h2 {
  font: 600 clamp(2.95rem, 6vw, 5.1rem)/1.02 var(--display);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--border);
  background: #121410;
}

.filters button {
  min-height: 2.75rem;
  padding: .52rem .83rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  transition: border-color .18s, color .18s, background-color .18s;
}

.filters button:hover { border-color: #9a8e7d; color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: #3c3e31;
  border-color: #777964;
  color: var(--ink);
}

#work-list { display: grid; gap: 3rem; }

.work-piece {
  min-width: 0;
  background: #22241d;
  border: 1px solid var(--border);
}

.work-photos {
  --mat: clamp(.42rem, 1.15vw, .9rem);
  display: grid;
  gap: var(--mat);
  padding: var(--mat) var(--mat) 0;
}
.work-photos.paired { grid-template-columns: 1.22fr 1fr; }

.work-photo {
  position: relative;
  isolation: isolate;
  display: block;
  overflow: hidden;
  min-width: 0;
  padding: 0;
  aspect-ratio: 1.69;
  border: 1px solid #555748;
  border-radius: 0;
  background: #24241e;
  color: var(--ink);
  cursor: zoom-in;
}

.paired .work-photo { aspect-ratio: auto; height: clamp(15rem, 33vw, 27rem); }
.work-photo:focus-visible { outline-offset: -4px; }

.work-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .38s;
}

.work-photo:hover img { transform: scale(1.025); }

.photo-caption {
  position: absolute;
  inset: auto .8rem .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}

.photo-label, .expand-mark {
  display: grid;
  place-items: center;
  min-height: 2.2rem;
  border: 1px solid #f4e8d943;
  background: #141410e8;
}

.photo-label { padding: .3rem .65rem; font-size: .84rem; }
.expand-mark { width: 2.2rem; }

.expand-mark::before {
  content: "";
  width: .85rem;
  height: .85rem;
  background:
    linear-gradient(var(--ink), var(--ink)) top left / 35% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) top right / 35% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom left / 35% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom right / 35% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) top left / 1px 35% no-repeat,
    linear-gradient(var(--ink), var(--ink)) top right / 1px 35% no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom left / 1px 35% no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom right / 1px 35% no-repeat;
}

.work-caption {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1rem clamp(1rem, 2.4vw, 2rem) 1.45rem;
}

.work-caption h3, .support-card h3 {
  font: 500 clamp(1.75rem, 3.1vw, 2.65rem)/1.14 var(--display);
  letter-spacing: -.01em;
}

.work-caption p { margin-top: .55rem; color: var(--muted); line-height: 1.5; }

.work-source {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.2rem;
  color: var(--muted);
  font-size: .875rem;
}

.work-source a, .quiet-button, .quiet-link {
  color: var(--rust);
  text-decoration: underline;
  text-decoration-color: #af654d;
  text-underline-offset: .22em;
}

.work-source a { display: inline-flex; min-height: 2rem; align-items: center; }

.work-source a:hover, .quiet-button:hover, .quiet-link:hover { color: var(--rust-hover); }

.empty-gallery {
  display: grid;
  align-items: center;
  min-height: 14rem;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  color: var(--muted);
  text-align: center;
}

.orders {
  padding-top: clamp(3.4rem, 6.2vw, 5.4rem);
  border-top: 1px solid var(--border);
  background: #24231c;
}

.orders h2, .support h2 { font-size: clamp(2.55rem, 5vw, 4.25rem); }

.section-description {
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.5;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(.6rem, 1.25vw, 1.1rem);
}

.offer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  background: #20221b;
}

.offer:hover, .offer:focus-within { border-color: #77765d; }

.offer img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: #baad96;
  border-bottom: 1px solid var(--border);
}

.offer-caption {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(.7rem, 1.55vw, 1.25rem);
  container-type: inline-size;
}

.offer-caption h3 {
  font: 500 clamp(1.25rem, 2.5vw, 2rem)/1.14 var(--display);
  overflow-wrap: break-word;
}

.offer-price {
  margin-block: .56rem .95rem;
  color: var(--rust-hover);
  font-size: 1.13rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.offer-actions {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  gap: .65rem;
  margin-top: auto;
  padding-top: .8rem;
}

.offer-actions .offer-price { margin: 0; white-space: nowrap; }
.offer-actions .button { width: 100%; min-height: 2.75rem; padding-inline: .72rem; }

@container (min-width: 11.25rem) {
  .offer-actions { align-items: center; flex-direction: row; }
  .offer-actions .button { width: fit-content; }
}

.orders-tail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(5.5rem, 18vw, 11rem);
  align-items: center;
  gap: clamp(.6rem, 2vw, 1.5rem);
  min-height: clamp(7rem, 13vw, 10rem);
  overflow: clip;
}

.orders-tail .button { margin-block: 1.15rem; }

.orders-character {
  align-self: end;
  transform: translateY(12%);
}

.catalog-page main { padding-block: clamp(2.3rem, 5vw, 4.6rem); }

.catalog-heading {
  padding: clamp(1.15rem, 3.4vw, 3rem);
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, #191b15 25%, #191b15de 47%, #1e1e14ae 80%, #231b15a8),
    url("assets/hall.webp") right 58% / cover no-repeat;
}

.catalog-heading h1 {
  margin-block: .4rem .9rem;
  font: 600 clamp(2.65rem, 6vw, 5.15rem)/1.05 var(--display);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.catalog-heading .section-description { max-width: 43ch; }

.catalog-filters {
  display: grid;
  grid-template-columns: minmax(11rem, 1.15fr) repeat(2, minmax(9rem, 13rem));
  gap: .75rem;
  margin-top: 1rem;
  padding: clamp(.75rem, 1.65vw, 1.35rem);
  border: 1px solid var(--border);
  background: #20221b;
}

.catalog-filters > div {
  min-width: 0;
  color: var(--muted);
  font-size: .875rem;
}

.catalog-filters :is(input, select) {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 2.75rem;
  margin-top: .35rem;
  padding: .55rem .7rem;
  border: 1px solid #656859;
  border-radius: 0;
  background: #171a14;
  color: var(--ink);
  font: inherit;
}

.catalog-filters select {
  appearance: none;
  padding-right: 1.6rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 1rem center / .31rem .31rem no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right .69rem center / .31rem .31rem no-repeat,
    #171a14;
}

.catalog-count {
  margin-block: 1.15rem .85rem;
  color: var(--muted);
  font-size: .875rem;
}

.support {
  padding-block: clamp(3.4rem, 6.2vw, 5.4rem);
  border-block: 1px solid var(--border);
  background: #191c16;
}

.support .support-heading {
  display: grid;
  grid-template-columns: clamp(4.65rem, 10vw, 8rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.8rem, 2.5vw, 2rem);
  overflow: clip;
}

.support-character {
  height: clamp(5.25rem, 8vw, 7rem);
  object-fit: cover;
  object-position: top;
  transform: translateY(.28rem);
}

.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.support-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(125deg, #2b2e24, var(--panel));
  border: 1px solid #4a4e41;
}

.support-card-donate {
  background: linear-gradient(125deg, #35281f, #29241b 68%);
  border-color: #655244;
}

.support-card .service-name {
  margin: 0 0 .55rem;
  color: var(--rust);
  font-size: .875rem;
  font-weight: 600;
}

.support-card h3 + p {
  max-width: 42ch;
  margin-block: .65rem 1.2rem;
  color: var(--muted);
  line-height: 1.55;
}

.widget-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; }

.quiet-button {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .875rem;
  text-align: left;
}

.copy-status { margin-top: .8rem; color: var(--ink); font-size: .875rem; }
.copy-status:empty { margin: 0; }

.fallback-link {
  width: 100%;
  min-height: 2.75rem;
  margin-top: .65rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--background);
  color: var(--ink);
  padding-inline: .55rem;
}

.donation-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .38rem;
  max-width: 22rem;
}

.donation-presets .button {
  width: 100%;
  padding-inline: .3rem;
  white-space: nowrap;
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: .875rem;
}

.site-footer { background: #141611; }
.footer-content { justify-content: start; flex-wrap: wrap; gap: clamp(1.25rem, 4vw, 4rem); min-height: 5.5rem; }
.footer-content .logo-plate { width: 7rem; }

dialog {
  width: min(57rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid #645347;
  background: #171715;
  color: var(--ink);
  overflow: auto;
}

dialog::backdrop { background: #080806e8; }

.viewer-header, .viewer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .9rem;
}

.viewer-header h2 { font: 500 clamp(1.25rem, 4vw, 1.65rem)/1.2 var(--display); }

.close-viewer {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 400 1.85rem/1 system-ui, sans-serif;
}

.close-viewer:hover { color: var(--rust-hover); border-color: var(--border); }

.viewer-stage {
  display: grid;
  place-items: center;
  height: min(66vh, 34rem);
  height: min(66dvh, 34rem);
  background: #0f0f0e;
  border-block: 1px solid var(--border);
}

.viewer-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }

.viewer-controls { display: grid; grid-template-columns: 1fr auto 1fr; }
.viewer-controls .button { min-height: 2.75rem; }
.viewer-controls .button:last-child { justify-self: end; }
.viewer-controls p { grid-column: 2; color: var(--muted); font-size: .875rem; }

#order-dialog { width: min(29rem, calc(100% - 2rem)); }
#order-dialog .viewer-header { border-bottom: 1px solid var(--border); }
.order-content { padding: 1rem; }

.order-overview {
  display: grid;
  grid-template-columns: 6rem 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.order-overview img { height: auto; }
.order-overview .offer-price { margin-block: 0 .35rem; font-size: 1.5rem; }
.order-note { color: var(--muted); font-size: .875rem; line-height: 1.5; }

.order-content label {
  display: block;
  padding-bottom: .45rem;
  font-size: .875rem;
  font-weight: 500;
}

.order-field + .order-field { margin-top: .45rem; }

.order-content :is(textarea, input) {
  display: block;
  width: 100%;
  padding: .65rem;
  border: 1px solid #827b6c;
  border-radius: 0;
  background: #20201d;
  color: var(--ink);
  font: inherit;
}

.order-content textarea { resize: vertical; }

.order-content .copy-status { margin-block: 0 .65rem; }
.order-content .copy-status:empty { margin: 0; }

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .5rem;
}

@media (50rem < width <= 65rem) {
  .catalog-page .offer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 50rem) {
  .header-content { min-height: 4rem; }
  .header-social { display: none; }
  .hero h1 { width: min(100%, clamp(17rem, 64vw, 28rem)); }
  .hero-content { padding-block: 3rem; }
  .work-caption { align-items: start; flex-direction: column; gap: .6rem; }
  .support-grid { grid-template-columns: 1fr; }
  .offer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 37rem) {
  .header-content { gap: .7rem; }
  .wordmark { gap: .35rem; }
  .wordmark .logo-plate { width: 6.25rem; }
  .avatar { width: 2rem; }
  .main-nav { gap: clamp(.45rem, 2.7vw, .85rem); }
  .main-nav a { padding-inline: 0; }
  .main-nav a { font-size: .82rem; }
  .corner-painter {
    width: 4.85rem;
    clip-path: inset(0 .9rem .9rem 0);
    transform: translate(.9rem, .9rem);
  }

  .hero { min-height: 27rem; }
  .hero-character {
    right: -.85rem;
    bottom: -1.1rem;
    width: clamp(7.5rem, 37vw, 12rem);
  }
  .hero::before {
    background:
      linear-gradient(90deg, #14160fe6, #14160f9e 58%, #14160f33),
      linear-gradient(0deg, #151813a3 0%, transparent 30%),
      url("assets/workshop-mobile.webp") 58% 47% / cover no-repeat;
  }

  .hero p { margin-block: 1.25rem 1.55rem; }
  .hero-social { gap: .7rem; margin-top: .55rem; }
  .section-header { margin-bottom: 1.15rem; }
  .work-photos.paired { grid-template-columns: 1fr; }
  .paired .work-photo { height: auto; aspect-ratio: 1.45; }
  .photo-caption { inset: auto .55rem .55rem; }
  .footer-content { min-height: 4.75rem; }
  .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .order-actions .button { width: 100%; }
  .support-heading h2 { font-size: clamp(1.9rem, 6.9vw, 2.55rem); }
  .catalog-heading {
    background:
      linear-gradient(90deg, #191b15, #191b15d9 54%, #1b1a15a6),
      url("assets/hall.webp") right 54% / cover no-repeat;
  }
  .catalog-filters { grid-template-columns: 1fr 1fr; }
  .catalog-search { grid-column: span 2; }
}

@media (max-width: 25rem) {
  .header-content { flex-wrap: wrap; gap: 0 .75rem; padding-block: .25rem; }
  .main-nav a { min-height: 2.5rem; }
}

@media (max-width: 23rem) {
  .footer-content { align-items: start; flex-direction: column; gap: 0; padding-block: .6rem; }
}

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