:root,
[data-theme="dark"] {
  --fg: #ffffff;
  --muted: #555555;
  --card-bg: #1a1a1a;
}

[data-theme="light"] {
  --fg: #000000;
  --muted: #cfcfcf;
  --card-bg: rgba(255, 255, 255, 0.08);
}

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

html,
body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
  perspective: 1000px;

  color: var(--fg);
  transition: color 0.3s ease;

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* page background layers — crossfade between themes */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background: linear-gradient(180deg, #0b0b0b 0%, #141414 100%);
}

body::after {
  background: linear-gradient(180deg, #6f6f6f 0%, #838383 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

[data-theme="light"] body::after {
  opacity: 1;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  width: 304px;
  height: 359px;
  padding: 32px;

  border-radius: 8px;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);

  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.4s ease, background 0.3s ease;
}

/* one-shot entrance animation (added in HTML, removed on animationend) */
.card.card-enter {
  animation: card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.card-enter {
    animation: none;
  }
}

.card-bottom {
  display: flex;
  flex-direction: column;
}

.name {
  font-size: 16px;
  font-weight: 400;
  color: var(--fg);
  width: fit-content;
  cursor: default;
  transition: color 0.3s ease;
}

/* Theme switch (top-right) */
.theme-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 0.25rem;
  z-index: 20;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.theme-btn:hover {
  color: var(--fg);
}

.theme-btn.is-active {
  color: var(--fg);
}

[data-theme="light"] .theme-btn {
  color: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .theme-btn:hover,
[data-theme="light"] .theme-btn.is-active {
  color: #ffffff;
}

.theme-btn:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 2px;
}

[data-theme="light"] .name {
  color: #ffffff;
}

.bio {
  color: var(--muted);
  transition: color 0.3s ease;
}

.links {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

.links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.links a:hover,
.links a:focus-visible {
  text-decoration: underline;
}

.links a:focus-visible {
  outline: none;
}
