/* placeholder2 - shared styles for every page */

:root {
  --cork: #b3946b;
  --paper: #f4f0e8;
  --ink: #2a2622;
  --ink-soft: #6b6258;
  --note-yellow: #fff7c4;
  --note-green: #c8e6cc;
  --note-blue: #bcdcf7;
  --note-pink: #f8bbd0;
  --tape: rgba(244, 232, 178, 0.78);
  --hand: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --type: "IBM Plex Mono", "DejaVu Sans Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--type);
  background: #b3946b url("background.svg") center / cover fixed no-repeat;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid #1f5fbf;
  outline-offset: 3px;
}

.board {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 20px 80px;
  text-align: center;
}

/* ---------- top links ---------- */

.topnav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--hand);
  font-size: 1.35rem;
}
.topnav a {
  text-decoration: none;
  padding: 2px 12px;
  background: var(--paper);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
  transform: rotate(var(--tilt, 0deg));
}
.topnav a:hover { background: #fff; }

/* ---------- title paper ---------- */

.paper-title {
  position: relative;
  display: inline-block;
  margin: 18px 0 0;
  padding: 22px 54px 26px;
  background: var(--paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(0, 0, 0, 0.08);
  transform: rotate(-1.4deg);
}
.paper-title h1,
.paper-title h2 {
  margin: 0;
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.01em;
}
.paper-title.small { padding: 10px 34px 14px; transform: rotate(0.8deg); }
.paper-title.small h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); }

.tagline {
  margin: 22px 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: #5a4c3a;
}
.count {
  margin: 8px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: #6c5a43;
}
.blurb {
  max-width: 46ch;
  margin: 18px auto 0;
  font-family: var(--hand);
  font-size: 1.5rem;
  line-height: 1.25;
}

/* ---------- tape ---------- */

.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 78px;
  height: 24px;
  margin-left: -39px;
  background: var(--tape);
  border: 1px solid rgba(180, 160, 90, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: rotate(var(--tape-tilt, -2deg));
  pointer-events: none;
}

/* ---------- sticky notes (album links) ---------- */

.notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
  margin: 36px 0 12px;
  padding: 0;
  list-style: none;
}
.note {
  display: block;
  min-width: 90px;
  padding: 9px 20px 10px;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.1;
  text-decoration: none;
  background: var(--note-yellow);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.note:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 8px 12px rgba(0, 0, 0, 0.28); }
.note.c0 { background: var(--note-yellow); }
.note.c1 { background: var(--note-green); }
.note.c2 { background: var(--note-blue); }
.note.c3 { background: var(--note-pink); }
.note.here { background: var(--paper); }

/* ---------- polaroids ---------- */

.pile {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 54px 36px;
  margin: 56px 0 0;
  padding: 0 8px;
}

.polaroid {
  position: relative;
  display: block;
  margin: 0;
  padding: 14px 14px 0;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(0, 0, 0, 0.1);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.polaroid:hover,
.polaroid:focus-within {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.32);
  z-index: 2;
}

.shot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  color: inherit;
  background: linear-gradient(135deg, #e8e0d2, #d6cbb9);
  border: 2px dashed rgba(190, 190, 190, 0.85);
}
.shot.has-photo { border-style: solid; border-color: #ececec; background: #ddd; }
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
button.shot {
  width: 100%;
  padding: 0;
  font: inherit;
  cursor: zoom-in;
}

.blank-label {
  padding: 0 12px;
  font-size: 0.85rem;
  color: #9d9588;
  word-break: break-all;
}

.caption {
  padding: 16px 8px 18px;
  font-family: var(--hand);
  font-size: 1.4rem;
  line-height: 1.15;
}
.caption small {
  display: block;
  margin-top: 4px;
  font-family: var(--type);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ---------- empty state ---------- */

.empty {
  max-width: 44ch;
  margin: 56px auto 0;
  padding: 22px 26px;
  background: var(--paper);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  transform: rotate(0.6deg);
  line-height: 1.6;
  font-size: 0.9rem;
  text-align: left;
}
.empty code { background: rgba(0, 0, 0, 0.07); padding: 1px 5px; }

/* ---------- plain paper page (contact, 404) ---------- */

.sheet {
  position: relative;
  max-width: 520px;
  margin: 56px auto 0;
  padding: 40px 36px 36px;
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  transform: rotate(0.7deg);
  text-align: left;
  line-height: 1.7;
}
.sheet p { margin: 0 0 16px; }
.sheet .hand { font-family: var(--hand); font-size: 1.7rem; line-height: 1.2; }
.sheet dl { margin: 22px 0 0; }
.sheet dt { margin-top: 12px; font-size: 0.75rem; letter-spacing: 0.12em; color: var(--ink-soft); }
.sheet dd { margin: 2px 0 0; font-size: 1.05rem; }

/* ---------- lightbox ---------- */

dialog.lightbox {
  width: min(94vw, 1100px);
  max-height: 94vh;
  padding: 14px 14px 10px;
  border: 0;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
}
dialog.lightbox::backdrop { background: rgba(30, 22, 12, 0.78); }
dialog.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 110px);
  margin: 0 auto;
  object-fit: contain;
}
dialog.lightbox p { margin: 10px 0 6px; font-family: var(--hand); font-size: 1.5rem; }
dialog.lightbox .controls { display: flex; justify-content: space-between; gap: 10px; }
dialog.lightbox button {
  padding: 4px 16px;
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--ink);
  background: var(--note-yellow);
  border: 0;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

footer.foot {
  margin-top: 70px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #5a4c3a;
}

@media (max-width: 560px) {
  .paper-title { padding: 18px 28px 20px; }
  .pile { grid-template-columns: 1fr 1fr; gap: 40px 18px; }
  .caption { font-size: 1.15rem; padding: 12px 4px 14px; }
  .tape { width: 56px; margin-left: -28px; }
  .sheet { padding: 30px 22px; }
}
@media (max-width: 380px) {
  .pile { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .polaroid, .note { transition: none; }
}

/* ---------- album pages: cork board panel in the centre ----------
   Every page gets the sky gradient (see body above). Album pages add
   class="album" to <body>, which puts the content on a framed cork panel. */

.album .board {
  width: calc(100% - 24px);
  max-width: 1040px;
  margin: 28px auto 40px;
  padding: 36px 24px 56px;
  background-color: #b3946b;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.24  0 0 0 0 0.1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.14), transparent 60%);
  border: 12px solid #6e4f31;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.18),
    inset 0 4px 14px rgba(0, 0, 0, 0.25),
    0 18px 36px rgba(0, 0, 0, 0.35);
}

@media (max-width: 560px) {
  .album .board { width: calc(100% - 12px); margin-top: 6px; padding: 24px 12px 40px; border-width: 8px; }
}
