* { box-sizing: border-box; }
:root { color-scheme: dark; --orange: #ff790d; --mint: #72e9bd; }
body {
  margin: 0; min-height: 100vh; padding: 22px 14px 35px;
  background: #000; color: #eef1f6;
  font-family: Arial, Helvetica, sans-serif;
}
.page { width: min(100%, 620px); margin: 0 auto; }
h1 {
  margin: 0 0 16px; text-align: center;
  color: #b9ddff; font-size: clamp(25px, 5vw, 39px);
  line-height: 1.15; font-weight: 800;
  text-shadow: 0 0 3px #4c9fff, 0 0 11px rgba(35,111,255,.9);
}
.examples {
  padding: 8px; border: 1px solid #a95c25;
  background: #08090c; box-shadow: 0 0 9px rgba(255,121,13,.08);
}
.example {
  display: grid; grid-template-columns: 1fr 1.45fr;
  gap: 10px; align-items: stretch; min-height: 83px;
  margin-bottom: 7px; padding: 7px;
  border: 1px solid #202936; border-radius: 8px;
  background: #10141c;
}
.example:last-child { margin-bottom: 0; }
.preview {
  min-width: 0; min-height: 68px; display: grid;
  place-items: center; overflow: hidden; background: #191b17;
  border-radius: 4px;
}
.demo-btn {
  --tone: #00d9ff;
  position: relative; isolation: isolate; overflow: hidden;
  min-width: 82px; max-width: 100%; min-height: 27px;
  padding: 0 9px; border: 1px solid var(--tone);
  border-radius: 2px; background: transparent; color: var(--tone);
  font: 700 8px Arial, sans-serif; letter-spacing: .25px;
  cursor: pointer; transition: color .35s ease, border-color .35s ease;
  -webkit-tap-highlight-color: transparent;
}
.demo-btn span { position: relative; z-index: 2; pointer-events: none; }
.demo-btn::before, .demo-btn::after {
  content: ""; position: absolute; z-index: 1;
  background: var(--tone); transition: all .45s ease;
}
.btn-1 { --tone: #00d9ff; }
.btn-2 { --tone: #d52cff; }
.btn-3 { --tone: #2bea55; }
.btn-4 { --tone: #ff4b25; }
.btn-5 { --tone: #ffd000; }
.btn-6 { --tone: #ed168e; }
.btn-7 { --tone: #833bff; }
.btn-8 { --tone: #00e5a0; }
.btn-9 { --tone: #ff314b; }
.btn-10 { --tone: #e7e7e7; }

.btn-1::before { top:0; bottom:0; left:0; width:0; }
.btn-1:hover, .btn-1.is-active { color:#071019; }
.btn-1:hover::before, .btn-1.is-active::before { width:100%; }

.btn-2::before { top:0; bottom:0; right:0; width:0; }
.btn-2:hover, .btn-2.is-active { color:#10051a; }
.btn-2:hover::before, .btn-2.is-active::before { width:100%; }

.btn-3::before { top:0; left:0; right:0; height:0; }
.btn-3:hover, .btn-3.is-active { color:#06130a; }
.btn-3:hover::before, .btn-3.is-active::before { height:100%; }

.btn-4::before { bottom:0; left:0; right:0; height:0; }
.btn-4:hover, .btn-4.is-active { color:#190702; }
.btn-4:hover::before, .btn-4.is-active::before { height:100%; }

.btn-5::before {
  top:0; bottom:0; left:50%; width:0;
  transform:translateX(-50%);
}
.btn-5:hover, .btn-5.is-active { color:#181300; }
.btn-5:hover::before, .btn-5.is-active::before { width:100%; }

.btn-6::before {
  left:0; right:0; top:50%; height:0;
  transform:translateY(-50%);
}
.btn-6:hover, .btn-6.is-active { color:#fff; }
.btn-6:hover::before, .btn-6.is-active::before { height:100%; }

.btn-7::before {
  top:50%; left:50%; width:0; height:0; border-radius:50%;
  transform:translate(-50%,-50%);
}
.btn-7:hover, .btn-7.is-active { color:#fff; }
.btn-7:hover::before, .btn-7.is-active::before { width:400px; height:400px; }

.btn-8::before {
  top:0; left:-150%; width:150%; height:100%;
  transform:skewX(45deg);
}
.btn-8:hover, .btn-8.is-active { color:#04140e; }
.btn-8:hover::before, .btn-8.is-active::before { left:-20%; }

.btn-9::before {
  top:0; right:-150%; width:150%; height:100%;
  transform:skewX(-45deg);
}
.btn-9:hover, .btn-9.is-active { color:#fff; }
.btn-9:hover::before, .btn-9.is-active::before { right:-20%; }

.btn-10::before, .btn-10::after { top:0; bottom:0; width:0; }
.btn-10::before { left:0; }
.btn-10::after { right:0; }
.btn-10:hover, .btn-10.is-active { color:#080808; }
.btn-10:hover::before, .btn-10:hover::after,
.btn-10.is-active::before, .btn-10.is-active::after { width:50%; }

.code { display:flex; align-items:center; min-width:0; padding:4px 7px; }
.code pre {
  margin:0; overflow-x:auto; color:var(--mint);
  font: 9px/1.4 "SFMono-Regular", Consolas, monospace;
  white-space:pre;
}
.hint { margin:12px 2px 0; color:#778493; text-align:center; font-size:11px; line-height:1.5; }
@media (max-width:430px) {
  body { padding:17px 8px 28px; }
  .examples { padding:5px; }
  .example { grid-template-columns:.85fr 1.15fr; gap:6px; padding:5px; }
  .demo-btn { min-width:72px; padding:0 5px; font-size:7px; }
  .code { padding:3px 4px; }
  .code pre { font-size:8px; }
}
@media (prefers-reduced-motion:reduce) {
  .demo-btn, .demo-btn::before, .demo-btn::after { transition-duration:.01ms !important; }
}
