:root {
  --black:      #000000;
  --white:      #FFFFFF;
  --purple:     #7C5CFC;
  --purple-dim: #4A3899;

  --ink:        #000000;
  --floor:      #000000;
  --surface:    rgba(255, 255, 255, 0.035);
  --surface-2:  rgba(255, 255, 255, 0.065);
  --hairline:   rgba(255, 255, 255, 0.12);
  --text:       #FFFFFF;
  --muted:      rgba(255, 255, 255, 0.5);

  --display:    'Oswald', sans-serif;
  --mono:       'IBM Plex Mono', monospace;
  --body:       'Inter', sans-serif;

  --radius: 18px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  position: relative;
  overflow-x: hidden;
}

/* Ambient "kiosk floor" backdrop: faint grid + vignette, nothing louder than the badge */
.floor {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(124, 92, 252, 0.16), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(124, 92, 252, 0.08), transparent 40%),
    linear-gradient(var(--floor), var(--ink) 60%);
}

.floor::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 70%);
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ---- The credential ---- */

.badge {
  width: 400px;
  max-width: 100%;
  background: linear-gradient(165deg, var(--surface), var(--surface-2));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 40px 32px 28px;
  position: relative;
  box-shadow:
    0 40px 80px -30px rgba(0,0,0,0.7),
    0 1px 0 rgba(255,255,255,0.04) inset;
}

/* subtle laminate sheen sweeping the card, like light off plastic */
.badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.05) 45%, transparent 60%);
  pointer-events: none;
}

.punch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 10px;
  border-radius: 100px;
  background: var(--ink);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.badge-head {
  text-align: center;
  margin: 20px 0 22px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.wordmark span {
  color: var(--purple);
}

.badge-kicker {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 2.5px;
  color: var(--muted);
}

/* ---- Status strip ---- */

.status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 100px;
  background: rgba(242, 240, 234, 0.04);
  border: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.status-strip[data-state="live"] {
  color: var(--purple);
  border-color: rgba(124, 92, 252, 0.45);
}
.status-strip[data-state="live"] .status-dot {
  background: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.25);
  animation: pulse 2.4s ease-in-out infinite;
}

.status-strip[data-state="down"] {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}
.status-strip[data-state="down"] .status-dot {
  background: var(--white);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.25); }
  50%      { box-shadow: 0 0 0 6px rgba(124, 92, 252, 0.06); }
}

/* ---- Scan line: sweeps once on load / on each recheck ---- */

.scanline {
  position: relative;
  height: 2px;
  margin: 0 -32px 22px;
  background: var(--hairline);
  overflow: hidden;
}

.scanline::before {
  content: "";
  position: absolute;
  top: 0; left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  animation: sweep 3.2s ease-in-out infinite;
}

@keyframes sweep {
  0%   { left: -30%; }
  60%  { left: 100%; }
  100% { left: 100%; }
}

/* ---- Spec grid ---- */

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
  margin: 0 0 26px;
}

.spec dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.spec dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
}

.spec:first-child {
  grid-column: 1 / -1;
}

/* ---- Gate list (endpoint links) ---- */

.gate-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border-top: 1px dashed var(--hairline);
  padding-top: 20px;
  margin-bottom: 24px;
}

.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.gate:hover,
.gate:focus-visible {
  border-color: var(--purple-dim);
  background: rgba(124, 92, 252, 0.1);
  transform: translateY(-1px);
}

.gate:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.gate-code {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--purple);
  letter-spacing: 1px;
}

.gate-label {
  font-size: 12px;
  font-weight: 500;
}

/* ---- Footer / barcode ---- */

.badge-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.barcode {
  width: 100%;
  height: 20px;
  background: repeating-linear-gradient(
    90deg,
    var(--text) 0px, var(--text) 2px,
    transparent 2px, transparent 4px,
    var(--text) 4px, var(--text) 5px,
    transparent 5px, transparent 9px,
    var(--text) 9px, var(--text) 12px,
    transparent 12px, transparent 14px
  );
  opacity: 0.55;
  border-radius: 2px;
}

.foot-text {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-align: center;
}

/* ---- Responsive ---- */

@media (max-width: 420px) {
  .badge { padding: 34px 22px 22px; }
  .wordmark { font-size: 26px; }
  .gate-list { grid-template-columns: repeat(2, 1fr); }
}