@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2");
}

:root {
  --cream: #faf7f2;
  --paper: #fffdfa;
  --ink: #1c1917;
  --ink-2: #423c37;
  --muted: #79716b;
  --line: rgba(28, 25, 23, 0.12);
  --brand: #5869c1;
  --brand-deep: #3f4c94;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-jp: "Hiragino Mincho ProN", "Yu Mincho", serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body.qr-body {
  min-height: 100svh;
  background-color: var(--cream);
  background-image: radial-gradient(120% 60% at 50% -10%, #fff 0%, rgba(255, 255, 255, 0) 60%);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
.qr-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.qr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 18px clamp(18px, 5vw, 48px);
}
.qr-back,
.qr-actions a,
.qr-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.qr-back:hover,
.qr-actions a:hover,
.qr-actions button:hover {
  background: #fff;
  border-color: rgba(88, 105, 193, 0.45);
  transform: translateY(-1px);
}
.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.qr-actions .qr-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.qr-actions .qr-primary:hover {
  background: #000;
  border-color: #000;
}
.qr-back .icon,
.qr-actions .icon {
  width: 15px;
  height: 15px;
}
.qr-back .icon {
  transform: scaleX(-1);
}
.qr-stage {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 18px 18px 26px;
}
.qr-card {
  container-type: inline-size;
  position: relative;
  display: flex;
  width: min(430px, 92vw);
  aspect-ratio: 105 / 148;
  overflow: hidden;
  border-radius: 26px;
  background: radial-gradient(120% 75% at 50% 0%, #fffdf9 0%, var(--cream) 58%);
  box-shadow: 0 44px 90px -46px rgba(28, 25, 23, 0.55);
}
.qr-card::after {
  content: "";
  position: absolute;
  inset: 3.4cqw;
  border: 1px solid rgba(28, 25, 23, 0.14);
  border-radius: 4.6cqw;
  pointer-events: none;
}
.qr-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 9cqw 9cqw 7cqw;
  text-align: center;
}
.qr-logo {
  width: 40cqw;
  height: 4.2cqw;
  background-color: var(--ink);
  -webkit-mask: url("/logo.svg") no-repeat center / contain;
  mask: url("/logo.svg") no-repeat center / contain;
}
.qr-kicker {
  margin: 4.4cqw 0 0;
  font-size: 2.3cqw;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.qr-title {
  margin: 2.4cqw 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 9.6cqw;
  line-height: 0.96;
  letter-spacing: -0.012em;
}
.qr-title em {
  font-style: italic;
  color: var(--brand-deep);
}
.qr-plate {
  width: 68cqw;
  margin: 4.6cqw auto 0;
  padding: 3.2cqw;
  border-radius: 4.2cqw;
  background: #fff;
  box-shadow: 0 2.4cqw 6cqw -3.4cqw rgba(28, 25, 23, 0.28);
}
.qr-plate img {
  display: block;
  width: 100%;
  height: auto;
}
.qr-url {
  margin: 3.4cqw 0 0;
  font-size: 3.4cqw;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.qr-foot {
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  width: 100%;
  margin-top: auto;
  padding-top: 2.8cqw;
  border-top: 1px solid rgba(28, 25, 23, 0.12);
  font-size: 2.05cqw;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.qr-hint {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 24px 30px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.qr-hint a {
  color: var(--brand-deep);
}

/* Solo card page (used to export PNG/PDF) */
.qr-body.qr-solo .qr-page {
  min-height: 100vh;
}
.qr-solo .qr-stage {
  display: block;
  padding: 0;
}
.qr-solo .qr-card {
  width: 100vw;
  height: 100vh;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 620px) {
  .qr-toolbar {
    justify-content: center;
  }
  .qr-back {
    display: none;
  }
}

@page {
  size: 105mm 148mm;
  margin: 0;
}
@media print {
  body.qr-body {
    background: #fff;
  }
  .qr-toolbar,
  .qr-hint {
    display: none !important;
  }
  .qr-page {
    min-height: auto;
  }
  .qr-stage {
    display: block;
    padding: 0;
  }
  .qr-card {
    width: 105mm;
    height: 148mm;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
}
