/* pegcityscoop.ca. Brand: PEG blue, CITY navy, SCOOP orange, ice. Courier New for text, Anton for the rare header. */
:root { --navy: #10183a; --ice: #e8f5fb; --orange: #ff6a00; --peg: #2b7fd4; --city: #1e4c8a; --card: #f7f1df; --ink: #1c2242; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 17px/1.5 "Courier New", Courier, monospace; color: var(--ink);
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  /* Adam's photo fills the page, anchored at the bottom so the skyline always shows */
  background: #2a1c2e url(../img/sunset.webp) 24% 100% / cover no-repeat fixed;
}
/* a white layer over the photo, 90% see-through */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: rgba(255,255,255,.10); }
/* phones: slide the photo over so the setting sun and the museum are both in frame */
@media (max-width: 760px) { body { background-position: 10% 100%; } }
main { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; padding: 3.5vh 12px 28vh; }

/* ---------- the postcard ---------- */
#card { position: relative; transform: rotate(-1.6deg); transition: transform .16s ease-in; filter: drop-shadow(8px 10px 0 rgba(0,0,0,.4)); }
#card.turning { transform: rotate(-1.6deg) scaleX(0); }
#front { position: relative; }
#pic { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#wordmark, #phil { position: absolute; object-fit: contain; pointer-events: none; }
#front button.hot { position: absolute; background: transparent; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#front button.hot:focus-visible, #stamp:focus-visible { outline: 3px dashed var(--orange); outline-offset: 2px; }

#back { background: var(--card); color: var(--ink); padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; position: relative; align-content: start; }
#back::before { content: "POST CARD"; position: absolute; left: 0; right: 0; top: 8px; text-align: center; font: 400 15px/1 Anton, Impact, sans-serif; letter-spacing: .3em; color: var(--city); }
#back .note { padding: 26px 14px 0 0; border-right: 2px solid var(--city); font-size: 16px; }
#back .note p { margin: 0 0 10px; }
#back .addr { padding-top: 6px; }
.stamprow { display: flex; justify-content: flex-end; align-items: flex-start; min-height: 116px; position: relative; }
#stamp { position: relative; width: 96px; height: 112px; padding: 3px; border: 4px dotted var(--card); cursor: pointer; background: #fff; }
#stamp canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#stamp img { position: absolute; left: 9px; bottom: 12px; width: calc(100% - 18px); }
.postmark { position: absolute; right: 74px; top: 16px; width: 78px; height: 78px; border: 2px solid rgba(28,34,66,.75); border-radius: 50%; transform: rotate(-12deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font: bold 10px/1.25 "Courier New", monospace; color: rgba(28,34,66,.8); pointer-events: none; }
.postmark::after { content: ""; position: absolute; left: 70px; top: 22px; width: 64px; height: 30px; background: repeating-linear-gradient(rgba(28,34,66,.7) 0 2px, transparent 2px 7px); border-radius: 0 40% 40% 0 / 0 60% 60% 0; }
#mailed { position: absolute; left: 0; top: 18px; font: 400 34px/1 Anton, Impact, sans-serif; color: #c0261c; border: 4px solid #c0261c; padding: 4px 12px; transform: rotate(-9deg); opacity: .85; letter-spacing: .06em; }
.addr .line { border-bottom: 2px solid var(--ink); padding: 8px 2px; }
.stickers { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 2px dashed var(--city); align-items: center; font-size: 14px; }
.sticker { font: 400 14px/1 Anton, Impact, sans-serif; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; padding: 8px 12px; border-radius: 999px; border: 2px solid #fff; box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.s1 { background: #2a1a4a; color: #d79bff; transform: rotate(-3deg); } .s2 { background: #8a5a30; color: #fff8e6; transform: rotate(2deg); } .s3 { background: #14141c; color: #ffd34a; transform: rotate(-1deg); }
@media (max-width: 560px) { #back { grid-template-columns: 1fr; } #back .note { border-right: 0; border-bottom: 2px solid var(--city); padding: 22px 0 8px; margin-bottom: 8px; } }

/* ---------- under the card (beside it on wide screens) ---------- */
#side { display: flex; flex-direction: column; align-items: center; width: min(560px, 100%); }
@media (min-width: 1100px) {
  main { flex-direction: row; justify-content: center; align-items: flex-start; gap: 36px; padding-top: 6vh; }
  #side { width: 440px; align-items: stretch; }
  #side .hint { margin-top: 0; }
}
.hint { margin: 18px 0 0; padding: 6px 12px; background: rgba(16,24,58,.82); color: #fff; font-size: 15px; text-align: center; }
.link { font: inherit; color: #ffd27a; background: none; border: 0; padding: 0 0 0 6px; text-decoration: underline; cursor: pointer; }
.link:focus-visible { outline: 2px dashed #fff; outline-offset: 2px; }
#say { margin: 10px 0 0; font-weight: bold; color: #fff; text-align: center; max-width: 560px; }
#say:not(:empty) { background: rgba(16,24,58,.9); padding: 10px 14px; border: 2px solid var(--ice); }
#say a { color: #ffd27a; }

/* the sign-up: a cream slip of card, always visible */
#join { width: min(560px, 100%); margin-top: 18px; padding: 20px 20px 16px; background: var(--card); border: 3px solid var(--navy); box-shadow: 6px 6px 0 rgba(0,0,0,.4); }
#join h1 { font: 400 clamp(26px, 6.4vw, 36px)/1.08 Anton, Impact, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 8px; color: var(--city); }
#join p { margin: 0 0 14px; }
#signup iframe { display: block; width: 100%; height: 52px; margin: 0; border: 0; background: transparent; }
.fine { font-size: 14px; margin: 12px 0 0 !important; color: #3a4060; }
.fine a, footer a { color: inherit; }
#result { font-weight: bold; margin: 12px 0 0 !important; min-height: 1.5em; }

footer { position: relative; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding: 10px 12px; font-size: 14px; color: #fff; background: rgba(16,24,58,.86); }
footer a { color: #fff; }

/* a plain page for the privacy note */
.plain { background: var(--card); max-width: 640px; margin: 5vh auto; padding: 24px; border: 3px solid var(--navy); }
.plain h1 { font: 400 32px/1.1 Anton, Impact, sans-serif; text-transform: uppercase; color: var(--city); margin: 0 0 12px; }

@media (prefers-reduced-motion: reduce) { #card { transition: none; } }
