:root {
  color-scheme: light;
  --paper: #f4efdf;
  --ink: #18163b;
  --blue: #2520c4;
  --dim: #58536c;
  --rule: #a9a3a6;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, sans-serif;
}

.page {
  max-width: 1440px;
  margin-inline: auto;
  padding: 24px clamp(18px, 4.3vw, 64px) 36px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 47px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  font: 600 13px var(--mono);
}

.masthead a, .masthead img { display: block; }
.masthead img { width: 152px; height: auto; }

.exchange {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.12fr);
  grid-template-rows: minmax(0, auto) minmax(0, 1fr);
  grid-template-areas: "title photo" "console photo";
  align-items: start;
  column-gap: clamp(24px, 4.6vw, 72px);
  padding-top: clamp(24px, 4.1vw, 62px);
}

h1 {
  grid-area: title;
  margin: clamp(22px, 5.2vw, 76px) 0 clamp(26px, 4.1vw, 62px);
  font: 400 clamp(49px, 7.55vw, 109px)/0.86 Georgia, "Times New Roman", serif;
  letter-spacing: -0.069em;
}

h1 span { color: var(--blue); }

.console {
  grid-area: console;
  max-width: 440px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.line-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 600 13px var(--mono);
  color: var(--dim);
}

.line-status > span { display: flex; align-items: center; gap: 9px; }

.line-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #566e3a;
  box-shadow: inset 0 0 0 1px #0002, 0 0 0 3px #566e3a21;
}

[data-state="active"] .line-status i {
  background: #352cff;
  box-shadow: 0 0 0 3px #352cff26;
  animation: signal 1.6s ease-in-out infinite;
}

@keyframes signal { 50% { box-shadow: 0 0 0 5px #352cff40; } }

.line-status time { font-variant-numeric: tabular-nums; }

#dispatch {
  display: flex;
  align-items: center;
  min-height: 3.35em;
  margin: 12px 0 13px;
  font: 400 clamp(19px, 2vw, 26px)/1.2 Georgia, "Times New Roman", serif;
}

.keys { display: flex; gap: 10px; }

button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }

.keys button {
  min-height: 53px;
  padding: 10px 18px;
  border: 1px solid var(--blue);
  border-radius: 2px;
  font-weight: 650;
  font-size: 15px;
}

.call {
  color: white;
  background: var(--blue);
  min-width: 138px;
  box-shadow: 0 3px 0 #18163b;
}

.call:hover { background: #171292; }
.call:active { transform: translateY(2px); box-shadow: 0 1px 0 #18163b; }

.sound {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--blue);
  background: transparent;
}

.sound::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.sound[aria-pressed="true"] { background: #dedafa; }
.sound[aria-pressed="true"]::before { background: currentColor; }
.sound:hover { background: #e7e2f4; }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.photograph {
  position: relative;
  grid-area: photo;
  isolation: isolate;
  margin: 0;
  background: #1713b7;
}

.photograph > img { display: block; width: 100%; height: auto; }

.dial-zero {
  position: absolute;
  z-index: 1;
  left: 68.4%;
  top: 55.7%;
  width: max(7%, 44px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 12%;
  padding: 0;
  background: transparent;
}

.dial-zero:hover { background: #fff3b641; }
.dial-zero:focus-visible { outline-color: white; }

.receipt {
  position: absolute;
  right: 3%;
  bottom: 4%;
  width: min(230px, 67%);
  padding: 15px 15px 17px;
  background: #fff8dc;
  color: #211d2a;
  box-shadow: 2px 9px 22px #08043b85;
  transform: rotate(-6deg);
  border-radius: 1px;
  font-family: var(--mono);
  animation: print 430ms cubic-bezier(0.1, 0.8, 0.35, 1) both;
}

.receipt::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 6px;
  background: linear-gradient(135deg, #fff8dc 25%, transparent 26%) 0 0 / 10px 8px repeat-x,
              linear-gradient(225deg, #fff8dc 25%, transparent 26%) 0 0 / 10px 8px repeat-x;
}

.receipt strong {
  display: block;
  padding-block: 10px;
  border-block: 1px dashed #938b78;
  margin-block: 7px;
  font-size: clamp(13px, 1.65vw, 20px);
  line-height: 1.08;
}

.receipt-line { display: flex; justify-content: space-between; gap: 5px; font-size: 10px; }

@keyframes print {
  from { opacity: 0; transform: translateY(14px) rotate(-1deg) scale(0.96); }
}

@media (max-width: 740px) {
  .page { max-width: 550px; padding-top: 13px; }
  .masthead { min-height: 38px; padding-bottom: 10px; }
  .masthead img { width: 128px; }
  .exchange {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "title" "photo" "console";
    row-gap: 17px;
    padding-top: 21px;
  }
  h1 { margin: 0; font-size: clamp(51px, 13vw, 77px); }
  .console { max-width: none; padding-top: 13px; }
  #dispatch { min-height: 2.4em; margin: 7px 0 10px; }
  .keys .call { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .receipt,
  [data-state="active"] .line-status i { animation: none; }
}
