/* Inside a product: one larger card dealt on its own. The logo and a vertical spine carry the
   identity down the left edge; a simple frame on the right holds the print. The face is laid
   out on a 920 x 600 canvas (340 x 520 on phones) and scaled like every other face. */

/* The inside deal is one row: previous token, the card, next token. Tokens drop below on phones. */
.card-row[data-section='inside'] {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
/* The card takes as much of the screen as the tokens beside it and the header above allow,
   so the print is as legible as the screen permits; the canvas scales up with it. */
.card-slot[data-kind='inside'], .card-wrapper.kind-inside,
.card-row[data-section='inside'] .card-slot[data-kind='inside'] {
  width: min(calc(100% - 124px), calc((100dvh - 190px) * var(--face-aspect, 1.5333)));
}
.card-slot[data-kind='token'], .card-wrapper.kind-token,
.card-row[data-section='inside'] .card-slot[data-kind='token'] { width: 38px; height: 36px; aspect-ratio: auto; }
.card-wrapper.kind-token { cursor: grab; }
.card-wrapper.kind-inside { cursor: grab; }
.card-wrapper.kind-inside:focus-visible { outline: 2px solid #c6cbce; outline-offset: 5px; }

.inside-arrow.table-token {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  padding: 7px;
  cursor: pointer;
}
.inside-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The face. Fixed pixel measures are canvas measures; the card scales them together. */
.inside-face {
  padding: 22px 24px;
  flex-direction: row;
  gap: 20px;
  text-align: left;
}
.inside-column { display: flex; flex-direction: column; flex: 0 0 56px; width: 56px; gap: 14px; }
.inside-logo { width: 56px; height: 56px; border-radius: 4px; overflow: hidden; }
.inside-logo img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.7); }
.inside-spine {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 0;
  border-radius: 3px;
  background: var(--grain), #1b1e21;
  box-shadow: inset 0 1px 0 #ffffff08, inset 0 0 0 1px #00000040;
}
.inside-spine-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 100%;
  overflow: hidden;
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .24em;
  text-transform: uppercase;
  white-space: nowrap;
}
.inside-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* The one sanctioned rule on the table: the frame is the point of the print. */
.inside-frame {
  height: 512px;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--card-line);
  border-radius: 3px;
  overflow: hidden;
}
.inside-figure { position: relative; flex: 0 1 auto; max-width: 100%; }
.inside-figure img, .inside-video { display: block; max-width: 100%; max-height: 494px; width: auto; height: auto; }
.inside-video { background: #000; pointer-events: auto; }
.inside-frame { pointer-events: auto; cursor: pointer; }

/* Notes are numbered dots at their coordinates on the print; the legend prints beneath the frame. */
.inside-notes { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.inside-notes li { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); }
.inside-note-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #1b1a14;
  font: 600 10.5px/1 var(--font-sans);
  letter-spacing: 0;
  box-shadow: 0 0 0 2px #0009, 0 2px 6px #000a;
}
.inside-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.inside-legend li { display: inline-flex; align-items: center; gap: 7px; color: #bec7c5; font-size: 12px; line-height: 1.4; }
.inside-legend .inside-note-dot { width: 16px; height: 16px; font-size: 9px; box-shadow: none; }

.inside-aside { flex: 0 1 34%; min-width: 0; align-self: center; display: flex; flex-direction: column; gap: 10px; padding: 4px 8px 4px 2px; }
.kind-aside .inside-figure { flex: 1 1 auto; }
.inside-aside-title {
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.inside-aside-body { color: #c1cbc7; font-size: 13.5px; line-height: 1.6; }

.inside-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 30px; }
.inside-caption { color: #96a3a4; font-size: 12px; line-height: 1.45; min-width: 0; }
.inside-foot-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.inside-counter { color: #aebbb8; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.inside-face .card-actions { padding: 0; }

/* The front prints Look inside a little brighter than the outgoing action. */
.card-actions { gap: 16px; flex-wrap: wrap; }
.btn-inside { color: var(--accent); }
.btn-inside:hover { color: #e6d79f; }

/* Portrait canvas on phones: a thinner spine, the frame beneath the foot's two lines. */
.inside-face.is-portrait { padding: 18px; gap: 12px; }
.inside-face.is-portrait .inside-column { flex-basis: 34px; width: 34px; gap: 10px; }
.inside-face.is-portrait .inside-logo { width: 34px; height: 34px; border-radius: 3px; }
.inside-face.is-portrait .inside-spine { padding: 12px 0; }
.inside-face.is-portrait .inside-spine-name { font-size: 12px; letter-spacing: .2em; }
.inside-face.is-portrait .inside-body { gap: 10px; }
.inside-face.is-portrait .inside-frame { height: 396px; padding: 8px; flex-direction: column; gap: 12px; }
.inside-face.is-portrait .inside-figure img, .inside-face.is-portrait .inside-video { max-height: 378px; }
.inside-face.is-portrait.kind-aside .inside-figure { flex: 0 1 auto; }
.inside-face.is-portrait.kind-aside .inside-figure img { max-height: 190px; }
.inside-face.is-portrait .inside-aside { flex: 1 1 auto; padding: 0 2px; gap: 6px; }
.inside-face.is-portrait .inside-aside-title { font-size: 11px; }
.inside-face.is-portrait .inside-aside-body { font-size: 11.5px; line-height: 1.5; }
.inside-face.is-portrait .inside-foot { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 0; }
.inside-face.is-portrait .inside-caption, .inside-face.is-portrait .inside-legend li { font-size: 11px; }
.inside-face.is-portrait .inside-foot-right { width: 100%; justify-content: space-between; }

/* On phones both arrow tokens sit beneath the card. */
@media (max-width: 760px) {
  .card-slot[data-kind='inside'], .card-wrapper.kind-inside,
  .card-row[data-section='inside'] .card-slot[data-kind='inside'] {
    width: min(100%, calc((100dvh - 200px) * var(--face-aspect, .6538)));
  }
  .card-row[data-section='inside'] { gap: 18px; }
  .card-row[data-section='inside'] .card-slot[data-kind='token'] { order: 1; }
}
