/* Tollgate ledger. Paper toll ticket. One accent, held to its meaning. */

:root {
  --paper: #faf8f4;
  --surface: #ffffff;
  --hairline: #e4e0d8;
  --ink: #1a1a17;
  --ink-muted: #6b6760;
  --stamp: #2f6b4f; /* cleared and settled. rare on purpose. */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 40px;

  --radius: 6px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ui: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.2);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.ledger {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

/* Masthead carries the running totals. */
.masthead {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: var(--space-5);
}

.masthead-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.gate-mark {
  color: var(--stamp);
  display: inline-flex;
}

h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin: var(--space-5) 0 0;
}

.total dt {
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.total dd {
  margin: 0;
}

.figure {
  font-family: var(--mono);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-top: var(--space-1);
}

.total .unit {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

/* Roll of tickets. */
.rolls {
  margin-top: var(--space-5);
}

.rolls-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 var(--space-3);
}

.ghost {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--stamp);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  transition:
    transform 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    background-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
  will-change: transform;
}

.ghost:hover {
  border-color: var(--stamp);
  background: #f3f7f4;
  transform: translateY(-1px);
  box-shadow: 0 2px 0 0 var(--hairline);
}

/* The physical push. The button sinks under the finger. */
.ghost:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
  transition-duration: 0.08s;
}

.ghost:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.ghost:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 2px;
}

.tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* One ticket. Perforated left edge, monospaced figures, a stamp on the right. */
.ticket {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  transition:
    transform 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

/* A ticket lifts off the stack slightly under the hand. */
.ticket:hover {
  transform: translateY(-2px);
  border-color: #d4cfc4;
  box-shadow: 0 3px 0 0 var(--hairline);
}

/* The perforation. */
.ticket::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  bottom: 10px;
  width: 0;
  border-left: 1px dashed var(--hairline);
}

.ticket-main {
  min-width: 0;
}

.ticket-resource {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.ticket-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

.ticket-id {
  color: var(--ink-muted);
}

.amount {
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ticket-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.tx-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}

.tx-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transition: right 0.25s var(--spring);
}

.tx-link:hover::after,
.tx-link:focus-visible::after {
  right: 0;
}

/* The stamp. The signature element. It demonstrates idempotency. */
.stamp {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: 2px 8px;
  transform: rotate(-7deg);
}

.stamp.paid {
  color: var(--stamp);
}

.stamp.void {
  color: var(--ink-muted);
  text-decoration: line-through;
}

/* Press animation when a ticket reveals. */
@keyframes press {
  0% {
    transform: rotate(-7deg) scale(2.1);
    opacity: 0;
  }
  60% {
    transform: rotate(-7deg) scale(0.92);
    opacity: 1;
  }
  100% {
    transform: rotate(-7deg) scale(1);
    opacity: 1;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ticket.enter {
  animation: reveal 0.4s var(--spring) both;
}

.ticket.enter .stamp {
  animation: press 0.5s var(--spring) both;
}

/* States. */
.empty.stub {
  background: var(--surface);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  position: relative;
}

.empty .perf {
  border-top: 1px dashed var(--hairline);
  margin: 0 auto var(--space-4);
  width: 60%;
}

.empty p {
  margin: var(--space-1) 0;
  font-family: var(--mono);
  font-size: 13px;
}

.muted {
  color: var(--ink-muted);
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skel-row {
  height: 64px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: linear-gradient(90deg, var(--surface), var(--paper), var(--surface));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.error {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink-muted);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.colophon {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

/* Calm fallback. No bounce, just a quiet fade. */
@media (prefers-reduced-motion: reduce) {
  .ticket.enter,
  .ticket.enter .stamp,
  .skel-row {
    animation: none;
  }
  .tx-link::after {
    transition: none;
  }
}

@media (max-width: 520px) {
  .totals {
    gap: var(--space-5);
  }
  .figure {
    font-size: 22px;
  }
  .ticket {
    grid-template-columns: 1fr;
  }
  .ticket-side {
    align-items: flex-start;
  }
  .amount {
    text-align: left;
  }
}

/* Documentation sections beneath the live ledger. Same tokens, same voice. */

.lede {
  margin: var(--space-4) 0 0;
  max-width: 58ch;
  color: var(--ink);
  font-size: 15px;
}

.ledger-note {
  font-family: var(--mono);
  font-size: 12px;
  margin: var(--space-3) 0 0;
}

.doc {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
}

.doc h2 {
  margin-bottom: var(--space-4);
}

.doc h3 {
  font-size: 14px;
  margin: 0 0 var(--space-1);
}

.doc p {
  max-width: 64ch;
  font-size: 14px;
  margin: var(--space-2) 0;
}

.mono {
  font-family: var(--mono);
  font-size: 0.95em;
}

/* The three-step gate walkthrough. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.steps li {
  display: flex;
  gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.step-no {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--stamp);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  align-self: flex-start;
  padding: 2px 8px;
}

.steps p {
  margin: 0;
  color: var(--ink-muted);
}

/* The four documented gaps. */
.gaps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.gap {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.gap p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Data tables: hairlines, mono figures. */
.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-size: 13px;
  margin: var(--space-3) 0;
}

.data th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
}

.data th,
.data td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

.data tr:last-child td {
  border-bottom: 0;
}

.data td.mono,
.data td .mono {
  word-break: break-all;
}

/* Code blocks read like the back of a ticket. */
.code {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  margin: var(--space-3) 0;
}

.plain-list {
  margin: var(--space-2) 0 0;
  padding-left: 1.1em;
  max-width: 68ch;
  font-size: 14px;
}

.plain-list li {
  margin-bottom: var(--space-2);
}

.colophon {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   Life. Motion is motivated: load-in tells the story top to bottom, scroll
   reveals sequence the documentation, the thud sells the stamp, the count-up
   acknowledges money arriving. All of it collapses under reduced motion.
--------------------------------------------------------------------------- */

/* The page settles in like a ledger being opened. */
@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.masthead-title,
.display,
.lede,
.specimen,
.totals,
.rolls {
  animation: settle 0.7s var(--ease-out) both;
}

.display {
  animation-delay: 60ms;
}

.lede {
  animation-delay: 130ms;
}

.specimen {
  animation-delay: 210ms;
}

.totals {
  animation-delay: 300ms;
}

.rolls {
  animation-delay: 380ms;
}

/* Scroll reveal. JS adds .in-view via IntersectionObserver; --index staggers
   children inside a revealed group. */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
  transition-delay: calc(var(--index, 0) * 70ms);
  will-change: transform, opacity;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* The thud. When the stamp presses, the whole ticket takes the hit. */
@keyframes thud {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

.ticket.enter {
  animation:
    reveal 0.4s var(--spring) both,
    thud 0.35s var(--ease-out) 0.28s;
}

/* The totals tick when money lands. */
@keyframes tick-bump {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

.figure.bump {
  animation: tick-bump 0.45s var(--spring);
}

/* The demo button is magnetic within a small radius. JS drives only transform;
   this just promises the GPU. */
#seed {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .masthead-title,
  .display,
  .lede,
  .specimen,
  .totals,
  .rolls,
  .figure.bump,
  .ticket.enter {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .ticket,
  .ghost {
    transition: none;
  }
  .ticket:hover,
  .ghost:hover {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Material. The page is paper on a desk: grain in the sheet, ink soaked
   through from yesterday's stamps, one specimen ticket as the picture, soft
   layered shadows so things actually sit. All decorative layers are
   aria-hidden and pointer-transparent.
--------------------------------------------------------------------------- */

/* Paper grain across the whole sheet. Real texture, barely-there alpha. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* A faint wash of stamp ink hanging in the air over the masthead. */
.masthead {
  position: relative;
}

.masthead::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -160px;
  width: 560px;
  height: 560px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(47, 107, 79, 0.07), rgba(47, 107, 79, 0));
}

/* Ink soaked through from yesterday's tickets. Always behind the content. */
.atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.masthead > :not(.atmosphere) {
  position: relative;
  z-index: 1;
}

.ghost-stamp {
  position: absolute;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.14em;
  border: 3px solid currentColor;
  border-radius: 8px;
  padding: 6px 18px;
  color: var(--ink);
  opacity: 0.04;
}

.gs-1 {
  font-size: 44px;
  top: -8px;
  right: 4%;
  transform: rotate(8deg);
  color: var(--stamp);
  opacity: 0.07;
}

.gs-2 {
  font-size: 28px;
  top: 150px;
  right: 22%;
  transform: rotate(-12deg);
}

.gs-3 {
  font-size: 30px;
  top: 320px;
  right: 6%;
  transform: rotate(-5deg);
  opacity: 0.05;
}

/* The headline. Big, plain, and true. */
.display {
  font-size: clamp(34px, 6.5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: var(--space-6) 0 0;
  position: relative;
}

.display-muted {
  color: var(--ink-muted);
}

/* The specimen ticket. The product, photographed. */
.specimen {
  position: relative;
  margin: var(--space-5) 0 0;
  /* Punch notches: semicircle bites into the top and bottom edges where the
     perforation runs, painted into the paper itself. */
  background:
    radial-gradient(circle at calc(100% - 125px) 0, var(--paper) 8px, var(--hairline) 8.5px 9.5px, rgba(0, 0, 0, 0) 10px),
    radial-gradient(circle at calc(100% - 125px) 100%, var(--paper) 8px, var(--hairline) 8.5px 9.5px, rgba(0, 0, 0, 0) 10px),
    var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: stretch;
  max-width: 560px;
  transform: rotate(-1deg);
  box-shadow:
    0 1px 2px rgba(26, 26, 23, 0.04),
    0 12px 32px rgba(26, 26, 23, 0.08);
}

.spec-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--space-5) var(--space-4) var(--space-5) var(--space-5);
  min-width: 0;
}

.spec-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.spec-route {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  margin: 2px 0 6px;
}

.spec-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.spec-perf {
  border-left: 1px dashed var(--hairline);
  margin: 12px 0;
}

.spec-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-4);
}

.spec-no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.spec-amount {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.spec-unit {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

/* Ticket stripe code. Texture in service of the object, not decoration. */
.spec-barcode {
  margin-top: 10px;
  width: 84px;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px,
    transparent 2px 4px,
    var(--ink) 4px 5px,
    transparent 5px 9px,
    var(--ink) 9px 12px,
    transparent 12px 14px
  );
  opacity: 0.75;
}

/* The big stamp, pressed slightly off the edge like a real inspector would. */
.spec-stamp {
  position: absolute;
  top: -14px;
  left: 38%;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--stamp);
  border: 3px solid currentColor;
  border-radius: 6px;
  padding: 4px 14px;
  transform: rotate(-8deg);
  background: rgba(255, 255, 255, 0.65);
}

/* Paper sits on the desk: soft layered shadows on every raised surface. */
.ticket,
.gap,
.steps li,
.data,
.code {
  box-shadow:
    0 1px 2px rgba(26, 26, 23, 0.03),
    0 6px 18px rgba(26, 26, 23, 0.05);
}

.ticket:hover {
  box-shadow:
    0 2px 3px rgba(26, 26, 23, 0.04),
    0 12px 28px rgba(26, 26, 23, 0.08);
}

/* Watermark numerals on the documentation, like page stamps in a ledger. */
.doc {
  position: relative;
}

.doc::after {
  content: attr(data-no);
  position: absolute;
  top: var(--space-4);
  right: 0;
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  opacity: 0.045;
  pointer-events: none;
}

@media (max-width: 560px) {
  .specimen {
    grid-template-columns: 1fr;
    transform: none;
  }
  .spec-perf {
    border-left: 0;
    border-top: 1px dashed var(--hairline);
    margin: 0 16px;
  }
  .spec-right {
    align-items: flex-start;
  }
  .specimen {
    background: var(--surface);
  }
  .spec-stamp {
    left: auto;
    right: 12px;
    top: -12px;
    font-size: 17px;
  }
  .ghost-stamp {
    display: none;
  }
  .doc::after {
    font-size: 48px;
  }
}

/* ---------------------------------------------------------------------------
   Live payment tracker. Reuses ticket and totals tokens; adds only the form.
--------------------------------------------------------------------------- */

.trk-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  margin: var(--space-4) 0;
}

.trk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.trk-grow {
  flex: 1 1 220px;
}

.trk-field span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.trk-field input,
.trk-field select {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 9px 11px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.trk-field input:focus,
.trk-field select:focus {
  outline: none;
  border-color: var(--stamp);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.trk-scan {
  height: 38px;
}

.trk-totals {
  margin: var(--space-4) 0;
  gap: var(--space-6);
}

#trk-list {
  margin-top: var(--space-4);
}

#trk-deeper {
  margin-top: var(--space-4);
}

/* Verify a settlement: a result card showing the on-chain read. */
.verify-card {
  margin-top: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  padding: var(--space-5);
  box-shadow: 0 1px 2px rgba(22, 21, 15, 0.03), 0 6px 18px rgba(22, 21, 15, 0.05);
}

.verify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.stamp.press {
  animation: press 0.5s var(--spring) both;
}

.verify-table {
  margin: 0;
}
.verify-table td {
  padding: 6px 0;
}
.verify-table td:first-child {
  color: var(--ink-muted);
  width: 9rem;
}
.verify-table td.mono {
  word-break: break-all;
}


/* ---------------------------------------------------------------------------
   Interaction taste: tilt sheen, ink-fleck click spark, cursor light. Paper
   and ink only. One green accent. All gated under reduced motion below.
--------------------------------------------------------------------------- */

/* The specimen leans toward the cursor; a faint band of light slides across
   the paper as it tilts. Not a glass glare, just paper catching the room. */
.specimen {
  transform-style: preserve-3d;
  will-change: transform;
}

.spec-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--sheen-o, 0);
  transition: opacity 0.3s var(--ease-out);
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0) calc(var(--sheen-x, 50%) - 22%),
    rgba(255, 255, 255, 0.55) var(--sheen-x, 50%),
    rgba(255, 255, 255, 0) calc(var(--sheen-x, 50%) + 22%),
    transparent 100%
  );
  mix-blend-mode: soft-light;
}

/* Ink flecks thrown from a press. */
.spark-layer {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.spark {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  will-change: transform, opacity;
}

/* A faint reading light follows the cursor across the masthead paper. */
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  background: radial-gradient(
    220px circle at var(--lx, 50%) var(--ly, 30%),
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0) 65%
  );
  mix-blend-mode: soft-light;
}

.masthead.lit::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .spec-sheen,
  .masthead::after {
    display: none;
  }
  .specimen {
    transform: rotate(-1deg) !important;
  }
}
