/* Shared controls and games. Each page layout is defined in eras.css. */
.hero-console {
  width: 100%;
  max-width: 400px;
  justify-self: end;
  min-width: 0;
}
.hero .hero-main {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}
.hero-type {
  padding-top: 50px;
}
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 18px;
  margin-top: 18px;
}
.hero-notes .name-annotation {
  position: static;
  transform: none;
  font-size: 9px;
}
.time-machine-toggle {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  background: none;
  font:
    400 10px/1.5 "IBM Plex Mono",
    monospace;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.time-machine-toggle > span {
  margin-left: 8px;
}
.time-machine-toggle:hover {
  text-decoration-thickness: 2px;
}
#time-machine {
  /* Open beside the trigger, then keep these bounds while the page changes. */
  --cyan: #f4f1e8;
  --ink: #202825;
  --orange: #fa8251;
  --rule: #657873;
  position: fixed;
  left: var(--panel-left, 12px);
  top: var(--panel-top, 12px);
  z-index: 30;
  margin: 0;
  display: block;
  width: min(360px, calc(100% - 24px));
  height: 116px;
  min-width: 0;
  min-height: 0;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  background: var(--cyan);
  color: var(--ink);
  font:
    10px/1.6 "IBM Plex Mono",
    monospace;
  cursor: default;
  box-shadow: 0 4px 20px #0003;
  view-transition-name: era-control;
}
#time-machine[hidden] {
  display: none;
}
.timeline-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  height: 32px;
}
.timeline-heading label {
  font-size: 9px;
  letter-spacing: 0.09em;
}
#era-label {
  font-weight: 500;
  margin-left: auto;
}
#close-time-machine {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font: 20px/1 monospace;
  cursor: pointer;
}
#close-time-machine:focus-visible {
  outline-offset: 0;
}
.era-slider {
  --dial-position: 100%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}
.era-slider:focus-visible {
  outline-offset: 0;
}
.era-slider::-webkit-slider-runnable-track {
  height: 5px;
  border: 1px solid var(--ink);
  background: linear-gradient(
    to right,
    var(--ink) var(--dial-position),
    transparent var(--dial-position)
  );
}
.era-slider::-moz-range-track {
  height: 3px;
  border: 1px solid var(--ink);
  background: linear-gradient(
    to right,
    var(--ink) var(--dial-position),
    transparent var(--dial-position)
  );
}
.era-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 25px;
  margin-top: -11px;
  border: 2px solid var(--ink);
  border-radius: 1px;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--cyan);
}
.era-slider::-moz-range-thumb {
  width: 9px;
  height: 21px;
  border: 2px solid var(--ink);
  border-radius: 1px;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--cyan);
}
.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
}
.hero-console .chip-figure {
  width: 78%;
  max-width: 290px;
  margin: 27px auto 0;
}
.artifact-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.artifact-trigger:hover {
  transform: translateY(-3px);
}
.artifact-trigger:disabled {
  cursor: default;
  opacity: 1;
}
.hero-console .figure-topline,
.hero-console .chip-figure figcaption {
  font-size: 8px;
}

/* Crossfade the whole composition without blocking a finger on the dial. */
::view-transition {
  pointer-events: none;
}
::view-transition-group(*) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}
::view-transition-old(root) {
  animation: era-out 0.32s ease both;
}
::view-transition-new(root) {
  animation: era-in 0.32s ease both;
}
::view-transition-group(era-control),
::view-transition-new(era-control) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(era-control) {
  display: none;
}
@keyframes era-out {
  to {
    opacity: 0;
  }
}
@keyframes era-in {
  from {
    opacity: 0;
  }
}
body,
.site-header,
.work-section,
.contact-section,
#time-machine {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}
:root[data-transitioning="true"] body,
:root[data-transitioning="true"] .site-header,
:root[data-transitioning="true"] .work-section,
:root[data-transitioning="true"] .contact-section,
:root[data-transitioning="true"] #time-machine {
  transition: none;
}

/* A shared, keyboard-accessible home for the six little surprises. */
.easter-dialog {
  width: min(540px, calc(100% - 32px));
  max-height: 85vh;
  max-height: 85dvh;
  padding: 0;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--cyan);
  font: 14px/1.65 var(--mono);
  box-shadow: 8px 8px 0 #0003;
}
.easter-dialog::backdrop {
  background: #060c16b8;
  backdrop-filter: blur(5px);
}
.easter-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 20px;
  background: var(--purple);
  border-bottom: 1px solid var(--ink);
}
#close-easter {
  width: 48px;
  height: 48px;
  border: 0;
  border-left: 1px solid var(--ink);
  background: transparent;
  font: 28px/1 monospace;
  cursor: pointer;
}
#close-easter:focus-visible {
  outline-offset: -6px;
}
.easter-body {
  padding: 26px;
}
.easter-body h2 {
  font: 500 24px/1.3 var(--mono);
  letter-spacing: -0.04em;
  text-shadow: none;
}
#easter-description {
  margin: 12px 0 23px;
  font-size: 13px;
}
.toy-button,
.synth-key,
.memory-card {
  min-height: 44px;
  border: 1px solid var(--ink);
  padding: 10px 16px;
  color: var(--ink);
  background: var(--purple);
  cursor: pointer;
}
.toy-button:hover,
.memory-card:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.toy-status {
  margin-top: 18px;
  font-size: 12px;
  min-height: 2em;
}
.terminal-output {
  min-height: 170px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.8 var(--pixel);
  border: 1px solid var(--rule);
  padding: 14px;
}
.terminal-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.terminal-form input {
  min-width: 0;
  width: 100%;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 10px 4px;
}
.synth-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.synth-key {
  height: 140px;
  padding: 10px 0;
  display: flex;
  align-items: end;
  justify-content: center;
  background: #e6dff4;
  color: #211038;
  border-color: #f078d3;
  box-shadow: 0 5px 0 #71377f;
  transition:
    background 0.12s,
    transform 0.12s;
}
.synth-key.is-playing {
  background: #9afff7;
  transform: translateY(4px);
  box-shadow: 0 1px 0 #71377f;
}
.stamp-choices {
  display: flex;
  gap: 12px;
}
.stamp-choices .toy-button {
  flex: 1;
  font: 24px/1.5 sans-serif;
  padding: 6px;
  border: 3px outset #c8bbed;
  background: #ffed92;
}
.stamp-wall {
  min-height: 140px;
  margin-top: 18px;
  padding: 16px;
  border: 3px inset #c8bbed;
  background: #fffdf5;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  align-content: start;
}
.guest-stamp {
  font: 25px/1.4 sans-serif;
  color: #92217c;
  transform: rotate(-9deg);
}
.guest-stamp:nth-child(even) {
  color: #302194;
  transform: rotate(12deg);
}
.dvd-stage {
  height: 230px;
  position: relative;
  overflow: hidden;
  background: #10172a;
  border: 3px inset #acb4c8;
  margin-bottom: 18px;
}
.dvd-logo {
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;
  height: 64px;
  padding: 0 0 10px;
  background: transparent;
  border: 0;
  color: #87f5ea;
  font:
    italic 900 34px/0.9 Arial,
    sans-serif;
  cursor: pointer;
  will-change: transform;
}
.dvd-video {
  display: block;
  font:
    700 9px/1.2 Arial,
    sans-serif;
  letter-spacing: 5px;
  padding-left: 6px;
}
.dvd-logo::after {
  content: "";
  position: absolute;
  bottom: 7px;
  left: 12px;
  width: 66px;
  height: 9px;
  border: 3px solid currentColor;
  border-radius: 50%;
}
.memory-game {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.memory-card {
  height: 92px;
  background: #1768a0;
  color: white;
  border: 0;
  font:
    500 21px/1 "Segoe UI",
    sans-serif;
  transition:
    background 0.2s,
    transform 0.2s;
}
.memory-card[data-revealed="true"] {
  background: #d8e6f5;
  color: #163556;
}
.memory-card[data-matched="true"] {
  background: #285e48;
  color: white;
  transform: scale(0.95);
}
.penalty-pitch {
  height: 210px;
  overflow: hidden;
  position: relative;
  background: #c6dfcf;
  border: 1px solid #547565;
}
.goal-net {
  position: absolute;
  width: 200px;
  height: 85px;
  top: 24px;
  left: calc(50% - 100px);
  border: 3px solid #344c41;
  background:
    repeating-linear-gradient(0deg, transparent 0 12px, #54756577 12px 13px),
    repeating-linear-gradient(90deg, transparent 0 12px, #54756577 12px 13px);
}
.goalkeeper {
  position: absolute;
  left: calc(50% - 14px);
  top: 62px;
  color: #394595;
  font: 35px/1 sans-serif;
  transition: transform 0.4s ease;
}
.football {
  position: absolute;
  left: calc(50% - 10px);
  bottom: 20px;
  color: #202825;
  font: 28px/1 sans-serif;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.4, 1);
}
.shot .football {
  transform: translate(var(--shot-x), -115px) scale(0.55);
}
.shot .goalkeeper {
  transform: translateX(var(--keeper-x));
}
.shot-controls {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.shot-controls .toy-button {
  flex: 1;
  padding-inline: 6px;
}

@media (max-width: 560px) {
  .hero .hero-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-type {
    padding-top: 0;
  }
  .hero-console {
    max-width: none;
  }
  .hero-console .chip-figure {
    max-width: 245px;
    width: 76%;
    margin-top: 30px;
  }
  .easter-body {
    padding: 20px;
  }
  .easter-body h2 {
    font-size: 21px;
  }
  .stamp-wall {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  #time-machine,
  .time-machine-toggle,
  .hero-console,
  .easter-dialog {
    display: none !important;
  }
  .hero-type {
    padding: 0;
    height: auto;
  }
}

.artifact-face {
  display: none;
}
.hero-console .chip-figure figcaption {
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
  line-height: 1.6;
}
.artifact-action {
  font:
    10px/1.5 "IBM Plex Mono",
    monospace;
}
