:root {
  --bg: #0d1412;
  --card: rgba(20, 26, 24, 0.85);
  --card-border: rgba(255, 255, 255, 0.06);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #7fc8a0;
  --accent-soft: rgba(127, 200, 160, 0.35);
  --accent-tint: rgba(127, 200, 160, 0.12);
  --on-accent: #0d1412;
  --text: #f2f5f3;
  --text-accent: #8fbf9f;
  --muted: #9aa5a0;
  --radius-card: 32px;
  --radius-btn: 18px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #bfeee9 0%, #5f9e92 45%, #1f3d33 100%);
}
.bg__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35));
}

/* Card */
.card {
  position: relative;
  width: min(100%, 380px);
  padding: 44px 24px 28px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lang {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.lang__btn {
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 11px/1 var(--font);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lang__btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.avatar {
  display: block;
  width: 110px;
  height: 110px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px var(--accent-soft);
  object-fit: cover;
}

.name {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.role {
  margin: 8px 0 0;
  color: var(--text-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
}
.socials a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}
.socials a:hover, .socials a:focus-visible { color: var(--text); transform: translateY(-2px); }
.socials svg { width: 24px; height: 24px; }

.nav { display: grid; gap: 12px; }
.nav__btn {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font: 600 15px/1.2 var(--font);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.nav__btn:hover, .nav__btn:focus-visible {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

/* Now Playing */
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  text-align: left;
  text-decoration: none;
}
a.now-playing[href]:hover { border-color: var(--accent-soft); }
.now-playing__art {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 700;
}
.now-playing__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.now-playing__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge__dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--on-accent); }
.is-playing .badge__dot { display: block; animation: pulse 1.4s ease-in-out infinite; }
.now-playing__title,
.now-playing__sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.now-playing__title { font-size: 14px; font-weight: 700; }
.now-playing__sub { color: var(--muted); font-size: 12px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px 16px; }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 8, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}
.modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: min(80dvh, 720px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px 24px;
}
.modal__title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: 0.04em; }
.modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { border-color: var(--accent); }
.modal__body { padding: 4px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal__status { margin: 0; padding: 24px 0; color: var(--muted); text-align: center; }

/* Sections */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--text-accent);
  font-size: 12px;
  font-weight: 600;
}

.project-list, .playlist-list, .timeline { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.project { padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.project__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border-radius: 12px;
  object-fit: cover;
}
.project__title { margin: 0; font-size: 16px; }
.project__desc { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.project__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.project__links:empty { display: none; }
.pill-link {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.pill-link:hover { border-color: var(--accent); }

.about__bio { margin: 0; line-height: 1.6; }
.about__heading {
  margin: 22px 0 6px;
  color: var(--text-accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.skill-group { margin-top: 10px; }
.skill-group h4 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.timeline__item {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.timeline__period { color: var(--text-accent); font-size: 12px; }
.timeline__place { color: var(--muted); font-size: 13px; }

.playlist {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.playlist:hover { border-color: var(--accent); }
.playlist__cover { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.playlist__cover--placeholder {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 24px;
}
.playlist__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.playlist__name { font-weight: 700; }
.playlist__meta { color: var(--text-accent); font-size: 12px; }
.playlist__desc { color: var(--muted); font-size: 13px; }

.load-error { padding: 24px 0; color: var(--muted); text-align: center; }
.load-error p { margin: 0; }
.load-error button {
  margin-top: 10px;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 600 14px var(--font);
  cursor: pointer;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (max-width: 480px) {
  .modal { padding: 0; }
  .modal__panel { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
