/* ============================================================
   Gallery page — card recipe taken from the live /craft page:
   white card, 12px radius, gray5 hairline, 4px padding, 8px
   radius media, 13px caption, "View" button, 3-column grid.
   ============================================================ */

/* the gallery lives on the same canvas as the landing page */
html.light,
html.light body {
  background: var(--colors-gray4);
}
html.dark,
html.dark body {
  background: var(--colors-gray1);
}

.page {
  padding: 8px 8px 4px 4px;
  margin-top: 138px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* page heading in the landing page's type scale */
.page-title {
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--colors-gray12);
  padding: 0 0 40px 8px;
}

.section-label {
  font-size: 14px;
  color: var(--colors-gray11);
  padding: 0 0 12px 8px;
}

section + section {
  margin-top: 48px;
}

/* cards enter with the landing's staggered choreography */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card[data-animate] {
  opacity: 0;
  animation: cardIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .card[data-animate] {
    opacity: 1;
    animation: none;
  }
}

.grid {
  --gap: 8px;
  display: flex;
  margin-left: calc(var(--gap) * -1);
  width: auto;
}
.column {
  padding-left: var(--gap);
  background-clip: padding-box;
  width: 33.3333%;
}

.card {
  display: block;
  width: 100%;
  background: var(--card-bg);
  height: fit-content;
  position: relative;
  margin-bottom: var(--gap);
  overflow: hidden;
  transform: translateZ(0);
  border: 1px solid var(--colors-gray5);
  border-radius: 12px;
  padding: 4px;
}
.card[data-interactive="true"] {
  cursor: pointer;
}
.card[data-interactive="true"]:focus-visible {
  outline: 2px solid var(--colors-focus);
  outline-offset: 2px;
}

.card-media {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
}
.card-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* placeholder tile while there is no video yet: white sheet, black number */
.card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--colors-gray5);
}
.card-placeholder span {
  font-size: 56px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #000;
}

.card-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px 8px 8px;
  font-size: 15px;
  line-height: 21px;
}
.card-caption .meta {
  font-size: 13px;
}
.card-caption .title {
  color: var(--colors-gray12);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-caption .meta {
  color: var(--caption-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.card [data-fake-button] {
  height: 40px;
  background: var(--colors-gray3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--colors-gray12);
  margin-top: 4px;
  transition: background 150ms ease, color 150ms ease;
}
.card[data-interactive="true"]:hover [data-fake-button],
.card[data-interactive="true"]:focus-visible [data-fake-button] {
  background: var(--colors-gray4);
}

/* blog space-holder */
.card-empty {
  border-style: solid;
  padding: 4px;
}
.card-empty .card-media {
  background: var(--colors-gray3);
}
.card-empty .card-placeholder {
  flex-direction: column;
  gap: 8px;
  background: transparent;
  box-shadow: none;
}
.card-empty .card-placeholder p {
  font-size: 14px;
  color: var(--colors-gray11);
  text-align: center;
  max-width: 26ch;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .column { width: 50%; }
}
@media (max-width: 640px) {
  .grid { display: block; margin-left: 0; }
  .column { width: 100%; padding-left: 0; }
  .page { margin-top: 112px; padding: 8px; }
}

/* ============================================================
   Publications ledger — each paper a pane of tinted mirror
   glass (mirror.js) beside its record. Quiet rows, hairline
   separated; the glass ripples toward the cursor on hover.
   ============================================================ */

.pub-list {
  max-width: 1060px;
  padding: 0 8px;
}

.pub-row {
  display: grid;
  grid-template-columns: 216px 1fr;
  gap: 30px;
  align-items: center;
  padding: 24px 8px;
  text-decoration: none;
  cursor: pointer;
}
.pub-row:not(:first-child) {
  border-top: 1px solid var(--colors-gray5);
}
.pub-row:focus-visible {
  outline: 2px solid var(--colors-focus);
  outline-offset: 2px;
  border-radius: 8px;
}

.pub-plaque {
  width: 216px;
  height: 132px;
  border-radius: 10px;
  overflow: hidden;
  transform: translateZ(0);
  background: #232b3a; /* slate base while the shader boots */
  position: relative;
}
/* lit rim so the reeded glass reads as glass against the page */
.pub-plaque::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.pub-plaque canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.pub-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--caption-dim);
}
.pub-index {
  font-family: var(--fonts-mono);
  font-size: 12px;
  color: var(--colors-gray11);
  border: 1px solid var(--colors-gray6);
  padding: 2px 7px;
  border-radius: 999px;
  transition: color 0.25s var(--transitions-snappy),
    border-color 0.25s var(--transitions-snappy),
    background 0.25s var(--transitions-snappy);
}
.pub-row:hover .pub-index,
.pub-row:focus-visible .pub-index {
  color: #fff;
  background: var(--pub-accent);
  border-color: var(--pub-accent);
}

.pub-title {
  font-size: 21px;
  line-height: 1.35;
  color: var(--colors-gray12);
  margin-top: 8px;
  max-width: 58ch;
  transition: transform 0.3s var(--transitions-snappy);
}
.pub-row:hover .pub-title {
  transform: translateX(6px);
}

.pub-authors {
  font-size: 13px;
  line-height: 1.6;
  color: var(--caption-dim);
  margin-top: 6px;
  max-width: 74ch;
}
.pub-authors .pub-me {
  color: var(--colors-gray12);
}

.pub-row[data-animate] {
  opacity: 0;
  animation: cardIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .pub-row[data-animate] {
    opacity: 1;
    animation: none;
  }
  .pub-row:hover .pub-title {
    transform: none;
  }
}

@media (max-width: 800px) {
  .pub-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pub-plaque {
    width: 100%;
    height: 150px;
  }
}


/* ============================================================
   Section rail (rail.js) — the Devouring Details line minimap,
   guiding the publications. Geometry verbatim from the DD
   landing; shared styles now live in rail.css.
   ============================================================ */

/* the page steps aside for the rail */
@media (min-width: 1181px) {
  body[data-has-rail] .page {
    padding-left: 128px;
  }
}
