/* The page is the app's own desk: gray dither, with paper lying on it. All the big type is
   banners exported from Bannerama, so the only web type is the system font, as in the app. */
:root {
  --paper: #fdfbf7;
  --fold: #f5f3ee;
  --ink: #262429;
  --soft: #6b676e;
  --hole: #7f7f7f;
  --blue: #0a6fe0;
  --gap: clamp(40px, 7vw, 96px);
}

* { box-sizing: border-box; }

html { background: #808080; }

body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
  background: conic-gradient(#888 25%, #787878 0 50%, #888 0 75%, #787878 0) 0 0 / 2px 2px;
}

main { overflow-x: clip; padding: var(--gap) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); justify-items: center; }

img { display: block; max-width: 100%; height: auto; }

.window { width: min(1160px, 100%); margin-block: calc(var(--gap) * -.45); padding: 0 8px; }
main > .window:first-child { margin-top: calc(var(--gap) * -.9); }

/* One sheet of fanfold, holes down both sides. */
.sheet {
  --edge: 34px;
  width: min(640px, 100% - 32px);
  padding: clamp(28px, 6vw, 52px) calc(var(--edge) + clamp(14px, 4vw, 36px));
  background:
    radial-gradient(circle, var(--hole) 0 4.5px, transparent 5px) 0 9px / var(--edge) 36px repeat-y,
    radial-gradient(circle, var(--hole) 0 4.5px, transparent 5px) 100% 9px / var(--edge) 36px repeat-y,
    linear-gradient(90deg, transparent calc(var(--edge) - 1px), #e4e0d8 0 var(--edge), transparent 0
      calc(100% - var(--edge)), #e4e0d8 0 calc(100% - var(--edge) + 1px), transparent 0),
    var(--paper);
  box-shadow: 0 1px 0 rgb(0 0 0 / .25), 0 14px 28px -10px rgb(0 0 0 / .45);
}
@media (max-width: 480px) { .sheet { --edge: 24px; background-size: var(--edge) 36px, var(--edge) 36px, auto, auto; } }
.sheet > * { margin: 0; }
.sheet > * + * { margin-top: 1.1em; }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

.button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { background: #0862c8; }
.button:active { background: #0756b0; }

.needs, .small { color: var(--soft); font-size: 14px; }

.sheet a:not(.button), .slip a:not(.button) { color: inherit; text-underline-offset: 2px; }
.sheet a:not(.button):hover, .slip a:not(.button):hover { color: var(--blue); }

/* A page of words, such as the privacy policy, on one long sheet, with the name at its head
   leading back to the front page. */
.doc { width: min(720px, 100% - 32px); }
.doc .home { display: block; width: min(100%, 240px); margin-left: -1.5%; }
.doc .name { image-rendering: pixelated; }
.doc h1 { font-size: 28px; line-height: 1.2; margin-top: 1.4em; }
.doc h2 { font-size: 19px; line-height: 1.3; margin-top: 1.8em; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: .5em; }

a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--ink); }

/* A torn-off slip of paper with a line about the banner above it. */
.note {
  margin: calc(var(--gap) * -.55) 16px 0;
  max-width: 34em;
  padding: 10px 18px;
  background: var(--paper);
  font-size: 15px;
  text-wrap: balance;
  text-align: center;
  box-shadow: 0 1px 0 rgb(0 0 0 / .25), 0 8px 16px -8px rgb(0 0 0 / .4);
}

/* The opening: the app's own Watch It Print. A dot matrix printer seen from above sits at the
   right of the first screen, and the banner runs out of it to the left, so the name reads as
   it appears. On a tall screen the whole picture is turned, as in the app, and the paper runs
   up. Everything is measured in inches of paper, and --in is one inch in pixels. Without
   print.js, or with reduced motion, the banner is simply already out. */
.press {
  --long: 66;                      /* inches of banner that should fit, where fitting matters */
  --odd: 1;                        /* 1 for a banner with an odd number of sheets; print.js sets it */
  --len: 100vw;                    /* the picture's long side */
  --fit: calc((var(--len) - 12px) / (var(--long) + 2.4));       /* the whole banner on the screen */
  --in: max(min(40px, var(--fit)), min(40px, 4.4svh));           /* or bigger, and its start runs off */
  --sheet: calc(11 * var(--in));
  --tail: calc(2.92 * var(--in));  /* paper past the title: round the roller, and 2.5 inches clear */
  min-height: max(100svh, 560px);
  padding: 16px 0;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(16px, 5vh, 64px);
  overflow: clip;
}

.stage, .bed { height: calc(11.9 * var(--in)); }
.stage { position: relative; }
.bed { position: relative; width: var(--len); }

.printer { position: absolute; right: 0; top: 0; height: 100%; width: calc(2.85 * var(--in)); }
.over { z-index: 2; }
.carriage { transform: translateY(calc(var(--u, 8.75) * 1px)); }    /* home is at the near end */

.feed {
  position: absolute;
  z-index: 1;
  left: 0; right: calc(1.63 * var(--in));           /* to where the paper goes out of sight round the roller */
  top: calc(1.2 * var(--in));
  height: calc(9.5 * var(--in));
  overflow: hidden;
  filter: drop-shadow(0 calc(.3 * var(--in)) calc(.5 * var(--in)) rgb(0 0 0 / .35));
}
/* the paper darkens as it turns away round the roller */
.feed::after {
  content: "";
  position: absolute; inset: 0 0 0 auto; width: calc(.42 * var(--in));
  background: linear-gradient(90deg, transparent, rgb(0 0 0 / .07), rgb(0 0 0 / .3));
  pointer-events: none;
}

/* The strip: blank fanfold with the title at its trailing end, every other sheet a touch
   darker as in the app. A banner longer than the screen runs off the far edge, start first, as
   it does in the app; on a screen longer than the banner the blank leader does. */
.paper {
  position: absolute; top: 0; right: 0;
  height: 100%; min-width: 100%;
  margin: 0; padding-right: var(--tail);
  will-change: transform;
  display: flex; justify-content: flex-end;
  background:
    linear-gradient(90deg, transparent 50%, rgb(0 0 0 / .022) 0)
      calc(100% - var(--tail) - var(--odd) * var(--sheet)) 0 / calc(2 * var(--sheet)) 100% repeat-x,
    url(img/blank.png) calc(100% - var(--tail)) 0 / auto 100% repeat-x,
    var(--paper);
}
/* The tractor holes are holes: the desk shows through them. They are punched every half inch
   down both edges, counted from the banner's end. */
.paper {
  --punch: calc(.085 * var(--in));
  mask:
    radial-gradient(circle at 50% calc(.25 * var(--in)), transparent var(--punch), #000 calc(var(--punch) + .5px))
      calc(100% - var(--tail)) 0 / calc(.5 * var(--in)) 100% repeat-x,
    radial-gradient(circle at 50% calc(100% - .25 * var(--in)), transparent var(--punch), #000 calc(var(--punch) + .5px))
      calc(100% - var(--tail)) 0 / calc(.5 * var(--in)) 100% repeat-x;
  mask-composite: intersect;
}
.paper img { flex: none; height: 100%; width: auto; max-width: none; }
/* print.js lays the ink on a canvas over the title, and the title itself stays for its words */
.paper canvas { position: absolute; top: 0; right: var(--tail); height: 100%; }
.paper.inked img { opacity: 0; }

/* Print another banner: a round paper button on the desk by the printer. */
.again {
  position: absolute; right: 14px; top: calc(100% + 8px); z-index: 3;
  width: 40px; height: 40px; padding: 9px;
  border: 0; border-radius: 50%;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 0 rgb(0 0 0 / .25), 0 8px 16px -8px rgb(0 0 0 / .5);
  cursor: pointer;
}
.again svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.again:hover { color: var(--blue); }
.again:active { translate: 0 1px; }
.again:disabled { color: var(--soft); cursor: default; }
.again:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--ink); }

/* The words and the button, on a slip of paper on the desk by the banner. */
.slip {
  align-self: center;
  width: min(560px, 100% - 32px);
  padding: 22px 26px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgb(0 0 0 / .25), 0 14px 28px -10px rgb(0 0 0 / .45);
}
/* the name again, small, for when the banner has run off the edge of the screen */
.slip h1 { line-height: 0; }
.slip .name { width: min(100%, 300px); margin-left: -2%; image-rendering: pixelated; }
.slip > * { margin: 0; }
/* a slip too narrow for the whole button says only App Store */
.slip { container-type: inline-size; }
@container (width < 210px) { .slip .wide { display: none; } }
.slip > * + * { margin-top: 1em; }

/* A tall screen: the picture turned a quarter turn, the printer at the foot and the slip beside. */
@media (max-aspect-ratio: 1/1) {
  .press {
    --len: max(100svh, 560px);
    --long: 55;
    --in: min((var(--len) - 12px) / (var(--long) + 2.4), 42vw / 11.9);
    padding: 0;
    flex-direction: row; justify-content: flex-start; align-items: stretch; gap: 0;
  }
  .stage { flex: none; width: calc(11.9 * var(--in)); height: var(--len); }
  .bed { transform-origin: 0 0; transform: translateX(calc(11.9 * var(--in))) rotate(90deg); }
  .slip { flex: 1; width: auto; margin: 0 14px 0 4px; padding: 18px; font-size: 15px; }
  .slip .button { padding-inline: 16px; }
  .again { top: auto; bottom: 14px; right: auto; left: calc(100% + 6px); }
}
