:root {
  color-scheme: dark;
  --canvas: #0d1117;
  --canvas-subtle: #010409;
  --surface: #161b22;
  --surface-hover: #1c2128;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --faint: #6e7681;
  --accent: #58a6ff;
  --accent-soft: rgba(56, 139, 253, 0.14);
  --green: #3fb950;
  --green-soft: rgba(46, 160, 67, 0.15);
  --orange: #d29922;
  --shadow: 0 8px 24px rgba(1, 4, 9, 0.3);
  --radius: 6px;
}

html[data-theme="light"] {
  color-scheme: light;
  --canvas: #ffffff;
  --canvas-subtle: #f6f8fa;
  --surface: #f6f8fa;
  --surface-hover: #eef1f4;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --text: #1f2328;
  --muted: #656d76;
  --faint: #818b98;
  --accent: #0969da;
  --accent-soft: rgba(9, 105, 218, 0.1);
  --green: #1a7f37;
  --green-soft: rgba(26, 127, 55, 0.1);
  --orange: #9a6700;
  --shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { color: inherit; }
svg { display: block; fill: currentColor; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--canvas-subtle) 94%, transparent);
  border-bottom: 1px solid var(--border-muted);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1320px;
  min-height: 64px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.header-search {
  position: relative;
  width: min(360px, 36vw);
  margin-right: auto;
}
.header-search svg, .repo-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}
.header-search input, .repo-search input {
  width: 100%;
  height: 34px;
  padding: 5px 34px 5px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: transparent;
  color: var(--text);
  transition: width 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.header-search input:focus, .repo-search input:focus {
  border-color: var(--accent);
  background: var(--canvas);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.header-search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  min-width: 20px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  transform: translateY(-50%);
}

.header-links { display: flex; align-items: center; gap: 18px; }
.header-links a { color: var(--text); font-size: 13px; font-weight: 600; }
.header-links a:hover { color: var(--accent); text-decoration: none; }

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-hover); border-color: var(--muted); }
.theme-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.theme-icon-moon { display: none; fill: currentColor; stroke: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; }

.profile-nav-wrap {
  position: sticky;
  top: 64px;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 94%, transparent);
  backdrop-filter: blur(12px);
}
.profile-nav {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 0 352px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-nav::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #f78166;
  transform: scaleX(0);
  transition: transform 160ms ease;
}
.tab:hover { background: var(--surface-hover); }
.tab.active { font-weight: 600; }
.tab.active::after { transform: scaleX(1); }
.tab svg { width: 16px; height: 16px; color: var(--muted); }
.counter {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--border-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 32px;
}

.profile-card { min-width: 0; }
.avatar-wrap { position: relative; margin-top: -76px; z-index: 21; }
.avatar-wrap img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  object-position: 56% 33%;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.availability-dot {
  position: absolute;
  right: 18px;
  bottom: 28px;
  width: 20px;
  height: 20px;
  border: 4px solid var(--canvas);
  border-radius: 50%;
  background: var(--green);
}
.profile-card h1 { margin: 18px 0 0; font-size: 24px; line-height: 1.25; }
.username { margin: 0 0 16px; color: var(--muted); font-size: 20px; font-weight: 300; }
.bio { margin: 0 0 16px; color: var(--text); font-size: 15px; line-height: 1.55; }

.primary-button, .secondary-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: var(--radius);
  background: #238636;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.1), inset 0 1px 0 rgba(255,255,255,0.03);
}
.primary-button { width: 100%; }
.primary-button:hover, .secondary-button:hover { background: #2ea043; text-decoration: none; }
.secondary-button { padding: 6px 14px; background: var(--surface); color: var(--text); border-color: var(--border); }
.secondary-button:hover { background: var(--surface-hover); }

.profile-meta { padding: 16px 0; margin: 0; border-bottom: 1px solid var(--border-muted); list-style: none; }
.profile-meta li { display: flex; align-items: center; gap: 8px; margin: 6px 0; color: var(--muted); overflow-wrap: anywhere; }
.profile-meta svg { width: 16px; height: 16px; flex: 0 0 auto; }
.profile-meta a { color: var(--text); }

.role-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-muted);
}
.status-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.role-box div { display: flex; flex-direction: column; }
.role-box span:last-child { margin-top: 2px; color: var(--muted); font-size: 12px; }
.profile-actions { padding-top: 14px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }

.content-column { min-width: 0; }
.tab-panel { animation: panel-in 180ms ease both; }
.tab-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

.box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--canvas); }
.box-header {
  min-height: 42px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.readme-body { padding: clamp(24px, 5vw, 48px); }
.eyebrow { color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; }
.readme h2, .panel-intro h2 {
  max-width: 720px;
  margin: 12px 0 16px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.readme-body > p, .panel-intro p { max-width: 760px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

.proof-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.proof-grid div { min-height: 118px; padding: 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background 160ms ease; }
.proof-grid div:hover { background: var(--surface); }
.proof-grid strong { display: block; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; }
.proof-grid span { display: block; margin-top: 7px; font-size: 12px; font-weight: 600; }
.proof-grid small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 10px; }
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 400; }
.text-button { padding: 4px; border: 0; background: none; color: var(--accent); cursor: pointer; }
.text-button:hover { text-decoration: underline; }

.pinned-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.loading-card { min-height: 150px; padding: 20px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.repo-card { position: relative; min-height: 158px; padding: 16px; overflow: hidden; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.repo-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transition: transform 160ms ease; }
.repo-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.repo-card:hover::before { transform: scaleY(1); }
.repo-card-top { display: flex; align-items: center; gap: 8px; }
.repo-card-top svg { width: 16px; height: 16px; color: var(--muted); }
.repo-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; white-space: nowrap; }
.visibility { margin-left: auto; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 11px; line-height: 20px; }
.repo-description { min-height: 42px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.repo-topics { min-height: 23px; display: flex; flex-wrap: wrap; gap: 5px; }
.topic { padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.repo-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.repo-meta span { display: inline-flex; align-items: center; gap: 5px; }
.language-dot { width: 10px; height: 10px; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: 50%; }

.build-note { margin-top: 24px; }
.live-label { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.live-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.build-note-body { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.build-note h3 { margin: 0 0 6px; font-size: 18px; }
.build-note p { max-width: 680px; margin: 0; color: var(--muted); }

.repo-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.repo-search { position: relative; }
select {
  height: 34px;
  padding: 5px 30px 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.repo-status { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.repo-list { margin-top: 8px; }
.repo-row { padding: 24px 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; border-bottom: 1px solid var(--border-muted); }
.repo-row h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 18px; }
.repo-row h3 a { font-weight: 600; }
.repo-row p { max-width: 720px; margin: 8px 0 12px; color: var(--muted); }
.repo-row .repo-topics { min-height: 0; margin-bottom: 12px; }
.repo-row .repo-meta { margin: 0; }
.repo-updated { color: var(--muted); font-size: 11px; white-space: nowrap; }
.empty-state { padding: 64px 20px; text-align: center; color: var(--muted); }

.panel-intro { padding: 28px 0 32px; border-bottom: 1px solid var(--border); }
.panel-intro h2 { margin-top: 10px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 26px; bottom: 26px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 26px 0 26px 38px; border-bottom: 1px solid var(--border-muted); }
.timeline-item::before { content: ""; position: absolute; left: 2px; top: 33px; width: 10px; height: 10px; border: 3px solid var(--canvas); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--border); }
.timeline-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.timeline h3 { margin: 0; font-size: 18px; }
.timeline-org { margin: 3px 0 0; color: var(--accent); font-weight: 600; }
.timeline-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.timeline-summary { max-width: 780px; margin: 12px 0; color: var(--muted); }
.timeline-details { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.timeline-details summary { padding: 10px 14px; color: var(--muted); cursor: pointer; user-select: none; }
.timeline-details summary:hover { color: var(--text); background: var(--surface); }
.timeline-details ul { margin: 0; padding: 4px 34px 18px; }
.timeline-details li { margin: 8px 0; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 11px; }

.credential-layout { padding-top: 28px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr); gap: 32px; }
.subheading { margin: 0 0 12px; font-size: 16px; }
.subheading.spaced { margin-top: 28px; }
.credential-card { padding: 16px; border: 1px solid var(--border); border-bottom: 0; background: var(--canvas); }
.credential-card:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.credential-card:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.credential-card h4 { margin: 0; font-size: 14px; }
.credential-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.credential-line { display: flex; justify-content: space-between; gap: 12px; }
.credential-year { color: var(--muted); font-size: 12px; white-space: nowrap; }
.credential-link { display: inline-flex; margin-top: 9px; font-size: 12px; }
.skill-group { border: 1px solid var(--border); border-bottom: 0; }
.skill-group:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.skill-group:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.skill-group button { width: 100%; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; background: var(--surface); text-align: left; cursor: pointer; }
.skill-group button:hover { background: var(--surface-hover); }
.skill-group button span:last-child { color: var(--muted); transition: transform 160ms ease; }
.skill-group.open button span:last-child { transform: rotate(45deg); }
.skill-body { display: none; padding: 14px; }
.skill-group.open .skill-body { display: block; animation: panel-in 160ms ease; }
.skill-note { margin: 0 0 10px; color: var(--muted); font-size: 11px; }

.panda-guide {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.panda-message {
  max-width: 260px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px 10px 2px 10px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: right bottom;
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(10px);
}
.panda-guide.speaking .panda-message,
.panda-guide:focus-within .panda-message,
.panda-guide:hover .panda-message { opacity: 1; transform: translateY(0) scale(1); }
.panda-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
  animation: panda-float 3.4s ease-in-out infinite;
}
.panda-button:hover,
.panda-button:focus-visible { border-color: var(--accent); background: var(--surface-hover); outline: none; transform: translateY(-3px); }
.panda-button:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.panda-emoji { display: block; font-size: 30px; line-height: 1; transform-origin: 50% 80%; }
.panda-guide.waving .panda-emoji { animation: panda-wave 520ms ease-in-out 2; }

@keyframes panda-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
@keyframes panda-wave {
  0%, 100% { transform: rotate(0); }
  35% { transform: rotate(-10deg) scale(1.06); }
  70% { transform: rotate(8deg); }
}

footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid var(--border-muted);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .profile-nav { padding-left: 330px; }
  .page-shell { grid-template-columns: 270px minmax(0, 1fr); gap: 24px; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .site-header { position: relative; }
  .header-inner { min-height: 56px; padding: 10px 16px; flex-wrap: wrap; }
  .brand span { display: none; }
  .header-search { order: 3; width: 100%; }
  .header-links { margin-left: auto; }
  .header-links a:first-child { display: none; }
  .profile-nav-wrap { top: 0; }
  .profile-nav { padding: 0 10px; }
  .tab { flex: 1 0 auto; justify-content: center; }
  .page-shell { padding: 24px 16px 64px; display: block; }
  .profile-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 18px; align-items: start; padding-bottom: 24px; }
  .avatar-wrap { grid-row: 1 / span 3; margin: 0; z-index: 1; }
  .availability-dot { right: 3px; bottom: 5px; width: 16px; height: 16px; border-width: 3px; }
  .profile-card h1 { margin: 5px 0 0; }
  .username { margin-bottom: 10px; font-size: 16px; }
  .bio, .primary-button, .profile-meta, .role-box, .profile-actions { grid-column: 1 / -1; }
  .bio { margin-top: 18px; }
  .content-column { margin-top: 8px; }
  .pinned-grid { grid-template-columns: 1fr; }
  .repo-toolbar { grid-template-columns: 1fr 1fr; }
  .repo-search { grid-column: 1 / -1; }
  .build-note-body { align-items: flex-start; flex-direction: column; }
  .credential-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .header-links a { display: none; }
  .brand span { display: inline; font-size: 13px; }
  .header-search kbd { display: none; }
  .header-search input { padding-right: 10px; }
  .tab { padding: 8px 10px; font-size: 12px; }
  .tab svg { display: none; }
  .readme-body { padding: 24px 18px; }
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .proof-grid div { min-height: 112px; padding: 12px; }
  .proof-grid strong { font-size: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .repo-toolbar { grid-template-columns: 1fr; }
  .repo-search { grid-column: auto; }
  .repo-row { grid-template-columns: 1fr; }
  .repo-updated { grid-row: 2; }
  .timeline-top { flex-direction: column; gap: 5px; }
  .credential-line { flex-direction: column; gap: 4px; }
  .panda-guide { right: 12px; bottom: 12px; }
  .panda-message { max-width: min(230px, calc(100vw - 88px)); }
  .panda-button { width: 46px; height: 46px; }
  .panda-emoji { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
