:root {
  --bg: #12151c;
  --fg: #58a6ff;
  --muted: #6b87ac;
  --accent: #79c0ff;
  --line: #242b37;
  --maxw: 640px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Smooth cross-fade when navigating between pages (supported browsers) */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.28s; }

/* Gentle fade-in of content on load (opacity only — avoids transform jank during transitions) */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.wrap { animation: fadeIn 0.28s ease both; }

/* Softer color transitions on links */
a { transition: color 0.15s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wrap { animation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
}

/* Keep heavy embedded content from rendering all at once during transitions */
.playlist-grid iframe {
  content-visibility: auto;
  contain-intrinsic-size: auto 152px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.7;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* Language switcher */
.langbar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  justify-content: flex-end;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  line-height: 1.4;
}
.lang-btn:hover { color: var(--fg); }
.lang-btn .sep { opacity: .5; margin: 0 3px; }
.lang-btn .on { color: var(--fg); font-weight: 700; }

/* Header */
header {
  text-align: center;
  padding: 32px 0 8px;
}
.avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1b212b;
  background-image: url('photo.jpeg');
  background-size: 170%;
  background-position: 100% 72%;
  background-repeat: no-repeat;
  overflow: hidden;
  border: 1px solid var(--line);
}

.site-name {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.site-name a { color: var(--fg); }
.site-name a:hover { color: var(--accent); text-decoration: none; }

.tagline {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 18px;
}

/* Top navigation menu */
nav.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  margin: 14px 0 4px;
  font-size: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
nav.menu a { color: var(--muted); }
nav.menu a:hover { color: var(--accent); text-decoration: none; }
nav.menu a.active { color: var(--fg); font-weight: 600; }

.social {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 18px 0 0;
  font-size: 15px;
}
.social a { color: var(--fg); }
.social a:hover { color: var(--accent); text-decoration: none; }

/* Page content */
main { margin-top: 40px; }
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.2px;
}
.exp-heading { margin-top: 40px; }
p { margin: 0 0 14px; }

ul.projects { list-style: none; margin: 0; padding: 0; }
ul.projects li { margin: 0 0 20px; }
.proj-title { font-weight: 600; }
.proj-desc { color: var(--muted); font-size: 15px; margin-top: 2px; }

/* GitHub projects */
.repo-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
.repo {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .15s ease;
}
.repo:hover { border-color: var(--muted); }
.repo-name { font-weight: 700; font-size: 16px; }
.repo-name a { color: var(--fg); }
.repo-name a:hover { color: var(--accent); text-decoration: none; }
.repo-desc { color: var(--muted); font-size: 14px; margin: 6px 0 12px; line-height: 1.55; }
.repo-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.repo-lang .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--accent);
}
.repo-loading { color: var(--muted); font-size: 14px; }
.more-link { margin-top: 20px; font-size: 14px; }

/* Travel map */
.travel-intro { font-size: 15px; margin-bottom: 4px; }
.travel-hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.map-wrap {
  position: relative;
  width: min(92vw, 720px);
  margin-left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0e1116;
}
#worldmap { width: 100%; height: auto; display: block; }
.country {
  fill: #263140;
  stroke: #12151c;
  stroke-width: 0.5;
  transition: fill 0.12s ease;
}
.country:hover { fill: var(--accent); }
.country.visited { fill: #3d7fbf; }
.country.visited:hover { fill: #79c0ff; }
.country.planned { fill: #5f9bcf; }
.country.planned:hover { fill: #8fc0ea; }
.map-tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: #12151c;
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transform: translate(-50%, -150%);
}

/* Experience */
.exp {
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 16px;
  margin-bottom: 22px;
}
.exp-role { font-weight: 700; font-size: 15px; }
.exp-org { font-size: 14px; margin-top: 2px; }
.exp-desc { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.55; }
.exp-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Spotify overview */
.spotify-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.sp-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.sp-name { font-weight: 700; font-size: 17px; }
.sp-meta { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }

.sub-title {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
  margin: 28px 0 14px;
}

.playlist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.playlist-grid iframe {
  width: 100%;
  border: 0;
  border-radius: 12px;
  display: block;
}

/* Lightweight playlist facade — loads the real player only on click */
.pl {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #1b212b;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--fg);
  font: inherit;
  transition: border-color .15s ease;
}
.pl:hover { border-color: var(--muted); }
.pl-cover {
  width: 56px; height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #12151c;
}
.pl-title { font-weight: 700; font-size: 14px; flex: 1; }
.pl-play { color: var(--muted); font-size: 13px; }
.pl:hover .pl-play { color: var(--accent); }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 64px;
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .site-name { font-size: 26px; }
  .social, nav.menu { gap: 12px; flex-wrap: wrap; }
}
