:root {
  color-scheme: light;
  --paper: #faf7ee;
  --ink: #17362a;
  --muted: #4b5a4e;
  --green: #12372a;
  --green-hover: #24513f;
  --edge: #d9d4c2;
  --gold: #e9c276;
  --focus: #a45627;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 var(--sans);
}

button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button:not(:disabled) { cursor: pointer; }

.masthead {
  background: var(--green);
  border-bottom: 1px solid var(--gold);
  color: #fffaf0;
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-inline: auto;
  width: min(100% - 2rem, 68rem);
  min-height: 3.75rem;
  padding-block: .45rem;
}

.masthead p { margin: 0; font: 600 1rem/1.3 var(--serif); }
.event-mark { font-size: 1.25rem; color: var(--gold); }

.studio {
  display: grid;
  width: min(100% - 2rem, 34rem);
  margin-inline: auto;
  padding-block: 1.6rem 2.65rem;
  gap: 1.25rem;
  grid-template-areas: 'intro' 'picker' 'poster' 'editor';
}

.intro { grid-area: intro; }
.intro h1 {
  font: 500 clamp(3.5rem, 12vw, 6.35rem)/.98 var(--serif);
  letter-spacing: -.065em;
  margin: .45rem 0 .75rem;
}
.intro h1 span { color: #9a5c29; }
.intro p { margin: 0; }
.intro > p:last-child { max-width: 33ch; color: var(--muted); }
.intro .event-date { font-size: .83rem; font-weight: 650; }
.event-date span { padding-inline: .18rem; color: #805120; }

.picker { grid-area: picker; }
.picker .button { width: 100%; }
.picker-note { margin: .45rem 0 0; text-align: center; }
.small { font-size: .875rem; color: var(--muted); }
.message {
  margin: .6rem 0 0;
  color: var(--green);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.message:empty { margin: 0; }
.message.error { color: #8b311e; }

.button {
  min-height: 3rem;
  padding: .65rem 1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--green);
  border-radius: .4rem;
  font-size: .96rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.button:disabled { opacity: .55; cursor: default; }
.button-primary { background: var(--green); color: #fffaf0; }
.button-primary:hover:not(:disabled) { background: var(--green-hover); }
.button-secondary { background: transparent; color: var(--green); }
.button-secondary:hover:not(:disabled) { background: #e8ebdf; }
.button-symbol { color: var(--gold); font-size: 1.45rem; line-height: .8; font-weight: 400; }

.poster {
  grid-area: poster;
  margin: 0;
  justify-self: center;
  width: min(100%, 22rem);
  min-width: 0;
}
.poster-frame {
  position: relative;
  background: #17352a;
  border: .3rem solid #17352a;
  outline: 1px solid #aa7b3b;
  border-radius: .3rem;
  box-shadow: 0 .8rem 1.65rem #163a2619;
}
.poster-image, #poster { display: block; width: 100%; height: auto; aspect-ratio: 387 / 691; }
.photo-gesture { display: none; }
#poster[data-has-photo="true"] + .photo-gesture {
  position: absolute;
  display: block;
  /* Circle at (193, 326), radius 84 in the 387 × 691 original. */
  left: 28.1654%;
  top: 35.0217%;
  width: 43.4109%;
  height: 24.3126%;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
}
.photo-gesture:active { cursor: grabbing; }
.poster figcaption {
  margin-block-start: .55rem;
  color: var(--muted);
  text-align: center;
  font-size: .875rem;
}

.editor {
  grid-area: editor;
  border-top: 1px solid var(--edge);
  padding-top: 1.25rem;
  min-width: 0;
}
.editor fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
.editor legend { padding: 0; margin-bottom: .7rem; font: 600 1.45rem/1.15 var(--serif); }
.zoom-head, .move-row { display: flex; justify-content: space-between; align-items: center; gap: .7rem; flex-wrap: wrap; }
.zoom-head label, .zoom-head output { font-size: .925rem; font-weight: 650; }
#zoom { width: 100%; margin: .35rem 0 .5rem; height: 2.5rem; accent-color: var(--green); }
.direction-buttons { display: flex; gap: .3rem; }
.direction {
  background: transparent;
  color: var(--green);
  border: 1px solid #acae99;
  border-radius: .3rem;
  width: 2.75rem;
  min-height: 2.75rem;
  font-size: 1.15rem;
}
.direction:hover:not(:disabled) { background: #e8ebdf; }
.direction:disabled, .text-button:disabled { opacity: .55; }
.text-button {
  color: var(--green);
  background: transparent;
  border: 0;
  padding: .3rem .1rem;
  min-height: 2.75rem;
  text-underline-offset: .17em;
  text-decoration: underline;
  font-weight: 650;
  font-size: .9rem;
}
.text-button:hover:not(:disabled), .footer a:hover { color: #79501e; }

.move-hint { margin: .65rem 0 1.15rem; }
.exports { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); }
.share-options { margin-top: .7rem; border-left: 2px solid var(--edge); padding-left: .7rem; }
.share-options p { margin: 0; }
.footer {
  border-top: 1px solid var(--edge);
  margin-inline: auto;
  width: min(100% - 2rem, 68rem);
  padding-block: .75rem 1.35rem;
  text-align: center;
}
.footer a { display: block; width: fit-content; margin-inline: auto; color: var(--green); font-weight: 650; }

@media (min-width: 46rem) {
  .studio {
    width: min(100% - 3rem, 57rem);
    grid-template-columns: minmax(0, 1fr) minmax(18rem, .88fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 'intro poster' 'picker poster' 'editor poster';
    gap: 1.45rem clamp(1.75rem, 7vw, 5.3rem);
    padding-block: 3rem;
    align-items: start;
  }
  .poster { width: 100%; }
  .intro { padding-top: .4rem; }
  .intro h1 { font-size: clamp(4.25rem, 9vw, 6.35rem); }
  .picker-note { text-align: left; }
  .editor { padding-top: 1.35rem; }
}
