:root {
  --navy: #003C72;
  --blue: #5FA4C3;
  --pale: #AFD2E1;
  --gray: #F5F5F5;
  --white: #FFFFFF;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  overflow: hidden;
}

html {
  background: var(--navy);
}

body {
  background: linear-gradient(180deg, var(--navy) 0%, #04407a 55%, var(--navy) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--white);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.stage {
  height: 100svh;
  height: 100vh; /* fallback for browsers without svh */
  width: 100vw;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  justify-items: center;
  padding: calc(1.4rem + var(--safe-t)) calc(1.6rem + var(--safe-r)) calc(1.2rem + var(--safe-b)) calc(1.6rem + var(--safe-l));
  gap: 0.6rem;
}

/* ---------- Brand ---------- */
.brand {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 0.2rem;
}

.brand__logo {
  height: clamp(2.6rem, 6svh, 4.2rem);
  width: auto;
  max-width: min(72vw, 520px);
  object-fit: contain;
}

/* ---------- Copy ---------- */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  max-width: 40rem;
  padding: 0 0.5rem;
}

.headline {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4.4svh, 2.6rem);
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.15;
}

.cta {
  font-size: clamp(1.05rem, 2.6svh, 1.5rem);
  font-weight: 600;
  color: var(--pale);
  margin: 0;
  letter-spacing: 0.02em;
}

.explanation {
  font-size: clamp(0.92rem, 2.1svh, 1.15rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  line-height: 1.5;
  max-width: 34rem;
}

/* ---------- QR panel ---------- */
.qr-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.qr-panel__inner {
  background: var(--white);
  border-radius: 14px;
  padding: clamp(14px, 2.2svh, 26px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  width: min(78vmin, 9.6cm);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ---------- Fallback URL ---------- */
.fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding-bottom: 0.2rem;
}

.fallback__label {
  margin: 0;
  font-size: clamp(0.8rem, 1.7svh, 0.95rem);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.fallback__url {
  margin: 0;
  font-size: clamp(0.95rem, 2.1svh, 1.2rem);
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid var(--blue);
  padding-bottom: 2px;
  letter-spacing: 0.01em;
}

/* ---------- Landscape fallback ---------- */
@media (orientation: landscape) {
  .stage {
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "content qr";
    align-items: center;
  }
  .brand { grid-area: brand; }
  .content { grid-area: content; align-items: flex-start; text-align: left; max-width: 26rem; }
  .qr-panel { grid-area: qr; }
  .fallback { grid-column: 1 / -1; }
  .qr-panel__inner { width: min(40vh, 34vw, 8.5cm); }
}

/* ---------- Small screens ---------- */
@media (max-width: 380px) {
  .headline { font-size: 1.5rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- No-JS / fallback readability ---------- */
noscript {
  display: block;
  text-align: center;
  padding: 1rem;
}
