.qr-landing {
  --rec-bg: #e1f3fd;
  --rec-text: #002d56;
  --rec-headline-color: #33b5f7;
  --rec-panel-radius: 16px;
  --rec-gallery-radius: 16px;
  --rec-btn-border: rgba(0, 45, 86, 0.28);

  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: var(--rec-bg);
  color: var(--rec-text);
  font-family:
    "CircularXX TT",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.qr-landing__shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "logo"
    "panel"
    "social"
    "headline"
    "gallery";
  flex: 1;
  gap: 24px;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 24px 20px 32px;
  background: var(--rec-bg);
}

/* Grid areas */
.qr-landing__logo {
  grid-area: logo;
}
.qr-landing__panel-wrap {
  grid-area: panel;
}
.qr-landing__social--body {
  grid-area: social;
  display: flex;
}
.qr-landing__headline {
  grid-area: headline;
}
.qr-landing__gallery {
  grid-area: gallery;
}

/* Logo */
.qr-landing__logo-img {
  display: block;
  height: 32px;
  width: auto;
}

/* Social proof */
.qr-landing__social {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 14px;
}

/* Header variant hidden on mobile; body variant hidden on desktop */
.qr-landing__social.qr-landing__social--header {
  display: none;
}

.qr-landing__social--body {
  display: flex;
}

.qr-landing__avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-landing__avatar {
  display: block;
  width: 67px;
  height: 67px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  margin-left: -16px;
}

.qr-landing__avatar:first-child {
  margin-left: 0;
}

.qr-landing__social-text {
  margin: 0;
  max-width: 311px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--rec-text);
  text-align: left;
}

/* QR panel — mobile: single white card */
.qr-landing__panel-wrap {
  background: #fff;
  border-radius: var(--rec-panel-radius);
  padding: 24px 20px 20px;
}

.qr-landing__panel-title {
  margin: 0 0 18px;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  color: var(--rec-text);
}

.qr-landing__panel-title--desktop {
  display: none;
}

.qr-landing__panel-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-landing__qr {
  width: min(100%, 220px);
  aspect-ratio: 1;
  flex-shrink: 0;
}

.qr-landing__qr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-landing__panel-copy {
  width: 100%;
  text-align: center;
}

.qr-landing__panel-sub {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--rec-text);
}

/* Action buttons */
.qr-landing__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.qr-landing__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--rec-text);
  background: #fff;
  border: 1px solid var(--rec-btn-border);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.18s ease,
    transform 0.1s ease;
}

.qr-landing__btn:hover {
  background: #f5fbff;
}

.qr-landing__btn:active {
  transform: scale(0.98);
}

.qr-landing__btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
}

.qr-landing__btn--copy.is-copied {
  background: #e8f7ef;
  border-color: #1a8c4e;
  color: #1a8c4e;
}

/* Headline */
.qr-landing__headline {
  margin: 0;
  font-size: 96px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--rec-headline-color);
}

/* Gallery — mobile stack */
.qr-landing__gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.qr-landing__gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: var(--rec-gallery-radius);
}

.qr-landing__gallery-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Error state */
.qr-landing--error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.qr-landing__error-box {
  max-width: 520px;
  padding: 32px 40px;
  background: #fff8f8;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  text-align: center;
}

.qr-landing__error-msg {
  margin: 0;
  font-size: 16px;
  color: #721c24;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Desktop (≥ 992px) — Figma 1440 layout
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
  .qr-landing__shell {
    grid-template-columns: minmax(0, 620px) 429px;
    grid-template-areas:
      "logo    gallery"
      "social  gallery"
      "headline gallery"
      "panel   gallery";
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-content: start;
    column-gap: 32px;
    row-gap: 0;
    padding-top: 138px;
    align-content: start;
  }

  .qr-landing__logo {
    padding-bottom: 20px;
  }

  .qr-landing__logo-img {
    height: 45px;
  }

  .qr-landing__social.qr-landing__social--header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    grid-area: social;
    grid-column: 1;
    width: 100%;
    max-width: 620px;
    text-align: left;
    padding-bottom: 28px;
  }

  .qr-landing__social--body,
  .qr-landing__social.qr-landing__social--body {
    display: none;
  }

  .qr-landing__social-text {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.35;
  }

  .qr-landing__avatar {
    width: 67px;
    height: 67px;
    margin-left: -18px;
  }

  .qr-landing__headline {
    font-size: clamp(3.75rem, 5.2vw, 5rem);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.025em;
    text-align: left;
    padding-bottom: 36px;
  }

  .qr-landing__panel-wrap {
    background: transparent;
    border-radius: 0;
    padding: 0;
  }

  .qr-landing__panel {
    background: #fff;
    border-radius: var(--rec-panel-radius);
    padding: 20px 24px;
  }

  .qr-landing__panel-title {
    display: none;
  }

  .qr-landing__panel-title--desktop {
    display: block;
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    color: var(--rec-text);
  }

  .qr-landing__panel-body {
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
  }

  .qr-landing__qr {
    width: 156px;
    flex-shrink: 0;
  }

  .qr-landing__panel-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    padding-top: 0;
  }

  .qr-landing__panel-copy
    .qr-landing__panel-title--desktop
    + .qr-landing__panel-sub {
    border-top: 1px solid rgba(0, 45, 86, 0.12);
    padding-top: 14px;
    margin-top: 0;
  }

  .qr-landing__panel-sub {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
  }

  .qr-landing__actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 20px;
  }

  .qr-landing__btn {
    min-height: 44px;
    padding: 11px 18px;
    font-size: 14px;
    white-space: nowrap;
  }

  /* Figma Frame 54 — 429×593 staggered gallery */
  .qr-landing__gallery {
    position: relative;
    display: block;
    width: 100%;
    max-width: 429px;
    aspect-ratio: 429 / 593;
    margin-left: 0;
    margin-right: 0;
    align-self: start;
    justify-self: start;
  }

  .qr-landing__gallery-item {
    position: absolute;
    margin: 0;
    overflow: hidden;
    border-radius: var(--rec-gallery-radius);
  }

  .qr-landing__gallery-item:nth-child(1) {
    left: 0;
    top: 0;
    width: 46.62%;
    height: 41.48%;
  }

  .qr-landing__gallery-item:nth-child(2) {
    left: 0;
    top: 46.37%;
    width: 46.62%;
    height: 53.63%;
  }

  .qr-landing__gallery-item:nth-child(3) {
    left: 53.38%;
    top: 9.27%;
    width: 46.62%;
    height: 41.31%;
  }

  .qr-landing__gallery-item:nth-child(4) {
    left: 53.38%;
    top: 55.31%;
    width: 46.62%;
    height: 35.41%;
  }

  .qr-landing__gallery-img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
  }
}

/* Tablet — keep mobile stack, slightly larger type */
@media (min-width: 768px) and (max-width: 991px) {
  .qr-landing__shell {
    padding: 40px 48px;
    gap: 28px;
  }

  .qr-landing__headline {
    font-size: clamp(2.5rem, 6vw, 3.25rem);
  }
}

/* Off-screen flyer export (html2canvas) */
.qr-landing__export-wrapper {
  position: fixed;
  left: -10000px;
  top: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.qr-landing--export.qr-landing {
  display: block;
  width: 600px;
  min-height: 0;
  background: var(--rec-bg);
}

.qr-landing--export .qr-landing__shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "logo"
    "panel"
    "social";
  width: 600px;
  min-height: 0;
  margin: 0;
  padding: 24px 20px 32px;
  gap: 24px;
}

.qr-landing--export .qr-landing__social.qr-landing__social--header {
  display: none;
}

.qr-landing--export .qr-landing__social--body {
  display: flex;
}

.qr-landing--export .qr-landing__panel-wrap {
  background: #fff;
  border-radius: var(--rec-panel-radius);
  padding: 24px 20px 20px;
}

.qr-landing--export .qr-landing__panel-title {
  display: block;
}

.qr-landing--export .qr-landing__panel-title--desktop {
  display: none;
}

.qr-landing--export .qr-landing__panel-body {
  flex-direction: column;
  align-items: center;
}

.qr-landing--export .qr-landing__panel-copy {
  text-align: center;
}

.qr-landing--export .qr-landing__panel-sub {
  text-align: center;
}

@media print {
  .qr-landing {
    display: block;
    min-height: 0 !important;
    height: auto !important;
    padding: 0;
    background: #fff;
    page-break-after: avoid;
  }

  .qr-landing__shell {
    display: block;
    flex: none;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px !important;
    page-break-inside: avoid;
  }

  .qr-landing__actions,
  .qr-landing__gallery,
  .qr-landing__headline {
    display: none !important;
  }
}
