/* =============================================================================
   SECTION 3 · OUR LITTLE WORLD  (scrapbook board)
   ========================================================================== */

.board {
  --board-bg: #FBF2E7;
  position: relative;
  padding: clamp(68px, 7vw, 76px) clamp(14px, 4vw, 48px) clamp(34px, 5vw, 56px);
  border-radius: var(--r-xl);
  background-color: var(--board-bg);
  background-image: radial-gradient(rgba(73, 52, 61, .12) 1px, transparent 1.5px);
  background-size: 22px 22px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-md);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 34px 14px;
  align-items: start;
}
.scrap--wide { grid-column: 1 / -1; }

@media (min-width: 720px) {
  .board-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 30px; }
  .scrap--wide { grid-column: span 2; }
}
@media (min-width: 1040px) {
  .board-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 54px 34px; }
}

/* Gentle organic offsets on larger screens */
@media (min-width: 720px) {
  .scrap:nth-child(3n + 2) { margin-top: 26px; }
  .scrap:nth-child(4n + 3) { margin-top: -10px; }
}

/* ---------- Polaroids --------------------------------------------------------- */
.polaroid {
  position: relative;
  display: block;
  width: 100%;
  padding: 9px 9px 0;
  border: 0;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(73, 52, 61, .08), 0 14px 28px -14px rgba(73, 52, 61, .45);
  text-align: center;
  cursor: pointer;
  transform: rotate(var(--rot, 0deg));
  transition: transform .5s var(--ease-spring), box-shadow .5s;
}
@media (hover: hover) {
  .polaroid:hover { transform: rotate(0) translateY(-8px) scale(1.035); box-shadow: 0 2px 2px rgba(73, 52, 61, .06), 0 28px 44px -18px rgba(73, 52, 61, .5); z-index: 2; }
}
.polaroid:focus-visible { transform: rotate(0) scale(1.03); z-index: 2; }
.polaroid:active { transform: rotate(0) scale(.98); }

.polaroid-img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: var(--blush);
}
.polaroid-img img,
.polaroid-img video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity .6s ease;
}
.polaroid-img .is-loading { opacity: 0; }
.polaroid-img::after { /* glossy film sheen */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}
.polaroid-cap {
  display: grid;
  place-items: center;
  min-height: 3.3em;
  padding: 10px 4px 12px;
  font-family: var(--font-hand);
  font-size: clamp(1.12rem, 4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--plum);
  text-wrap: balance;
}

/* Placeholder (shown until a real photo exists) */
.ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: var(--cherry-deep);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 10px, transparent 10px 20px),
    var(--ph-bg, var(--blush));
}
[data-tint="butter"] { --ph-bg: var(--butter-soft); }
[data-tint="kraft"] { --ph-bg: var(--kraft); }
[data-tint="rose"] { --ph-bg: #F4C9D1; }
.ph-icon { width: 34px; height: 34px; opacity: .7; }
.ph-text { font-family: var(--font-hand); font-size: 1.15rem; font-weight: 600; line-height: 1; }
.ph-path {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .7);
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--plum);
  overflow-wrap: anywhere;
}

/* ---------- Sticky notes that flip -------------------------------------------- */
.note {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  transform: rotate(var(--rot, 0deg));
  transition: transform .5s var(--ease-spring);
}
@media (hover: hover) { .note:hover { transform: rotate(0) translateY(-5px); } }
.note-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s var(--ease-spring);
}
.note.is-flipped .note-inner { transform: rotateY(180deg); }
.note-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #FBE3A1, #F4D48A);
  box-shadow: 0 16px 24px -16px rgba(73, 52, 61, .55), 0 1px 1px rgba(73, 52, 61, .1);
  font-family: var(--font-hand);
  text-align: left;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.note--blush .note-face { background: linear-gradient(160deg, #FBE6EA, #F4C4CE); }
.note-face::after { /* folded corner */
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(315deg, var(--board-bg, #FBF2E7) 50%, rgba(73, 52, 61, .14) 50%, rgba(255, 255, 255, .5) 100%);
}
.note-back { transform: rotateY(180deg); }
.note-kicker {
  font-family: var(--font-body);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.note-title { font-size: clamp(1.3rem, 4.6vw, 1.65rem); font-weight: 700; line-height: 1.02; color: var(--plum); }
.note-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cherry);
}
.note-text { font-size: clamp(1.15rem, 4vw, 1.4rem); font-weight: 600; line-height: 1.1; color: var(--plum); }
.note .tape { top: -10px; width: 64px; height: 22px; }

/* ---------- Notebook list ----------------------------------------------------- */
.notebook {
  position: relative;
  padding: 34px 18px 16px 52px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 38px, rgba(201, 62, 84, .4) 38px 39.5px, transparent 39.5px),
    repeating-linear-gradient(to bottom, var(--paper) 0 33px, rgba(73, 52, 61, .12) 33px 34px);
  background-position: 0 0, 0 16px;
  box-shadow: var(--shadow-md);
  transform: rotate(var(--rot, 0deg));
}
.notebook::before { /* spiral holes */
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 10px;
  height: 12px;
  background: radial-gradient(circle, var(--board-bg, #FBF2E7) 4.5px, transparent 5px) 0 0 / 24px 12px repeat-x;
}
.notebook-title {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 34px;
  color: var(--cherry);
}
.notebook-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 34px;
  color: var(--plum);
}
.notebook-list .icon { width: 14px; height: 14px; color: var(--rose); transition: transform .4s var(--ease-spring); }
.notebook-list li:hover .icon { transform: scale(1.4) rotate(-12deg); color: var(--cherry); }
.is-placeholder { opacity: .62; font-style: italic; }

/* ---------- Ticket stub -------------------------------------------------------- */
.ticket {
  position: relative;
  display: flex;
  min-height: 132px;
  border-radius: 14px;
  background: var(--cherry);
  color: #fff;
  box-shadow: 0 18px 30px -18px rgba(168, 48, 63, .8);
  transform: rotate(var(--rot, 0deg));
  transition: transform .5s var(--ease-spring);
}
@media (hover: hover) { .ticket:hover { transform: rotate(0) scale(1.02); } }
.ticket::before,
.ticket::after { /* notches */
  content: "";
  position: absolute;
  right: 92px;
  width: 22px;
  height: 22px;
  margin-right: -11px;
  border-radius: 50%;
  background: var(--board-bg, #FBF2E7);
}
.ticket::before { top: -11px; }
.ticket::after { bottom: -11px; }
.ticket-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 18px 20px;
  border-right: 2px dashed rgba(255, 255, 255, .45);
  min-width: 0;
}
.ticket-kicker { font-size: .66rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.ticket-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  font-variation-settings: "SOFT" 100;
}
.ticket-meta { font-size: .8rem; opacity: .9; }
.ticket-stub {
  display: grid;
  place-items: center;
  align-content: center;
  width: 92px;
  flex: none;
  font-family: var(--font-mono);
  font-size: .7rem;
  text-align: center;
}
.ticket-stub b { display: block; font-size: 1.1rem; writing-mode: vertical-rl; transform: rotate(180deg); margin-top: 6px; letter-spacing: .1em; }

/* ---------- Secret star (hidden message) -------------------------------------- */
.secret {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}
.secret-hint {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-3);
  transform: rotate(-6deg);
}
.secret-star {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.secret-star svg {
  width: 30px;
  height: 30px;
  fill: var(--butter);
  stroke: var(--plum);
  stroke-width: 1.4;
  --r: -8deg;
  animation: twinkle 2.6s ease-in-out infinite;
  transition: transform .6s var(--ease-spring);
}
@media (hover: hover) { .secret-star:hover svg { animation: none; transform: rotate(72deg) scale(1.2); } }
.secret-star[aria-expanded="true"] svg { animation: none; transform: rotate(144deg) scale(1.15); fill: var(--cherry); }

.secret-note {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(290px, calc(100vw - 2 * var(--gutter) - 28px));
  padding: 18px 18px 16px;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: note-unfold .55s var(--ease-spring);
}
.secret-note::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--cherry) 0 10px, var(--butter) 10px 20px);
}
@keyframes note-unfold {
  from { opacity: 0; transform: scale(.6) rotate(8deg); }
  to { opacity: 1; transform: rotate(-1.5deg); }
}
.secret-note { transform: rotate(-1.5deg); }
.secret-title { font-family: var(--font-hand); font-size: 1.5rem; font-weight: 700; color: var(--cherry); line-height: 1.1; }
.secret-text { margin-top: 6px; font-size: .95rem; line-height: 1.45; }

/* ---------- Lightbox ------------------------------------------------------------ */
.lightbox {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop {
  background: rgba(73, 52, 61, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox[open] .lb-card { animation: lb-in .55s var(--ease-spring); }
@keyframes lb-in {
  from { opacity: 0; transform: translateY(30px) scale(.9) rotate(-4deg); }
  to { opacity: 1; transform: rotate(-1deg); }
}
.lb-card {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 14px 14px 18px;
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1deg);
}
.lb-close { position: absolute; top: 22px; right: 22px; z-index: 4; }
.lb-img {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 62dvh;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 2px;
  background: var(--blush);
}
.lb-img img,
.lb-img video { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-cap {
  margin-top: 14px;
  font-family: var(--font-hand);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  color: var(--plum);
}
.lb-note { margin: 8px auto 0; max-width: 34ch; text-align: center; color: var(--ink-2); }
.lb-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.lb-count { font-size: .85rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
