.hero--typewriter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 48px;
}

.hero--typewriter > * { animation: none; }
.hero--typewriter .hero-accessible-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hero-greeting {
  margin-bottom: 22px;
  color: var(--primary);
  font: 500 32px/1.3 var(--display);
}
.hero--typewriter .hero-summary { font-size: 1.1rem; line-height: 1.7; }
.typewriter-art { min-width: 0; }
.typewriter {
  --machine: #718993;
  --machine-light: #8ca0a8;
  --machine-dark: #536b76;
  --machine-paper: #f5efdf;
  --machine-ink: #4b443c;
  --machine-chrome: #c5c7bf;
  position: relative;
  display: block;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1.02;
  margin: 0 auto;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  container-type: inline-size;
}
.typewriter > span, .typewriter-paper, .typewriter-text { display: block; }
.typewriter-carriage {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 57%;
  transform: translateX(var(--carriage-offset, 0px));
  transition: transform 100ms linear;
}
.typewriter-carriage.is-returning { transition: transform 300ms cubic-bezier(.2,.8,.25,1); }
.typewriter-paper {
  position: absolute;
  left: 15%;
  width: 72%;
  height: calc(100% + 12px);
  padding: 17% 6% 0;
  border-radius: 1px;
  background: var(--machine-paper);
  box-shadow: 0 1px 5px #0000000b;
  transform: translateY(var(--paper-feed, 0px)) rotate(-1.5deg);
  transition: transform 220ms ease;
}
.typewriter-text {
  min-height: 75px;
  color: var(--machine-ink);
  font: 400 clamp(14px, 5.3cqw, 21px)/1.65 'Special Elite', 'Courier New', monospace;
  white-space: pre-wrap;
}
.typewriter-roller {
  position: absolute;
  left: 8%; bottom: -1%;
  width: 88%; height: 6%;
  border-radius: 4px;
  background: var(--machine-dark);
}
.typewriter-knob {
  position: absolute;
  bottom: -3%;
  width: 5%; height: 13%;
  border-radius: 3px;
  background: var(--machine-dark);
}
.typewriter-knob-left { left: 4%; }
.typewriter-knob-right { right: 0; }
.typewriter-lever {
  position: absolute;
  left: 0; bottom: 5%;
  width: 12%; height: 3%;
  border-radius: 3px;
  background: var(--machine-chrome);
  transform: rotate(-12deg);
  transform-origin: right center;
}
.typewriter-back {
  position: absolute;
  left: 13%; top: 55%;
  z-index: 3;
  width: 76%; height: 17%;
  border-radius: 10px 10px 0 0;
  background: var(--machine-light);
}
.typewriter-ribbon {
  position: absolute;
  left: 12%; top: 30%;
  width: 76%; height: 24%;
  border-radius: 60% 60% 0 0;
  background: var(--machine-dark);
  opacity: .6;
}
.typewriter-strike {
  position: absolute;
  left: 50%; top: 8%;
  width: 4px; height: 22px;
  background: var(--machine-chrome);
  opacity: 0;
}
.typewriter-housing {
  position: absolute;
  left: 5%; top: 66%;
  z-index: 4;
  width: 92%; height: 29%;
  padding-top: 15px;
  border-radius: 10px 10px 18px 18px;
  background: var(--machine);
  box-shadow: 0 4px 0 var(--machine-dark);
}
.typewriter-keys { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 6%; }
.typewriter-keyrow { display: flex; justify-content: center; gap: 5px; width: 100%; }
.typewriter-key {
  display: flex; align-items: center; justify-content: center;
  width: 7.3%; aspect-ratio: 1;
  border-radius: 50%;
  background: #fdfcf9;
  color: var(--machine-dark);
  box-shadow: 0 1px 0 var(--machine-dark);
  font: 7px Rubik, sans-serif;
  opacity: .94;
  transition: transform 70ms, box-shadow 70ms;
}
.typewriter-key.is-pressed { transform: translateY(2px); box-shadow: none; background: var(--machine-dark); color: var(--machine-paper); }
.typewriter-feet { position: absolute; top: 94%; left: 13%; right: 11%; z-index: 1; height: 3.5%; }
.typewriter-feet::before, .typewriter-feet::after {
  content: '';
  position: absolute; top: 0;
  width: 9%; height: 100%;
  border-bottom: 2px solid #302d2b;
  border-radius: 0 0 4px 4px;
  background: var(--machine-dark);
}
.typewriter-feet::before { left: 0; }
.typewriter-feet::after { right: 0; }
.typewriter-shadow {
  position: absolute; bottom: -5%; left: 3%; z-index: -1;
  width: 96%; height: 13%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #0000000c, transparent 70%);
}

@media (max-width: 640px) {
  .hero--typewriter { grid-template-columns: minmax(0,.7fr) minmax(0,1fr); gap: 23px 14px; min-height: 0; padding-block: 3rem; }
  .hero-introduction { display: contents; }
  .hero--typewriter .hero-greeting { grid-column: 1; grid-row: 1; align-self: center; margin: 0; font-size: 29px; }
  .typewriter-art { grid-column: 2; grid-row: 1; }
  .hero--typewriter .hero-summary { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 1rem; }
  .hero--typewriter .hero-actions { grid-column: 1 / -1; grid-row: 3; gap: 16px; flex-direction: row; align-items: center; }
  .hero--typewriter .button { width: auto; }
  .typewriter { max-width: 300px; }
  .typewriter-paper { padding-top: 10%; }
  .typewriter-text { font-size: 13px; line-height: 1.4; }
  .typewriter-housing { padding-top: 5%; }
  .typewriter-keys { gap: 3px; }
  .typewriter-keyrow { gap: 2px; }
  .typewriter-key { font-size: 4px; color: transparent; }
}
@media (max-width: 359px) {
  .hero--typewriter { grid-template-columns: minmax(0,.5fr) minmax(0,1fr); column-gap: 10px; }
  .hero--typewriter .hero-greeting { font-size: 25px; }
  .typewriter-paper { padding-top: 8%; }
  .typewriter-text { line-height: 1.35; }
}
@media (prefers-reduced-motion: reduce) {
  .typewriter-carriage, .typewriter-carriage.is-returning, .typewriter-paper, .typewriter-key { transition: none; }
}
