html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffd23f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.fa {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(100%, 430px);
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
}

.fa__bar {
  display: flex;
  gap: 8px;
}

.fa__pick {
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.1);
  color: #17141a;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.fa__pick[aria-pressed=true] {
  background: #0a4fe8;
  color: #fff7e6;
}

.fa__pick:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.fa__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fa__card {
  position: relative;
  box-sizing: border-box;
  height: 150px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(23, 20, 26, 0.14);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.fa__card--serif {
  font-family: ui-serif, Georgia, "Times New Roman", "Noto Serif KR", serif;
}

.fa__card--sans {
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.fa__sample {
  position: absolute;
  left: 12px;
  bottom: 16px;
  color: #17141a;
  font-weight: 400;
  font-size: 52px;
  line-height: 1;
}

.fa__rule {
  position: absolute;
  left: 8px;
  right: 8px;
  font-size: 52px;
  pointer-events: none;
}

.fa__rule::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, #0a4fe8 0 6px, transparent 6px 10px);
  background-size: 10px 1px;
}

.fa__rule--base {
  bottom: calc(16px + 0.21em);
}

.fa__rule--x {
  bottom: calc(16px + 0.21em + 1ex);
}

.fa__rule--cap {
  bottom: calc(16px + 0.21em + 0.7em);
}

.fa__rule--x::before {
  height: 2px;
  background: linear-gradient(90deg, #c93000 0 100%);
}

.fa__tag {
  position: absolute;
  right: 0;
  bottom: 2px;
  color: #0a4fe8;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 9px;
  line-height: 1.2;
}

.fa__rule--x .fa__tag {
  right: auto;
  left: 0;
  color: #c93000;
}

.fa__name {
  position: absolute;
  left: 8px;
  bottom: 4px;
  color: rgba(23, 20, 26, 0.72);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
}

.fa.is-serif .fa__card--serif,
.fa.is-sans .fa__card--sans {
  border-color: #0a4fe8;
  background: rgba(47, 109, 246, 0.07);
}

.fa__note {
  margin: 0;
  color: rgba(23, 20, 26, 0.72);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.fa.is-demo .fa__card--serif {
  animation-name: faHoldA;
}

.fa.is-demo .fa__card--sans {
  animation-name: faHoldB;
}

.fa.is-demo .fa__card {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.fa.is-demo .fa__pick:nth-child(1) {
  animation-name: faPickA;
}

.fa.is-demo .fa__pick:nth-child(2) {
  animation-name: faPickB;
}

.fa.is-demo .fa__pick {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.fa.is-demo .fa__rule--x {
  animation-name: faSlide;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.fa.is-demo .fa__sample {
  animation-name: faLift;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

@keyframes faHoldA {
  0% {
    border-color: #0a4fe8;
    background-color: rgba(47, 109, 246, 0.07);
  }
  50%, 100% {
    border-color: rgba(23, 20, 26, 0.14);
    background-color: #ffffff;
  }
}
@keyframes faHoldB {
  0% {
    border-color: rgba(23, 20, 26, 0.14);
    background-color: #ffffff;
  }
  50%, 100% {
    border-color: #0a4fe8;
    background-color: rgba(47, 109, 246, 0.07);
  }
}
@keyframes faPickA {
  0% {
    background-color: #0a4fe8;
    color: #fff7e6;
  }
  50%, 100% {
    background-color: rgba(23, 20, 26, 0.1);
    color: #17141a;
  }
}
@keyframes faPickB {
  0% {
    background-color: rgba(23, 20, 26, 0.1);
    color: #17141a;
  }
  50%, 100% {
    background-color: #0a4fe8;
    color: #fff7e6;
  }
}
@keyframes faSlide {
  0%, 10% {
    transform: translateY(0);
  }
  40%, 60% {
    transform: translateY(-10px);
  }
  90%, 100% {
    transform: translateY(0);
  }
}
@keyframes faLift {
  0%, 10% {
    transform: translateY(0);
  }
  40%, 60% {
    transform: translateY(-4px);
  }
  90%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .fa {
    gap: 4px;
    padding: 8px;
  }
  .fa__card {
    height: 106px;
    padding: 4px;
  }
  .fa__sample {
    font-size: 38px;
    left: 8px;
    bottom: 12px;
  }
  .fa__rule {
    font-size: 38px;
    left: 4px;
    right: 4px;
  }
  .fa__rule--base {
    bottom: calc(12px + 0.21em);
  }
  .fa__rule--x {
    bottom: calc(12px + 0.21em + 1ex);
  }
  .fa__rule--cap {
    bottom: calc(12px + 0.21em + 0.7em);
  }
  .fa__pick, .fa__note {
    font-size: 10px;
  }
  .fa__tag {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fa.is-demo .fa__card,
  .fa.is-demo .fa__pick,
  .fa.is-demo .fa__rule--x,
  .fa.is-demo .fa__sample {
    animation: none !important;
    transform: none !important;
  }
}
