:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #151716;
  --muted: #626864;
  --line: #d8dcd8;
  --accent: #0b617b;
  --accent-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111412;
    --surface: #181c19;
    --text: #f2f4f2;
    --muted: #b3bbb5;
    --line: #343a36;
    --accent: #7ac7df;
    --accent-text: #0b1518;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #151716;
  --muted: #626864;
  --line: #d8dcd8;
  --accent: #0b617b;
  --accent-text: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111412;
  --surface: #181c19;
  --text: #f2f4f2;
  --muted: #b3bbb5;
  --line: #343a36;
  --accent: #7ac7df;
  --accent-text: #0b1518;
}

@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.icon {
  display: block;
  width: 19px;
  height: 19px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.vcard-page {
  width: min(580px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 34px;
}

.vcard-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 26px;
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.vcard-person {
  display: flex;
  min-width: 0;
  gap: 17px;
  align-items: center;
}

.portrait {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  object-fit: cover;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 400;
  line-height: 1;
}

.vcard-role {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.vcard-role a {
  color: var(--text);
  text-decoration: none;
}

.vcard-role a:hover {
  color: var(--accent);
}

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

.qr {
  margin: 0;
}

.qr img {
  display: block;
  width: 84px;
  height: 84px;
  background: #ffffff;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.quick-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  text-decoration: none;
}

.quick-actions .primary-action {
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}

.icon-action {
  width: 44px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.icon-action:hover,
.icon-action:focus-visible {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.profile-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.profile-rail a,
.theme-toggle {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.profile-rail a:hover,
.profile-rail a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface);
  color: var(--text);
  transform: translateY(-1px);
}

.profile-rail .brand-icon {
  width: 20px;
  height: 20px;
}

.contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 20px;
  font-size: 12px;
}

.theme-toggle {
  padding: 0;
  font: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  .vcard-identity,
  .quick-actions,
  .profile-rail {
    transform: translateY(7px);
    animation: enter 380ms ease forwards;
  }

  .quick-actions {
    animation-delay: 50ms;
  }

  .profile-rail {
    animation-delay: 100ms;
  }

  @keyframes enter {
    to {
      transform: translateY(0);
    }
  }
}

@media (max-width: 520px) {
  .vcard-page {
    padding-top: 30px;
  }

  .vcard-identity {
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 13px;
  }

  .vcard-person {
    gap: 12px;
    align-items: flex-start;
  }

  .portrait {
    width: 58px;
    height: 58px;
  }

  h1 {
    font-size: 29px;
  }

  .vcard-role {
    font-size: 11px;
  }

  .headline {
    font-size: 10px;
  }

  .qr img {
    width: 68px;
    height: 68px;
  }

  .quick-actions {
    gap: 7px;
  }

  .icon-action,
  .profile-rail a,
  .theme-toggle {
    width: 42px;
    height: 42px;
  }

  .profile-rail {
    gap: 4px;
  }

  .contact-footer {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
