/* Foil & Datasheet edition pages (2026-10-09). Loaded after /_showcase/style.css on
   portfolio-owned landings and write-ups (shared/edition-page.mjs adds the link).
   It draws the datasheet head: the lede on a hairline grid beside the project's foil
   art plate, with spec cells, crosshairs, a ruler and a barcode. */
@import url('/_showcase/edition-tokens.css');

/* ---- head: lede | art plate ------------------------------------------------ */
.sc-edition .sc-head {
  --card-accent: var(--signal);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin: 0 0 8px;
  background: var(--line);
  border: 1px solid var(--line);
}
/* The fallback head (no lede to wrap) sits above the body as a band of art. */
.sc-edition .sc-window > .sc-head {
  margin: clamp(20px, 3vw, 40px) var(--edge) 0;
}
.sc-edition .sc-head--art .sc-plate {
  min-height: clamp(220px, 32vw, 420px);
}
@media (min-width: 900px) {
  .sc-edition .sc-head:not(.sc-head--art) {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  }
}
/* One rhythm between the head and whatever the landing prints next. */
.sc-edition .sc-body > .sc-head {
  margin-bottom: var(--pad, 28px);
}
.sc-edition .sc-head__lede {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 3.4vw, 48px) var(--pad) var(--pad);
  background: var(--paper);
}
.sc-edition .sc-head__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.sc-edition .sc-head__meta .sc-ruler {
  flex: 1;
  min-width: 40px;
  animation: sc-draw 1100ms var(--ease-out) 260ms both;
}
.sc-edition .sc-head__lede > :is(.sc-kicker, .sc-title, h1, .sc-tagline, .sc-actions) {
  animation: sc-rise 760ms var(--ease-out) both;
}
.sc-edition .sc-head__lede > .sc-kicker { animation-delay: 120ms; }
.sc-edition .sc-head__lede > :is(.sc-title, h1) { animation-delay: 200ms; }
.sc-edition .sc-head__lede > .sc-tagline { animation-delay: 300ms; }
.sc-edition .sc-head__lede > .sc-actions { animation-delay: 380ms; }
.sc-edition .sc-head__lede > .sc-kicker {
  order: 0;
}
html body.sc-edition .sc-head__lede .sc-title {
  margin-bottom: 22px;
}
html body.sc-edition .sc-head__lede .sc-tagline {
  margin-bottom: 28px;
}
.sc-edition .sc-head__lede .sc-actions {
  margin-bottom: 32px;
}

/* spec cells: hairline-topped facts, staggered in */
.sc-edition .sc-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.sc-edition .sc-spec {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 16px 16px 4px 0;
  animation: sc-rise 640ms var(--ease-out) both;
  animation-delay: calc(460ms + var(--n, 0) * 60ms);
}
.sc-edition .sc-spec:nth-child(2) { --n: 1; }
.sc-edition .sc-spec:nth-child(3) { --n: 2; }
.sc-edition .sc-spec:nth-child(4) { --n: 3; }
.sc-edition .sc-spec:nth-child(5) { --n: 4; }
.sc-edition .sc-spec:nth-child(6) { --n: 5; }
.sc-edition .sc-spec:nth-child(7) { --n: 6; }
.sc-edition .sc-spec__v {
  min-height: 26px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.sc-edition .sc-spec__v.sc-num {
  white-space: nowrap;
  overflow-wrap: normal;
}
/* a long path breaks inside its own cell instead of running into the next one */
.sc-edition .sc-spec--path .sc-spec__v.sc-num {
  white-space: normal;
  overflow-wrap: anywhere;
}
.sc-edition .sc-spec--wide {
  grid-column: 1 / -1;
}
.sc-edition .sc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sc-edition .sc-spec--code {
  position: relative;
}
.sc-edition .sc-spec--code .sc-barcode {
  width: 100%;
  max-width: 132px;
  height: 26px;
}
/* barcode scanline when the head is hovered */
.sc-edition .sc-spec--code::after {
  content: '';
  position: absolute;
  left: 0;
  top: 34px;
  width: 2px;
  height: 26px;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
  opacity: 0;
}
@media (hover: hover) {
  .sc-edition .sc-head:hover .sc-spec--code::after {
    animation: sc-scan 1.1s var(--ease-out) both;
  }
}

/* ---- art plate --------------------------------------------------------------- */
.sc-edition .sc-plate {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: clamp(300px, 86vw, 420px);
  padding: clamp(32px, 4vw, 56px);
  background: var(--paper-2);
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 900px) {
  .sc-edition .sc-plate {
    min-height: 520px;
  }
}
/* the dot field, drifting at .3x scroll (showcase-motion.js sets --sc-par) */
.sc-edition .sc-plate__dots {
  position: absolute;
  inset: -40px 0;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.16) 1px, transparent 1.4px);
  background-size: 18px 18px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 50%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 62% at 50% 50%, #000 30%, transparent 78%);
  transform: translateY(calc(var(--sc-par, 0) * 1px));
}
.sc-edition .sc-plate::after {
  /* a soft accent glow under the art: the card's brand colour at wash scale */
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 56%;
  width: 62%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--card-accent) 26%, transparent), transparent 66%);
  filter: blur(8px);
  opacity: 0.9;
}
.sc-edition .sc-cross {
  position: absolute;
  z-index: 2;
  width: 15px;
  height: 15px;
  color: var(--sheet);
  animation: sc-snap 700ms var(--ease-spring) 380ms both;
}
.sc-edition .sc-cross svg {
  display: block;
  width: 100%;
  height: 100%;
}
.sc-edition .sc-cross--tl { top: 14px; left: 14px; }
.sc-edition .sc-cross--tr { top: 14px; right: 14px; animation-delay: 440ms; }
.sc-edition .sc-cross--bl { bottom: 14px; left: 14px; animation-delay: 500ms; }
.sc-edition .sc-cross--br { bottom: 14px; right: 14px; animation-delay: 560ms; }
.sc-edition .sc-plate__fig {
  position: absolute;
  left: 40px;
  bottom: 16px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sc-edition .sc-plate__art {
  position: relative;
  width: min(100%, 460px);
  transform: perspective(900px) rotateX(var(--sc-rx, 0deg)) rotateY(var(--sc-ry, 0deg)) rotate(-3deg);
  transition: transform 500ms var(--ease-spring-soft);
  animation: sc-slap 900ms var(--ease-spring) 160ms backwards;
}
.sc-edition .sc-plate--game .sc-plate__art {
  width: min(100%, 640px);
  transform: perspective(900px) rotateX(var(--sc-rx, 0deg)) rotateY(var(--sc-ry, 0deg));
  animation-name: sc-slap-flat;
}
.sc-edition .sc-plate--game .sc-plate__art img:not(.is-thumb) {
  animation: sc-bob 6s ease-in-out 1.2s infinite;
}
.sc-edition .sc-plate__art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  filter: var(--art-shadow) !important;
  transition: filter 300ms var(--ease-out);
}
.sc-edition .sc-plate:hover .sc-plate__art img {
  filter: var(--art-shadow-hover) !important;
}
/* the card's own thumb, when the foil art is not printed yet: a framed screen */
.sc-edition .sc-plate__art img.is-thumb {
  max-height: 420px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  filter: none !important;
}
.sc-edition .sc-plate__art:has(.is-thumb) {
  transform: perspective(900px) rotateX(var(--sc-rx, 0deg)) rotateY(var(--sc-ry, 0deg));
}
.sc-edition .sc-plate__art:has(.is-thumb) .sc-plate__foil {
  display: none;
}
/* foil sheen, masked to the art, angle following the pointer (or drifting) */
.sc-edition .sc-plate__foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--foil-conic);
  mix-blend-mode: soft-light;
  opacity: 0.55;
  -webkit-mask: var(--sc-mask) center / contain no-repeat;
  mask: var(--sc-mask) center / contain no-repeat;
  animation: sc-foil-angle 12s linear infinite;
}
@media (hover: hover) and (pointer: fine) {
  .sc-edition .sc-plate__foil {
    animation: none;
  }
}
.sc-edition .sc-plate__pending {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sc-edition .sc-plate.is-empty .sc-plate__art {
  display: none;
}
.sc-edition .sc-plate.is-empty .sc-plate__pending {
  display: block;
}

/* ---- write-up gallery: the real screens, in their own colours ---------------- */
.sc-edition .sc-gallery {
  display: flex;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0 0 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.sc-edition .sc-shot {
  flex: none;
  margin: 0;
  scroll-snap-align: start;
}
.sc-edition .sc-shot img {
  display: block;
  height: clamp(200px, 26vw, 300px);
  width: auto;
  max-width: 80vw;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-2);
  transition: transform 420ms var(--ease-spring-soft), border-color 240ms var(--ease-out);
}
/* Phones and tablets: a rail that fades at the right edge, so "there is more" shows. */
@media (max-width: 899px) {
  .sc-edition .sc-gallery {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
}
/* Desktop: every screen at once, two to a row, nothing cropped at the edge. */
@media (min-width: 900px) {
  .sc-edition .sc-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
  }
  .sc-edition .sc-shot img {
    width: 100%;
    height: auto;
    max-width: none;
    object-fit: contain;
  }
}
@media (hover: hover) {
  .sc-edition .sc-shot:hover img {
    transform: translateY(-4px);
    border-color: var(--line-strong);
  }
}
.sc-edition .sc-shot figcaption {
  margin-top: 8px;
}

/* ---- page-local terminals keep their own ink; plain media failures ---------- */
.sc-media-unavailable {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 24px;
  min-height: 140px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

@keyframes sc-slap {
  from { transform: perspective(900px) scale(1.12) rotate(-9deg); opacity: 0; }
  to { transform: perspective(900px) rotateX(var(--sc-rx, 0deg)) rotateY(var(--sc-ry, 0deg)) rotate(-3deg); opacity: 1; }
}
@keyframes sc-slap-flat {
  from { transform: perspective(900px) scale(1.1) rotate(4deg); opacity: 0; }
  to { transform: perspective(900px) rotateX(var(--sc-rx, 0deg)) rotateY(var(--sc-ry, 0deg)); opacity: 1; }
}
@keyframes sc-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes sc-snap {
  from { transform: rotate(-90deg) scale(0.2); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes sc-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes sc-scan {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 130px; opacity: 0; }
}
@keyframes sc-foil-angle {
  from { --foil-angle: 0deg; }
  to { --foil-angle: 360deg; }
}

@media (max-width: 899px) {
  .sc-edition .sc-head:not(.sc-head--art) .sc-plate {
    order: -1;
    min-height: 0;
    padding: 40px 28px 48px;
  }
  .sc-edition .sc-plate__fig {
    left: 36px;
  }
  .sc-edition .sc-plate__art {
    width: min(76%, 320px);
  }
  .sc-edition .sc-plate--game .sc-plate__art {
    width: min(100%, 460px);
  }
  .sc-edition .sc-plate__art img {
    max-height: 300px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc-edition .sc-plate__art,
  .sc-edition .sc-plate--game .sc-plate__art {
    transform: rotate(-3deg);
  }
  .sc-edition .sc-plate--game .sc-plate__art {
    transform: none;
  }
  .sc-edition .sc-plate__dots {
    transform: none;
  }
}
@media print {
  .sc-edition .sc-plate__foil,
  .sc-edition .sc-plate__dots {
    display: none;
  }
}

/* A landing's own hero image: framed, and capped so it never becomes a dark slab. */
@media (min-width: 768px) {
  html body.sc-desk.sc-edition .sc-body .sc-hero img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
  }
}
/* Phones: terminal transcripts wrap instead of clipping at the edge. */
@media (max-width: 560px) {
  html body.sc-desk.sc-edition .sc-body pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
/* Less empty frame between the masthead and the head sheet. */
html body.sc-desk.sc-edition .sc-body {
  padding-top: clamp(16px, 2vw, 24px);
}
@media (pointer: coarse) {
  .sc-edition .sc-specs .sc-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
/* The sheet's two column rails stop at the footer rule: a paper mask under the
   small print covers them from the rule down. The window clips the mask. */
html body.sc-desk.sc-edition .sc-window {
  overflow: clip;
}
html body.sc-desk.sc-edition .sc-body > .sc-footer {
  position: relative;
  isolation: isolate;
}
html body.sc-desk.sc-edition .sc-body > .sc-footer::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -100vw;
  right: -100vw;
  top: 0;
  height: 100vh;
  background: var(--paper);
  pointer-events: none;
}
