/* ============================================================
   EVIDENCE BOARD — draggable desk page
   ============================================================ */
.desk-page {
  overflow: hidden;
  height: 100vh;
}
.desk-page #torch-overlay { display: none; }

#board-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}
#board-viewport.grabbing .b-card,
#board-viewport.grabbing .b-photo { pointer-events: none; }

#board-canvas {
  position: absolute;
  width: 3000px;
  height: 2000px;
  will-change: transform;
  background:
    radial-gradient(rgba(255, 26, 26, 0.08) 1px, transparent 1.5px),
    var(--black);
  background-size: 44px 44px;
}
[data-theme="light"] #board-canvas {
  background:
    radial-gradient(rgba(0, 0, 0, 0.10) 1px, transparent 1.5px),
    var(--black);
  background-size: 44px 44px;
}

/* Red string */
#board-string {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#board-string path {
  fill: none;
  stroke: rgba(255, 26, 26, 0.45);
  stroke-width: 1.5;
}
#board-string circle {
  fill: rgba(255, 26, 26, 0.25);
  stroke: rgba(255, 26, 26, 0.9);
  stroke-width: 1.5;
}

/* Shared item base */
.b-item { position: absolute; transform: rotate(var(--r, 0deg)); }

/* Center title */
.b-title {
  width: 700px;
  text-align: center;
  pointer-events: none;
}
.b-kicker {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  color: var(--indigo);
  margin-bottom: 16px;
}
.b-title h1 {
  font-family: 'SHAKA', var(--display);
  font-size: 4.5rem;
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: var(--white);
  margin-bottom: 14px;
}
.b-title p {
  font-size: 0.6875rem;
  letter-spacing: 0.26em;
  color: var(--gray);
}

/* Case cards */
.b-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border-medium);
  padding: 12px 12px 10px;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.b-card:hover {
  transform: rotate(calc(var(--r, 0deg) / 2)) scale(1.03);
  border-color: var(--indigo);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 26, 26, 0.15);
  z-index: 5;
}
.b-card img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.92);
}
.b-card:hover img { filter: saturate(1); }
.b-card-tag {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  color: var(--indigo);
  margin-bottom: 10px;
}
.b-card-cta {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--gray);
  margin-top: 10px;
  transition: color 0.2s, letter-spacing 0.3s;
}
.b-card:hover .b-card-cta { color: var(--indigo); letter-spacing: 0.3em; }

/* Text-only cards (no artwork) */
.b-card-text .b-card-body { padding: 18px 6px 8px; }
.b-card-text h3 {
  font-family: var(--display);
  font-size: 1.375rem;
  color: var(--white);
  margin-bottom: 8px;
}
.b-card-text .b-card-body p {
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  color: var(--gray);
}

/* Static info cards (profile / skills / contact) — same paper, not links */
.b-static { cursor: inherit; }
.b-rows { padding: 4px 2px 2px; }

/* Profile + generic key/value rows */
.b-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.b-meta-key { font-size: 0.5625rem; letter-spacing: 0.18em; color: var(--gray); white-space: nowrap; }
.b-meta-val {
  font-size: 0.75rem;
  color: var(--white);
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Certificate cards */
.b-cert-title {
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--white);
  margin: 12px 4px 8px;
}
.b-cert-issuer {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.5625rem;
  letter-spacing: 0.24em;
  color: var(--gray);
  margin: 0 4px 4px;
}

/* Skill rows with icons */
.b-skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.b-skill-row svg {
  width: 16px;
  height: 16px;
  color: var(--indigo);
  flex-shrink: 0;
}
.b-skill-name { flex: 1; font-size: 0.625rem; letter-spacing: 0.14em; color: var(--white); }
.b-skill-bar {
  width: 64px;
  height: 2px;
  background: var(--border-medium);
  flex-shrink: 0;
}
.b-skill-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--coral));
}
.b-skill-pct { width: 30px; text-align: right; font-size: 0.625rem; color: var(--gray); flex-shrink: 0; }

/* Contact rows */
.b-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8125rem;
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s;
}
.b-contact-row:hover { color: var(--indigo); }
.b-contact-ic {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-medium);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  flex-shrink: 0;
}
.b-contact-arr { margin-left: auto; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.b-contact-row:hover .b-contact-arr { opacity: 1; transform: translateX(3px); }

/* Board pins (reuse the sticky-note pin look) */
.b-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FF7B6B, #E01212 58%, #8F0808 100%);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Taped photos */
.b-photo {
  background: #F5F1E8;
  padding: 10px 10px 26px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}
.b-photo::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 84px;
  height: 24px;
  background: rgba(255, 255, 255, 0.22);
  border-left: 1px dashed rgba(0, 0, 0, 0.12);
  border-right: 1px dashed rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .b-photo::before { background: rgba(120, 110, 90, 0.25); }
.b-photo img { display: block; width: 100%; height: auto; }
.b-photo-cap {
  position: absolute;
  bottom: 6px;
  left: 12px;
  font-size: 0.5625rem;
  letter-spacing: 0.24em;
  color: rgba(30, 24, 14, 0.6);
}

/* Scattered labels */
.b-label {
  display: inline-block;
  padding: 6px 12px;
  border: 1px dashed var(--border-medium);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--gray);
  background: var(--surface);
}

/* Notes live in canvas coordinates here — never inline-flow */
.desk-page .note {
  position: absolute;
  margin: 0;
  display: block;
  width: 13rem;
}

/* Hint + back button */
.board-hint {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  color: var(--white);
  padding: 10px 22px;
  background: rgba(8, 8, 8, 0.75);
  border: 1px solid var(--border-medium);
  border-radius: 2px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.5s ease;
}
[data-theme="light"] .board-hint { background: rgba(240, 237, 230, 0.85); }
.board-hint span { color: var(--indigo); animation: scrollPulse 2s infinite; }
.board-hint.gone { opacity: 0; }

.board-back {
  position: fixed;
  bottom: 34px;
  left: 30px;
  z-index: 10;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  color: var(--gray);
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid var(--border-medium);
  border-radius: 2px;
  background: rgba(8, 8, 8, 0.75);
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s;
}
[data-theme="light"] .board-back { background: rgba(240, 237, 230, 0.85); }
.board-back:hover { color: var(--indigo); border-color: var(--indigo); }

/* Zoom controls */
.board-zoom {
  position: fixed;
  bottom: 34px;
  right: 30px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-zoom button {
  min-width: 44px;
  padding: 9px 10px;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--gray);
  background: rgba(8, 8, 8, 0.75);
  border: 1px solid var(--border-medium);
  border-radius: 2px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
[data-theme="light"] .board-zoom button { background: rgba(240, 237, 230, 0.85); }
.board-zoom button:hover { color: var(--indigo); border-color: var(--indigo); }

@media (max-width: 620px) {
  .board-zoom { right: 16px; bottom: 88px; }
}

@media (max-width: 620px) {
  .b-title h1 { font-size: 3rem; }
  .board-back { left: 16px; bottom: 88px; }
}

/* ============================================================
   OPENING SEQUENCE — "CHAIN OF EVIDENCE"
   Armed by the inline script in desk.astro (html.desk-intro),
   choreographed by src/scripts/desk-intro.js. This file only
   declares the resting/hidden state and the letterbox.
   ============================================================ */

/* Everything the sequence assembles starts invisible. Plain class
   specificity on purpose — GSAP's inline opacity has to win. */
html.desk-intro .b-item,
html.desk-intro .note,
html.desk-intro #board-string path,
html.desk-intro #board-string circle,
html.desk-intro #navbar,
html.desk-intro .board-zoom,
html.desk-intro .board-hint,
html.desk-intro .board-back { opacity: 0; }

/* The card/note transforms are GSAP's for the duration — a CSS
   transition on the same property would drag a frame behind it. */
html.desk-intro .b-card,
html.desk-intro .note,
html.desk-intro .b-photo { transition: none !important; }

/* Nothing is interactive until the camera lands */
html.desk-intro #board-viewport { cursor: none; }

/* Only ever painted while the sequence is armed — a return visit that
   never runs it must not inherit a letterboxed board. */
#board-intro { display: none; }
html.desk-intro #board-intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 9990;          /* over the board and its UI, under grain/cursor */
  pointer-events: none;
}

/* Letterbox — opens on the frame the camera stops on */
.bi-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 9vh;
  min-height: 42px;
  background: #050505;
  overflow: hidden;
}
[data-theme="light"] .bi-bar { background: #14110E; }
.bi-bar-top { top: 0; }
.bi-bar-bot {
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
}

.bi-slug {
  font-size: 0.625rem;
  letter-spacing: 0.26em;
  color: rgba(242, 239, 232, 0.42);
  white-space: nowrap;
  opacity: 0;
}
.bi-slug:last-of-type { color: rgba(255, 26, 26, 0.75); }

.bi-skip {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid rgba(242, 239, 232, 0.16);
  color: rgba(242, 239, 232, 0.5);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.26em;
  opacity: 0;
  pointer-events: auto;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.bi-skip:hover { color: #FF1A1A; border-color: #FF1A1A; }

/* Title wipe — injected into .b-title so it rides in board space */
.bi-wipe {
  position: absolute;
  background: #FF1A1A;
  pointer-events: none;
  will-change: transform;
}

/* Pin impact ring */
.bi-shock {
  fill: none;
  stroke: #FF1A1A;
  stroke-width: 2;
  pointer-events: none;
}

@media (max-width: 620px) {
  .bi-bar { height: 7vh; min-height: 34px; }
  .bi-bar-bot { padding: 0 14px; gap: 10px; }
  .bi-slug { font-size: 0.5rem; letter-spacing: 0.14em; }
  .bi-slug:last-of-type { display: none; }
  .bi-skip { padding: 6px 12px; font-size: 0.5rem; letter-spacing: 0.16em; }
}
