@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Instrument+Serif&display=swap');

:root {
  color-scheme: dark;
  --background: #14100f;
  --ink: #f2e8df;
  --muted: #aea097;
  --line: #3a2c26;
  --ember: #f3965b;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100svh; color: var(--ink); background: var(--background); }
button { font: inherit; }
button:focus-visible { outline: 2px solid #ffd298; outline-offset: 5px; }

.shell { width: min(936px, calc(100% - 80px)); margin: 0 auto; padding: 42px 0 28px; }
.header { display: flex; align-items: center; justify-content: space-between; height: 58px; border-bottom: 1px solid var(--line); }
.header h1 { display: flex; align-items: center; gap: 13px; margin: 0; font: 400 25px/1 var(--serif); letter-spacing: .09em; }
.mark { color: var(--ember); font: 400 19px/1 var(--mono); }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; letter-spacing: .09em; }
.connection i { width: 5px; height: 5px; border-radius: 50%; background: #968879; }
.connection[data-link="online"] i { background: #a4b99a; box-shadow: 0 0 9px #a4b99463; }
.connection[data-link="offline"] i { background: #e9a16d; }

.relay { width: min(720px, 100%); margin: clamp(24px, 6vh, 60px) auto 0; }
.stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: clamp(322px, 51vh, 455px);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #402d25;
  background: radial-gradient(ellipse at 50% 56%, #211512 0%, #191211 42%, #161110 77%);
  transition: border-color 240ms ease;
}
.stage[data-lit="true"] { border-color: #64402d; }
.stage[data-handoff="true"] { border-color: #be7448; }
.stage::before, .stage::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 10px auto auto 10px;
  width: 13px;
  height: 13px;
  border-top: 1px solid #815e4a;
  border-left: 1px solid #815e4a;
  opacity: .75;
  pointer-events: none;
}
.stage::after { inset: auto 10px 10px auto; transform: rotate(180deg); }
.instrument, .flame-canvas { position: absolute; inset: 0 0 auto; width: 100%; height: 76%; pointer-events: none; }
.instrument { display: grid; place-items: center; }
.instrument::before {
  content: "";
  position: absolute;
  inset: 13% 0 0;
  background: linear-gradient(90deg, transparent calc(50% - .5px), #b5916e12 50%, transparent calc(50% + .5px));
  mask-image: linear-gradient(transparent, #000 35%, #000 70%, transparent);
}
.instrument span { position: absolute; top: 55%; width: min(46%, 260px); aspect-ratio: 1; transform: translateY(-50%); border: 1px solid #b98e7415; border-radius: 50%; }
.instrument span:nth-child(2) { width: min(39%, 219px); border-color: #b98e7415; }
.instrument span:nth-child(3) { width: min(31%, 175px); border-color: #b98e741b; }
.status { z-index: 2; padding: 0 16px clamp(22px, 4vh, 39px); width: 100%; text-align: center; }
.status h2 { margin: 0 auto; font: 400 clamp(25px, 4.7vw, 37px)/1.44 var(--serif); letter-spacing: .025em; }
.status p { color: var(--muted); margin: 9px 0 0; font-size: clamp(11px, 2vw, 13px); letter-spacing: .035em; line-height: 1.75; }

.stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border: 1px solid var(--line); border-top: 0; }
.stats > div { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 15px clamp(14px, 3vw, 27px); }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.stats dd { margin: 0; font: 400 clamp(14px, 2.3vw, 19px)/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.stats dd span { margin-left: 5px; font: 11px/1 "Yu Gothic", sans-serif; color: var(--muted); }
.controls { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0 0; }
.hold, .copy { display: inline-flex; justify-content: center; align-items: center; border: 0; gap: 10px; cursor: pointer; }
.hold {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-width: min(100%, 270px);
  min-height: 57px;
  padding: 12px 22px;
  border: 1px solid #f9b585;
  border-radius: 3px;
  background: #f2a774;
  color: #2c180e;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .09em;
  transition: background 150ms ease, box-shadow 150ms ease;
}
.hold:hover { background: #f8b987; }
.hold[data-pressed="true"] { background: #e78c58; box-shadow: 0 0 25px #e9905545, inset 0 0 0 2px #723d273c; }
.hold[data-handoff="true"] { background: #ffd59b; box-shadow: 0 0 33px #fed49b35; }
.hold[aria-disabled="true"] { opacity: .6; cursor: default; }
.hold-icon { width: 16px; height: 16px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; }
.hold-icon::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.hold[data-pressed="true"] .hold-icon::before { width: 8px; height: 8px; }
.copy { color: var(--muted); background: transparent; padding: 10px 14px; border-radius: 2px; min-height: 42px; font-size: 12px; letter-spacing: .035em; }
.copy:hover { color: var(--ink); background: #211916; }
.copy-icon { width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 2px; position: relative; margin: 0 3px 3px 0; }
.copy-icon::after { content: ""; position: absolute; inset: 2px -4px -4px 2px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; border-radius: 0 0 2px 0; }

@media (max-width: 600px) {
  .shell { width: calc(100% - 36px); padding-top: 16px; }
  .header { height: 49px; }
  .header h1 { font-size: 19px; gap: 9px; }
  .relay { margin-top: clamp(18px, 4vh, 32px); }
  .stage { height: clamp(309px, 50vh, 426px); }
}

@media (max-width: 360px) {
  .shell { width: calc(100% - 24px); }
  .stats > div { padding: 13px 9px; gap: 4px; }
  .stats dt { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

