/* The polaroids by the mirror, up close (her ask, 2026-10-29). One colour scheme, no dark mode switch (her standing rule);
   the walls, crown and skirting are walls.css, loaded after this.
   polaroids.js adds "up" to the body: the list of secrets (the page without script) steps aside and the vanity wall fills
   the screen, drawn in its own units (vanity.jpg's pixels) and moved and scaled as one. A polaroid opens over the wall as a
   polaroid in the hand with its secret on a sticky note. */
body.up { height: 100%; overflow: hidden; }
body.up main { display: none; }
.view { display: none; }
body.up .view { display: block; position: fixed; left: 0; right: 0; top: var(--crown, 0px); bottom: var(--skirt, 0px); overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
        background: transparent; }   /* the wallpaper behind is the room's own, so the wall runs on past its edges */
.view.held { cursor: grabbing; }
.view.arrive { animation: arrive .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes arrive { from { transform: scale(.6); opacity: 0; filter: blur(3px); } to { transform: none; opacity: 1; filter: none; } }
.vanity { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.vanity > img { position: absolute; left: 0; top: 0; display: block; -webkit-user-drag: none; }

/* a polaroid on the wall: her picture over the room's, lit like the room, a link to itself */
.pola { position: absolute; display: block; outline: none; }
.pola img { display: block; width: 100%; height: 100%; object-fit: cover; filter: brightness(.84) saturate(.68) sepia(.16) contrast(.95); -webkit-user-drag: none; }
.pola::after { content: ""; position: absolute; inset: -5px -5px -18px; pointer-events: none; transition: box-shadow .2s; }
.pola:hover::after, .pola:focus-visible::after { box-shadow: 0 0 0 2px #4fb3a9, 0 0 12px 2px #4fb3a988; }
/* the ones with a secret carry a little sticky note on their corner */
.pola .stuck { position: absolute; right: -16%; bottom: -30%; width: 42%; aspect-ratio: 1; background: linear-gradient(180deg, #e9cf62, #f6e384 22%, #f3dc72);
               box-shadow: 1px 2px 3px #0006; transform: rotate(8deg); pointer-events: none; }


/* the polaroid in the hand */
.veil { position: fixed; inset: 0; z-index: 70; overflow: auto; background: #2a1d14c4; -webkit-overflow-scrolling: touch; }
.veil.come { animation: come .35s ease-out both; }
@keyframes come { from { opacity: 0; } to { opacity: 1; } }
/* A real polaroid (her walk, 2 November: "they don't look like Polaroids anymore", the font far too large and the picture tiny):
   a square picture, narrow equal edges and a deep lip below, everything sized from --w. It was padding in percent, which in the
   side by side layout below is a percent of the whole row, not of the polaroid, so on a wide screen the frame ate the picture. */
.hold { position: relative; width: min(84vw, 420px); margin: 72px auto 96px; --w: min(84vw, 420px); }
.snap { box-sizing: border-box; width: var(--w); margin: 0; padding: calc(var(--w) * .055) calc(var(--w) * .055) 0; color: #2a1c2e; transform: rotate(var(--tilt, -1.5deg));
        background: linear-gradient(160deg, #fdfbf4, #f6f2e6 55%, #efeadc); box-shadow: 0 1px 1px #0004, 2px 5px 8px #0005, 5px 16px 30px #0009; }
.snap img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #2a1c2e; box-shadow: 0 0 0 1px #0003; }
.snap figcaption { box-sizing: border-box; display: flex; align-items: center; justify-content: center; height: calc(var(--w) * .2); padding: 0 4px; text-align: center;
                   font: italic calc(var(--w) * .043) / 1.15 Lora, Georgia, serif; color: #3a2a48; }
/* her sticky note, stuck on by its top edge, the bottom corner lifting off the page */
.sticky { position: relative; box-sizing: border-box; width: min(78vw, 300px); min-height: min(78vw, 300px); margin: -18px -3% 0 auto; padding: 26px 20px 22px; color: #2a1c2e; font: italic 15px/1.42 Lora, Georgia, serif;
          background: linear-gradient(180deg, #e6cb5a, #f6e389 7%, #f7e68f 72%, #f1db74); box-shadow: 1px 2px 2px #0003, 3px 12px 12px -5px #0008; transform: rotate(2.2deg); }
.sticky p { margin: 0 0 9px; color: #2a1c2e; }
.sticky p:last-child { margin-bottom: 0; }
.sticky a { color: #6a2a55; }
.veil button { position: fixed; z-index: 71; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid #c9a24b; background: #fffaf0; color: #2a1c2e;
               font: bold 24px/1 'Crimson Pro', Georgia, serif; cursor: pointer; box-shadow: 0 2px 8px #000a; }
.veil button:focus-visible { outline: 3px solid #4fb3a9; outline-offset: 3px; }
.veil .x { right: 14px; top: 14px; }
.veil .prev { left: 10px; top: 50%; margin-top: -22px; }
.veil .next { right: 10px; top: 50%; margin-top: -22px; }
@media (max-width: 520px) { .veil .prev, .veil .next { top: auto; bottom: 16px; margin: 0; } .veil .next { right: 14px; } }
@media (prefers-reduced-motion: reduce) { .view.arrive, .veil.come { animation: none; } }

/* in the room (polaroids.html?in=room, room-view.js): no wall and no page, only the polaroid in the hand over the room */
html.inroom, html.inroom body { background: transparent !important; background-image: none !important; }
html.inroom main, html.inroom .view, html.inroom .crown, html.inroom .skirting { display: none !important; }
html.inroom .veil { background: transparent; }

/* a polaroid taped up after the wall was drawn (vanity.json "taped", 31 October night: What would Nimbus say about us?):
   the page gives it the white edge and the shadow the others have in the wall's own picture */
.pola.taped { z-index: 1; transform: rotate(-2.5deg); }
.pola.taped::before { content: ""; position: absolute; inset: -7px -7px -24px; z-index: -1; background: #e6dfcf; box-shadow: 2px 5px 7px #0008; pointer-events: none; }

/* the polaroid in the hand on a wide screen (Ship's find, 31 October night: a long answer ran off the bottom of the screen
   at 1024 by 768 and 1280 by 800): the picture and its note lie side by side, both inside the screen; a note longer than
   the screen scrolls inside itself. On a phone they stay one above the other and the whole veil scrolls, as before. */
@media (min-width: 760px) {
  .hold { display: flex; align-items: center; justify-content: center; gap: 0; width: min(94vw, 940px); height: 100vh; height: 100dvh;
          margin: 0 auto; padding: 70px 56px 30px; box-sizing: border-box; --w: min(38vw, 420px, calc(100dvh - 190px)); }
  .snap { flex: 0 0 auto; }
  .sticky { flex: 0 0 auto; z-index: 1; width: 300px; min-height: 300px; max-height: calc(100dvh - 130px); margin: 40px 0 0 -26px; overflow: auto; overscroll-behavior: contain; }
}

/* a phone on its side (her walk, 2 November): the polaroid takes the height of the screen, its note beside it */
@media (min-width: 560px) and (max-height: 620px) {
  .hold { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; height: 100vh; height: 100dvh; margin: 0; padding: 10px 56px; box-sizing: border-box; --w: min(44vw, calc((100dvh - 24px) / 1.16)); }
  .snap { flex: 0 0 auto; }
  .sticky { flex: 0 1 280px; z-index: 1; width: auto; min-height: 0; max-height: calc(100dvh - 40px); margin: 0 0 0 -18px; overflow: auto; overscroll-behavior: contain; }
}
