/* Artrepo: a sand sheet, the mark top left, one input in the middle. On
   submit the palette choice and input glide to the top and the framed print
   fades up beneath them. */
:root {
  --sand: #efe6d3;
  --ink: #1d1a17;
  --muted: #7a7064;
  --red: #b3372d;
  --frame: #f6f0e3;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; /* frame info */
  --glide: 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { background: var(--sand); }
body {
  margin: 0;
  color: var(--ink);
  font: 18px/1.4 var(--serif);
  background-color: var(--sand);
  /* paper grain */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11  0 0 0 0 0.09  0 0 0 0 0.07  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  min-height: 100vh;
}
a { color: inherit; }

/* top bar: the mark on the left, the gallery link on the right, one line */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
}
.mark { margin: 0; display: flex; align-items: baseline; gap: 10px; font: 400 28px/1 var(--serif); letter-spacing: -0.01em; white-space: nowrap; }
.mark a { text-decoration: none; }
.mark .back { font-size: 20px; color: var(--muted); transition: color 0.2s ease, transform 0.2s ease; }
.mark .back:hover { color: var(--red); transform: translateX(-3px); }
.mark .name:hover { color: var(--red); }
/* The studio's wordmark, in the page's ink, between the way back and the name:
   as tall as the name's capital A, standing on the same line. */
.mark .studio img { display: block; height: 0.73em; width: auto; }
.mark .studio:hover img { opacity: 0.75; }
/* Bottom of the page, as on the studio's other pages. */
.credit { position: fixed; left: 0; right: 0; bottom: 10px; z-index: 1; text-align: center; font: 12px var(--mono); color: var(--muted); pointer-events: none; }
.corner {
  font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  text-decoration: none; white-space: nowrap;
  border-bottom: 1.5px solid currentColor; padding-bottom: 1px;
}
.corner:hover { color: var(--red); }

/* The painting page never scrolls: the print is sized to the space left. */
body.home { height: 100vh; height: 100dvh; overflow: hidden; }
body.home .stage { height: 100vh; height: 100dvh; }

/* Before: title and input sit in the middle of the page. */
.stage {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
  gap: 20px;
}
.head { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.tagline { margin: 20px 0 0; color: var(--muted); font-size: 24px; font-style: italic; text-align: center; text-wrap: pretty; }
/* the tagline on one line; the explanation stays narrow, about the input's width */
.tagline { white-space: nowrap; }
.explain { max-width: 660px; }
@media (max-width: 1240px) { .tagline { white-space: normal; max-width: 660px; } }
.explain { margin: 6px 0 0; color: var(--muted); font-size: 19px; line-height: 1.45; text-align: center; text-wrap: pretty; }
/* Under the input: Artrepo cannot see private repos. */
.note { margin: -8px 0 0; color: var(--red); font-size: 15px; font-style: italic; text-align: center; }
body.started .tagline, body.started .explain, body.started .note { display: none; }
.tagline-ghost { position: fixed; margin: 0; transition: opacity 0.35s ease; pointer-events: none; }

form { width: min(580px, 100%); position: relative; }
input {
  width: 100%;
  font: 400 28px var(--serif);
  color: var(--ink);
  text-align: center;
  padding: 8px 44px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s ease;
}
input::placeholder { color: #5f574d; font-style: italic; opacity: 1; }
input:focus { border-bottom-color: var(--red); }
/* the arrow at the end of the line: submits, like pressing Enter */
form button.go {
  position: absolute; right: 0; bottom: 6px;
  font: 400 30px/1 var(--serif); letter-spacing: 0; text-transform: none;
  color: var(--muted); background: none; border: 0; padding: 4px 6px;
  transition: color 0.3s ease, transform 0.3s ease;
}
form button.go:hover:not(:disabled), input:focus + button.go { color: var(--red); background: none; box-shadow: none; }
form button.go:hover:not(:disabled) { transform: translateX(3px); }
@media (max-width: 640px) {
  input { font-size: 24px; }
}
.choice { display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: 19px; white-space: nowrap; }
.choice button {
  font: italic 400 19px var(--serif); letter-spacing: 0; text-transform: none;
  color: var(--muted); background: none; border: 0; padding: 0 0 1px; border-radius: 0;
  border-bottom: 1px solid transparent;
}
.choice button:hover:not(:disabled) { color: var(--ink); background: none; box-shadow: none; }
.choice button.on { color: var(--ink); border-bottom-color: var(--ink); }
.choice-label { color: var(--muted); }
/* palette names written in their own colours */
.choice button.tinted, .choice button.tinted:hover:not(:disabled) {
  color: transparent; -webkit-background-clip: text; background-clip: text;
}
.choice button.tinted { opacity: 0.75; }
.choice button.tinted:hover, .choice button.tinted.on { opacity: 1; }

#status { min-height: 1.4em; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-variant-numeric: tabular-nums; }
#status.error { color: var(--red); }

/* After: the head sits at the top, the print below it. */
.print { display: none; margin: 0; flex-direction: column; align-items: center; gap: 10px; --size: min(calc(100vh - 290px), calc(100vw - 60px)); }
body.started .stage { justify-content: flex-start; }
/* while painting, the palette choice sits just above the input at the top;
   the status line tucks under the input so the frame keeps its height */
body.started .stage { gap: 30px; padding-top: 58px; }
body.started .head { gap: 8px; position: relative; }
body.started #status { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 16px; margin-top: 2px; }
@media (max-width: 1000px) {
  body.started .stage { gap: 24px; }
  .meta { flex-wrap: wrap; }
}
body.started .print { display: flex; }

/* the frame fades up once the head has started to move */
.print.enter { opacity: 0; transform: translateY(28px) scale(0.985); }
.print.entering { transition: opacity 1s ease 0.35s, transform var(--glide) 0.35s; }

.frame {
  padding: 14px;
  background: var(--frame);
  box-shadow: 0 1px 0 rgba(29, 26, 23, 0.08), 0 24px 48px -28px rgba(29, 26, 23, 0.45);
}
canvas { display: block; width: var(--size); height: var(--size); }

#caption { width: calc(var(--size) + 28px); display: flex; gap: 12px; white-space: nowrap; font: 12px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
#label { white-space: nowrap; font: 12px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
/* label on the left, buttons on the right, one line under the frame */
.meta { width: calc(var(--size) + 28px); display: flex; align-items: center; gap: 16px; }
.meta #label { flex: 1; min-width: 0; }
#caption { color: var(--muted); min-height: 1.5em; }
#caption .msg { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#label { display: block; text-transform: uppercase; letter-spacing: 0.1em; overflow: hidden; text-overflow: ellipsis; min-height: 1.5em; }
#actions button[hidden] { display: none; }

/* space kept from the start so nothing moves when the buttons appear */
#actions { display: flex; visibility: hidden; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; flex-shrink: 0; }
body.finished #actions { visibility: visible; }
button {
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover:not(:disabled) { background: var(--ink); color: var(--sand); box-shadow: 3px 3px 0 var(--red); }
button:disabled { opacity: 0.4; cursor: default; }


