@font-face {
  font-family: Golos;
  src: url('./fonts/golos-lat.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Golos;
  src: url('./fonts/golos-cyr.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0400-052F, U+20B4, U+2116;
}
@font-face {
  font-family: Prata;
  src: url('./fonts/prata-lat.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Prata;
  src: url('./fonts/prata-cyr.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-052F, U+20B4, U+2116;
}

:root {
  --paper: #f8f5ef;
  --surface: #fffaf2;
  --ink: #29251e;
  --muted: #665b50;
  --line: #d8cbbc;
  --accent: #785044;
  --display: Prata, Georgia, serif;
  --body: Golos, Arial, sans-serif;
  --corner: 0px;
  --page-width: 960px;
  --gutter: clamp(16px, 5vw, 42px);
  --gap: clamp(12px, 3.2vw, 34px);
  color-scheme: light;
  color: var(--ink);
  font-family: var(--body);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--custom-paper, var(--paper));
  background-image: var(--custom-background, none);
  background-position: center;
  background-repeat: repeat;
  background-size: cover;
  color: var(--ink);
}
body[data-theme][data-background-tone="dark"] {
  --paper: #29231f;
  --surface: #382d27;
  --ink: #fff8ee;
  --muted: #f3e3d0;
  --line: #977a64;
  --accent: #ffcdb7;
}
html:has(:is(.work-dialog, .catalog-editor-dialog)[open]) { overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
textarea { resize: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .view {
  width: min(100% - 2 * var(--gutter), var(--page-width));
  margin-inline: auto;
}
.header-inner {
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 3px 12px;
}
.wordmark { font-size: clamp(15px, 2.1vw, 19px); font-weight: 650; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.header-actions button {
  border: 1px solid var(--line);
  border-radius: var(--corner);
  background: var(--surface);
  min-height: 44px;
  padding: 6px clamp(8px, 2vw, 14px);
  font-size: 12px;
}

.view { padding: clamp(25px, 6vw, 72px) 0 clamp(38px, 9vw, 100px); }
.view > .navigation-back { margin-bottom: clamp(12px, 3vw, 29px); }
.navigation-back { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: 14px; color: var(--muted); }
.navigation-back:hover { color: var(--ink); }
.navigation-back-label { line-height: 1.25; overflow-wrap: anywhere; }
.navigation-back-icon {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
}
.navigation-back-icon::before,
.navigation-back-icon::after {
  content: '';
  position: absolute;
  top: 50%;
}
.navigation-back-icon::before {
  inset-inline: 1px 2px;
  height: 1.5px;
  background: currentColor;
  transform: translateY(-50%);
}
.navigation-back-icon::after {
  left: 2px;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: translateY(-50%) rotate(-45deg);
}
.hero { margin-bottom: clamp(25px, 6vw, 58px); }
.hero-title {
  max-width: 13ch;
  font: 400 clamp(33px, 8vw, 85px)/1.09 var(--display);
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.hero-intro {
  max-width: 37ch;
  margin-top: 13px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 19px);
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.occasion-grid, .work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.occasion-card, .work-card { min-width: 0; }
.occasion-card { display: block; }
.occasion-card .occasion-edit-link { margin-top: 5px; min-height: 44px; align-items: center; font-size: 12px; color: var(--muted); }
.media { display: block; background: var(--media-color, #dfd0ba); overflow: hidden; }
.occasion-media { aspect-ratio: 1.11; border-radius: var(--corner); }
.occasion-caption, .work-caption { padding-top: clamp(9px, 1.5vw, 15px); }
.occasion-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.occasion-title, .work-title {
  font: 400 clamp(16px, 3.1vw, 34px)/1.24 var(--display);
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.occasion-arrow { flex: none; color: var(--accent); font-size: clamp(15px, 2vw, 20px); }
.work-price { color: var(--muted); font-size: clamp(13px, 2vw, 19px); margin-top: 6px; font-variant-numeric: tabular-nums; }
.gallery { position: relative; min-width: 0; }
.gallery-stage {
  display: block;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--corner);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.gallery-frame { position: absolute; inset: 0; }
.gallery-stage img { -webkit-user-drag: none; }
.gallery-dots {
  --dot-step: 24px;
  position: absolute;
  z-index: 1;
  inset: auto auto 0 50%;
  translate: -50% 0;
  display: flex;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  height: 38px;
  color: #332a20;
}
.gallery-dots[data-dense] { --dot-step: 16px; }
.gallery-dots button {
  display: grid;
  place-items: end center;
  padding: 0 0 10px;
  border: 0;
  background: transparent;
  width: var(--dot-step);
  flex: none;
  height: 100%;
}
.gallery-dots button::before, .gallery-marker {
  width: 5px;
  height: 5px;
  border-radius: 20px;
  background: currentColor;
  box-shadow: 0 0 0 1px #fff8;
}
.gallery-dots button::before { content: ''; opacity: .57; }
.gallery-dots button[aria-current="true"]::before { opacity: 0; }
.gallery-marker {
  position: absolute;
  bottom: 10px;
  left: calc((var(--dot-step) - 13px) / 2);
  width: 13px;
  transform: translateX(calc(var(--dot-index, 0) * var(--dot-step)));
  pointer-events: none;
}

.work-dialog {
  position: fixed;
  --work-edge: clamp(6px, 1vw, 14px);
  inset: max(var(--work-edge), env(safe-area-inset-top)) max(var(--work-edge), env(safe-area-inset-right))
    max(var(--work-edge), env(safe-area-inset-bottom)) max(var(--work-edge), env(safe-area-inset-left));
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--corner);
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.work-dialog::backdrop { background: #26201986; }
.dialog-top {
  position: sticky;
  z-index: 4;
  inset-block-start: 0;
  display: flex;
  justify-content: flex-end;
  height: 0;
  padding-inline: 9px;
  pointer-events: none;
}
.dialog-close {
  position: relative;
  inset-block-start: 9px;
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid #fffdf5ad;
  border-radius: 999px;
  background: #fef8f0cf;
  box-shadow: 0 4px 13px #2a211f26, inset 0 1px 1px #fff7;
  color: #34251e;
  backdrop-filter: blur(8px);
  touch-action: manipulation;
  pointer-events: auto;
}
.dialog-close { flex: 0 0 46px; width: 46px; height: 46px; padding: 0; }
.dialog-close > span:not(.glass-optic) { font-size: 26px; line-height: 1; }
.work-dialog-content {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  gap: 6px;
}
.work-dialog .gallery-stage {
  height: max(180px, 76dvh);
  aspect-ratio: auto;
  border-radius: 0;
}
.work-dialog .gallery-stage img { object-fit: contain; }
body:not([data-editing]) .work-dialog .gallery-stage[data-zoomable] {
  touch-action: none;
  cursor: zoom-in;
}
body:not([data-editing]) .work-dialog .gallery-stage[data-zoomed] { cursor: grab; }
body:not([data-editing]) .work-dialog .gallery-stage[data-zoomed]:active { cursor: grabbing; }
.detail-copy { min-width: 0; padding: 11px 15px; }
@media (min-width: 840px) {
  .work-dialog-content {
    height: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(205px, 23%);
    grid-template-rows: minmax(0, 1fr);
  }
  .work-dialog .gallery-stage { height: 100%; }
  .work-dialog .detail-copy { overflow: auto; padding: 63px 20px 18px; }
}
.detail-title { font: 400 clamp(23px, 4vw, 35px)/1.15 var(--display); letter-spacing: -.035em; overflow-wrap: anywhere; }
.detail-copy .work-price { margin-top: 5px; font-size: 13px; }
.detail-description { margin-top: 6px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; color: var(--muted); overflow-wrap: anywhere; }
.section-empty { color: var(--muted); margin-top: 13px; }
.editor-only { display: none; }
body[data-editing] .editor-only { display: inline-flex; }
.editor-actions { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.editor-actions button, .editor-actions a, .editor-add {
  min-height: 44px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--corner);
  color: var(--ink);
  padding: 5px 8px;
  text-align: left;
  font-size: 12px;
}
.editor-add { margin-top: 14px; }
.work-photo-actions { margin-top: 14px; }
.work-photo-actions .editor-add { margin-top: 0; }
.work-photo-actions button:disabled { opacity: .7; cursor: default; }

@media (max-width: 380px) {
  .header-actions button { padding-inline: 7px; }
  .theme-switch button { padding-inline: 11px; }
}
