:root {
  --void: #070c14;
  --card: #0c1420;
  --ink: #f3f6fb;
  --muted: #9aa7b6;
  --blue: #3b8eef;
  --blue-core: #0261b9;
  --blue-deep: #0a4a8f;
  --line: rgba(232, 238, 246, 0.12);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--void);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

.ambiance {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 60% at 50% -5%, rgba(20, 110, 210, 0.55), transparent 62%),
    radial-gradient(ellipse 70% 45% at 90% 100%, rgba(2, 97, 185, 0.32), transparent 55%),
    #070c14 url("../images/atmosphere.jpg") center / cover no-repeat;
  filter: brightness(0.7) saturate(1.25);
}

.ambiance::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 140px 140px;
  mix-blend-mode: overlay;
}

.card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 24px));
  margin: 16px auto 28px;
  padding: 0 0 8px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 28, 44, 0.92) 0%, rgba(10, 16, 26, 0.96) 40%, #0a1018 100%);
  border: 1px solid rgba(232, 238, 246, 0.1);
  border-radius: 22px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(2, 97, 185, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.identity,
.actions,
.qr-block,
.card-foot {
  padding-left: 22px;
  padding-right: 22px;
}

.hero {
  position: relative;
  line-height: 0;
  overflow: hidden;
  background: #081018;
}

.cover {
  width: 100%;
  height: 236px;
  object-fit: cover;
  object-position: center 70%;
  display: block;
  transform-origin: center center;
  animation: kenburns 1.8s var(--ease) both;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(8, 16, 24, 0.05) 28%, rgba(10, 16, 26, 0.38) 68%, rgba(12, 20, 32, 1) 100%),
    linear-gradient(to right, rgba(2, 97, 185, 0.12), transparent 40%);
  pointer-events: none;
}

.identity { padding-top: 0; text-align: center; }

.portrait-wrap {
  width: 116px;
  height: 116px;
  margin: -58px auto 18px;
  position: relative;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.ring {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  transform: rotate(-90deg);
  overflow: visible;
}

.ring circle {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  animation: ringDraw 1s var(--ease) 0.3s forwards;
}

.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #081630;
  border: 3px solid #121c2c;
  display: block;
  animation: portraitIn 0.7s var(--ease) 0.15s backwards;
}

h1 {
  margin: 0;
  font-family: Syne, Outfit, "Segoe UI", sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}

.title {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c5d3e2;
}

.bio {
  margin: 18px auto 0;
  max-width: 34em;
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  color: #c9d2dc;
}

.status {
  margin: 16px 0 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.skills span {
  padding: 5px 10px;
  border: 1px solid rgba(59, 142, 239, 0.28);
  border-radius: 999px;
  background: rgba(2, 97, 185, 0.12);
  color: #d5e6f8;
}

.actions { padding-top: 22px; }

.contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  border-top: none;
}

.contacts li + li { border-top: none; }

.contact-link {
  position: relative;
  overflow: hidden;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.contact-link > svg:first-child {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(2, 97, 185, 0.22);
  color: #8ec2ff;
  box-shadow: inset 0 0 0 1px rgba(59, 142, 239, 0.18);
}

.contact-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 12px;
  row-gap: 2px;
}

.contact-label {
  font-size: 15px;
  font-weight: 500;
  color: #f4f7fb;
}

.contact-value {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.contact-link .contact-go {
  flex-shrink: 0;
  color: #7d8b9a;
}

.contact-link:active { background: rgba(59, 142, 239, 0.16); }

.contact-link:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.btn {
  position: relative;
  overflow: hidden;
  min-height: 54px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font: 600 15px/1 Outfit, "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0 16px;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-save {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(180deg, #1a7ae0 0%, var(--blue-core) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 28px rgba(2, 97, 185, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1);
  animation: ripple 500ms ease-out forwards;
  pointer-events: none;
}

.btn-save .ripple { background: rgba(255, 255, 255, 0.4); }

@media (hover: hover) {
  .contact-link:hover {
    background: rgba(59, 142, 239, 0.12);
    border-color: rgba(59, 142, 239, 0.4);
    box-shadow: 0 8px 22px rgba(2, 97, 185, 0.16);
  }

  .contact-link:hover .contact-label { color: #fff; }
  .contact-link:hover > svg:first-child { color: #fff; background: var(--blue-core); }

  .btn-save:hover {
    filter: brightness(1.08);
    box-shadow:
      0 14px 32px rgba(2, 97, 185, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

.btn:active { transform: scale(0.98); }

.btn.is-opening {
  background: linear-gradient(180deg, var(--blue-deep) 0%, #08366c 100%);
}

.qr-block {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 18px 16px 14px;
  text-align: center;
  border: 1px solid rgba(59, 142, 239, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.qr-block canvas {
  width: 168px;
  height: 168px;
  border-radius: 8px;
  background: #e8eef6;
}

.qr-block p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.qr-block.is-visible::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  height: 1px;
  background: var(--blue);
  top: 16%;
  animation: scan 0.9s ease 0.1s 1 forwards;
  pointer-events: none;
}

.card-foot { padding-top: 16px; padding-bottom: 22px; text-align: center; }

.card-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.rise { animation: fadeUp 0.7s var(--ease) backwards; }
.d1 { animation-delay: 0.02s; }
.d2 { animation-delay: 0.08s; }
.d3 { animation-delay: 0.14s; }
.d4 { animation-delay: 0.2s; }
.d5 { animation-delay: 0.26s; }
.d6 { animation-delay: 0.32s; }
.d7 { animation-delay: 0.38s; }
.d8 { animation-delay: 0.44s; }

@media (min-width: 520px) {
  body { padding: 36px 16px 48px; }
}

@media (max-width: 360px) {
  h1 { font-size: 26px; }
  .cover { height: 200px; }
  .card { width: min(420px, calc(100% - 16px)); margin: 12px auto 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  html.js .qr-block:not(.is-visible) {
    opacity: 0;
    transform: translateY(12px);
  }

  html.js .qr-block.is-visible {
    animation: fadeUp 0.7s var(--ease) forwards;
  }
}

@keyframes kenburns {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes portraitIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes ringDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes ripple {
  to { transform: scale(18); opacity: 0; }
}

@keyframes scan {
  from { top: 18%; opacity: 1; }
  to { top: 78%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .rise,
  .portrait,
  .cover,
  html.js .qr-block {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .ring circle { stroke-dashoffset: 0 !important; }
  .qr-block.is-visible::after { display: none !important; }
}
