:root {
  --hue: 200;
  --bg: #ffffff;
  --ink: #2b2b2b;
  --muted: #767676;
  --border: #e6e6e6;

  --dot: rgba(0, 0, 0, 0.12);

  --accent: hsl(var(--hue) 70% 38%);
  --accent-soft: hsl(var(--hue) 70% 96%);
}

[data-theme="dark"] {
  --bg: #15171a;
  --ink: #e3e3e3;
  --muted: #8a8a8a;
  --border: #2a2d31;

  --dot: rgba(255, 255, 255, 0.08);

  --accent: hsl(var(--hue) 65% 65%);
  --accent-soft: hsl(var(--hue) 40% 18%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(
    var(--dot) 0.8px,
    transparent 0.8px
  );
  background-size: 20px 20px;
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  transition: background .25s ease, color .25s ease;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 12vh 24px 90px;
}

/* Fixed Floating Topbar */

.topbarfix {
  position: fixed;
  top: 3vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 650px);
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  transition: background .25s ease, border-color .25s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .18s ease, background-color .18s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(128, 128, 128, 0.08);
}

.nav-links a.active {
  color: var(--ink);
  font-weight: 500;
}

.nav-links .separator {
  color: var(--muted);
  opacity: 0.5;
  font-size: 12px;
  user-select: none;
  padding: 0 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s ease, color .2s ease, transform .15s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* Avatar + Heading */

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.identity h1 {
  font-size: 1.7rem;
  font-weight: 900;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color .2s ease;
}

.avatar-sm:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}

.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1 {
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0;
}

.role {
  color: var(--muted);
  font-size: 14.5px;
  margin: 2px 0 0;
}

p {
  margin: 0 0 18px;
  color: var(--ink);
}

p.compact {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--ink);
}

p.compact + p.compact {
  margin-top: 0;
}

.lines {
  margin: 0 0 20px;
}

a {
  color: var(--ink);
  text-decoration-color: var(--border);
}

main a {
  color: var(--ink);
  text-underline-offset: 3px;
}

main p a,
main .lines a,
.project-line a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border);
}

main p a:hover,
main .lines a:hover,
.project-line a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 18px;
}

.find-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  margin-bottom: 6px;
}

.find-row a {
  font-size: 14.5px;
  text-decoration: none;
  color: var(--ink);
}

.find-row a:hover {
  color: var(--accent);
}

.mail-line {
  font-size: 14.5px;
  color: var(--muted);
}

.mail-line a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border);
}

.project-line {
  margin-bottom: 20px;
  font-size: 15px;
}

.project-line strong {
  font-weight: 600;
}

.project-line .stack {
  display: inline;
}

.project-line .stack code {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--muted);
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
}

.timeline-line {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 15px;
}

.timeline-line time {
  color: var(--muted);
  flex-shrink: 0;
  width: 44px;
}

@media (max-width: 520px) {
  .timeline-line {
    flex-direction: column;
    gap: 0;
  }

  .timeline-line time {
    width: auto;
  }
}

.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: -12px;
  margin-bottom: 28px;
}

.status-line strong {
  color: var(--ink);
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #d64545;
  box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.45);
  animation: pulse-red 2.4s ease-out infinite;
  transition: background 0.3s ease;
}

.status-dot.online {
  background: #3d9b63;
  animation: pulse-green 2.4s ease-out infinite;
}

#statusText {
  transition: color 0.3s ease;
}

#statusText.online {
  color: #3d9b63;
}

#statusText.offline {
  color: #d64545;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 155, 99, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(61, 155, 99, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 155, 99, 0);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(214, 69, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(214, 69, 69, 0);
  }
}

@media (max-width: 520px) {
  .status-line {
    flex-wrap: wrap;
  }
}

/* Footer & Back to Top */

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

footer p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color .2s ease, background-color .2s ease;
}

.back-to-top:hover {
  color: var(--ink);
  background: rgba(128, 128, 128, 0.08);
}

.back-to-top svg {
  width: 14px;
  height: 14px;
  transition: transform .2s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}