:root {
  --paper: #f6f3ee;
  --desk: #e7e2d8;
  --ink: #1c2430;
  --muted: #5c6570;
  --blue: #1f4e79;
  --blue-deep: #183e61;
  --line: rgba(28, 36, 48, 0.14);
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

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

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

.card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 0 12px;
}

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

.hero { text-align: center; }

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tagline {
  margin: 12px 0 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.03em;
  animation: tagReveal 0.85s var(--ease) 0.08s backwards;
}

.tagline em {
  font-style: italic;
  color: var(--blue);
}

.rule {
  display: block;
  width: 40px;
  height: 1px;
  margin: 18px auto 0;
  background: var(--blue);
  transform-origin: center;
  animation: ruleIn 0.55s var(--ease) 0.45s backwards;
}

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

.portrait-wrap {
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  position: relative;
}

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

.ring circle {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5;
  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 22%;
  background: #fff;
  display: block;
  animation: portraitIn 0.7s var(--ease) 0.15s backwards;
}

h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.title {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 500;
}

.meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.bio {
  margin: 16px auto 0;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.55;
  text-align: left;
}

.status {
  margin: 14px 0 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.skills span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.actions { padding-top: 22px; }

.contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.contacts li + li { border-top: 1px solid var(--line); }

.contact-link {
  position: relative;
  overflow: hidden;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  color: var(--ink);
  text-decoration: none;
}

.contact-link svg { display: block; flex: 0 0 auto; color: var(--blue); }

.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;
}

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

.contact-link .contact-go { color: var(--muted); }

.contact-link:active { background: rgba(28, 36, 48, 0.04); }

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

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

.btn-save {
  width: 100%;
  margin-top: 16px;
  background: var(--blue);
  color: var(--paper);
}

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

.btn-save .ripple { background: rgba(246, 243, 238, 0.4); }

@media (hover: hover) {
  .contact-link:hover .contact-label { color: var(--blue); }
  .btn-save:hover { background: var(--blue-deep); }
}

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

.btn.is-opening { background: var(--blue-deep); }

.qr-block {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding-top: 20px;
  padding-bottom: 4px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.qr-block canvas {
  width: 168px;
  height: 168px;
  border-radius: 4px;
}

.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: 28px; 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 {
    background: var(--desk);
    padding: 28px 16px 40px;
  }

  .card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding-top: 32px;
  }
}

@media (max-width: 360px) {
  .tagline { font-size: 38px; }
  h1 { font-size: 32px; }
}

@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 tagReveal {
  from { clip-path: inset(0 0 100% 0); opacity: 0.4; }
  to { clip-path: inset(0); opacity: 1; }
}

@keyframes ruleIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(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,
  .tagline,
  html.js .qr-block {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

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