:root {
  --bg: #0a0a12;
  --raised: #12121c;
  --raised-edge: rgba(255, 255, 255, 0.08);
  --chalk: rgba(255, 255, 255, 0.94);
  --chalk-2: rgba(255, 255, 255, 0.62);
  --red: #e30613;
  --red-deep: #b3121b;
  --blue: #00208f;
  --blue-bright: #2455ff;
  --radius: 18px;
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background:
    radial-gradient(120% 80% at 15% -10%, rgba(227, 6, 19, 0.28), transparent 55%),
    radial-gradient(90% 55% at 100% 100%, rgba(0, 32, 143, 0.35), transparent 50%),
    var(--bg);
  color: var(--chalk);
  line-height: 1.4;
}

.shell {
  width: min(100% - 1.5rem, 26rem);
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.panel {
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise 0.55s ease both;
}

.contacts {
  animation-delay: 0.08s;
}

.save {
  animation: rise 0.55s ease both;
  animation-delay: 0.14s;
}

.qr-panel {
  animation-delay: 0.2s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  padding: 1rem 1.15rem 1.75rem;
  background:
    radial-gradient(110% 90% at 90% 0%, rgba(227, 6, 19, 0.55), transparent 52%),
    linear-gradient(145deg, #8f0610 0%, var(--red) 38%, var(--blue) 100%);
  text-align: center;
  box-shadow: 0 12px 40px rgba(100, 10, 30, 0.35);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}

.brand__mark {
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  object-fit: contain;
  border-radius: 0.35rem;
  background: #fff;
  padding: 2px;
}

.brand__text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand__red {
  color: #fff;
}

.brand__amp {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85em;
}

.brand__blue {
  color: #9eb4ff;
}

.lang {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lang:hover,
.lang:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  outline: none;
}

.portrait-wrap {
  width: 8.5rem;
  height: 8.5rem;
  margin: 0 auto 1.1rem;
  padding: 4px;
  border-radius: 1.15rem;
  background: linear-gradient(135deg, #fff, var(--red));
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(20, 0, 40, 0.35);
  animation: ring 3.2s ease-in-out infinite;
}

@keyframes ring {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.28),
      0 10px 28px rgba(20, 0, 40, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 0.42),
      0 12px 32px rgba(20, 0, 40, 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .save,
  .portrait-wrap {
    animation: none;
  }
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0.95rem;
  background: #fff;
  padding: 0.65rem;
}

.name {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.role {
  margin: 0.35rem 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.contacts {
  background: var(--raised);
  border: 1px solid var(--raised-edge);
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--raised-edge);
}

.row--last {
  border-bottom: none;
}

.row__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: rgba(227, 6, 19, 0.12);
  color: #ff5a63;
}

.row__icon--wa {
  background: rgba(37, 211, 102, 0.14);
  color: #25d366;
}

.row__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.row__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.row__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--chalk-2);
}

.row__value {
  color: var(--chalk);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.row__value:hover {
  color: #ff7a82;
}

.copy {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--chalk-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.65rem;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.copy:hover,
.copy:focus-visible {
  color: #ff7a82;
  border-color: rgba(227, 6, 19, 0.45);
  outline: none;
}

.copy.is-copied {
  color: #ff7a82;
  border-color: rgba(227, 6, 19, 0.55);
  background: rgba(227, 6, 19, 0.12);
}

.save {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  border-radius: 0.95rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #ff3b45 0%, var(--red) 55%, var(--red-deep) 100%);
  color: #fff;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(227, 6, 19, 0.32);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.save svg {
  width: 1.25rem;
  height: 1.25rem;
}

.save:hover {
  filter: brightness(1.05);
}

.save:active {
  transform: scale(0.985);
}

.save:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.qr-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.1rem;
  background: var(--raised);
  border: 1px solid var(--raised-edge);
}

.qr {
  width: 6.25rem;
  height: 6.25rem;
  padding: 0.4rem;
  border-radius: 0.7rem;
  background: #fff;
  display: grid;
  place-items: center;
}

.qr img,
.qr canvas,
.qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-copy h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.qr-copy p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--chalk-2);
  line-height: 1.45;
}

.footer {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

/* RTL */
html[dir="rtl"] .brand__text {
  flex-direction: row-reverse;
}

html[dir="rtl"] .row {
  direction: rtl;
}

html[dir="rtl"] .qr-panel {
  direction: rtl;
}

html[dir="rtl"] .qr-copy {
  text-align: right;
}

@media (max-width: 360px) {
  .qr-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  html[dir="rtl"] .qr-copy {
    text-align: center;
  }
}
