:root { font: 16px/1.5 system-ui, sans-serif; color: #e9f5f4; background: #101c24; }
body { margin: 0; }
main { max-width: 900px; margin: auto; padding: 1rem; }
.panel { display: grid; gap: 1rem; }
h1 { margin: .3rem 0 0; font-size: clamp(2rem, 7vw, 3.5rem); }
.title-cut { color: #a8b6bd; text-decoration-color: #ff6b6b; text-decoration-thickness: .12em; }
.title-ration { color: #ff6b6b; }
h2 { margin: 0 0 .6rem; font-size: 1.3rem; }
h3 { margin: .8rem 0 .4rem; font-size: 1rem; }
p { margin: .5rem 0; }
.tagline { margin: 0; color: #7fe0cb; font-weight: 600; }
.step, details { padding: 1rem; border: 1px solid #39706e; border-radius: .7rem; background: #172a34; }
.step { display: grid; gap: .6rem; }
canvas { display: block; width: 100%; height: 240px; background: #172a34; border: 1px solid #39706e; border-radius: .6rem; }
.controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
button, label { color: inherit; background: #27454e; border: 1px solid #6faba7; border-radius: .4rem; padding: .6rem .8rem; font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, label:focus-within { outline: 3px solid #7fe0cb; }
input { max-width: 12rem; }
select, input[type="number"] { color: inherit; background: #101c24; border: 1px solid #6faba7; border-radius: .3rem; padding: .3rem; font: inherit; }
pre { margin: .2rem 0; padding: .7rem; min-height: 1.4rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #0b151b; border-radius: .4rem; }
#perl-source { min-height: 8rem; }
#generated-status { font-weight: 700; color: #7fe0cb; }
[hidden] { display: none !important; }
.candidate { margin: 0; font-size: 3rem; font-weight: 700; text-align: center; }
.hold { min-height: 4rem; background: #315e59; touch-action: none; }
.live-strength { display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.strength-dot { width: 1rem; height: 1rem; flex: none; border-radius: 50%; background: #71848b; }
.live-strength-quiet .strength-dot { background: #7fe0cb; }
.live-strength-weak .strength-dot { background: #f0b65d; }
.live-strength-strong .strength-dot { background: #d38fea; box-shadow: 0 0 0 .3rem #d38fea40; }
.motion-example { margin: .2rem 0; padding: .9rem; border: 1px solid #39706e; border-radius: .6rem; background: #10232b; }
.motion-example-scene { position: relative; display: grid; place-items: center; height: 110px; overflow: hidden; }
.motion-example-arrow { position: absolute; color: #7fe0cb; font-size: 2.5rem; letter-spacing: .4rem; opacity: .6; }
.motion-example-phone { position: relative; display: grid; place-items: center; width: 54px; height: 86px; border: 4px solid #a6d7d0; border-radius: 12px; background: #27454e; box-shadow: 0 8px 20px #0005; color: #fff; font-size: 1.6rem; font-weight: 700; animation: shake-mixed 3.6s ease-in-out infinite; }
.motion-example-phone::after { position: absolute; bottom: 4px; width: 10px; height: 3px; border-radius: 2px; background: #a6d7d0; content: ''; }
.motion-example-token .motion-example-phone { animation-name: shake-weak; }
.motion-example-morse .motion-example-phone { animation-name: shake-morse; }
.motion-example-haptic .motion-example-phone { animation-name: haptic-buzz; }
.motion-example-shake-select .motion-example-phone { animation-name: shake-weak; }
.motion-example-waveform .motion-example-phone { animation-name: waveform-shake; }
.motion-example-haptic .motion-example-arrow { opacity: 0; }
.motion-example-finger { position: absolute; top: 74px; left: calc(50% + 18px); color: #ffd28b; font-size: 1.7rem; animation: press-release 3.6s infinite; }
.motion-example-letters { position: relative; width: 1.5em; height: 1.5em; }
.motion-example-letters span { position: absolute; inset: 0; text-align: center; opacity: 0; animation: letter-cycle 3.6s infinite; }
.motion-example-letters span:nth-child(2) { animation-delay: 1.2s; }
.motion-example-letters span:nth-child(3) { animation-delay: 2.4s; }
.motion-example-beats { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 2.6rem; }
.motion-example-beats span:not(.motion-example-result) { display: grid; place-items: center; min-width: 2.3rem; height: 2.3rem; padding: 0 .2rem; border-radius: 999px; background: #315e59; color: #e9f5f4; font-weight: 700; animation: highlight-beat 3.6s infinite; }
.motion-example-beats span:nth-child(2) { animation-delay: 1.2s; }
.motion-example-beats span:nth-child(3) { animation-delay: 2.4s; }
.motion-example-beats span.strong { background: #925d2b; }
.motion-example-beats span.long { min-width: 4.4rem; }
.motion-example-beats .motion-example-result { color: #7fe0cb; font-weight: 700; }
.motion-example figcaption { margin-top: .6rem; text-align: center; }
@keyframes shake-mixed { 0%, 20%, 32%, 52%, 66%, 86%, 100% { transform: translateX(0) rotate(0); } 10%, 76% { transform: translateX(5px) rotate(5deg); } 42% { transform: translateX(12px) rotate(11deg); } }
@keyframes shake-weak { 0%, 20%, 32%, 52%, 66%, 86%, 100% { transform: translateX(0) rotate(0); } 10%, 42%, 76% { transform: translateX(5px) rotate(5deg); } }
@keyframes shake-morse { 0%, 15%, 30%, 75%, 100% { transform: translateX(0) rotate(0); } 8% { transform: translateX(5px) rotate(5deg); } 40%, 55%, 68% { transform: translateX(8px) rotate(8deg); } 47%, 62% { transform: translateX(-8px) rotate(-8deg); } }
@keyframes haptic-buzz { 0%, 12%, 88%, 100% { transform: translateX(0); } 15%, 25%, 35%, 45%, 55%, 65%, 75%, 85% { transform: translateX(2px); } 20%, 30%, 40%, 50%, 60%, 70%, 80% { transform: translateX(-2px); } }
@keyframes waveform-shake { 0%, 12%, 32%, 62%, 82%, 100% { transform: translateX(0); } 6%, 74% { transform: translateX(3px); } 22% { transform: translateX(14px); } 46% { transform: translateX(-8px); } }
@keyframes press-release { 0%, 10%, 90%, 100% { transform: translateY(0); } 15%, 85% { transform: translateY(-14px); } }
@keyframes letter-cycle { 0%, 28% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes highlight-beat { 0%, 20% { opacity: 1; transform: scale(1.12); } 28%, 100% { opacity: .5; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .motion-example * { animation: none !important; } .motion-example-letters span:first-child { opacity: 1; } .motion-example-beats span:not(.motion-example-result) { opacity: 1; } }
