:root {
  --crimson: #DC143C;
  --white: #ffffff;
  --dim: rgba(255, 255, 255, 0.35);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --sans: 'Instrument Sans', 'Helvetica Neue', system-ui, sans-serif;

  /* One code box drives every size in the row: 150px at 1440 wide, shrinking to fit phones. */
  --box: min(150px, calc((100vw - 48px) / 7));
  --gutter: clamp(16px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  background: var(--crimson);
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */

.top {
  position: absolute;
  inset: clamp(20px, 3.4vw, 48px) var(--gutter) auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.brand img {
  display: block;
  width: auto;
  height: clamp(22px, 2.2vw, 30px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  animation: blink 1.8s ease-in-out infinite;
}

/* Code */

main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 3vw, 44px);
  padding: 96px 16px;
}

.code {
  display: flex;
  align-items: center;
  gap: calc(var(--box) * 0.093);
}

.box {
  width: var(--box);
  height: calc(var(--box) * 1.3);
  border-radius: calc(var(--box) * 0.173);
  border: 2px solid var(--dim);
  background: transparent;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: calc(var(--box) * 0.693);
  font-weight: 700;
  line-height: 1;
  transition: all .25s;
}

.box.filled { border-color: var(--white); }

.box.active {
  border-color: var(--white);
  box-shadow: 0 0 0 calc(var(--box) * 0.04) rgba(255, 255, 255, 0.18);
}

.box.active::after {
  content: '';
  width: max(2px, calc(var(--box) * 0.027));
  height: calc(var(--box) * 0.613);
  border-radius: 2px;
  background: var(--white);
  animation: caret .9s step-end infinite;
}

.code.done .box {
  border-color: var(--white);
  background: var(--white);
  color: var(--crimson);
  box-shadow: 0 calc(var(--box) * 0.16) calc(var(--box) * 0.33) rgba(90, 0, 20, 0.4);
}

.dash {
  width: calc(var(--box) * 0.227);
  height: max(3px, calc(var(--box) * 0.04));
  border-radius: 3px;
  background: var(--white);
  flex-shrink: 0;
}

.caption {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

/* Motion */

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.rise-1 { animation: rise .9s cubic-bezier(.2, .7, .2, 1) .1s both; }
.rise-2 { animation: rise .9s cubic-bezier(.2, .7, .2, 1) .25s both; }
.fade { animation: fade 1.6s ease .2s both; }

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