/* Hallmark · macrostructure: sticky sample output and film rail · tone: studio industrial · studied: yes · DNA-source: video */
/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4 */
.af-works {
  --deck-paper: oklch(97.4% .010 85);
  --deck-sheet: oklch(98.8% .008 86);
  --deck-sheet-dark: oklch(94.4% .015 84);
  --deck-ink: oklch(20.5% .013 87);
  --deck-mute: oklch(44% .026 84);
  --deck-rule: oklch(86% .017 84);
  --deck-accent: oklch(43% .084 157);
  --deck-shadow: oklch(27% .027 76 / .19);
  --deck-dark: oklch(19% .009 244);
  --deck-clear: transparent;
  --deck-engraving-fill: oklch(22% .006 245);
  --deck-engraving-edge: oklch(15% .006 245 / .95);
  --deck-engraving-light: oklch(73% .009 85 / .68);
  --deck-mono: "SFMono-Regular", Consolas, monospace;
  --deck-roll-duration: 880ms;
  --deck-roll-ease: cubic-bezier(.25, .72, .32, 1);
  background: var(--deck-paper);
  color: var(--deck-ink);
}

.af-works .site-header {
  background: var(--deck-paper);
  border-bottom: 1px solid var(--deck-rule);
}

.sample-deck {
  --deck-nav: 84px;
  --deck-dock-height: calc(100svh - var(--deck-nav));
  /* The roller gap is at y=303 in the 1360 × 445 machine image. */
  --deck-slot-overlap: max(-10.44%, -73.09px);
  --deck-paper-peek: 21px;
  --deck-shadow-depth: clamp(23px, 5.5vw, 52px);
  --deck-roller-shadow: linear-gradient(
    to bottom,
    oklch(19% .014 83 / .70),
    oklch(24% .023 81 / .42) 18%,
    oklch(35% .025 83 / .18) 44%,
    oklch(45% .020 83 / .05) 73%,
    transparent
  );
  --deck-fade-length: clamp(60px, 12svh, 138px);
  --deck-tail-fade: linear-gradient(
    to bottom,
    black calc(100% - var(--deck-fade-length)),
    rgb(0 0 0 / .74) calc(100% - var(--deck-fade-length) * .67),
    rgb(0 0 0 / .22) calc(100% - var(--deck-fade-length) * .28),
    transparent
  );
  --deck-signal-cover: radial-gradient(
    circle,
    oklch(19% .022 151) 44%,
    oklch(17% .012 151 / .96) 57%,
    transparent 73%
  );
  position: relative;
}

.deck-dock {
  display: grid;
  position: relative;
}

.deck-copy {
  align-self: center;
  min-width: 0;
  padding-block: clamp(3rem, 7vh, 6.4rem) 2.25rem;
}

.deck-eyebrow,
.deck-current__readout,
.deck-machine__label,
.deck-paper__footer,
.deck-directory__head p {
  font: 500 .72rem / 1.25 var(--deck-mono);
  letter-spacing: .075em;
  color: var(--deck-mute);
}

.deck-eyebrow {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.75rem;
  white-space: nowrap;
}

.deck-eyebrow > :first-child {
  inline-size: .43rem;
  block-size: .43rem;
  border-radius: 50%;
  background: var(--deck-accent);
}

.deck-eyebrow__dash {
  inline-size: 1.8rem;
  border-top: 1px solid var(--deck-rule);
}

.deck-copy h1 {
  font-size: clamp(3.25rem, 7.2vw, 7rem);
  font-weight: 620;
  line-height: 1.025;
  letter-spacing: -.060em;
}

.deck-intro {
  color: var(--deck-mute);
  font-size: clamp(.91rem, 1.45vw, 1.05rem);
  margin-top: 1.55rem;
}

.deck-cue {
  display: none;
  align-items: center;
  gap: .6rem;
  color: var(--deck-mute);
  margin-top: 1.45rem;
  font-size: .81rem;
}

.deck-cue__touch { display: none; }

@media (pointer: coarse) {
  .deck-cue__wheel { display: none; }
  .deck-cue__touch { display: inline; }
}

.deck-cue__arrow {
  color: var(--deck-accent);
  font: 500 1.15rem / 1 var(--deck-mono);
}

.deck-current {
  border-top: 1px solid var(--deck-rule);
  max-width: 26rem;
  margin-top: clamp(1.25rem, 5svh, 3.5rem);
  padding-top: .95rem;
}

.deck-current__readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.deck-current__index > :first-child {
  color: var(--deck-accent);
  font-weight: 700;
}

.deck-current h2 {
  display: flex;
  align-items: center;
  min-height: 3.6rem;
  font-size: clamp(1.4rem, 2.2vw, 2.05rem);
  line-height: 1.12;
  margin-block: .25rem .12rem;
}

.deck-current__play {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  min-height: 44px;
  white-space: nowrap;
  font-weight: 620;
  font-size: .88rem;
}

.deck-current__play:hover {
  color: var(--deck-accent);
}

.deck-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-top: .6rem;
}

.deck-control {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: .4rem .75rem;
  border: 1px solid var(--deck-rule);
  border-radius: .25rem;
  background: var(--deck-clear);
  color: var(--deck-ink);
  line-height: 1.2;
  white-space: nowrap;
}

.deck-control:hover {
  background: var(--deck-sheet);
  border-color: var(--deck-mute);
}

.deck-control--directory {
  gap: .45rem;
  font-size: .83rem;
}

.deck-control--directory > :first-child {
  font-size: 1.15rem;
}

.deck-control__count {
  color: var(--deck-mute);
  font: .72rem / 1 var(--deck-mono);
}

.deck-direction, .deck-auto { display: none; }
.deck-auto { font-size: .83rem; }

.deck-machine {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  width: min(100%, 700px);
  margin-inline: auto;
  isolation: isolate;
}

.deck-machine__label {
  display: flex;
  justify-content: space-between;
  margin-inline: 5%;
  padding: .68rem 0 .5rem;
  border-top: 1px solid var(--deck-rule);
  font-size: clamp(.6rem, .9vw, .73rem);
}

.deck-machine__housing {
  position: relative;
  container-type: inline-size;
  z-index: 1;
}

.deck-machine__body {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 9px 8px var(--deck-shadow));
  pointer-events: none;
}

.deck-machine__engraving {
  position: absolute;
  inset: 31.5% auto auto 45%;
  transform: translate(-50%, -50%);
  color: var(--deck-engraving-fill);
  font-size: clamp(8px, 3.3cqw, 24px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: .10em;
  white-space: nowrap;
  text-shadow:
    0 -.7px .4px var(--deck-engraving-edge),
    0 .9px .4px var(--deck-engraving-light);
  pointer-events: none;
}

.deck-machine__housing::after {
  content: "";
  position: absolute;
  /* Center of the green lens in the machine image. */
  inset: 28.65% auto auto 79.01%;
  width: 1.2%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--deck-signal-cover);
  opacity: 0;
  pointer-events: none;
  animation: deck-signal-blink 2s linear infinite;
}

@keyframes deck-signal-blink {
  0%, 36%, 100% { opacity: 0; }
  44%, 89% { opacity: 1; }
}

.deck-aperture {
  display: none;
}

.deck-rail {
  position: relative;
  z-index: 1;
  width: min(66.6%, 466px);
  margin: var(--deck-slot-overlap) auto clamp(3.5rem, 8svh, 7rem);
  padding: 0;
  list-style: none;
}

.deck-step {
  scroll-margin-top: 16px;
}

.deck-frame {
  position: relative;
  background: var(--deck-sheet);
  border-inline: 1px solid var(--deck-rule);
  box-shadow: 0 4px 17px var(--deck-shadow);
}

.deck-frame__link {
  display: block;
  padding: .6rem .6rem .85rem;
  border-bottom: 1px dashed var(--deck-rule);
}

.deck-frame__art {
  display: grid;
  aspect-ratio: 16 / 9;
  background: var(--deck-dark);
}

.deck-frame__art img:not([src]) { display: none; }

.deck-frame[data-shape="portrait"] .deck-frame__art { aspect-ratio: 4 / 5; }

.deck-frame__art img,
.deck-paper__image img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-width: 0;
  min-height: 0;
}

.deck-frame__label {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr) 2.75rem;
  align-items: center;
  padding-top: .55rem;
}

.deck-frame__number,
.deck-frame__meta {
  color: var(--deck-mute);
  font: .68rem / 1.35 var(--deck-mono);
}

.deck-frame__title {
  font-size: clamp(.96rem, 3vw, 1.25rem);
  line-height: 1.25;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.deck-frame__meta { grid-column: 2; }

.deck-frame__play {
  grid-column: 3;
  grid-row: span 2;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--deck-accent);
}

.deck-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.deck-directory {
  border: 1px solid var(--deck-rule);
  padding: 0;
  max-height: min(82dvh, 48rem);
  width: min(36rem, calc(100vw - 2rem));
  background: var(--deck-sheet);
  color: var(--deck-ink);
}

.deck-directory::backdrop { background: var(--color-scrim); }

.deck-directory__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: 1.15rem clamp(.9rem, 4vw, 1.55rem);
  background: var(--deck-sheet);
  border-bottom: 1px solid var(--deck-rule);
}

.deck-directory__head h2 {
  font-size: 1.7rem;
  margin-top: .25rem;
}

.deck-directory__close { font-size: 1.4rem; }

.deck-directory__list {
  list-style: none;
  padding: 0 clamp(.9rem, 4vw, 1.55rem) .85rem;
  margin: 0;
}

.deck-directory__list a {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr) 1.15rem;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  padding-block: .4rem;
  border-bottom: 1px solid var(--deck-rule);
  font-size: .94rem;
  overflow-wrap: anywhere;
}

.deck-directory__list a span:first-child {
  color: var(--deck-mute);
  font: .72rem / 1 var(--deck-mono);
}

.deck-directory__list a:hover,
.deck-directory__list a[aria-current] {
  color: var(--deck-accent);
}

.deck-player-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .5rem;
}

.deck-player-quality {
  min-height: 44px;
  padding-inline: .65rem;
  border: 1px solid currentColor;
  border-radius: .35rem;
  background: transparent;
  color: inherit;
  font-size: .8rem;
  white-space: nowrap;
}

.deck-player-error { padding: 1rem; }
.deck-player-error a { text-decoration: underline; }

.sample-deck.is-motion { scroll-margin-top: var(--deck-nav); }

.sample-deck.is-motion .deck-dock {
  height: var(--deck-dock-height);
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(1rem, 3.6vw, 3.6rem);
  background: var(--deck-paper);
}

.sample-deck.is-motion .deck-copy {
  padding-block: 1.3rem;
}

.is-motion .deck-cue,
.is-motion .deck-direction,
.is-motion .deck-auto {
  display: inline-flex;
}

.is-motion .deck-machine {
  padding-top: clamp(.8rem, 5svh, 3.25rem);
  padding-bottom: .7rem;
}

.is-motion .deck-aperture {
  display: block;
  position: relative;
  z-index: 2;
  width: 60%;
  justify-self: center;
  margin-top: var(--deck-slot-overlap);
  isolation: isolate;
  overflow: clip;
  mask-image: var(--deck-tail-fade);
  touch-action: pan-x pinch-zoom;
}

.is-motion .deck-aperture::after,
.sample-deck:not(.is-motion) .deck-step:first-child .deck-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  height: var(--deck-shadow-depth);
  background: var(--deck-roller-shadow);
  pointer-events: none;
}

.deck-papers { position: absolute; inset: 0; }

.deck-paper,
.deck-paper-target {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  aspect-ratio: 1.39;
  transform: translate3d(0, calc(var(--paper-offset, 0) * 100% + var(--deck-paper-peek)), 0);
}

.deck-paper {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: clamp(.42rem, 1vw, .8rem);
  color: var(--deck-ink);
  background: var(--deck-sheet);
  border-inline: 1px solid var(--deck-rule);
  border-bottom: 1px dashed var(--deck-rule);
  pointer-events: none;
}

.deck-paper__image {
  display: grid;
  min-width: 0;
  min-height: 0;
  background: var(--deck-sheet-dark);
}

.deck-paper__proof { display: none; }

.deck-paper[data-shape="portrait"] .deck-paper__image {
  grid-template-columns: minmax(0, 1fr) minmax(0, .78fr);
}

.deck-paper[data-shape="portrait"] .deck-paper__proof {
  display: grid;
  align-content: center;
  gap: .7rem;
  padding: clamp(.45rem, 1vw, 1rem);
  border-left: 1px solid var(--deck-rule);
  color: var(--deck-mute);
  font: 500 clamp(.47rem, .75vw, .65rem) / 1.35 var(--deck-mono);
}

.deck-paper__proof strong {
  color: var(--deck-ink);
  font: 620 clamp(.75rem, 1.15vw, 1.05rem) / 1.15 var(--font-display);
  overflow-wrap: anywhere;
}

.deck-paper__footer {
  display: flex;
  justify-content: space-between;
  gap: .25rem;
  padding-top: .48rem;
  font-size: clamp(.52rem, .8vw, .64rem);
}

.deck-paper-target {
  cursor: pointer;
  display: flex;
  z-index: 2;
  align-items: end;
  justify-content: end;
  padding: .9rem .7rem 2rem;
  background: var(--deck-clear);
}

.deck-paper-target:active {
  transform: translate3d(0, calc(var(--paper-offset, 0) * 100% + var(--deck-paper-peek)), 0);
}

.deck-paper-target > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--deck-sheet);
  box-shadow: 0 3px 10px var(--deck-shadow);
}

.deck-paper-target:hover > span { color: var(--deck-accent); }

.is-first-feed .deck-papers {
  animation: deck-first-feed var(--deck-roll-duration) var(--deck-roll-ease) both;
}

@keyframes deck-first-feed {
  from { transform: translateY(-65%); }
  to { transform: translateY(0); }
}

.is-first-feed .deck-aperture::after {
  animation: deck-shadow-in var(--deck-roll-duration) linear both;
}

@keyframes deck-shadow-in {
  0%, 24% { opacity: 0; }
  48%, 100% { opacity: 1; }
}

.sample-deck.is-motion .deck-rail { display: none; }

.af-works .af-work-contact { scroll-margin-top: 1rem; }

@media (max-width: 950px), (max-height: 650px) {
  .deck-dock { max-width: 48rem; margin-inline: auto; }
  .deck-copy h1 br { display: none; }

  .sample-deck.is-motion {
    --deck-fade-length: clamp(50px, 9svh, 86px);
  }

  .sample-deck.is-motion .deck-dock {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .sample-deck.is-motion .deck-copy { padding-block: 1.3rem 0; }
  .is-motion .deck-cue { margin-top: .7rem; }

  .is-motion .deck-current {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: .65rem;
    max-width: none;
    margin-top: 1rem;
    padding-top: .7rem;
  }

  .is-motion .deck-current__readout { grid-column: 1 / -1; }
  .is-motion .deck-current h2 { min-height: 46px; margin-block: 0; font-size: 1.25rem; }
  .is-motion .deck-controls { margin-top: .35rem; gap: .35rem; }
  .is-motion .deck-control { padding-inline: .5rem; }
  .is-motion .deck-machine { padding-block: 0; }

  .is-motion .deck-aperture {
    width: 66.6%;
    height: clamp(260px, 67vw, 450px);
  }
}

@media (max-width: 480px) {
  .deck-copy h1 { font-size: clamp(2.15rem, 10.4vw, 3.25rem); }
  .deck-intro { margin-top: .85rem; }
  .deck-eyebrow { margin-bottom: 1.25rem; }
  .deck-copy { padding-top: 2.4rem; }
  .deck-frame__label { column-gap: .1rem; }
  .deck-frame__meta { font-size: .59rem; }

  .is-motion .deck-eyebrow { margin-bottom: .9rem; }
  .is-motion .deck-control--directory { font-size: .78rem; }
  .is-motion .deck-paper[data-shape="portrait"] .deck-paper__image { grid-template-columns: minmax(0, 1fr); }
  .is-motion .deck-paper[data-shape="portrait"] .deck-paper__proof { display: none; }
}

@media (max-width: 480px) and (max-height: 700px) {
  .sample-deck.is-motion .deck-copy { padding-top: .9rem; }
  .sample-deck.is-motion .deck-dock { gap: .65rem; }
  .is-motion .deck-intro,
  .is-motion .deck-machine__label { display: none; }
  .is-motion .deck-cue { margin-top: .55rem; }
  .is-motion .deck-current { margin-top: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .deck-papers,
  .deck-machine__housing::after { animation: none; }
}
