:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #eeeae2;
  background: #171b1b;
  font-synthesis: none;
  --muted: #aaa9a2;
  --line: rgb(228 222 210 / 18%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .4; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #e6bbd0; outline-offset: 5px; }

.gallery {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  min-height: 620px;
  height: 100svh;
  padding: max(26px, env(safe-area-inset-top)) max(38px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(38px, env(safe-area-inset-left));
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 42%, #303330 0%, #212524 43%, #141919 100%);
}

.gallery::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='white' filter='url(%23n)' opacity='.8' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

.heading, .caption, .toolbar, .buttons, .collection, .settings-heading { display: flex; align-items: center; }
.heading { justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.collection { gap: 12px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.collection svg { width: 30px; height: 30px; color: #d4c1c3; transition: transform 1s ease; }
.collection:hover svg { transform: rotate(60deg); }
.edition { font-size: 10px; letter-spacing: .06em; color: var(--muted); }
.edition-divider { padding: 0 14px; color: #707974; }
.stage { position: relative; min-height: 0; margin: 3px -24px; }
#garden { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.5s ease; }
#garden.ready { opacity: 1; }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; color: #d0c7c6; font-size: 11px; letter-spacing: .14em; }
.loading-flower { font-size: 38px; font-weight: 200; animation: unfurl 12s linear infinite; }
@keyframes unfurl { to { transform: rotate(360deg); } }
.unavailable { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90%, 360px); text-align: center; line-height: 1.6; color: var(--muted); }
.unavailable h2 { color: #eeeae2; font-family: Georgia, serif; font-weight: 400; font-size: 28px; }
.unavailable p { font-size: 13px; }
.caption { justify-content: space-between; align-items: flex-end; gap: 24px; padding-top: 6px; }
.eyebrow { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: #b6b3a9; margin: 0 0 9px; }
h1 { font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif; font-weight: 400; font-size: clamp(28px, 3.1vw, 42px); letter-spacing: -.045em; margin: 0; line-height: 1.05; }
h1 em { font-weight: 400; color: #d8bfc7; }
.description { margin: 10px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .015em; }
.toolbar { gap: 24px; padding-bottom: 2px; }
.motion-status { font-size: 10px; letter-spacing: .035em; color: #b6b9ae; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #b7c99b; box-shadow: 0 0 10px #b7c99b33; }
.motion-status.paused .status-dot { background: #8b8d86; box-shadow: none; }
.buttons { border: 1px solid var(--line); border-radius: 100px; padding: 3px; gap: 1px; background: #1d222077; }
.icon-button { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: #e5dfd210; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.settings { position: absolute; z-index: 5; right: max(38px, env(safe-area-inset-right)); bottom: 106px; width: 300px; padding: 22px; border: 1px solid #d4cfbf26; border-radius: 14px; background: #202724f5; box-shadow: 0 18px 60px #0005; backdrop-filter: blur(20px); }
.settings-heading { justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.settings h2 { font: 400 19px Georgia, serif; letter-spacing: -.025em; margin: 0; }
.close-button { border: 0; background: none; color: #b4b8ac; font-size: 24px; width: 36px; height: 36px; margin: -9px -9px -9px 0; }
.settings label { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 11px; letter-spacing: .02em; }
.settings output { font-size: 10px; color: #c9b4bd; }
.settings input[type="range"] { width: 100%; height: 20px; margin: 0; accent-color: #dab9ca; cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: #919b91; font-size: 9px; margin: 4px 0 26px; }
.settings-hint { color: #a8b0a5; font: italic 13px Georgia, serif; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.text-button { display: inline-flex; align-items: center; gap: 30px; border: none; padding: 10px 0; background: none; font-size: 10px; color: #d1cfbf; }
.text-button:hover { color: white; }
.text-button span { font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .gallery { padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); min-height: 560px; }
  .collection { font-size: 9px; gap: 9px; letter-spacing: .13em; }
  .collection svg { width: 26px; height: 26px; }
  .edition { font-size: 9px; }
  .edition-divider { padding: 0 7px; }
  .stage { margin: 6px -14px; }
  .caption { flex-wrap: wrap; row-gap: 22px; }
  .artwork-title { width: 100%; text-align: center; }
  h1 { font-size: 34px; }
  .description { font-size: 10px; }
  .toolbar { width: 100%; justify-content: space-between; gap: 10px; padding-top: 17px; border-top: 1px solid var(--line); }
  .motion-status { font-size: 10px; }
  .icon-button { width: 42px; height: 42px; }
  .settings { right: 20px; bottom: 92px; width: min(320px, calc(100% - 40px)); }
}

@media (max-width: 420px) {
  .edition { font-size: 0; }
  .edition::after { content: "No. 001"; font-size: 9px; }
  .edition-divider { display: none; }
}

@media (max-height: 600px) and (min-width: 701px) {
  .gallery { min-height: min(400px, 100svh); padding-top: 15px; padding-bottom: 18px; }
  .description { display: none; }
  h1 { font-size: 28px; }
  .caption { padding-top: 0; }
}

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

/* Fullscreen keeps the entire display for the frame. Controls remain reachable
   on touchscreens and when the browser only supports a full-window fallback. */
.screen-mode { overflow: hidden; }
.screen-mode .gallery { position: fixed; inset: 0; display: block; height: 100dvh; min-height: 0; padding: 0; }
.screen-mode .stage { position: absolute; inset: 0; margin: 0; }
.screen-mode .heading, .screen-mode .artwork-title, .screen-mode .motion-status { display: none; }
.screen-mode .caption { position: absolute; z-index: 2; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: block; padding: 0; }
.screen-mode .toolbar { width: auto; padding: 0; border: 0; }
.screen-mode .buttons { background: #171b1be8; backdrop-filter: blur(10px); }
.screen-mode .settings { right: max(18px, env(safe-area-inset-right)); bottom: max(82px, calc(env(safe-area-inset-bottom) + 66px)); max-height: calc(100dvh - 104px); overflow-y: auto; }
