/* Lanyard card renderer. Values for the badge profile mirror firmware/main/badge_ui.c. */
@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-display: block;
  src: url("assets/fonts/inter-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: block;
  src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --navy: #0b1957;
  --teal: #5fc8a4;
  --title: #1d6f86;
  --muted: #5a6478;
  --page: #e9edf3;
  --band: linear-gradient(90deg, var(--navy), var(--teal));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--page);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The stage centres a fixed-size frame and scales it to fit the window. */
#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.frame {
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--bg);
  color: var(--navy);
  overflow: hidden;
  transform-origin: center center;
  box-shadow: 0 12px 48px rgba(11, 25, 87, 0.12);
}

.band {
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background: var(--band);
}
.band.top { top: 0; }
.band.bottom { bottom: 0; }

.logo { display: block; }

.name {
  margin: 0;
  font-weight: 700;
  letter-spacing: -2px;
  text-align: center;
  line-height: 1.19;
}
.name span { display: block; }

.rule {
  width: 112px;
  height: 8px;
  border-radius: 4px;
  background: var(--band);
}

.title {
  font-weight: 500;
  color: var(--title);
  text-align: center;
}

.qr svg { display: block; }
.qr-label {
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}

/* ---- badge profile: 720 x 1280, same geometry as the firmware ------------------------ */
.frame.badge {
  width: 720px;
  height: 1280px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 104px 40px 64px;
}
.badge .logo { width: 560px; height: auto; }
.badge .middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 640px;
}
.badge .name { font-size: 120px; }
.badge .name.small { font-size: 92px; }
.badge .rule { margin-top: 28px; }
.badge .title { font-size: 44px; margin-top: 24px; }
.badge .qr-block { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.badge .qr svg { width: 300px; height: 300px; }
.badge .qr-label { font-size: 34px; }

/* ---- desk profile: 1920 x 1080 landscape -------------------------------------------- */
.frame.desk {
  width: 1920px;
  height: 1080px;
  display: grid;
  grid-template-columns: 1fr 640px;
  align-items: center;
  padding: 96px 120px;
  column-gap: 96px;
}
.desk .left { display: flex; flex-direction: column; align-items: flex-start; gap: 48px; }
.desk .logo { width: 620px; height: auto; }
.desk .name { font-size: 168px; text-align: left; }
.desk .name.small { font-size: 128px; }
.desk .rule { width: 160px; height: 10px; border-radius: 5px; }
.desk .title { font-size: 56px; text-align: left; }
.desk .qr-block { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.desk .qr svg { width: 520px; height: 520px; }
.desk .qr-label { font-size: 48px; }

.fallback { font: 500 20px/1.4 system-ui, sans-serif; color: var(--navy); padding: 24px; }
.error { font: 500 18px/1.4 system-ui, sans-serif; color: #8a1c1c; padding: 24px; }
