/* QR gateway — /qrcode/  Mobile-first, cinematic, conversion only. */

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-1, #0a0a0b);
  color: var(--text-primary, #fafafa);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.page-qrcode {
  overflow-x: hidden;
}

.qr {
  --qr-red: var(--red, #ff2d2d);
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    clamp(20px, 6vw, 32px)
    calc(16px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

.qr.is-leaving {
  pointer-events: none;
}

.qr.is-leaving .qr-stage {
  opacity: 0.28;
  transform: scale(0.985);
  filter: blur(8px);
  transition: opacity 0.45s var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1)),
    transform 0.45s var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1)),
    filter 0.45s var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1));
}

.qr-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.qr-bg__glow {
  position: absolute;
  width: 72vw;
  height: 72vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  filter: blur(8px);
}

.qr-bg__glow--left {
  top: -12%;
  left: -28%;
  background: radial-gradient(circle, rgba(255, 45, 45, 0.18) 0%, transparent 68%);
  animation: qrDrift 16s ease-in-out infinite;
}

.qr-bg__glow--right {
  right: -22%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(255, 45, 45, 0.1) 0%, transparent 70%);
  animation: qrDrift 22s ease-in-out infinite reverse;
}

.qr-bg__spot {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  left: var(--qr-spot-x, 50%);
  top: var(--qr-spot-y, 28%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 45, 45, 0.14) 0%, transparent 70%);
  opacity: 0.85;
  transition: left 0.35s linear, top 0.35s linear;
}

.qr-bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.qr-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, transparent, transparent 79px, rgba(255, 255, 255, 0.02) 80px),
    repeating-linear-gradient(to bottom, transparent, transparent 79px, rgba(255, 255, 255, 0.015) 80px);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

.qr-bg__wm {
  position: absolute;
  right: -4vw;
  top: 54%;
  margin: 0;
  transform: translateY(-50%);
  font-size: clamp(96px, 28vw, 240px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.8;
  color: rgba(255, 255, 255, 0.035);
  text-shadow: 0 0 48px rgba(0, 0, 0, 0.32);
  user-select: none;
}

@keyframes qrDrift {
  0%,
  100% { transform: translate(0, 0); }
  50% { transform: translate(18px, 22px); }
}

.qr-head,
.qr-stage,
.qr-foot {
  position: relative;
  z-index: 1;
}

.qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(28px, 6vh, 48px);
  animation: qrRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.qr-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qr-logo__word {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--qr-red);
  line-height: 1;
}

.qr-logo__line {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: rgba(255, 45, 45, 0.28);
  position: relative;
  overflow: hidden;
}

.qr-logo__line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 60%;
  height: 100%;
  background: var(--qr-red);
  animation: qrLogoSignal 2.4s ease-in-out infinite;
}

@keyframes qrLogoSignal {
  0%,
  100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(220%); opacity: 1; }
}

.qr-head__meta {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-dark-dim, rgba(255, 255, 255, 0.4));
}

.qr-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}

.qr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-on-dark-dim, rgba(255, 255, 255, 0.4));
  animation: qrRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
}

.qr-eyebrow__pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--qr-red);
  box-shadow: 0 0 10px rgba(255, 45, 45, 0.7);
  animation: qrPulse 1.8s ease-in-out infinite;
}

@keyframes qrPulse {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.qr-headline {
  margin: 0 0 14px;
  font-size: clamp(2.6rem, 12vw, 5.4rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.9;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  animation: qrRise 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.qr-headline__line {
  display: block;
}

.qr-headline__line:last-child {
  color: var(--qr-red);
}

.qr-sub {
  margin: 0 0 clamp(28px, 5vh, 40px);
  max-width: 28em;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-on-dark-dim, rgba(255, 255, 255, 0.4));
  animation: qrRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

.qr-doors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.qr-door {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 22px 20px 20px;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: qrRise 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition:
    transform 0.28s var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1)),
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.qr-door--recruiter { animation-delay: 0.2s; }
.qr-door--institute { animation-delay: 0.28s; }

.qr-door__glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at var(--qr-mx, 20%) var(--qr-my, 20%), rgba(255, 45, 45, 0.22), transparent 46%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.qr-door__index,
.qr-door__body,
.qr-door__go {
  position: relative;
  z-index: 1;
}

.qr-door__index {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 45, 45, 0.55);
  align-self: start;
  padding-top: 2px;
}

.qr-door__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.qr-door__kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-dark-faint, rgba(255, 255, 255, 0.28));
  margin-bottom: 8px;
}

.qr-door__title {
  font-size: clamp(1.7rem, 6vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  margin-bottom: 8px;
}

.qr-door__copy {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-on-dark-dim, rgba(255, 255, 255, 0.4));
  margin-bottom: 12px;
}

.qr-door__meta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
}

.qr-door__go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.qr-door__arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1));
}

.qr-door:hover,
.qr-door:focus-visible {
  border-color: rgba(255, 45, 45, 0.45);
  background: rgba(255, 45, 45, 0.06);
  box-shadow: 0 16px 40px rgba(255, 45, 45, 0.12);
  outline: none;
}

.qr-door:hover .qr-door__glow,
.qr-door:focus-visible .qr-door__glow {
  opacity: 1;
}

.qr-door:hover .qr-door__arrow,
.qr-door:focus-visible .qr-door__arrow {
  transform: translateX(4px);
}

.qr-door:hover .qr-door__go,
.qr-door:focus-visible .qr-door__go {
  background: var(--qr-red);
  border-color: var(--qr-red);
  color: #fff;
}

.qr-door:active {
  transform: scale(0.985);
}

.qr-door.is-chosen {
  border-color: var(--qr-red);
  background: rgba(255, 45, 45, 0.14);
  transform: scale(1.02);
}

.qr-foot {
  margin: clamp(24px, 4vh, 36px) 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-faint, rgba(255, 255, 255, 0.28));
  animation: qrRise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.34s both;
}

@keyframes qrRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .qr {
    padding-inline: clamp(32px, 8vw, 80px);
  }

  .qr-doors {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .qr-door {
    min-height: 280px;
    padding: 28px 26px 24px;
  }

  .qr-door__index {
    margin-bottom: 18px;
  }

  .qr-door__body {
    flex: 1;
  }

  .qr-door__title {
    font-size: clamp(2.1rem, 3.4vw, 2.8rem);
  }

  .qr-door__copy {
    font-size: 14px;
    max-width: 22em;
  }

  .qr-door__go {
    margin-top: auto;
  }

  .qr-door:hover {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-head,
  .qr-eyebrow,
  .qr-headline,
  .qr-sub,
  .qr-door,
  .qr-foot,
  .qr-bg__glow,
  .qr-logo__line::after,
  .qr-eyebrow__pip {
    animation: none;
  }

  .qr-head,
  .qr-eyebrow,
  .qr-headline,
  .qr-sub,
  .qr-door,
  .qr-foot {
    opacity: 1;
    transform: none;
  }

  .qr.is-leaving .qr-stage {
    filter: none;
    transform: none;
  }
}
