:root {
  --gallery-bg: #ffffff;
  --gallery-ink: #171916;
  font-family: "DM Sans", Arial, sans-serif;
  color: var(--gallery-ink);
  background: var(--gallery-bg);
  font-synthesis: none;
  letter-spacing: 0;
}
@font-face { font-family: "Chill Huo Fang Song"; src: url("fonts/chill-huofangsong-conbold.ttf") format("truetype"); font-display: swap; font-weight: 700; }
@font-face { font-family: "OnTheFritz"; src: url("fonts/on-the-fritz.otf") format("opentype"); font-display: swap; font-weight: 400; }
@font-face { font-family: "Src Ming Italic"; src: url("fonts/src-ming-italic.ttf") format("truetype"); font-display: swap; font-style: normal; font-weight: 100 900; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, label[for="mosaic-upload"] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.mosaic-page { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr; overflow-x: hidden; isolation: isolate; background: var(--gallery-bg); }
.mosaic-page::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: var(--gallery-bg-image, none); background-position: center; background-repeat: no-repeat; background-size: var(--gallery-bg-image-size, 100% auto); opacity: var(--gallery-bg-image-opacity, 0); }
.mosaic-layout { position: relative; z-index: 1; width: 100%; display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, .85fr); align-items: center; gap: 38px; padding: 44px 5% 44px 32px; }
.mosaic-art { display: flex; align-items: center; justify-content: flex-start; min-width: 0; }
.mosaic-board { position: relative; isolation: isolate; width: min(100%, calc((100svh - 142px) * 4 / 3)); min-width: 0; aspect-ratio: 4 / 3; user-select: none; }
.mosaic-cell { position: absolute; left: var(--cell-x); top: var(--cell-y); width: var(--cell-width); height: var(--cell-height); transform: rotate(var(--cell-angle)); transform-origin: center; perspective: 1000px; opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 180ms; }
.mosaic-cell.is-visible { opacity: 1; visibility: visible; }
.mosaic-develop { position: absolute; inset: 0; transform-style: preserve-3d; }
.mosaic-page.is-entering .mosaic-develop { opacity: 0; }
.mosaic-water-filters { position: absolute; width: 0; height: 0; pointer-events: none; }
.mosaic-flipper { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: center center; transform: rotateX(0deg); pointer-events: none; }
.mosaic-cell.is-rippling .mosaic-flipper { will-change: transform; }
.mosaic-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-repeat: no-repeat; }
.mosaic-front { opacity: var(--photo-opacity, .68); background-image: var(--mosaic-photo); background-size: var(--photo-width) var(--photo-height); background-position: calc(var(--photo-x) - var(--cell-x)) calc(var(--photo-y) - var(--cell-y)); transform-style: preserve-3d; transform-origin: center center; backface-visibility: visible; -webkit-backface-visibility: visible; overflow: visible; will-change: transform; }
.mosaic-paper { position: absolute; inset: 0; transform-style: preserve-3d; visibility: hidden; backface-visibility: hidden; background-image: var(--mosaic-photo); background-repeat: no-repeat; opacity: var(--photo-opacity, .68); }
.mosaic-directory { min-width: 0; max-width: 480px; margin-left: 18px; padding-bottom: 32px; }
.mosaic-door-tile { --door-pencil: rgb(157 160 155 / .82); --door-pencil-soft: rgb(177 180 174 / .42); --door-label: #c12624; position: relative; isolation: isolate; width: min(312px, 100%); height: 142px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; margin: 0 0 32px auto; transform: rotate(-.25deg); transition: transform 380ms cubic-bezier(.2,.7,.2,1); }
.mosaic-door-label { position: relative; z-index: 2; align-self: flex-end; display: grid; gap: 3px; width: 104px; margin: 0 0 45px; color: var(--door-label); font-family: "OnTheFritz", "Chill Huo Fang Song", cursive; font-size: 15px; line-height: .92; letter-spacing: .025em; text-transform: uppercase; transform: rotate(.55deg); text-shadow: .35px .4px 0 rgb(135 33 31 / .22); }
.mosaic-door-stage { position: relative; z-index: 1; flex: 0 0 144px; width: 144px; height: 128px; overflow: visible; perspective: 680px; }
.mosaic-door-drawing { display: block; width: 144px; height: 128px; overflow: visible; }
.mosaic-pencil-heavy, .mosaic-pencil-echo, .mosaic-pencil-hatch { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mosaic-pencil-heavy { stroke: var(--door-pencil); stroke-width: 1.75; }
.mosaic-pencil-echo { stroke: var(--door-pencil-soft); stroke-width: 1.05; }
.mosaic-pencil-hatch { stroke: var(--door-pencil-soft); stroke-width: .78; }
.mosaic-door-shadow { fill: none; }
.mosaic-door-void { fill: rgb(19 20 19 / .96); stroke: none; }
.mosaic-door-frame-line { opacity: .96; }
.mosaic-door-fill { fill: color-mix(in srgb, var(--gallery-bg) 88%, transparent); }
.mosaic-pencil-knob { fill: none; stroke: var(--door-pencil); stroke-width: 1.25; }
.mosaic-door-leaf { transform-box: fill-box; transform-origin: 0 50%; transform: rotateY(0deg) rotateZ(-.25deg); transform-style: preserve-3d; transition: transform 560ms cubic-bezier(.18,.7,.2,1); }
.mosaic-door-tile:hover, .mosaic-door-tile:focus-visible { transform: translateY(-2px) rotate(-.35deg); }
.mosaic-door-tile:hover .mosaic-door-leaf, .mosaic-door-tile:focus-visible .mosaic-door-leaf { transform: rotateY(-34deg) rotateZ(-.8deg) translateX(-2px) translateZ(6px); }
.mosaic-page.is-entering .mosaic-directory { opacity: 0; pointer-events: none; }
.mosaic-directory ol { padding: 0; margin: 0; list-style: none; }
.mosaic-directory { font-family: "Src Ming Italic", "Chill Huo Fang Song", "DM Sans", Arial, sans-serif; font-weight: 400; }
.mosaic-directory li + li { margin-top: 15px; }
.mosaic-directory ol a[data-project-id] { --wave-scale: 1; --wave-x: 0px; --wave-y: 0px; display: block; position: relative; padding: 8px 20px 8px 0; opacity: .58; transition: opacity 180ms ease; }
.project-label { display: block; transform: translate3d(var(--wave-x), var(--wave-y), 0) scale(var(--wave-scale)); transform-origin: left center; transition: transform 220ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.mosaic-directory a:hover, .mosaic-directory a:focus-visible, .mosaic-directory a.is-active { opacity: 1; }
.project-title { display: block; max-width: 100%; color: var(--directory-color, var(--gallery-ink)); font-size: var(--directory-size, 27px); font-style: var(--directory-style, normal); line-height: 1.24; font-weight: 300; overflow-wrap: anywhere; text-wrap: pretty; transform: rotate(var(--directory-tilt, 0deg)); transform-origin: left center; transition: color 180ms ease; }
.mosaic-directory ol a[data-project-id]:hover .project-title,
.mosaic-directory ol a[data-project-id]:focus-visible .project-title { color: var(--directory-hover-color, var(--directory-color, var(--gallery-ink))); }
.mosaic-directory a.is-active .project-title { text-decoration: none; }
.mosaic-edit-toggle { position: fixed; bottom: 16px; right: 24px; z-index: 5; border: 1px solid currentColor; color: var(--gallery-ink); background: var(--gallery-bg); padding: 8px 12px; cursor: pointer; font-size: 12px; }
.mosaic-editor { position: fixed; z-index: 100; margin: 0; inset: 24px 24px auto auto; width: min(390px, calc(100vw - 48px)); max-width: calc(100vw - 48px); height: min(90vh, calc(100vh - 48px)); max-height: calc(100vh - 48px); padding: 24px; border: 1px solid #d4d4d4; background: #fafafa; color: #202020; overflow-y: auto; }
.mosaic-editor::backdrop { background: rgb(0 0 0 / .14); }
.editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid #d4d4d4; padding-bottom: 18px; margin-bottom: 24px; cursor: grab; touch-action: none; user-select: none; }
.editor-heading:active { cursor: grabbing; }
.editor-heading.is-dragging { cursor: grabbing; }
.editor-heading h2 { font-size: 18px; font-weight: 500; margin: 0; }
.editor-heading button { padding: 4px 0; background: none; border: 0; color: #444; cursor: pointer; }
.editor-field, .editor-upload { display: block; margin-bottom: 9px; font-size: 13px; }
.editor-select { width: 100%; padding: 10px; border: 1px solid #bdbdbd; background: #fff; font-size: 14px; }
.editor-layout-button { width: 100%; margin: 12px 0 0; padding: 10px; background: #202020; border: 1px solid #202020; color: #fff; cursor: pointer; }
.editor-photo { width: 100%; height: 170px; margin: 18px 0; background: #eee; }
.editor-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
#mosaic-upload { font-size: 12px; width: 100%; }
.editor-filename { font-size: 11px; color: #666; overflow-wrap: anywhere; min-height: 16px; }
.editor-crop { margin: 22px 0; display: grid; gap: 8px; }
.editor-crop label { display: flex; justify-content: space-between; font-size: 13px; }
.editor-crop input { width: 100%; accent-color: #333; margin: 0 0 12px; }
.editor-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #d4d4d4; }
.editor-section-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.editor-range { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.editor-section > input[type="range"] { width: 100%; margin: 5px 0 12px; accent-color: #333; }
.editor-inline-row { display: grid; grid-template-columns: 1fr 38px 1fr; gap: 10px; align-items: center; font-size: 13px; }
.editor-directory-colors { grid-template-columns: 1fr 38px 1fr 38px; }
.editor-directory-style-row { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.editor-inline-row input[type="color"] { width: 38px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.editor-inline-row select { width: 100%; min-height: 30px; border: 1px solid #ccc; background: #fff; font-size: 12px; }
.editor-background-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.editor-background-actions button { padding: 8px 10px; border: 1px solid #aaa; background: #fff; cursor: pointer; font-size: 12px; }
.editor-background-actions button:disabled { opacity: .4; cursor: default; }
.editor-color-row { display: grid; grid-template-columns: 1fr 38px 84px; gap: 12px; align-items: center; font-size: 13px; padding-top: 20px; border-top: 1px solid #d4d4d4; }
.editor-color-row input[type="color"] { padding: 0; width: 38px; height: 32px; border: 0; background: none; cursor: pointer; }
.editor-color-row input[type="text"] { width: 100%; padding: 6px; border: 1px solid #ccc; font-size: 12px; }
.editor-status { min-height: 36px; font-size: 12px; line-height: 1.5; color: #466349; }
.editor-status.is-error { color: #a32b24; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 12px; }
.editor-actions button { background: none; color: inherit; border: 1px solid #aaa; padding: 8px; cursor: pointer; }
.editor-actions a { text-decoration: underline; text-underline-offset: 3px; }
.layout-toolbar { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); z-index: 10; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; background: #fafafa; color: #202020; border: 1px solid #aaa; border-radius: 4px; font-size: 12px; }
.layout-toolbar__handle { width: 28px; height: 28px; padding: 0; border: 1px solid #aaa; background: #fff; color: #555; cursor: grab; touch-action: none; }
.layout-toolbar__handle:active { cursor: grabbing; }
.layout-toolbar__handle.is-dragging { cursor: grabbing; }
.layout-toolbar select { min-width: 0; max-width: 175px; height: 34px; border: 1px solid #bbb; background: #fff; }
.layout-check { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.layout-check input { accent-color: #333; }
.layout-commands { display: flex; flex-wrap: wrap; gap: 6px; }
.layout-toolbar button { height: 34px; border: 1px solid #aaa; background: #fff; color: inherit; padding: 0 9px; cursor: pointer; white-space: nowrap; }
.layout-toolbar .layout-icon { width: 34px; padding: 0; font-family: Arial, sans-serif; font-size: 22px; }
.layout-toolbar button:disabled { opacity: .3; cursor: default; }
.layout-toolbar button[aria-pressed="true"] { background: #147e9e; color: #fff; }
#layout-done { background: #202020; color: #fff; border-color: #202020; }
#layout-status { color: #466349; font-size: 11px; }
.mosaic-layout-editing { padding-bottom: 110px; }
.mosaic-layout-editing .mosaic-edit-toggle { display: none; }
.mosaic-layout-editing .mosaic-cell.is-visible { touch-action: none; cursor: grab; transition: none; }
.mosaic-layout-editing .mosaic-cell:focus-visible { outline: 2px solid #147e9e; outline-offset: -2px; }
.mosaic-layout-editing .mosaic-cell.is-selected { outline: 2px solid #147e9e; outline-offset: -2px; }
.mosaic-layout-editing .mosaic-cell.is-dragging { z-index: 60 !important; cursor: grabbing; outline: 2px solid #147e9e; outline-offset: -2px; }
.layout-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, var(--tile-size)); grid-template-rows: repeat(9, var(--tile-size)); pointer-events: none; }
.layout-grid.is-adding { z-index: 80; }
.layout-grid > span { border: 1px dashed color-mix(in srgb, var(--gallery-ink) 22%, transparent); }
.layout-grid.is-adding > span { pointer-events: auto; cursor: crosshair; }
.layout-grid.is-adding > span:hover { background: rgb(20 126 158 / .15); }
.layout-ghost { position: absolute; border: 2px dashed #147e9e; background: rgb(20 126 158 / .12); pointer-events: none; z-index: 70; }
.layout-ghost.is-invalid { border-color: #a32b24; background: rgb(163 43 36 / .12); }
@media (min-width: 1700px) { .project-title { font-size: var(--directory-size, 32px); } }
@media (max-width: 1000px) and (min-width: 701px) {
  .mosaic-layout { grid-template-columns: minmax(0,1.55fr) minmax(220px,.8fr); padding-left: 20px; gap: 24px; }
  .project-title { font-size: var(--directory-size, 22px); }
}
@media (max-width: 700px) {
  .mosaic-layout { grid-template-columns: minmax(0,1fr); gap: 4px; padding: 32px 20px 20px; align-items: start; }
  .mosaic-art { width: 100%; }
  .mosaic-board { width: 100%; }
  .mosaic-directory { padding: 14px 0 0; width: calc(100% - 10px); max-width: none; margin-left: 10px; }
  .mosaic-door-tile { width: min(306px, 100%); height: 128px; gap: 8px; margin: 0 0 24px auto; }
  .mosaic-door-label { width: 84px; margin-bottom: 39px; font-size: 14px; }
  .mosaic-door-stage { flex-basis: 132px; width: 132px; height: 118px; }
  .mosaic-door-drawing { width: 132px; height: 118px; }
  .mosaic-directory li + li { margin-top: 10px; }
  .project-title { font-size: var(--directory-size, 22px); }
  .mosaic-edit-toggle { bottom: 12px; right: 20px; }
  .layout-toolbar { gap: 8px; width: calc(100% - 24px); padding: 10px; }
  .layout-toolbar select { flex: 1; max-width: none; }
  .layout-check { font-size: 11px; }
  .layout-project-label { display: none; }
  .layout-commands { width: 100%; }
  #layout-done { margin-left: auto; }
  #layout-status { flex-basis: 100%; }
  .mosaic-layout-editing { padding-bottom: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .mosaic-cell, .mosaic-flipper, .mosaic-directory a, .project-label, .project-title, .mosaic-door-tile { transition: none; }
  .project-label { transform: none; }
  .mosaic-cell.is-rippling .mosaic-flipper { transform: none; }
  .mosaic-page.is-entering .mosaic-develop, .mosaic-page.is-entering .mosaic-directory { opacity: 1; pointer-events: auto; }
}
