:root {
  color-scheme: dark;
  --cream: #decfae;
  --dark: #242820;
  --screen: #9ba681;
  --screen-ink: #293521;
  font-family: Arial, Helvetica, sans-serif;
  color: #efe9dc;
  background: #292b2a;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 35%, #55534e, #2b2c2b 70%),
    #292b2a;
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.masthead {
  width: min(100%, 1000px);
  margin: auto;
  padding: 24px 24px 0;
}

.masthead a { color: inherit; text-decoration: none; }
.masthead strong { display: block; font: 700 14px monospace; letter-spacing: 2px; }
.masthead span { display: block; margin-top: 7px; color: #bdb9af; font: 400 12px monospace; letter-spacing: 1px; }

.stage {
  min-height: 690px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 35px 50px 38px;
}

.device {
  position: relative;
  width: min(390px, 78vw);
  aspect-ratio: 420 / 650;
  filter: drop-shadow(16px 26px 20px #0007);
}

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid #a8926d;
  border-radius: 8.5% / 5.8%;
  background:
    linear-gradient(112deg, #fff8 0 3%, transparent 18% 76%, #765f3a35 97%),
    radial-gradient(ellipse at 34% 10%, #f5ead0, #ddcba8 52%, #c7b28e 100%);
  box-shadow:
    inset 15px 17px 24px #fff9,
    inset -17px -20px 27px #75603f66,
    inset 0 0 0 3px #eadcbd99,
    0 2px 0 #f5e8cb,
    0 0 0 1px #796648;
  container-type: inline-size;
  isolation: isolate;
}

.face::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  opacity: .5;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.34' numOctaves='4' seed='17' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 420 650' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.025' numOctaves='3' seed='9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)' opacity='.2'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 18% 24%, #5c452644, transparent 33%),
    radial-gradient(ellipse at 72% 63%, #fff8df88, transparent 42%);
  background-size: 135px 135px, 100% 100%, 100% 100%, 100% 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.face::after {
  position: absolute;
  inset: 3.2% 4.2%;
  z-index: 0;
  content: "";
  border: 2px solid #92784f;
  border-radius: 5% / 3.2%;
  box-shadow:
    0 1px 0 #fff9,
    1px 2px 3px #6b543b55,
    inset 1px 2px 3px #6b543b40;
  pointer-events: none;
}

.face > * { z-index: 1; }

.nameplate {
  position: absolute;
  top: 7%;
  left: 9%;
  width: 82%;
  color: #242620;
  font: 900 5.2cqw monospace;
  letter-spacing: -.15cqw;
  text-align: center;
}

.nameplate span {
  display: block;
  margin-top: 1.2cqw;
  color: #555345;
  font-size: 1.8cqw;
  letter-spacing: .28cqw;
}

.led {
  position: absolute;
  top: 15%;
  right: 5.3%;
  width: 3.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fcc, #ed4131 30%, #890d05 80%);
  box-shadow: 0 0 0 2px #b3a078, 0 0 8px #ef311155;
}

.is-off .led {
  background: radial-gradient(circle at 30% 25%, #9d6960, #502b25 65%);
  box-shadow: 0 0 0 2px #b3a078;
}

.screen-frame {
  position: absolute;
  left: 10%;
  top: 15%;
  width: 77%;
  height: 25%;
  padding: 2.2%;
  border-radius: 5px;
  background: linear-gradient(130deg, #3b3d36, #1d201c);
  box-shadow: 0 2px 3px #fff5, 0 -1px 3px #766a54, inset 1px 1px 2px #777;
}

.screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5%;
  color: var(--screen-ink);
  background: linear-gradient(125deg, #a4ad87, #919c78);
  box-shadow: inset 3px 4px 6px #2b33177a;
  font: 700 4.3cqw/1.2 "Courier New", monospace;
  text-shadow: 1px 1px #b9c1a433;
}

.screen::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, #35412807 2px 3px);
}

.screen-top {
  position: absolute;
  top: 7%;
  left: 6%;
  right: 6%;
  padding-bottom: 3%;
  border-bottom: 1px solid #56614766;
  font-size: 1.65cqw;
  letter-spacing: .12cqw;
}

.screen-main, .phrase, .diagnostics { text-align: center; }
.cursor { animation: blink 1s steps(1) infinite; }
.phrase { margin: 6% 0 0; font-size: 4cqw; line-height: 1.16; text-wrap: balance; }
.diagnostics { font-size: 3cqw; }
.progress { height: 6px; margin: 8% 0 5%; border: 1px solid #46533c; }
.progress-bar { width: 0; height: 100%; background: #46533c; }
.memory { font-size: 2.1cqw; }
.is-off .screen > * { visibility: hidden; }
.is-off .screen { background: #798369; }

.dial-unit {
  position: absolute;
  top: 46%;
  width: 23%;
  height: 18%;
  color: var(--dark);
  text-align: center;
}

.power-unit { left: 10%; }
.volume-unit { right: 10%; }
.control-label { display: block; font: 800 3.1cqw monospace; letter-spacing: -.12cqw; }

.knob-wrap {
  position: relative;
  width: 72%;
  aspect-ratio: 1;
  margin: 8% auto 0;
}

.knob {
  position: absolute;
  inset: 0;
  border: 1px solid #c4ac83;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 20%, #f2e4c4, #d7c299 65%, #ab9570 97%);
  box-shadow: 2px 4px 3px #6f604c77, inset 1px 2px 2px #fff9, inset -2px -3px 3px #927c5866;
  transform: rotate(var(--turn, 45deg));
  pointer-events: none;
}

.knob::before { position: absolute; inset: 3px; content: ""; border: 2px dashed #d5c09b99; border-radius: 50%; }
.knob::after { position: absolute; top: 8%; left: 47%; width: 6%; height: 30%; content: ""; border-radius: 2px; background: #313329; box-shadow: 1px 0 #fff6; }

.dial-input {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
}

.knob-wrap:focus-within { border-radius: 50%; outline: 2px solid #5f7555; outline-offset: 5px; }
.dial-value { display: block; margin-top: 10%; font: 700 2.4cqw monospace; }

.notch-ring { position: absolute; inset: -16%; pointer-events: none; }
.notch-ring i { position: absolute; inset: 0; transform: rotate(var(--notch)); }
.notch-ring i::before { position: absolute; top: 0; left: calc(50% - 1.5px); width: 3px; height: 5px; content: ""; border-radius: 1px; background: #393b2e; }

.speaker {
  position: absolute;
  left: 42%;
  top: 50%;
  width: 16%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9%;
  padding: 2%;
}

.hole { width: 100%; aspect-ratio: 1; border-radius: 50%; background: #323328; box-shadow: inset 1px 1px 1px #000, 0 1px 1px #fff9; }
.hole.blank { visibility: hidden; }

.slider-unit { position: absolute; top: 68%; width: 36%; color: var(--dark); }
.moral-unit { left: 11%; }
.ambition-unit { right: 11%; }
.slider-label { display: flex; justify-content: space-between; align-items: center; font: 800 2.65cqw monospace; letter-spacing: -.1cqw; white-space: nowrap; }
.slider-label output { font-size: 2.2cqw; font-weight: 400; }

.slider {
  width: 100%;
  height: 7cqw;
  margin: 3cqw 0 0;
  border: 0;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(#171b15, #3a3b30);
  box-shadow: 0 -2px 3px #77664b, 0 2px 1px #fff9;
  outline-offset: 6px;
  cursor: ew-resize;
  touch-action: none;
}

.slider::-webkit-slider-thumb { width: 10cqw; height: 8cqw; border: 1px solid #ae946d; border-radius: 4px; appearance: none; -webkit-appearance: none; background: repeating-linear-gradient(90deg, #ddc59a 0 3px, #f3e1bb 3px 5px, #b99b71 5px 6px); box-shadow: 2px 3px 3px #0007, inset 0 2px 2px #fff9; }
.slider::-moz-range-thumb { width: 10cqw; height: 8cqw; border: 1px solid #ae946d; border-radius: 4px; background: repeating-linear-gradient(90deg, #ddc59a 0 3px, #f3e1bb 3px 5px, #b99b71 5px 6px); box-shadow: 2px 3px 3px #0007; }
.ticks { display: flex; justify-content: space-between; margin: 2cqw 1cqw 0; font: 700 2.6cqw monospace; }
.slider-caption { display: flex; justify-content: space-between; margin-top: 1cqw; font: 1.8cqw monospace; }

.motivate-unit { position: absolute; left: 31%; top: 84.8%; width: 38%; text-align: center; }
.motivate {
  width: 100%;
  height: 12cqw;
  min-height: 44px;
  padding: 0 1cqw;
  border: 1px solid #947b55;
  border-radius: 5px;
  color: #28291f;
  background: linear-gradient(150deg, #f4e8cc, #d1b98f);
  box-shadow: 2px 3px 2px #66543b, inset 1px 2px 2px #fffb;
  font: 900 3.4cqw/1 monospace;
  letter-spacing: .08cqw;
  text-shadow: 0 1px #fff8;
  cursor: pointer;
}

.motivate:active:not(:disabled), .is-working .motivate { transform: translateY(2px); box-shadow: 0 1px 2px #66543b, inset 1px 1px 3px #8c7959; }
.motivate:focus-visible, .slider:focus-visible { outline: 3px solid #5f7555; outline-offset: 5px; }
.motivate:disabled { cursor: default; opacity: .72; }

.tools { max-width: 600px; margin: 0 auto; padding: 0 20px 12px; text-align: center; }
.secondary { padding: 9px 15px; border: 1px solid #79776e; border-radius: 5px; color: #e4dfd3; background: #333632; font-size: 14px; cursor: pointer; }
.secondary:disabled { opacity: .4; cursor: default; }
.live-status { min-height: 1.5em; margin: 0 auto 24px; padding: 0 20px; color: #aaa79d; font: 12px monospace; text-align: center; }
.site-nav { max-width: 1000px; display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 0 auto 20px; padding: 0 24px; font: 13px monospace; }
.site-nav a { color: #dbd3c2; text-underline-offset: 4px; }
a:focus-visible, .secondary:focus-visible { outline: 2px solid #eed6a5; outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 600px) {
  .masthead { padding: 20px 16px 0; text-align: center; }
  .stage { min-height: auto; padding: 35px 28px 30px; }
  .device { width: min(390px, 80vw); }
  .notch-ring i::before { width: 2px; height: 4px; }
  .site-nav { font-size: 12px; }
}

@media (max-height: 720px) and (orientation: landscape) {
  .stage { padding-block: 20px; }
  .device { width: min(330px, 48vw); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
