/* 8472 prints. The look is James's straw page: a pixel title with a heavy underline, serif text,
   a red order line, section titles sliding between dashed rules, doodles and tilted notes. */
@font-face { font-family: "VT323"; src: url("/fonts/VT323-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Frank Ruhl"; src: url("/fonts/FrankRuhlLibre-400.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --ink: #000;
  --paper: #fff;
  --red: #df001d;
  --card: #fdfcf8;
  --edge: #d8d8d8;
  --w: 150px; /* short side of a print */
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  padding: 40px 16px 120px;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.35 "Frank Ruhl", Georgia, serif;
  -webkit-text-size-adjust: 100%;
}
.straw, .receipt { max-width: 500px; margin: 0 auto; }
p { margin: 0 0 14px; }
a { color: inherit; }

/* title block */
.px, .mark {
  margin: 0 auto 30px;
  width: max-content;
  font: 400 96px/0.8 "VT323", monospace;
  -webkit-text-stroke: 3px var(--ink);
  letter-spacing: 2px;
  border-bottom: 8px solid var(--ink);
  padding-bottom: 6px;
}
.px a { text-decoration: none; }
.sub, .tag { margin: 0 0 30px; text-align: center; font-size: 21px; font-weight: 400; line-height: 1.25; }
.red { text-align: center; color: var(--red); margin-bottom: 22px; }
.red b { font-weight: 400; }

/* a section title sliding between two dashed rules */
.rule { border-top: 2px dashed var(--ink); border-bottom: 2px dashed var(--ink); overflow: hidden; white-space: nowrap; padding: 9px 0; margin: 0 0 16px; }
.rule > div { display: inline-block; animation: slide 24s linear infinite; }
.rule span { display: inline-block; padding-right: 34px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* a numbered step: the same dashed rules, but it stays still so it can be read */
.step { display: flex; align-items: baseline; gap: 10px; border-top: 2px dashed var(--ink); border-bottom: 2px dashed var(--ink); padding: 9px 0; margin: 26px 0 16px; font-size: 19px; font-weight: 400; }
.step b { font: 400 30px/0.7 "VT323", monospace; -webkit-text-stroke: 1px var(--ink); }

svg.doodle { display: block; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.note { display: inline-block; font-size: 13px; transform: rotate(8deg); }
.note.l { transform: rotate(-7deg); }
.right { text-align: right; }
.small { font-size: 14px; }
.c { text-align: center; }

/* boxes with a button bar along the bottom, like the straw page's own */
.box, .drop { border: 2px solid var(--ink); border-radius: 5px; font: 17px/1.2 Arial, Helvetica, sans-serif; text-align: center; }
a.box { display: block; max-width: 380px; margin: 0 auto; text-decoration: none; }
.box b, .drop .big { display: block; margin: 0; font-weight: normal; padding: 30px 12px; }
.box span { display: block; border-top: 2px solid var(--ink); padding: 12px; }
a.box:hover span, a.box:focus-visible span { background: var(--ink); color: var(--paper); }
.drop.over { background: var(--ink); color: var(--paper); }
.drop .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-top: 2px solid var(--ink); }
.drop .btns button { border: 0; border-radius: 0; padding: 13px 6px; background: transparent; color: inherit; }
.drop .btns button + button { border-left: 2px solid var(--ink); }
.drop .btns button:hover { background: var(--ink); color: var(--paper); }
.start { display: flex; justify-content: flex-end; align-items: flex-end; gap: 4px; margin: -4px 30px 2px 0; }

button {
  font: 17px/1.2 Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
}
button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button:disabled { cursor: default; opacity: .45; }
.btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0 0; }

.msg { border: 2px solid var(--ink); border-radius: 5px; padding: 10px; font-size: 15px; text-align: center; }
.hint { font-size: 14px; text-align: center; margin: 12px 0 0; }
#clear { font-size: 14px; min-height: 36px; padding: 6px 12px; border-width: 1px; }

/* prints */
.prints { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 18px 14px; }
.prints:empty { display: none; }
.item { margin: 0; }
.item .card { margin: 0 auto; }
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: 2px 3px 7px rgba(0, 0, 0, .18);
  transform: rotate(var(--tilt, 0deg));
  width: var(--w);
  height: calc(var(--w) * 86 / 54);
}
.photo {
  position: absolute;
  left: calc(var(--w) * 4 / 54);
  top: calc(var(--w) * 7 / 54);
  width: calc(var(--w) * 46 / 54);
  height: calc(var(--w) * 62 / 54);
  overflow: hidden;
  background: #1c1b1a;
  cursor: grab;
}
/* a landscape photo prints sideways on the film: turned upright, the wide border sits on the left */
.item.land .card { width: calc(var(--w) * 86 / 54); height: var(--w); }
.item.land .photo {
  left: calc(var(--w) * 17 / 54);
  top: calc(var(--w) * 4 / 54);
  width: calc(var(--w) * 62 / 54);
  height: calc(var(--w) * 46 / 54);
}
.photo:active { cursor: grabbing; }
.photo img {
  position: absolute; left: 0; top: 0; display: block; max-width: none; transform-origin: 0 0;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  animation: develop 5s ease-out both;
}
@keyframes develop {
  0% { opacity: 0; filter: sepia(.9) saturate(.2) contrast(.4) brightness(.55); }
  35% { opacity: .55; filter: sepia(.7) saturate(.4) contrast(.6) brightness(.8); }
  100% { opacity: 1; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .photo img, .rule > div { animation: none; }
}
.ctl { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 8px; font: 14px Arial, Helvetica, sans-serif; }
.ctl button { font-size: 14px; padding: 2px 8px; min-width: 36px; min-height: 36px; border-width: 1px; border-radius: 4px; }
/* under an upright print the buttons take two rows, so two prints still sit side by side */
.item:not(.land) .ctl { flex-wrap: wrap; max-width: calc(var(--w) + 8px); margin-left: auto; margin-right: auto; }
.ctl .qty { min-width: 2ch; text-align: center; }
.state { font-size: 13px; min-height: 1.4em; margin: 2px 0 0; text-align: center; }

/* bill */
.line { display: flex; align-items: baseline; gap: 6px; margin: 0 0 6px; }
.line i { flex: 1; border-bottom: 2px dotted var(--ink); transform: translateY(-4px); }
.line.total { font-weight: 700; font-size: 21px; margin-top: 12px; }
.nudge { font-size: 14px; margin: 12px 0 0; text-align: center; color: var(--red); }
.pay {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 19px;
}
.pay:disabled { background: var(--paper); color: var(--ink); font-size: 16px; opacity: .6; }

.keep { margin-top: 30px; text-align: center; font-size: 15px; }
.keep .big { font-size: 17px; margin-bottom: 6px; }
/* share with a friend: answers the finger at once, no double-tap wait, no grey flash */
[data-share], .share-more button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
[data-share] { min-width: 210px; }
[data-share]:active, .share-more button:active { background: var(--ink); color: var(--paper); }
.share-more button { font-size: 15px; min-width: 96px; }
footer { margin-top: 34px; font-size: 14px; text-align: center; }
footer p { margin-bottom: 6px; }

/* running total pinned to the bottom of the screen once there is something to pay for */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 2px dashed var(--ink);
  font: 16px Arial, Helvetica, sans-serif;
}
.bar[hidden] { display: none; }
.bar .pay { width: auto; margin: 0; padding: 11px 22px; }

.cam { border: 2px solid var(--ink); border-radius: 5px; padding: 12px; max-width: min(92vw, 560px); }
.cam::backdrop { background: rgba(255, 255, 255, .9); }
.cam video { display: block; width: 100%; background: #000; }

/* plain pages: thank you, terms */
.receipt > section { border-top: 2px dashed var(--ink); padding-top: 16px; margin-top: 16px; }
.receipt .big { font-size: 21px; }
.page h2 { font-size: 17px; margin: 0 0 6px; }

/* about page */
.cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; margin-bottom: 8px; }
.cols.flip { grid-template-columns: 1fr 1.2fr; }
.side { position: relative; }
/* photos sit in white print frames with room for a line underneath, a little askew */
.snap { margin: 4px 0 14px; padding: 8px 8px 0; background: var(--card); border: 1px solid var(--edge); box-shadow: 2px 3px 8px rgba(0, 0, 0, .2); transform: rotate(var(--tilt, 0deg)); }
.snap img { display: block; width: 100%; height: auto; }
.snap figcaption { padding: 8px 2px 10px; font-size: 13px; text-align: center; }
.leave { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; }

@media (max-width: 480px) {
  body { padding-top: 26px; }
  .px, .mark { font-size: 78px; }
  .cols, .cols.flip { grid-template-columns: 1fr; }
  .snap { max-width: 260px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 380px) { :root { --w: 132px; } }
