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

/* ── Tokens ────────────────────────────────────────────── */
:root {
  --bg: #0d0f18;
  --surface: rgba(22, 25, 40, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #e05a5a;
  --accent-dim: rgba(224, 90, 90, 0.12);
  --text-primary: #e8eaf0;
  --text-secondary: #7a7f94;
  --radius: 18px;
  --theme-transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

[data-theme="light"] {
  --bg: #f5f0f0;
  --surface: rgba(255, 255, 255, 0.72);
  --border: rgba(0, 0, 0, 0.08);
  --accent: #c0392b;
  --accent-dim: rgba(192, 57, 43, 0.1);
  --text-primary: #111827;
  --text-secondary: #6b7280;
}

/* ── Base ──────────────────────────────────────────────── */
html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  overflow-x: hidden;
  transition: var(--theme-transition);
}

/* ── Animated gradient background ──────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    135deg,
    var(--bg) 0%,
    #1a0a0e 20%,
    #2d1215 35%,
    var(--bg) 50%,
    #1a0f1a 65%,
    #2a1018 80%,
    var(--bg) 100%
  );
  background-size: 300% 300%;
  animation: aurora 20s ease infinite;
}

[data-theme="light"] .bg {
  background: linear-gradient(
    135deg,
    var(--bg) 0%,
    #f0d6d6 20%,
    #e8c4c8 35%,
    var(--bg) 50%,
    #e6d0e0 65%,
    #edc8cc 80%,
    var(--bg) 100%
  );
}

@keyframes aurora {
  0%   { background-position: 0% 0%; }
  25%  { background-position: 100% 50%; }
  50%  { background-position: 50% 100%; }
  75%  { background-position: 0% 50%; }
  100% { background-position: 0% 0%; }
}

/* ── Theme toggle ──────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--theme-transition), transform 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}

.theme-toggle img {
  width: 18px;
  height: 18px;
  transition: opacity 0.3s ease, transform 0.4s ease;
  filter: brightness(0) invert(0.6);
}

.theme-toggle:hover img {
  filter: brightness(0) invert(0.4) sepia(1) saturate(5) hue-rotate(330deg);
}

[data-theme="light"] .theme-toggle img {
  filter: brightness(0) invert(0.4);
}

[data-theme="light"] .theme-toggle:hover img {
  filter: brightness(0) invert(0.2) sepia(1) saturate(5) hue-rotate(330deg);
}

.icon-sun  { position: absolute; }
.icon-moon { position: absolute; }

/* Dark mode → show moon, hide sun */
:root .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
:root .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* Light mode → show sun, hide moon */
[data-theme="light"] .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }

/* ── Card ──────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 48px 40px 40px;
  text-align: center;
  transition: var(--theme-transition);
}

/* ── Avatar ────────────────────────────────────────────── */
.avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin-bottom: 24px;
  filter: grayscale(100%) brightness(0.8) sepia(0.3) hue-rotate(310deg);
  transition: filter 0.4s ease, border-color 0.4s ease;
}

[data-theme="light"] .avatar {
  filter: grayscale(100%) brightness(1.05) sepia(0.2) hue-rotate(310deg);
}

.avatar:hover {
  filter: none;
}

/* ── Typography ────────────────────────────────────────── */
.name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
  transition: color 0.4s ease;
}

.title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  transition: color 0.4s ease;
}

.divider {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 auto 24px;
  border-radius: 2px;
  transition: background 0.4s ease;
}

.bio {
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 36px;
  transition: color 0.4s ease;
}

/* ── Tech stack ────────────────────────────────────────── */
.tech {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.tech-pill {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* ── Links ─────────────────────────────────────────────── */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.link:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.link-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(0.6);
  transition: filter 0.15s ease;
}

[data-theme="light"] .link-icon {
  filter: brightness(0) invert(0.35);
}

.link:hover .link-icon {
  filter: brightness(0) invert(0.4) sepia(1) saturate(5) hue-rotate(330deg);
}

.link-label {
  flex: 1;
  text-align: left;
}

.link-arrow {
  flex-shrink: 0;
  opacity: 0.3;
  font-size: 0.8rem;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.link:hover .link-arrow {
  opacity: 0.7;
  transform: translateX(3px);
}

/* ── Sparkle particles ─────────────────────────────────── */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  font-family: "SF Mono", "Fira Code", "Courier New", monospace;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  animation: sparkle-fly 0.8s ease-out forwards;
}

.sparkle-avatar {
  font-size: 14px;
  text-shadow: 0 0 6px var(--accent);
}

@keyframes sparkle-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.3);
  }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 36px 24px 32px; }
  .name { font-size: 1.5rem; }
}
