/* Catppuccin Mocha (Dark) */
[data-theme="dark"] {
  --ctp-text: #cdd6f4;
  --ctp-subtext1: #bac2de;
  --ctp-subtext0: #a6adc8;
  --ctp-overlay1: #7f849c;
  --ctp-surface1: #45475a;
  --ctp-surface0: #313244;
  --ctp-base: #1e1e2e;
  --ctp-mauve: #cba6f7;
  --ctp-lavender: #b4befe;

  --bg: var(--ctp-base);
  --bg-card: var(--ctp-surface0);
  --text: var(--ctp-text);
  --text-sub: var(--ctp-subtext0);
  --accent: var(--ctp-lavender);
  --accent-hover: var(--ctp-mauve);
  --border: var(--ctp-surface1);
  --shadow: rgba(0, 0, 0, 0.4);
  --icon-fill: var(--ctp-subtext1);
  --icon-hover: var(--ctp-mauve);
  --toggle-bg: var(--ctp-surface1);
}

/* Catppuccin Latte (Light) */
[data-theme="light"] {
  --ctp-text: #4c4f69;
  --ctp-subtext1: #5c5f77;
  --ctp-subtext0: #6c6f85;
  --ctp-overlay1: #8c8fa1;
  --ctp-surface1: #bcc0cc;
  --ctp-surface0: #ccd0da;
  --ctp-base: #eff1f5;
  --ctp-mantle: #e6e9ef;
  --ctp-mauve: #8839ef;
  --ctp-lavender: #7287fd;

  --bg: var(--ctp-base);
  --bg-card: var(--ctp-mantle);
  --text: var(--ctp-text);
  --text-sub: var(--ctp-subtext0);
  --accent: var(--ctp-lavender);
  --accent-hover: var(--ctp-mauve);
  --border: var(--ctp-surface1);
  --shadow: rgba(0, 0, 0, 0.08);
  --icon-fill: var(--ctp-subtext1);
  --icon-hover: var(--ctp-mauve);
  --toggle-bg: var(--ctp-surface0);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
  overflow-y: auto;
  padding: 1.5rem 0;
}

.container {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 1.5rem;
}

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--toggle-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.4s ease;
  z-index: 100;
}

.theme-toggle.animate {
  animation: rotateClick 0.4s ease;
}

@keyframes rotateClick {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(15deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  position: absolute;
}

[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="light"] .icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="light"] .icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

.card {
  background: color-mix(in srgb, var(--bg-card) 65%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: 
    0 8px 32px var(--shadow),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition:
    background-color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  animation: fadeInUp 0.6s ease both;
}

.avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  transition:
    border-color 0.3s ease,
    transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05) rotate(3deg);
  border-color: var(--accent-hover);
}

.name {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  transition: color 0.4s ease;
}

.tagline {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-sub);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  transition: color 0.4s ease;
}

.bio {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  transition: color 0.4s ease;
}

.location {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ctp-overlay1);
  margin-bottom: 2rem;
  transition: color 0.4s ease;
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.location::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--ctp-overlay1);
  transition: width 0.3s ease, left 0.3s ease;
}
.location:hover::after {
  width: 100%;
  left: 0;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--icon-fill);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.social-link:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}

.social-link svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
}

.social-link::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.85);
  padding: 4px 10px;
  background: var(--ctp-surface1);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.social-link:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: color 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social-link {
  animation: fadeInUp 0.5s ease both;
}

.social-link:nth-child(1) {
  animation-delay: 0.1s;
}
.social-link:nth-child(2) {
  animation-delay: 0.15s;
}
.social-link:nth-child(3) {
  animation-delay: 0.2s;
}
.social-link:nth-child(4) {
  animation-delay: 0.25s;
}
.social-link:nth-child(5) {
  animation-delay: 0.3s;
}
.social-link:nth-child(6) {
  animation-delay: 0.35s;
}
.social-link:nth-child(7) {
  animation-delay: 0.4s;
}

@media (max-width: 480px) {
  .card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  .name {
    font-size: 1.5rem;
  }
  .avatar {
    width: 100px;
    height: 100px;
  }
  .social-link {
    width: 44px;
    height: 44px;
  }
  .social-link svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 1rem;
  }
  .card {
    padding: 1.5rem 1rem;
    border-radius: 16px;
  }
  .name {
    font-size: 1.35rem;
  }
  .tagline,
  .bio {
    font-size: 0.8rem;
  }
  .social-links {
    gap: 0.5rem;
  }
  .social-link {
    width: 40px;
    height: 40px;
  }
  .social-link svg {
    width: 18px;
    height: 18px;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  opacity: 1;
}

::view-transition-new(root) {
  animation: vt-bubble-in 1s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes vt-bubble-in {
  from {
    clip-path: circle(0% at var(--ripple-x, 50%) var(--ripple-y, 0%));
  }
  to {
    clip-path: circle(150% at var(--ripple-x, 50%) var(--ripple-y, 0%));
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

.action-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--ctp-surface1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 16px var(--shadow);
  z-index: 100;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.action-menu.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.action-menu-btn {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.5rem 1rem;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}
.action-menu-btn:hover {
  background: var(--ctp-surface0);
}

.ambient-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient-glow::before, .ambient-glow::after {
  content: ' ';
  position: absolute;
  width: 30vw;
  height: 30vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: floatBackground 6s infinite alternate ease-in-out;
}
.ambient-glow::before {
  top: -5vw;
  left: -5vw;
  background: var(--accent);
}
.ambient-glow::after {
  bottom: -5vw;
  right: -5vw;
  background: var(--ctp-mauve);
  animation-delay: -4s;
}

@keyframes floatBackground {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vw, 6vw) scale(1.1); }
}
