/* Mechanical illustration ported from the supplied typewriter-typing-app demo (2026-11-19).
   Generated section: laid out at the demo's full size (880px stage) and scaled as a whole. */
.typewriter-machine * {
  box-sizing: border-box;
}

.typewriter-machine .machine-stage {
  --carriage-rise: 140px;
  position: relative;
  overflow: visible;
  width: min(880px, 72%);
  min-height: 0;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border: 0;
  background: transparent;
  isolation: isolate;
}

.typewriter-machine .machine-shell {
  --side-flare: 38px;
  position: absolute;
  top: 44%;
  left: -10%;
  width: 120%;
  height: 48%;
  pointer-events: none;
  filter: drop-shadow(0 5px 3px rgba(23, 20, 16, 0.55));
}

.typewriter-machine .machine-shell::before {
  position: absolute;
  inset: 0 7% 3%;
  content: "";
  background:
    var(--grit-texture) center / cover,
    linear-gradient(180deg, #494940, #262820 80%);
  background-blend-mode: multiply, normal;
  clip-path: polygon(0 0, 100% 0, 100% 95%, 96% 100%, 4% 100%, 0 95%);
}

.typewriter-machine .shell-shoulder {
  position: absolute;
  top: 0;
  width: calc(24% + var(--side-flare));
  height: 100%;
  overflow: visible;
}

.typewriter-machine .casing-lighting {
  z-index: 7;
  filter: none;
}

.typewriter-machine .casing-lighting::before {
  content: none;
}

.typewriter-machine .shell-shoulder.left {
  left: calc(-1 * var(--side-flare));
}

.typewriter-machine .shell-shoulder.right {
  right: calc(-1 * var(--side-flare));
  transform: scaleX(-1);
}

.typewriter-machine .page-clip {
  position: absolute;
  z-index: 6;
  top: 22%;
  width: 5%;
  height: 18%;
  overflow: visible;
  filter: drop-shadow(2px 3px 2px rgba(25, 28, 20, 0.4));
  pointer-events: none;
  transform-origin: 50% 100%;
}

.typewriter-machine .page-clip.left { left: 4%; transform: rotate(-6deg); }
.typewriter-machine .page-clip.right { right: 4%; transform: rotate(6deg) scaleX(-1); }

.typewriter-machine .carriage-end-bracket {
  position: absolute;
  z-index: 7;
  top: calc(46% - var(--carriage-rise));
  width: 5.3%;
  height: calc(var(--carriage-rise) + 3%);
  overflow: visible;
  pointer-events: none;
}

.typewriter-machine .carriage-end-bracket.left { left: calc(-7% + 19px); }
.typewriter-machine .carriage-end-bracket.right { right: calc(-7% + 19px); transform: scaleX(-1); }

.typewriter-machine .carriage-support {
  position: absolute;
  z-index: 7;
  top: 43%;
  width: max(8px, calc(3.4% - 0.25cm));
  height: 9%;
  border: 1px solid #322e25;
  border-radius: 4px 4px 30% 30%;
  transform: translateY(calc(-1 * var(--carriage-rise)));
  background: var(--detail-grit-texture) center / cover, linear-gradient(90deg, #9a8d71, #514a3c 38%, #26251f 82%);
  background-blend-mode: multiply, normal;
  box-shadow: inset 1px 0 1px #bbac8c, 2px 3px 4px #191814;
}

.typewriter-machine .carriage-support.left {
  left: calc(-4.1% + 19px - 0.125cm);
  transform: translate(-50%, calc(-1 * var(--carriage-rise)));
}
.typewriter-machine .carriage-support.right {
  right: calc(-4.1% + 19px - 0.125cm);
  transform: translate(50%, calc(-1 * var(--carriage-rise)));
}

.typewriter-machine .support-bolt {
  position: absolute;
  left: 27%;
  bottom: 12%;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(35deg, transparent 43%, #29251e 45% 55%, transparent 57%), radial-gradient(circle, #a99c80, #4d4637 70%);
  box-shadow: 0 1px 1px #151510;
}

.typewriter-machine .machine-stage::before {
  position: absolute;
  z-index: 2;
  top: 46%;
  left: 3.5%;
  right: 3.5%;
  bottom: 12%;
  content: "";
  clip-path: polygon(5% 0, 95% 0, 86% 100%, 14% 100%);
  background:
    radial-gradient(ellipse at 50% 6%, rgba(24, 23, 21, 0.5), transparent 32%),
    linear-gradient(180deg, rgba(36, 35, 32, 0.94), rgba(71, 70, 64, 0.82) 56%, rgba(30, 29, 27, 0.72));
  box-shadow:
    inset 0 14px 26px rgba(0, 0, 0, 0.34),
    inset 0 -12px 18px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.typewriter-machine .machine-stage::after {
  position: absolute;
  z-index: 30;
  inset: 0;
  content: "";
  clip-path: polygon(0 44.5%, 100% 44.5%, 100% 100%, 0 100%);
  background:
    radial-gradient(circle at 31% 52%, rgba(0, 0, 0, 0.22) 0 1px, transparent 1.5px),
    radial-gradient(circle at 67% 57%, rgba(255, 255, 255, 0.16) 0 1px, transparent 1.6px),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.025) 3px 4px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.11), transparent 11% 89%, rgba(0, 0, 0, 0.12));
  background-position: 0 0, 17px 9px, 0 0, 0 0;
  background-size: 33px 33px, 41px 41px, 100% 100%, 100% 100%;
  mix-blend-mode: multiply;
  opacity: 0.13;
  pointer-events: none;
}

.typewriter-machine .rear-carriage-mechanism {
  position: absolute;
  z-index: 0;
  top: calc(51% - var(--carriage-rise));
  left: -5%;
  width: 110%;
  height: 23%;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, #35382d 14px, #0b100b 16px 24px),
    linear-gradient(180deg, #11160f, #262b21 35%, #080d08);
  box-shadow: inset 0 12px 22px #060a06, inset 0 -10px 18px #050905;
  pointer-events: none;
}

.typewriter-machine .rear-carriage-mechanism::before {
  position: absolute;
  inset: 22% 0 0;
  content: "";
  background: repeating-linear-gradient(180deg, #10160e 0 5px, #404236 6px, #22281d 8px, #080d08 11px 35px);
  box-shadow: inset 0 0 18px 7px #070c07;
  opacity: 0.7;
}

.typewriter-machine .rear-platen {
  --platen-axis: calc(98.61% - var(--carriage-rise) * 0.5 - 0.25cm - 4px);
  --platen-wheel-height: calc(2.78% + var(--carriage-rise) + 0.5cm + 8px);
  position: absolute;
  z-index: 0;
  top: calc(35.5% + 0.5cm);
  left: -14%;
  width: 128%;
  height: 18%;
  transform: translateY(-50%) scale(1.02, 1.05);
  transform-origin: 50% 100%;
  pointer-events: none;
}

.typewriter-machine .rear-platen-shaft {
  position: absolute;
  z-index: 2;
  top: var(--platen-axis);
  transform: translateY(-50%);
  left: 3.6%;
  right: 3.6%;
  height: 22%;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(180deg, #373327, #a29679 25%, #665a42 55%, #29271d);
}

.typewriter-machine .rear-platen-rubber {
  position: absolute;
  z-index: 3;
  inset: 0 4.5%;
  top: calc(97.22% - var(--carriage-rise) - 0.5cm - 8px);
  border-radius: 1% / 50%;
  overflow: hidden;
  background:
    linear-gradient(180deg, #151a13, #3c4135 18%, #22291e 40%, #0d130c 76%, #080c07),
    #10160e;
  box-shadow: inset 0 2px 1px rgba(154, 155, 130, 0.25), inset 0 -6px 8px #050804;
}

.typewriter-machine .rear-platen-rubber::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.16) 3px 4px, rgba(151, 153, 130, 0.07) 4px 5px, transparent 5px 9px),
    var(--detail-grit-texture) 35% 55% / 360px 240px;
  background-blend-mode: soft-light;
  background-position: 0 var(--platen-feed-offset, 0px), 35% calc(55% + var(--platen-feed-offset, 0px));
  mix-blend-mode: soft-light;
  opacity: 0.42;
  pointer-events: none;
}

.typewriter-machine .platen-knob-rotation {
  transform: rotate(var(--platen-feed-angle, 0deg));
  transform-origin: 0 0;
}

.typewriter-machine .rear-platen-coupling {
  position: absolute;
  z-index: 2;
  top: var(--platen-axis);
  width: 1.8%;
  height: 36%;
  transform: translateY(-50%);
  clip-path: url(#platen-coupling-profile);
  background: linear-gradient(180deg, #3e3728, #a29373 24%, #837050 44%, #5e4e35 72%, #302a1e);
  box-shadow: inset 0 1px 0 rgba(235, 218, 181, 0.5), inset 0 -1px 0 #3b3425;
}

.typewriter-machine .rear-platen-coupling.left { left: 3.4%; }
.typewriter-machine .rear-platen-coupling.right { right: 3.4%; transform: translateY(-50%) scaleX(-1); }

.typewriter-machine .rear-platen-shaft::after,
.typewriter-machine .rear-platen-coupling::before {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--detail-grit-texture) 38% 61% / 100px 65px;
  background-position: 38% calc(61% + var(--platen-shaft-offset, 0px));
  mix-blend-mode: multiply;
  opacity: 0.45;
  pointer-events: none;
}

.typewriter-machine .rear-platen-coupling::before {
  background-position: 38% calc(61% + var(--platen-coupling-offset, 0px));
}

.typewriter-machine .rear-platen-coupling::after {
  position: absolute;
  content: "";
  top: 12%;
  left: 0;
  width: 36%;
  height: 76%;
  border-left: 1px solid rgba(39, 34, 23, 0.85);
  border-radius: 50%;
  box-shadow: inset 1px 0 1px rgba(226, 208, 169, 0.4);
  pointer-events: none;
}

.typewriter-machine .rear-platen-bands {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
}

.typewriter-machine .rear-platen-wheel {
  position: absolute;
  z-index: 1;
  top: var(--platen-axis);
  width: 6%;
  height: var(--platen-wheel-height);
  overflow: visible;
  transform: translateY(-50%);
}

.typewriter-machine .rear-platen-wheel.left { left: 0; transform: translateY(-50%) scaleX(-1); }
.typewriter-machine .rear-platen-wheel.right { right: 0; }

.typewriter-machine .paper {
  --print-y: calc(85% - 0.5em - 15px);
  --type-size: 1.1rem;
  --line-step: 1.38em;
  --char-step: 0.68em;
  position: absolute;
  z-index: 1;
  inset: 0 1% auto;
  height: 44.5%;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 99.7% 90%, 99% 100%, 1% 100%, 0.3% 90%, 0 80%);
  background:
    radial-gradient(circle at 48% 85%, rgba(130, 21, 25, 0.08), transparent 7%),
    linear-gradient(90deg, transparent, rgba(118, 111, 99, 0.12), transparent 8% 92%, rgba(118, 111, 99, 0.12), transparent),
    repeating-linear-gradient(87deg, rgba(81, 72, 60, 0.03) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.018) 0 1px, transparent 1px 8px),
    #f1ece2;
  box-shadow: inset 0 -18px 32px rgba(76, 69, 59, 0.2);
}

.typewriter-machine .paper-shadow {
  position: absolute;
  inset: auto 0 0;
  height: 8%;
  background: linear-gradient(180deg, transparent, rgba(35, 31, 24, 0.2) 65%, rgba(25, 23, 18, 0.48));
  pointer-events: none;
}

.typewriter-machine .paper-rod-shadow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.typewriter-machine .paper-rod-shadow::before {
  position: absolute;
  content: "";
  top: calc(98.88% - var(--carriage-rise) + 8px);
  left: -6px;
  right: -6px;
  height: 9px;
  background: rgba(35, 31, 23, 0.38);
  filter: blur(4px);
}

.typewriter-machine .platen {
  position: absolute;
  z-index: 4;
  top: 44.5%;
  left: 0;
  right: 0;
  height: 3.3%;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 18% 68%, rgba(0, 0, 0, 0.58)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.38) 0 1px, transparent 1px 7px),
    #11100f;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.12),
    inset 0 -4px 0 rgba(0, 0, 0, 0.55),
    0 7px 12px rgba(0, 0, 0, 0.28);
}

.typewriter-machine .platen::before {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--grit-texture) center / cover;
  mix-blend-mode: multiply;
  opacity: 0.5;
  pointer-events: none;
}

.typewriter-machine .platen::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: scaleX(-1);
  background: var(--grit-texture) center / cover;
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
}

.typewriter-machine .platen-scar {
  position: absolute;
  z-index: 1;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(238, 232, 216, 0.32), transparent 45%),
    linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.72) 12% 72%, rgba(232, 224, 205, 0.18) 74% 86%, transparent);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.09),
    0 1px 2px rgba(0, 0, 0, 0.42);
  opacity: 0.72;
  pointer-events: none;
}

.typewriter-machine .platen-scar::after {
  position: absolute;
  left: 18%;
  top: 50%;
  width: 42%;
  height: 1px;
  content: "";
  transform: translateY(-50%);
  background: rgba(235, 228, 210, 0.26);
}

.typewriter-machine .scar-left {
  left: 23%;
  top: 35%;
  transform: rotate(-7deg);
}

.typewriter-machine .scar-right {
  right: 26%;
  top: 60%;
  width: 48px;
  transform: rotate(11deg);
  opacity: 0.58;
}

.typewriter-machine .platen-end {
  position: absolute;
  z-index: 5;
  top: calc(1.54% - var(--carriage-rise));
  width: 8%;
  height: 105.23%;
  transform: translateY(-50%);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5));
}

.typewriter-machine .platen-end.left { left: -7.5%; }
.typewriter-machine .platen-end.right { right: -7.5%; filter: none; }

.typewriter-machine .platen-axle {
  position: absolute;
  z-index: 3;
  top: calc(-8.46% - var(--carriage-rise));
  left: -7.5%;
  width: 57.5%;
  height: 20%;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(35, 30, 22, 0.25) 7px 8px),
    linear-gradient(180deg, #4b4436, #e4dac1 24%, #b2a58a 45%, #625845 73%, #24211a);
  box-shadow: 0 1px 1px #171612;
}

.typewriter-machine .platen-axle.left {
  left: calc(-7.5% - var(--return-knob-offset));
  width: calc(28.15% + var(--return-knob-offset));
  border-radius: 3px 0 0 3px;
}

.typewriter-machine .platen-axle.right {
  left: 79.35%;
  width: 27.19%;
  border-radius: 0 999px 999px 0;
}

.typewriter-machine .platen-axle.center {
  z-index: 4;
  left: calc(23.3% - 4px);
  width: calc(53.4% + 8px);
  border-radius: 2px;
}

.typewriter-machine .paper-guide-roller {
  position: absolute;
  z-index: 4;
  top: calc(1.54% - var(--carriage-rise));
  width: 5.3%;
  height: 46%;
  transform: translateY(-50%);
  overflow: visible;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
}

.typewriter-machine .paper-guide-roller.left { left: 18%; }
.typewriter-machine .paper-guide-roller.right { right: 18%; transform: translateY(-50%) scaleX(-1); }

.typewriter-machine .axle-bearing {
  position: absolute;
  z-index: 4;
  top: 30%;
  left: 15%;
  width: 28%;
  height: 75%;
  overflow: visible;
}

.typewriter-machine .platen-end.left .axle-bearing { left: auto; right: calc(16% + 0.125cm); }
.typewriter-machine .platen-end.right .axle-bearing { left: calc(15% + 0.125cm); }

.typewriter-machine .knob-assembly {
  position: absolute;
  z-index: 4;
  top: 10%;
  left: 52%;
  width: 70%;
  height: 80%;
  overflow: visible;
}

.typewriter-machine .return-pivot {
  position: absolute;
  top: calc(29% - 0.125cm);
  left: calc(19% - var(--return-knob-offset));
  width: 48%;
  height: 45%;
  border: 1px solid #3c372c;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(15, 14, 10, 0.24), transparent 24%, rgba(20, 18, 13, 0.12) 45%, rgba(14, 13, 10, 0.62)),
    linear-gradient(-28deg, transparent 47%, #383025 48% 52%, transparent 53%),
    radial-gradient(ellipse, #9c8b6b 0 15%, #39332a 17% 24%, #b9aa89 26% 45%, #615643 49% 58%, #c7baa0 62% 68%, #494338 72%);
  box-shadow: 0 3px 0 #38342b, 0 5px 3px #171611;
}

.typewriter-machine .return-lever {
  position: absolute;
  bottom: calc(49% + 0.125cm);
  left: calc(40% - var(--return-knob-offset));
  width: 13%;
  height: 72%;
  transform-origin: 50% 100%;
  transform: rotate(-39deg);
  border-radius: 3px;
  background: linear-gradient(90deg, #423c30, #b8ac90 45%, #d4c6a7 57%, #635b49);
}

.typewriter-machine .lever-paddle {
  position: absolute;
  bottom: 78%;
  left: -59%;
  width: 218%;
  height: 57%;
  border: 1px solid #c3b496;
  border-radius: 50% 50% 35% 35%;
  background: var(--detail-grit-texture) center / cover, linear-gradient(90deg, #5e5544, #b3a58b 55%, #80735d);
  background-blend-mode: multiply, normal;
}

.typewriter-machine .platen-knob::before,
.typewriter-machine .bail-roller::before,
.typewriter-machine .bail-foot::before,
.typewriter-machine .guide-ear::before,
.typewriter-machine .guide-screw::before,
.typewriter-machine .guide-throat::before {
  position: absolute;
  inset: -16%;
  content: "";
  background: var(--detail-grit-texture) center / cover;
  mix-blend-mode: multiply;
  opacity: 0.92;
  pointer-events: none;
}

.typewriter-machine .platen-knob::after,
.typewriter-machine .bail-roller::after,
.typewriter-machine .bail-foot::after,
.typewriter-machine .guide-ear::after,
.typewriter-machine .guide-screw::after,
.typewriter-machine .guide-throat::after {
  position: absolute;
  inset: -18%;
  content: "";
  transform: scaleX(-1);
  background: var(--detail-grit-texture) center / cover;
  mix-blend-mode: overlay;
  opacity: 0.62;
  pointer-events: none;
}

.typewriter-machine .ribbon {
  --spool-spin: 0deg;
  --spool-widening: 0.75cm;
  --spool-outward-shift: 0.333333cm;
  --spool-rise: 0.5cm;
  --return-knob-offset: 19px;
  --ribbon-lift-angle: 8deg;
  position: absolute;
  z-index: 8;
  top: 43.8%;
  left: 0;
  width: 100%;
  height: 13%;
  pointer-events: none;
  filter: none;
}

.typewriter-machine .spool-shadow {
  position: absolute;
  z-index: 2;
  top: calc(100% - var(--spool-rise));
  width: calc(24% + var(--spool-widening));
  height: 85%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.65) 42%, transparent 76%);
  filter: blur(8px);
}

.typewriter-machine .spool-shadow.left { left: calc(-1% - var(--spool-widening) - var(--spool-outward-shift)); }
.typewriter-machine .spool-shadow.right { right: calc(-1% - var(--spool-widening) - var(--spool-outward-shift)); }

.typewriter-machine .ribbon-spool {
  position: absolute;
  z-index: 7;
  top: calc(-72% - 7px - var(--spool-rise));
  width: calc(17.5% + var(--spool-widening));
  height: 239.316%;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #cac5b9 0 6%, #4d4941 7% 12%, transparent 13%),
    radial-gradient(circle at 39% 34%, rgba(255, 255, 255, 0.32) 0 6%, transparent 18%),
    radial-gradient(circle at 64% 68%, rgba(0, 0, 0, 0.44) 0 18%, transparent 42%),
    conic-gradient(from calc(28deg + var(--spool-spin)), #11100f, #4b4740 15%, #1a1816 30%, #686257 43%, #171513 57%, #3d3933 74%, #0b0a09 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.18),
    inset 0 -8px 12px rgba(0, 0, 0, 0.58),
    inset 7px 0 14px rgba(255, 255, 255, 0.08),
    0 15px 12px rgba(0, 0, 0, 0.68),
    0 24px 25px rgba(0, 0, 0, 0.5);
  transition: transform 90ms cubic-bezier(0.2, 0.75, 0.28, 1);
}

.typewriter-machine .ribbon-spool-body {
  position: absolute;
  z-index: 6;
  top: calc(-72% - 15px + 42px - var(--spool-rise) + 0.5cm);
  width: calc(17.5% - 10px + var(--spool-widening));
  height: calc(239.316% - 10px);
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.1) 0 6%, transparent 18%),
    radial-gradient(circle at 64% 68%, rgba(0, 0, 0, 0.66) 0 20%, transparent 44%),
    conic-gradient(from calc(28deg + var(--spool-spin)), #030303, #211f1b 15%, #080807 30%, #38332d 43%, #070706 57%, #1b1815 74%, #010101 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -8px 12px rgba(0, 0, 0, 0.68),
    0 12px 12px rgba(0, 0, 0, 0.65),
    0 19px 22px rgba(0, 0, 0, 0.42);
  opacity: 1;
  transition: transform 90ms cubic-bezier(0.2, 0.75, 0.28, 1);
}

.typewriter-machine .spool-face-highlight {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 1.8px solid rgba(210, 216, 190, 0.62);
  border-radius: 50%;
  mask-image: conic-gradient(from -10deg, #000 0deg 85deg, transparent 135deg 310deg, #000 360deg);
  pointer-events: none;
}

.typewriter-machine .spool-disc-edge {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(110deg, #62675a 0%, #767a6b 18%, #454a3f 40%, #20251e 67%, #060806 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% calc(50% - 8px), transparent 98%, #000 100%);
  box-shadow: inset 0 -1px 1px #0a0c08;
  pointer-events: none;
}

.typewriter-machine .spool-disc-edge.upper {
  z-index: 8;
  top: calc(-72% - 2px - var(--spool-rise));
  width: calc(17.5% + var(--spool-widening));
  height: 239.316%;
}

.typewriter-machine .spool-disc-edge.lower {
  z-index: 8;
  top: calc(-72% - 10px + 42px - var(--spool-rise) + 0.5cm);
  width: calc(17.5% - 10px + var(--spool-widening));
  height: calc(239.316% - 10px);
}

.typewriter-machine .spool-disc-edge.left {
  left: calc(2.4% - var(--spool-widening) - var(--spool-outward-shift));
  transform: rotate(-8deg) scaleY(0.5) translateY(-12%);
}

.typewriter-machine .spool-disc-edge.right {
  right: calc(2.4% - var(--spool-widening) - var(--spool-outward-shift));
  transform: rotate(8deg) scaleY(0.5) translateY(-12%);
}

.typewriter-machine .spool-disc-edge.lower.left { left: calc(2.4% + 8px - var(--spool-widening) - var(--spool-outward-shift)); }
.typewriter-machine .spool-disc-edge.lower.right { right: calc(2.4% + 8px - var(--spool-widening) - var(--spool-outward-shift)); }

.typewriter-machine .ribbon-spool-body::before {
  position: absolute;
  content: "";
  pointer-events: none;
}

.typewriter-machine .ribbon-spool-body::before {
  inset: -8%;
  background:
    var(--detail-grit-texture),
    repeating-conic-gradient(from calc(10deg + var(--spool-spin)), rgba(255, 255, 255, 0.05) 0 4deg, transparent 4deg 18deg);
  background-blend-mode: multiply, normal;
  opacity: 0.88;
}

.typewriter-machine .spool-core {
  position: absolute;
  z-index: 6;
  top: calc(-9.778% - 7px - var(--spool-rise));
  width: calc(12.6% + var(--spool-widening) * 0.72);
  height: calc(86.154% + 42px - 8px + 0.5cm);
  overflow: visible;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.typewriter-machine .spool-core.left {
  left: calc(4.85% - var(--spool-widening) * 0.86 - var(--spool-outward-shift));
  transform: rotate(-8deg);
}

.typewriter-machine .spool-core.right {
  right: calc(4.85% - var(--spool-widening) * 0.86 - var(--spool-outward-shift));
  transform: rotate(8deg);
}

.typewriter-machine .ribbon-spool-body.left {
  left: calc(2.4% + 8px - var(--spool-widening) - var(--spool-outward-shift));
}

.typewriter-machine .ribbon-spool-body.right {
  right: calc(2.4% + 8px - var(--spool-widening) - var(--spool-outward-shift));
}

.typewriter-machine .ribbon-spool-body.left::before,
.typewriter-machine .ribbon-spool-body.left::after {
  transform-origin: center;
}

.typewriter-machine .ribbon-spool.left {
  left: calc(2.4% - var(--spool-widening) - var(--spool-outward-shift));
  transform: rotate(-8deg) scaleY(0.5) translateY(-12%);
}

.typewriter-machine .ribbon-spool.right {
  right: calc(2.4% - var(--spool-widening) - var(--spool-outward-shift));
  transform: rotate(8deg) scaleY(0.5) translateY(-12%);
}

.typewriter-machine .ribbon-spool-body.left {
  transform: rotate(-8deg) scaleY(0.5) translateY(-12%);
}

.typewriter-machine .ribbon-spool-body.right {
  transform: rotate(8deg) scaleY(0.5) translateY(-12%);
}

.typewriter-machine .ribbon-spool.left::before,
.typewriter-machine .ribbon-spool.right::before {
  box-shadow: 0 42px 0 rgba(8, 7, 6, 0.72);
}

.typewriter-machine .ribbon-spool::before,
.typewriter-machine .ribbon-spool::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.typewriter-machine .ribbon-spool::before {
  inset: -8%;
  background:
    var(--detail-grit-texture),
    repeating-conic-gradient(from calc(10deg + var(--spool-spin)), rgba(255, 255, 255, 0.08) 0 4deg, transparent 4deg 18deg);
  background-blend-mode: multiply, normal;
  opacity: 0.82;
}

.typewriter-machine .ribbon-spool::after {
  left: 50%;
  top: 50%;
  width: 32%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 58%, rgba(255, 255, 255, 0.22) 59% 65%, rgba(0, 0, 0, 0.34) 66% 74%, transparent 75%),
    linear-gradient(24deg, transparent 42%, rgba(0, 0, 0, 0.58) 43% 55%, transparent 56%),
    linear-gradient(145deg, #cbb787, #8d7448 48%, #403321);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.44),
    inset 0 -2px 0 rgba(0, 0, 0, 0.42),
    0 2px 5px rgba(0, 0, 0, 0.45);
}

.typewriter-machine .ribbon-spool.left::after {
  transform: translate(-50%, -50%) rotate(-18deg);
}

.typewriter-machine .spool-arm {
  position: absolute;
  z-index: 5;
  top: calc(18% - var(--spool-rise));
  width: 19%;
  height: 18%;
  border-radius: 999px;
  background:
    var(--detail-grit-texture),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 45%, rgba(0, 0, 0, 0.38)),
    linear-gradient(90deg, #817b70, #161412 18% 82%, #6d675d);
  background-blend-mode: multiply, normal, normal;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 5px rgba(0, 0, 0, 0.38);
}

.typewriter-machine .spool-arm.left {
  left: calc(10.8% - var(--spool-widening) / 2 - var(--spool-outward-shift));
  transform: rotate(13deg);
  transform-origin: 0 50%;
}

.typewriter-machine .spool-arm.right {
  right: calc(10.8% - var(--spool-widening) / 2 - var(--spool-outward-shift));
  transform: rotate(-13deg);
  transform-origin: 100% 50%;
}

.typewriter-machine .ribbon-run {
  position: absolute;
  z-index: 4;
  top: calc(3% - var(--spool-rise) - 5px);
  width: calc(47.7% + var(--spool-widening) + var(--spool-outward-shift));
  height: calc(42% + 0.25cm);
  overflow: hidden;
  will-change: transform, filter;
  background:
    linear-gradient(180deg, #0c0b0a 0 48%, #6f1217 49% 54%, #151210 55% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09), transparent 22% 70%, rgba(255, 255, 255, 0.05)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 4px),
    #0f0e0d;
  transform-origin: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}

.typewriter-machine .ribbon-run::before,
.typewriter-machine .ribbon-run::after {
  position: absolute;
  inset: -80% -20%;
  content: "";
  background: var(--grit-texture) center / cover;
  pointer-events: none;
}

.typewriter-machine .ribbon-run::before {
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.typewriter-machine .ribbon-run::after {
  transform: scaleX(-1);
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.typewriter-machine .ribbon-run.left {
  left: calc(3.3% - var(--spool-widening) - var(--spool-outward-shift));
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 83%);
  transform: rotate(-1deg);
  transform-origin: 0 50%;
}

.typewriter-machine .ribbon-run.right {
  right: calc(3.3% - var(--spool-widening) - var(--spool-outward-shift));
  clip-path: polygon(0 0, 100% 19%, 100% 83%, 0 100%);
  transform: rotate(1deg);
  transform-origin: 100% 50%;
}

.typewriter-machine .ribbon-hit {
  position: absolute;
  top: 21%;
  left: 50%;
  width: 7.5%;
  height: 47%;
  transform: translateX(-50%);
  border-radius: 6px;
  background: linear-gradient(90deg, transparent, rgba(150, 25, 29, 0.58), transparent);
  opacity: 0;
}

.typewriter-machine .ribbon-vibrator {
  position: absolute;
  z-index: 3;
  top: 10%;
  left: 50%;
  width: 10%;
  height: 79%;
  transform: translateX(-50%);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(circle at 50% 12%, rgba(245, 241, 229, 0.55) 0 7%, transparent 8%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 17% 76%, rgba(0, 0, 0, 0.36)),
    linear-gradient(180deg, #898276, #34312b 52%, #151411);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.34),
    0 10px 13px rgba(0, 0, 0, 0.36);
}

.typewriter-machine .ribbon.is-typing .ribbon-hit {
  animation: inkFlash 95ms ease-out both;
}

.typewriter-machine .paper-bail {
  position: absolute;
  z-index: 8;
  top: 31%;
  left: 50%;
  width: 23%;
  height: 15%;
  transform: translateX(-50%);
}

.typewriter-machine .paper-bail::before {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 60%;
  width: 62%;
  height: 24%;
  content: "";
  transform: translateX(-50%) skewX(-6deg);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  filter: blur(7px);
  opacity: 0.82;
  pointer-events: none;
}

.typewriter-machine .bail-wire {
  position: absolute;
  z-index: 1;
  top: calc(-18% + 0.833333cm);
  left: 50%;
  width: 35%;
  height: calc(128% - 0.333333cm);
  transform: translateX(-50%);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    var(--detail-grit-texture),
    linear-gradient(90deg, rgba(255, 255, 255, 0.46), transparent 20% 78%, rgba(0, 0, 0, 0.44)),
    linear-gradient(180deg, #d9d4c8, #827c72 46%, #312e29);
  background-blend-mode: multiply, normal, normal;
  clip-path: url(#bail-wire-profile);
  filter:
    drop-shadow(0 2px 1px rgba(0, 0, 0, 0.55))
    drop-shadow(0 8px 7px rgba(0, 0, 0, 0.52));
  opacity: 0.96;
}

.typewriter-machine .bail-wire::before,
.typewriter-machine .bail-wire::after {
  position: absolute;
  inset: -10%;
  content: "";
  background: var(--detail-grit-texture) center / cover;
  pointer-events: none;
}

.typewriter-machine .bail-wire::before {
  mix-blend-mode: multiply;
  opacity: 0.94;
}

.typewriter-machine .bail-wire::after {
  transform: scaleX(-1);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.58) 0 8%, rgba(255, 255, 255, 0.22) 8% 12%, transparent 12% 82%, rgba(0, 0, 0, 0.36) 82% 87%, rgba(255, 255, 255, 0.62) 87% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 0 8%, transparent 8% 86%, rgba(0, 0, 0, 0.42) 86% 100%),
    var(--detail-grit-texture) center / cover;
  background-blend-mode: normal, normal, overlay;
  mix-blend-mode: overlay;
  opacity: 0.62;
}

.typewriter-machine .bail-roller {
  position: absolute;
  top: calc(55% + 0.5cm);
  width: 15%;
  height: 18%;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #22201d, #050505 58%, #2e2b25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 3px 5px rgba(0, 0, 0, 0.4);
}

.typewriter-machine .bail-roller.left {
  left: 12%;
  transform: rotate(7deg);
}

.typewriter-machine .bail-roller.right {
  right: 12%;
  transform: rotate(-7deg);
}

.typewriter-machine .bail-foot {
  position: absolute;
  bottom: calc(-5% - 0.5cm);
  width: 13%;
  height: 54%;
  overflow: hidden;
  border-radius: 5px 5px 8px 8px;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0 9%, transparent 21% 76%, rgba(255, 255, 255, 0.4) 90%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 18% 82%, rgba(0, 0, 0, 0.32)),
    radial-gradient(circle at 50% 17%, rgba(37, 35, 31, 0.78) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 17%, rgba(238, 233, 220, 0.8) 0 15%, transparent 16%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 18% 72%, rgba(0, 0, 0, 0.52)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #b8b2a6 0 16%, #7b766d 17% 52%, #332f29 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.42),
    0 5px 8px rgba(0, 0, 0, 0.32);
}

.typewriter-machine .bail-foot.left {
  left: 18%;
  transform: rotate(7deg) scaleY(-1);
}

.typewriter-machine .bail-foot.right {
  right: 18%;
  transform: rotate(-7deg) scaleY(-1);
}

.typewriter-machine .type-guide {
  position: absolute;
  z-index: 9;
  top: 40.5%;
  left: 50%;
  width: 8.5%;
  height: 25%;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 7px rgba(0, 0, 0, 0.75)) drop-shadow(7px 17px 12px rgba(0, 0, 0, 0.45));
}

.typewriter-machine .type-guide::before {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 76%;
  height: 58%;
  content: "";
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 22% 74%, rgba(0, 0, 0, 0.31)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 8px),
    #38342d;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.36),
    0 8px 12px rgba(0, 0, 0, 0.34);
}

.typewriter-machine .guide-ear {
  position: absolute;
  top: 0;
  width: 24%;
  height: 62%;
  overflow: hidden;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(90deg, #3b3933, #a19c90 42%, #1e1d1a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 7px 10px rgba(0, 0, 0, 0.32);
}

.typewriter-machine .guide-ear.left {
  left: 10%;
  transform: rotate(-4deg);
}

.typewriter-machine .guide-ear.right {
  right: 10%;
  transform: rotate(4deg);
}

.typewriter-machine .guide-slot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 40%;
  height: 78%;
  transform: translateX(-50%);
  border-radius: 7px 7px 2px 2px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 17%, rgba(148, 24, 27, 0.35), transparent 24%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 18% 70%, rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 6px),
    #4b463d;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.25),
    0 10px 16px rgba(0, 0, 0, 0.4);
}

.typewriter-machine .guide-slot::before,
.typewriter-machine .guide-slot::after {
  position: absolute;
  inset: -20% -180%;
  content: "";
  background: var(--grit-texture) center / cover;
  pointer-events: none;
}

.typewriter-machine .guide-slot::before {
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.typewriter-machine .guide-slot::after {
  transform: scaleX(-1);
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.typewriter-machine .guide-screw {
  position: absolute;
  z-index: 2;
  top: 19%;
  width: 16%;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(18deg, transparent 42%, rgba(0, 0, 0, 0.6) 43% 56%, transparent 57%),
    radial-gradient(circle at 35% 30%, #dad4c8, #777166 47%, #292721 74%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 3px rgba(0, 0, 0, 0.42);
}

.typewriter-machine .guide-screw.left {
  left: 8%;
  transform: rotate(-18deg);
}

.typewriter-machine .guide-screw.right {
  right: 8%;
  transform: rotate(15deg);
}

.typewriter-machine .guide-throat {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 10%;
  width: 13%;
  height: 80%;
  transform: translateX(-50%);
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.78), rgba(214, 205, 188, 0.26) 42% 58%, rgba(0, 0, 0, 0.86)),
    linear-gradient(180deg, #4d473f, #171512 68%);
  box-shadow:
    inset 2px 0 0 rgba(255, 255, 255, 0.18),
    inset -2px 0 0 rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(0, 0, 0, 0.52),
    0 0 6px rgba(116, 14, 18, 0.38);
}

.typewriter-machine .guide-throat::before {
  inset: 7% 31% 8%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 34% 66%, rgba(0, 0, 0, 0.55)),
    linear-gradient(180deg, #080706, #171411 52%, #050504);
  box-shadow:
    inset 1px 0 2px rgba(255, 255, 255, 0.1),
    inset -2px 0 3px rgba(0, 0, 0, 0.74),
    0 0 0 1px rgba(0, 0, 0, 0.44);
  mix-blend-mode: normal;
  opacity: 1;
}

.typewriter-machine .guide-throat::after {
  inset: -12%;
  transform: none;
  background:
    radial-gradient(ellipse at 50% 88%, rgba(238, 232, 216, 0.55) 0 12%, rgba(238, 232, 216, 0.18) 22%, transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0 9%, transparent 19% 74%, rgba(0, 0, 0, 0.4) 86%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 22% 78%, rgba(255, 255, 255, 0.18)),
    var(--detail-grit-texture) center / cover;
  background-blend-mode: screen, overlay, normal, overlay;
  mix-blend-mode: overlay;
  opacity: 0.72;
}

.typewriter-machine .type-basket {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 52.5%;
  width: 24%;
  height: 18%;
  transform: translateX(-50%);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0, rgba(0, 0, 0, 0.52), transparent 56%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 18% 84%, rgba(0, 0, 0, 0.34)),
    linear-gradient(180deg, #5f5a51, #211f1b 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 12px 18px rgba(0, 0, 0, 0.34);
}

.typewriter-machine .type-basket::before,
.typewriter-machine .type-basket::after {
  position: absolute;
  inset: -30% -20%;
  content: "";
  background: var(--grit-texture) center / cover;
  pointer-events: none;
}

.typewriter-machine .type-basket::before {
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.typewriter-machine .type-basket::after {
  transform: scaleX(-1);
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.typewriter-machine .basket-slot {
  position: absolute;
  top: 9%;
  width: 4%;
  height: 92%;
  overflow: hidden;
  transform-origin: 50% 0;
  border-radius: 999px 999px 0 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.58) 0 19%, rgba(217, 207, 190, 0.34) 43% 56%, rgba(0, 0, 0, 0.66) 82% 100%),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(255, 255, 255, 0.08) 9px 10px, transparent 10px 22px),
    linear-gradient(180deg, #47423a, #171512 74%);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.16),
    inset -1px 0 0 rgba(0, 0, 0, 0.62),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.34);
}

.typewriter-machine .basket-slot::before,
.typewriter-machine .basket-slot::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.typewriter-machine .basket-slot::before {
  inset: 8% 31% 0;
  border-radius: 999px 999px 0 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), rgba(255, 255, 255, 0.12) 45% 55%, rgba(0, 0, 0, 0.58)),
    linear-gradient(180deg, #0b0a09, #1c1916);
  box-shadow:
    inset 1px 0 1px rgba(255, 255, 255, 0.08),
    inset -1px 0 2px rgba(0, 0, 0, 0.62);
}

.typewriter-machine .basket-slot::after {
  inset: 12% -20% 12%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0 4%, transparent 4% 72%, rgba(0, 0, 0, 0.32) 86%),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(0, 0, 0, 0.22) 18px 19px, rgba(255, 255, 255, 0.08) 19px 20px, transparent 20px 36px);
  mix-blend-mode: overlay;
  opacity: 0.72;
}

.typewriter-machine .slot-one {
  left: 24%;
  transform: rotate(-19deg);
}

.typewriter-machine .slot-two {
  left: 36%;
  transform: rotate(-9deg);
}

.typewriter-machine .slot-three {
  left: 49%;
}

.typewriter-machine .slot-four {
  right: 36%;
  transform: rotate(9deg);
}

.typewriter-machine .slot-five {
  right: 24%;
  transform: rotate(19deg);
}

.typewriter-machine .rear-basket-shade {
  position: absolute;
  z-index: 4;
  top: 47%;
  left: 5%;
  right: 5%;
  height: 17%;
  background: linear-gradient(180deg, rgba(2, 5, 3, 0.85), rgba(3, 7, 4, 0.65) 45%, transparent);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
  pointer-events: none;
}

.typewriter-machine .bar-fan {
  --hammer-perspective: 0.62;
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: -12%;
  width: 96%;
  height: 57%;
  transform-origin: 50% 0;
  transform: translate(-50%, 10px) scaleY(var(--hammer-perspective));
}

.typewriter-machine .fan-bar,
.typewriter-machine .fan-bar-extrude {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.72%;
  height: calc(98% - 19px);
  overflow: visible;
  transform: translateX(-50%) rotate(var(--angle));
  transform-origin: 50% 0;
  border-radius: 0 0 999px 999px;
}

.typewriter-machine .hammer-well,
.typewriter-machine .hammer-well-rim {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 50%;
  width: auto;
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  pointer-events: none;
}

.typewriter-machine .hammer-well-rim {
  height: calc(98% - 19px + 34px);
  border: 4px solid #655e4e;
  border-top: 0;
  background: linear-gradient(180deg, #33362e, #4a483b);
  box-shadow:
    inset 0 -2px 1px rgba(204, 190, 154, 0.5),
    0 2px 1px rgba(200, 185, 149, 0.35),
    0 6px 8px rgba(0, 0, 0, 0.65);
}

.typewriter-machine .hammer-well {
  height: calc(98% - 19px + 24px);
  background:
    radial-gradient(ellipse at 50% 0, #050705, #0c100c 65%, #171b14);
  box-shadow:
    inset 0 -8px 10px #020302,
    inset 8px 0 12px rgba(0, 0, 0, 0.8),
    inset -8px 0 12px rgba(0, 0, 0, 0.8),
    0 2px 1px rgba(144, 136, 112, 0.3);
}

.typewriter-machine .fan-bar-extrude {
  top: var(--extrude-y);
  z-index: calc(20 - var(--extrude-step));
  width: 0.72%;
  border-radius: 0;
  background: none;
  opacity: 1;
  filter: brightness(calc(1 - var(--extrude-step) * 0.045));
  box-shadow: none;
}

.typewriter-machine .fan-bar-extrude::after {
  position: absolute;
  left: 50%;
  bottom: -1.5%;
  width: 23px;
  height: 50px;
  content: "";
  transform: translateX(-50%);
  border-radius: 0;
  background:
    linear-gradient(90deg, #171913, #4c493d 42% 58%, #161811);
  box-shadow:
    inset 1px 0 0 rgba(191, 180, 152, 0.12),
    inset -1px 0 0 rgba(0, 0, 0, 0.65);
}

.typewriter-machine .fan-bar {
  z-index: 30;
  background: none;
  opacity: 1;
  box-shadow: none;
}

.typewriter-machine .curved-hammer-stems {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  height: calc(98% - 19px);
  width: auto;
  aspect-ratio: 2 / 1;
  overflow: visible;
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.75));
}

.typewriter-machine .hammer-center-receiver {
  position: absolute;
  z-index: 40;
  top: 0;
  left: 50%;
  width: 12%;
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  border: 5px solid #68614f;
  border-top: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, #10140f, #030503);
  box-shadow: inset 0 -3px 2px #252a20, 0 3px 0 #292c23, 0 9px 8px rgba(0, 0, 0, 0.8);
}

.typewriter-machine .fan-bar::after {
  position: absolute;
  left: 50%;
  bottom: -1.5%;
  z-index: 1;
  width: 23px;
  height: 50px;
  content: "";
  transform: translateX(-50%);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px calc(100% - 2px), rgba(0, 0, 0, 0.34) calc(100% - 2px)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0 2px, rgba(221, 214, 201, 0.48) 10px 13px, rgba(0, 0, 0, 0.42) calc(100% - 2px)),
    linear-gradient(180deg, #bdb4a4, #827b70 48%, #3b3731);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 0 0 1px rgba(35, 31, 27, 0.26);
}

.typewriter-machine .fan-bar::before {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -1.5%;
  display: grid;
  place-items: center;
  width: 23px;
  height: 50px;
  content: attr(data-char);
  transform: translateX(-50%) scale(0.72, -1.18);
  color: rgba(25, 22, 18, 0.78);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.24),
    0 -1px 0 rgba(0, 0, 0, 0.18);
}

.typewriter-machine .machine-bed {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: -7.8%;
  width: 104%;
  height: 60%;
  transform: translateX(-50%);
  border: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.typewriter-machine .bed-rails,
.typewriter-machine .machine-seams {
  position: absolute;
  left: 50%;
  bottom: -7.8%;
  width: 104%;
  height: 60%;
  transform: translateX(-50%);
  pointer-events: none;
}

.typewriter-machine .bed-rails {
  z-index: 3;
}

.typewriter-machine .front-grooves {
  z-index: 6;
}

.typewriter-machine .front-engraving {
  clip-path: inset(42% 0 0);
}

.typewriter-machine .basket-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.typewriter-machine .machine-seams {
  z-index: 4;
}

.typewriter-machine .machine-bed::before {
  position: absolute;
  inset: 6% 4% 22%;
  content: "";
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background:
    radial-gradient(circle at 18% 82%, rgba(15, 14, 13, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 74%, rgba(235, 230, 218, 0.16) 0 1px, transparent 2px),
    repeating-linear-gradient(103deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 12px);
  opacity: 0.72;
  pointer-events: none;
}

.typewriter-machine .machine-bed::after {
  position: absolute;
  inset: -2%;
  content: "";
  transform: scaleX(-1);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: var(--grit-texture) center 64% / cover;
  mix-blend-mode: multiply;
  opacity: 0.65;
  pointer-events: none;
}

.typewriter-machine .bed-arc-detail {
  position: absolute;
  z-index: 1;
  content: "";
  border-right: 4px solid rgba(34, 31, 27, 0.54);
  border-bottom: 4px solid rgba(24, 22, 20, 0.62);
  border-left: 4px solid rgba(196, 188, 172, 0.22);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: transparent;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.1),
    inset 0 -3px 4px rgba(0, 0, 0, 0.34),
    0 -1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(0, 0, 0, 0.44);
  opacity: 0.82;
  pointer-events: none;
}

.typewriter-machine .arc-detail-outer {
  inset: 8% 2% 13%;
}

.typewriter-machine .arc-detail-inner {
  inset: 21% 8% 24%;
  opacity: 0.58;
  border-right-color: rgba(30, 28, 25, 0.48);
  border-bottom-color: rgba(18, 17, 15, 0.5);
  border-left-color: rgba(225, 216, 196, 0.16);
}

.typewriter-machine .bed-arc-tick {
  position: absolute;
  z-index: 2;
  width: 38px;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 50%),
    linear-gradient(90deg, transparent, rgba(12, 11, 10, 0.58) 18% 82%, transparent);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(0, 0, 0, 0.5);
  opacity: 0.72;
  pointer-events: none;
}

.typewriter-machine .tick-left-one {
  left: 4%;
  top: 32%;
  transform: rotate(-21deg);
}

.typewriter-machine .tick-left-two {
  left: 9%;
  top: 50%;
  width: 30px;
  transform: rotate(10deg);
  opacity: 0.58;
}

.typewriter-machine .tick-left-three {
  left: 2.5%;
  top: 68%;
  transform: rotate(24deg);
}

.typewriter-machine .tick-right-one {
  right: 4%;
  top: 32%;
  transform: rotate(21deg);
}

.typewriter-machine .tick-right-two {
  right: 9%;
  top: 50%;
  width: 30px;
  transform: rotate(-10deg);
  opacity: 0.58;
}

.typewriter-machine .tick-right-three {
  right: 2.5%;
  top: 68%;
  transform: rotate(-24deg);
}

.typewriter-machine .machine-seam {
  position: absolute;
  z-index: 1;
  display: block;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 52%),
    linear-gradient(90deg, transparent, rgba(12, 11, 10, 0.72) 10% 90%, transparent);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(0, 0, 0, 0.5);
  opacity: 0.7;
  pointer-events: none;
}

.typewriter-machine .machine-seam::before,
.typewriter-machine .machine-seam::after {
  position: absolute;
  top: 50%;
  width: 5px;
  aspect-ratio: 1;
  content: "";
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(235, 229, 212, 0.36), rgba(54, 49, 42, 0.62) 58%, rgba(8, 7, 6, 0.76));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 2px rgba(0, 0, 0, 0.42);
}

.typewriter-machine .machine-seam::before {
  left: -2px;
}

.typewriter-machine .machine-seam::after {
  right: -2px;
}

.typewriter-machine .edge-plate {
  position: absolute;
  z-index: 0;
  top: 13%;
  width: 15%;
  height: 70%;
  opacity: 0.36;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 24% 76%, rgba(0, 0, 0, 0.2)),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.06) 18%, rgba(0, 0, 0, 0.2) 72%, transparent),
    repeating-linear-gradient(101deg, transparent 0 13px, rgba(0, 0, 0, 0.18) 13px 14px, rgba(255, 255, 255, 0.06) 14px 15px, transparent 15px 31px);
  clip-path: polygon(0 9%, 100% 0, 92% 86%, 10% 100%);
}

.typewriter-machine .edge-plate-left {
  left: 0.5%;
  transform: rotate(-4deg);
}

.typewriter-machine .edge-plate-right {
  right: 0.5%;
  transform: scaleX(-1) rotate(-4deg);
}

.typewriter-machine .vertical-seam {
  width: 15%;
  transform-origin: center;
}

.typewriter-machine .vertical-seam.left-a {
  left: 2.5%;
  top: 35%;
  width: 16%;
  transform: rotate(84deg);
  opacity: 0.62;
}

.typewriter-machine .vertical-seam.left-b {
  left: 10%;
  top: 55%;
  width: 11%;
  transform: rotate(101deg);
  opacity: 0.5;
}

.typewriter-machine .vertical-seam.right-a {
  right: 2.5%;
  top: 35%;
  width: 16%;
  transform: rotate(-84deg);
  opacity: 0.62;
}

.typewriter-machine .vertical-seam.right-b {
  right: 10%;
  top: 55%;
  width: 11%;
  transform: rotate(-101deg);
  opacity: 0.5;
}

.typewriter-machine .bed-rivet {
  position: absolute;
  z-index: 2;
  width: 11px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(38deg, transparent 42%, rgba(0, 0, 0, 0.5) 43% 56%, transparent 57%),
    radial-gradient(circle at 36% 28%, rgba(238, 231, 215, 0.48), rgba(88, 80, 69, 0.62) 52%, rgba(12, 11, 10, 0.74));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 2px 3px rgba(0, 0, 0, 0.34);
  opacity: 0.72;
  pointer-events: none;
}

.typewriter-machine .rivet-left-one {
  left: 4.2%;
  top: 21%;
  transform: rotate(-18deg);
}

.typewriter-machine .rivet-left-two {
  left: 10.5%;
  top: 40%;
  transform: rotate(34deg);
  opacity: 0.56;
}

.typewriter-machine .rivet-left-three {
  left: 5.8%;
  top: 70%;
  transform: rotate(8deg);
}

.typewriter-machine .rivet-right-one {
  right: 4.2%;
  top: 21%;
  transform: rotate(18deg);
}

.typewriter-machine .rivet-right-two {
  right: 10.5%;
  top: 40%;
  transform: rotate(-34deg);
  opacity: 0.56;
}

.typewriter-machine .rivet-right-three {
  right: 5.8%;
  top: 70%;
  transform: rotate(-8deg);
}

.typewriter-machine .seam-left-top {
  left: 6%;
  top: 28%;
  width: 18%;
  transform: rotate(-7deg);
}

.typewriter-machine .seam-left-mid {
  left: 17%;
  top: 45%;
  width: 12%;
  transform: rotate(11deg);
  opacity: 0.58;
}

.typewriter-machine .seam-left-lower {
  left: 7%;
  top: 63%;
  width: 20%;
  transform: rotate(5deg);
}

.typewriter-machine .seam-left-upper-chip {
  left: 14%;
  top: 20%;
  width: 8%;
  transform: rotate(16deg);
  opacity: 0.48;
}

.typewriter-machine .seam-left-short {
  left: 25%;
  top: 31%;
  width: 7%;
  transform: rotate(-22deg);
  opacity: 0.44;
}

.typewriter-machine .seam-center-left {
  left: 33%;
  top: 36%;
  width: 10%;
  transform: rotate(-16deg);
  opacity: 0.52;
}

.typewriter-machine .seam-center-right {
  right: 33%;
  top: 39%;
  width: 9%;
  transform: rotate(14deg);
  opacity: 0.52;
}

.typewriter-machine .seam-center-short {
  left: 46%;
  top: 30%;
  width: 7%;
  transform: rotate(8deg);
  opacity: 0.4;
}

.typewriter-machine .seam-right-lower {
  right: 7%;
  top: 64%;
  width: 21%;
  transform: rotate(-5deg);
}

.typewriter-machine .seam-right-short {
  right: 25%;
  top: 32%;
  width: 7%;
  transform: rotate(23deg);
  opacity: 0.44;
}

.typewriter-machine .seam-right-upper-chip {
  right: 14%;
  top: 19%;
  width: 8%;
  transform: rotate(-15deg);
  opacity: 0.48;
}

.typewriter-machine .seam-right-mid {
  right: 17%;
  top: 46%;
  width: 13%;
  transform: rotate(-12deg);
  opacity: 0.58;
}

.typewriter-machine .seam-right-top {
  right: 6%;
  top: 27%;
  width: 18%;
  transform: rotate(7deg);
}

.typewriter-machine .rail {
  position: absolute;
  overflow: hidden;
  border-right: 4px solid rgba(30, 28, 25, 0.9);
  border-bottom: 4px solid rgba(18, 17, 15, 0.92);
  border-left: 4px solid rgba(30, 28, 25, 0.9);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 20% 72%, rgba(0, 0, 0, 0.22)),
    transparent;
  box-shadow:
    inset 0 3px 4px rgba(0, 0, 0, 0.5),
    inset 0 -2px 0 rgba(255, 255, 255, 0.12),
    0 -1px 0 rgba(0, 0, 0, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0.86;
}

.typewriter-machine .rail::before,
.typewriter-machine .rail::after {
  position: absolute;
  inset: 5% 4% 9%;
  content: "";
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  pointer-events: none;
}

.typewriter-machine .rail::before {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 1px solid rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.08),
    inset 0 -3px 4px rgba(0, 0, 0, 0.28);
  opacity: 0.74;
}

.typewriter-machine .rail::after {
  inset: 13% 8% 16%;
  border-right: 1px dashed rgba(235, 227, 209, 0.12);
  border-bottom: 1px dashed rgba(235, 227, 209, 0.14);
  border-left: 1px dashed rgba(0, 0, 0, 0.32);
  opacity: 0.62;
}

.typewriter-machine .rail-top {
  inset: 10% -1% 9%;
}

.typewriter-machine .rail-bottom {
  inset: 22% 4% 16%;
}

.typewriter-machine .screw {
  position: absolute;
  z-index: 3;
  width: clamp(18px, 5.4%, 34px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 58%, rgba(255, 255, 255, 0.24) 59% 65%, rgba(0, 0, 0, 0.34) 66% 74%, transparent 75%),
    linear-gradient(80deg, transparent 43%, rgba(0, 0, 0, 0.52) 44% 55%, transparent 56%),
    linear-gradient(145deg, #cbb787, #8d7448 48%, #403321);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.46),
    inset 0 -2px 0 rgba(0, 0, 0, 0.42),
    0 4px 6px rgba(0, 0, 0, 0.25);
}

.typewriter-machine .screw.rear-screw {
  top: calc(45% - var(--spool-rise) + 0.916667cm - 5px);
  width: clamp(12px, 2.8%, 26px);
  transform: scaleY(0.5);
  filter: brightness(0.72);
}

.typewriter-machine .screw.rear-screw.left { left: 29%; transform: scaleY(0.5) rotate(-24deg); }
.typewriter-machine .screw.rear-screw.right { right: 29%; transform: scaleY(0.5) rotate(18deg); }

.typewriter-machine .left-one {
  left: 2%;
  top: 20%;
  transform: rotate(-8deg) scaleY(0.62);
}

.typewriter-machine .left-two {
  left: 18%;
  top: 74%;
  transform: rotate(-8deg) scaleY(0.62);
}

.typewriter-machine .right-one {
  right: 18%;
  top: 74%;
  transform: rotate(8deg) scaleY(0.62);
}

.typewriter-machine .right-two {
  right: 2%;
  top: 20%;
  transform: rotate(8deg) scaleY(0.62);
}

.typewriter-machine .brand-badge {
  position: absolute;
  z-index: 8;
  top: 77.5%;
  left: calc(-5% - 0.666667cm);
  width: 24%;
  aspect-ratio: 6.9;
  container-type: inline-size;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #6a573b;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(5, 7, 5, 0.4), transparent 22% 72%, rgba(3, 5, 3, 0.5)),
    linear-gradient(165deg, #292c25, #10150f 48%, #080c08);
  box-shadow: inset 0 0 3px 1px #080c07, inset 0 1px 0 rgba(182, 171, 139, 0.24), 0 2px 3px rgba(0, 0, 0, 0.65);
}

.typewriter-machine .brand-badge::before {
  position: absolute;
  inset: 0;
  content: "";
  z-index: 2;
  background: var(--detail-grit-texture) 28% 54% / 100%;
  mix-blend-mode: multiply;
  opacity: 0.65;
  pointer-events: none;
}

.typewriter-machine .brand-badge::after {
  position: absolute;
  inset: 1px;
  content: "";
  border: 1px solid rgba(158, 126, 81, 0.38);
  border-radius: 3px;
  pointer-events: none;
}

.typewriter-machine .brand-lettering {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.16em;
  padding: 0 15%;
  color: #c5a564;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(5px, 10cqi, 18.5px);
  font-style: normal;
  font-weight: 700;
  font-kerning: normal;
  letter-spacing: 0;
  line-height: 1;
  transform: scaleX(1.18);
  text-shadow: 0 1px 1px #050804, 0 -1px 0 rgba(226, 196, 128, 0.38);
}

.typewriter-machine .brand-letter { font: inherit; }

.typewriter-machine .badge-screw {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 7%;
  aspect-ratio: 1;
  border: 1px solid #453720;
  border-radius: 50%;
  background:
    linear-gradient(85deg, transparent 42%, #362b1b 43% 56%, transparent 57%),
    linear-gradient(145deg, #cfba87, #8e7549 48%, #443621);
  box-shadow: inset 0 1px 0 rgba(231, 204, 146, 0.4), inset 0 -1px 1px #392c19, 0 1px 2px #281913;
}

.typewriter-machine .badge-screw.left { left: 4%; transform: translateY(-50%) rotate(-28deg); }
.typewriter-machine .badge-screw.right { right: 4%; transform: translateY(-50%) rotate(22deg); }

.typewriter-machine .active-typebar {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 12.2%;
  width: 8.6%;
  height: 46%;
  transform: translateX(-50%) rotate(var(--bar-angle));
  transform-origin: 50% 100%;
  animation: hammerStrike 110ms cubic-bezier(0.18, 0.82, 0.26, 1) both;
  animation-duration: calc(var(--ribbon-up-time, 55ms) * 2);
  pointer-events: none;
}

.typewriter-machine .type-rod {
  position: absolute;
  left: 47%;
  bottom: 0;
  width: 9%;
  height: 84%;
  border-radius: 999px;
  background: linear-gradient(90deg, #302d27, #aaa294 44%, #1d1b18);
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.34);
}

.typewriter-machine .type-slug {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 23px;
  aspect-ratio: 0.46;
  transform: translateX(-50%);
  border-radius: 1px;
  background: linear-gradient(120deg, #dad5ca, #5d574d 44%, #211f1a);
  color: #1d1a15;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 12px rgba(0, 0, 0, 0.32);
}

.typewriter-machine .type-slug::before,
.typewriter-machine .type-slug::after {
  position: absolute;
  inset: -12%;
  content: "";
  background: var(--grit-texture) center / cover;
  pointer-events: none;
}

.typewriter-machine .type-slug::before {
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.typewriter-machine .type-slug::after {
  transform: scaleX(-1);
  mix-blend-mode: overlay;
  opacity: 0.5;
}

@keyframes hammerStrike {
  0% {
    transform: translateX(-50%) translateY(22%) rotate(calc(var(--bar-angle) * 2.15));
  }
  43% {
    transform: translateX(-50%) translateY(-39%) rotate(calc(var(--bar-angle) * 0.18));
  }
  55% {
    transform: translateX(-50%) translateY(-40%) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) translateY(18%) rotate(calc(var(--bar-angle) * 2.05));
  }
}

@keyframes inkFlash {
  0%,
  26% {
    opacity: 0;
    transform: translateX(-50%) scaleX(0.65);
  }
  44% {
    opacity: 0.9;
    transform: translateX(-50%) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleX(1.45);
  }
}

/* ---- Murder at the Prompt integration ---- */
.typewriter-machine, .typewriter-machine *, .typewriter-machine *::before, .typewriter-machine *::after { box-sizing: border-box; }

/* The deck is the strip of machine pinned to the foot of the play screen. Its height follows the
   sheet's width; the dock (app.css) and the log's clearance (game.js) both stand on --deck-h. */
html:root:has(#app.game) {
  --tw-paper-w: min(100vw, 680px);
  --deck-h: calc(var(--tw-paper-w) * 0.215 + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 705px) {
  html:root:has(#app.game) { --tw-paper-w: 710px; }
}

.typewriter-machine {
  --grit-texture: url('/assets/img/typewriter-grit.png');
  --detail-grit-texture: url('/assets/img/typewriter-detail.png');
  /* The demo's sheet is 862.4px wide on its 880px stage; scale it to our sheet. */
  --tw-scale: tan(atan2(var(--tw-paper-w), 862.4px));
  /* Stage pixels hidden above the top of the deck; the roller's top edge is at 220.3px. */
  --tw-crop: 165px;
  /* The sheet's edges: the dock's box is --curl-flare wider than the log sheet on each side. */
  --curl-flare: clamp(0px, calc((712px - 100vw) / 2), 16px);
  --sheet-in: calc(var(--curl-flare) / var(--tw-scale)); /* the same, in stage pixels */
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--tw-paper-w);
  height: var(--deck-h);
  overflow: visible;
  pointer-events: none;
  background: #302d27;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.typewriter-machine .machine-stage,
.typewriter-machine .bail-stage {
  --carriage-rise: 112px; /* a lower carriage drum than the demo's 140px */
  position: absolute;
  top: calc(var(--tw-crop) * var(--tw-scale) * -1);
  left: 50%;
  width: 880px;
  height: 495px;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  transform: translateX(-50%) scale(var(--tw-scale));
  transform-origin: 50% 0;
}
/* Above the deck, the sheet's own column belongs to the dock and the log: only the machine's sides show there. */
.typewriter-machine .machine-stage {
  --sheet-l: calc(1% + var(--sheet-in));
  --sheet-r: calc(99% - var(--sheet-in));
  --sheet-t: calc(var(--tw-crop) - 2px); /* a hair above the deck, so no seam opens under the dock */
  clip-path: polygon(-400px -400px, var(--sheet-l) -400px, var(--sheet-l) var(--sheet-t), var(--sheet-r) var(--sheet-t),
    var(--sheet-r) -400px, calc(100% + 400px) -400px, calc(100% + 400px) calc(100% + 400px), -400px calc(100% + 400px));
}
/* The machine's sheet is the log-wide column; .sheet-curl widens it down to the roller. */
.typewriter-machine .paper {
  background: var(--paper);
  clip-path: inset(0 calc(var(--sheet-in) + 1px)); /* a hair inside its column; .sheet-curl overlaps it */
}
.typewriter-machine .active-typebar { visibility: hidden; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .typewriter-machine *, .typewriter-machine *::before, .typewriter-machine *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Keep the hundreds of static shaded layers out of each typing/scroll
   frame's paint preparation. Promote the fan once, not each metal strip. */
.typewriter-machine .bar-fan { will-change: transform; }

/* Same geometry as the stage, but outside its clipping/stacking context. */
.typewriter-bail-layer {
  z-index: 12;
  overflow: visible;
  background: none;
  padding: 0;
}

/* Wider screens show the whole machine: casing shoulders and the carriage drums. */
@media (min-width: 705px) {
  .typewriter-machine { --curl-flare: 15px; }
  .typewriter-machine:not(.typewriter-bail-layer) { background: transparent; }
}

/* The command dock and exposed sheet share one aligned paper grain. */
.prompt-dock,
.typewriter-machine .paper {
  background-color:var(--paper);
  background-image:
    linear-gradient(color-mix(in srgb, var(--paper) 92%, transparent), color-mix(in srgb, var(--paper) 92%, transparent)),
    url('/assets/img/typewriter-grit.png');
  background-size:auto, var(--paper-grain-width, 680px) auto;
  background-position:0 0, var(--grain-x,0px) var(--grain-y,0px);
}

/* One sheet: log, commands and the strip in the machine are the same page. It keeps the log's
   width down to the top of the carriage drum, then widens over the drum's height and tucks in
   at the roller. game.js trims a paperclip at the dock's top edge. The paper fingers reach up
   over the foot of the dock, so the commands are indented to clear them. */
.prompt-dock {
  --curl-flare: clamp(0px, calc((712px - 100vw) / 2), 16px);
  border-top: 1px solid transparent;
  box-shadow: none;
  /* The box keeps its width; only the log-wide column is sheet. */
  clip-path: inset(0 var(--curl-flare));
  padding-inline: calc(var(--tw-paper-w) * 0.092);
}
@media (min-width: 705px) {
  .prompt-dock { --curl-flare: 15px; }
}
.typewriter-machine .sheet-curl {
  /* Stage pixels: the widening runs from the drum's top edge to the roller's. */
  --curl-top: calc(201.5px - var(--carriage-rise));
  --roller-top: 220.3px;
  position: absolute;
  z-index: 1;
  left: 1%;
  right: 1%;
  top: var(--curl-top);
  height: calc(var(--roller-top) - var(--curl-top));
}
.typewriter-machine .sheet-curl::before,
.typewriter-machine .sheet-curl::after {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--sheet-in) + 2px);
  height: 100%;
  content: "";
  background: var(--paper);
  --curl-edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 100' preserveAspectRatio='none'%3E%3Cpath d='M15 0C15 42 0 48 0 86C0 93 1.5 97 3.5 100H15Z'/%3E%3C/svg%3E");
  -webkit-mask: var(--curl-edge) 0 0 / 100% 100% no-repeat;
  mask: var(--curl-edge) 0 0 / 100% 100% no-repeat;
}
.typewriter-machine .sheet-curl::after { left: auto; right: 0; transform: scaleX(-1); }

/* Slightly smaller paper fingers than the demo's, standing on the same spot. */
.typewriter-machine .page-clip { top: 25.6%; width: 4%; height: 14.4%; }

/* When the log runs on behind the commands, a rule marks the edge and a small button leads back down. */
.prompt-dock.has-more { border-top-color: var(--rule); }
.dock-jump {
  flex: 0 0 100%;
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  height: 1.5rem;
  margin-bottom: 0.2rem;
  visibility: hidden;
}
.prompt-dock.has-more .dock-jump { visibility: visible; }
.jump-bottom {
  height: 100%;
  padding: 0 0.7rem;
  border: 1px solid var(--rule);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: var(--paper);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.jump-bottom::before { content: "\2193\00a0"; }
.jump-bottom:hover { color: var(--oxblood); }
.jump-bottom:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }
