/* ---------- 2. Cork board: "What I do" ---------- */
.scene-cork {
  display: flex; flex-direction: column; align-items: center;
  padding: 10vh calc(var(--side) + 16px) 2vh;
}
@media (max-width: 520px) {
  .scene-cork { padding: 8vh calc(var(--side) + 2px) 2vh; }
  .cork-board { border-width: 8px; box-shadow: 6px 8px 0 rgba(70, 60, 40, 0.13); }
}

/* Aluminum frame, lit from the top left like everything else in the room */
.cork-board {
  container: board / inline-size;
  width: min(1180px, 100%);
  border: 12px solid;
  border-color: #dedcd4 #b0ada3 #a29f95 #cfccc3;
  box-shadow: 12px 14px 0 rgba(70, 60, 40, 0.13);
}
.cork {
  position: relative; isolation: isolate;
  min-height: 24rem;
  padding: 18px 14px 26px;
  background-color: #c79d6c;
  background-image:
    radial-gradient(#b0855a 1px, transparent 1.6px),
    radial-gradient(#dcb886 1px, transparent 1.6px),
    radial-gradient(#a97c50 0.8px, transparent 1.3px);
  background-size: 6px 6px, 9px 9px, 13px 13px;
  background-position: 0 0, 3px 4px, 7px 2px;
}

.cork-title {
  position: relative; z-index: 4;
  display: inline-block;
  margin: 0 0 22px 6px; padding: 4px 18px 6px;
  background: var(--paper);
  font-family: var(--f-hand); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.1;
  transform: rotate(-2deg);
  box-shadow: 4px 5px 0 rgba(70, 45, 20, 0.22);
}
.cork-title::before, .cork-title::after {
  content: ""; position: absolute; top: -8px; width: 54px; height: 18px; background: rgba(226, 214, 172, 0.92);
}
.cork-title::before { left: -12px; transform: rotate(-18deg); }
.cork-title::after { right: -12px; transform: rotate(14deg); }

/* Red string runs behind the items (so it never crosses text) and the pins sit on top. */
.cork-string { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.string-shadow { fill: none; stroke: rgba(60, 35, 15, 0.28); stroke-width: 2.4; transform: translate(2px, 3px); }
.string-line { fill: none; stroke: #b3302a; stroke-width: 2; stroke-linecap: round; }

/* Flow layout (phones and tablets) */
.cork-items {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 14px; align-items: start;
}
.cork-slot { position: relative; padding-top: 6px; }
.slot-sticky .pinned, .slot-photo .pinned { max-width: 12.5rem; margin-inline: auto; }
.cork-slot:nth-child(odd) { margin-top: 10px; }
@container board (max-width: 559px) {
  .cork { padding: 14px 10px 22px; }
  .cork-slot:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }
  .pinned { font-size: 0.86rem; }
  .skin-card { padding: 0.45em 0.6em 0.7em; min-height: 7em; }
  .skin-sticky { padding: 0.9em 0.65em 0.7em; }
  .skin-photo { padding: 0.4em 0.4em 0.55em; }
}
@container board (min-width: 560px) {
  .cork-items { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 26px; }
  .cork-slot:nth-child(odd) { margin-top: 0; }
  .cork-slot:nth-child(3n + 2) { margin-top: 18px; }
}

/* Push pins */
.cork-pin {
  position: absolute; top: 0; left: 50%; z-index: 3;
  width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%;
  background: var(--pin);
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22), inset 2px 2px 0 rgba(255, 255, 255, 0.35), 2px 3px 0 rgba(50, 30, 10, 0.32);
  pointer-events: none;
}
.pin-red { --pin: #c23a2b; }
.pin-blue { --pin: #2f6a8a; }
.pin-yellow { --pin: #e2b43a; }
.pin-green { --pin: #3f8a55; }

/* Items on the wall */
.pinned {
  position: relative; z-index: 1;
  display: block; width: 100%;
  margin: 0; border: 0; border-radius: 0;
  font-family: var(--f-hand); font-size: 0.98rem; line-height: 1.3; text-align: left;
  color: var(--ink);
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 8px;
  box-shadow: 4px 6px 0 rgba(70, 45, 20, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pinned:hover { transform: rotate(calc(var(--tilt, 0deg) * -0.6)) translateY(-2px); box-shadow: 7px 10px 0 rgba(70, 45, 20, 0.2); }
.pinned:focus-visible { outline-offset: 4px; }
.pinned.is-lifted { visibility: hidden; }
.it-title { display: block; font-weight: 700; font-size: 1.22em; line-height: 1.1; margin-bottom: 0.3em; }
.it-front { display: block; }

/* Skins: shared by the wall items and the inspect faces */
.skin-card {
  padding: 0.55em 0.85em 0.9em;
  min-height: 8.5em;
  background-color: #fbfaf5;
  background-image:
    linear-gradient(#d9675a, #d9675a),
    repeating-linear-gradient(180deg, transparent 0 calc(1.3em - 1px), #c3d5e2 calc(1.3em - 1px) 1.3em);
  background-size: 100% 1px, 100% 100%;
  background-position: 0 2.1em, 0 2.1em;
  background-repeat: no-repeat, no-repeat;
}
.skin-card .it-title { min-height: 1.7em; }
.skin-sticky {
  aspect-ratio: 1 / 1;
  padding: 1.1em 0.9em 0.9em;
  background: var(--sticky);
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0 0.55em, transparent 0.55em);
}
.sticky-yellow { --sticky: #f3df7c; }
.sticky-pink { --sticky: #f2b8c0; }
.sticky-blue { --sticky: #abd3e6; }
.sticky-green { --sticky: #c3e0a6; }
.skin-photo { padding: 0.5em 0.5em 0.7em; background: #fbfaf6; }
.skin-photo .it-title { margin: 0.45em 0 0.15em; text-align: center; }
.skin-photo .it-front { font-size: 0.86em; text-align: center; color: var(--ink-soft); }
.photo-img { display: block; aspect-ratio: 1 / 1; background: #e6e0cf; overflow: hidden; }
.photo-img svg, .photo-img img { width: 100%; height: 100%; object-fit: cover; }

/* Collage layout (wide screens): positions come from content.json (x, y in % of the board) */
@container board (min-width: 880px) {
  .cork { aspect-ratio: 16 / 9; min-height: 0; padding: 0; }
  .cork-title { position: absolute; left: 3.5%; top: 6%; margin: 0; font-size: clamp(1.8rem, 3.3cqw, 2.6rem); }
  .cork-items { display: block; position: absolute; inset: 0; }
  .cork-slot { position: absolute; left: var(--x, 0); top: var(--y, 0); margin: 0 !important; width: 15%; }
  .slot-card { width: 21%; }
  .pinned { font-size: clamp(13px, 1.32cqw, 17px); }
}

/* ---------- Inspect view ---------- */
html.is-inspecting { overflow: hidden; background: #5f594b; } /* fills the scrollbar gutter under the backdrop */
.inspect {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--ink);
  overflow: auto; overscroll-behavior: contain;
}
.inspect::backdrop { background: rgba(38, 33, 24, 0.72); }
.inspect-stage {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  padding: 28px 16px;
}
.inspect-fly { perspective: 1400px; width: min(88vw, 33rem); }
.inspect-sticky { width: min(86vw, 27rem); }
.inspect-photo { width: min(84vw, 25rem); }
.inspect-card {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; /* pan-y: tall cards still scroll on phones */
}
.inspect-card.is-dragging { transition: none; cursor: grabbing; }
.face {
  grid-area: 1 / 1;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-family: var(--f-hand); font-size: clamp(1.02rem, 3.6vw, 1.2rem); line-height: 1.35;
  box-shadow: 10px 14px 0 rgba(20, 15, 8, 0.35);
}
.face-back { transform: rotateY(180deg); }
.face h2, .face h3, .face p, .face ul { margin: 0; }
.face .it-title { font-size: 1.5em; }
.face.skin-card { min-height: 0; }
.face.skin-photo .it-front { font-size: 0.95em; }
.it-more { margin-top: 0.9em !important; font-family: var(--f-device); font-size: 0.68em; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.skin-photo .it-more { text-align: center; }
.face-back.skin-photo { padding: 1.1em 1.2em 1.3em; background: #f1eee5; }
.face-back.skin-card { background-position: 0 2.6em, 0 2.6em; padding-top: 0.75em; }
.it-back-heading { font-size: 1.3em; line-height: 1.15; margin-bottom: 0.55em !important; }
.face-back.skin-card .it-back-heading { min-height: 1.6em; }
.it-back-list { padding-left: 1.1em; }
.it-back-list li { margin: 0.3em 0; }
.it-back-list li::marker { color: #b3302a; }

.inspect-ui { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 33rem; }
.inspect-btn {
  min-height: 44px; padding: 0 16px;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font-weight: 700; box-shadow: 3px 4px 0 #000;
}
.inspect-btn:hover { background: #fff6e6; }
.inspect-btn-close { background: var(--ink); color: #f3f0e6; }
.inspect-btn-close:hover { background: #3a3e43; }
.inspect-hint {
  flex-basis: 100%; margin: 4px auto 0; max-width: max-content; padding: 4px 10px;
  background: rgba(24, 24, 22, 0.86); color: #f3efe2;
  font-family: var(--f-device); font-size: 0.78rem; text-align: center;
}
.inspect :focus-visible { outline-color: #f3c35c; }
