:root {
  --bg: #2b2a28;
  --surface: #3a3835;
  --border: #4a4844;
  --fg: #f6f6eb;
  --fg-muted: #c2b8ae;
  --accent: #8b57a5;
  --accent-dim: #6e4582;
  --card-size: 176px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fadeIn {
  from { opacity: 0.5; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #5a5854 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text { height: 0.6rem; margin-bottom: 0.25rem; }
.skeleton-text:last-child { width: 60%; }
.skeleton-circle { border-radius: 50%; }
.skeleton-bar { height: 6px; border-radius: 3px; margin-bottom: 0.5rem; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px 1fr;
  gap: 2rem;
  align-items: center;
}

.sidebar-left { justify-self: end; display: grid; grid-template-columns: repeat(2, 176px); gap: 0.5rem; align-items: start; }
.sidebar-right { justify-self: start; display: grid; grid-template-columns: repeat(2, 176px); grid-template-rows: auto auto; gap: 0.5rem; align-items: start; }
.center { text-align: center; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

.avatar, h1, .bio, .timezone, .links a, .footer { opacity: 0; animation: fadeUp 0.5s ease forwards; }
.sidebar-left { opacity: 0; animation: fadeLeft 0.5s ease forwards; animation-delay: 0.3s; }
.sidebar-right { opacity: 0; animation: fadeRight 0.5s ease forwards; animation-delay: 0.3s; }

.avatar { animation-delay: 0s; }
h1 { animation-delay: 0.08s; }
.bio { animation-delay: 0.16s; }
.timezone { animation-delay: 0.24s; }
.links a:nth-child(1) { animation-delay: 0.32s; }
.links a:nth-child(2) { animation-delay: 0.40s; }
.links a:nth-child(3) { animation-delay: 0.48s; }
.links a:nth-child(4) { animation-delay: 0.56s; }
.links a:nth-child(5) { animation-delay: 0.64s; }
.footer { animation-delay: 0.72s; }

.avatar { width: 88px; height: 88px; border-radius: 50%; margin-bottom: 1.25rem; transition: opacity 0.2s ease; }
.avatar:hover { opacity: 0.8; }

h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.375rem; }
.bio { color: var(--fg-muted); font-size: 0.875rem; margin-bottom: 0.5rem; font-weight: 400; }
.bio .cursor { color: var(--accent); animation: blink 1s step-end infinite; margin-left: 1px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.timezone { color: var(--fg-muted); font-size: 0.75rem; margin-bottom: 1.5rem; font-weight: 400; font-variant-numeric: tabular-nums; }

.links { display: flex; flex-direction: column; gap: 0.5rem; }
.links a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; color: var(--fg); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: background 0.15s ease, border-color 0.15s ease; }
.links a:hover { background: var(--border); border-color: var(--accent-dim); }
.links svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.links span { flex: 1; text-align: left; }
.links .arrow { opacity: 0.4; transition: transform 0.15s ease, opacity 0.15s ease; }
.links a:hover .arrow { transform: translateX(2px); opacity: 0.7; }

.github { grid-column: span 2; height: var(--card-size); padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; overflow: hidden; }
.github:hover { border-color: var(--accent-dim); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.github-graph { display: flex; gap: 2px; margin-bottom: 0.5rem; justify-content: flex-start; }
.github-graph .week { display: flex; flex-direction: column; gap: 2px; }
.github-graph .day { width: 10px; height: 10px; background: var(--border); border-radius: 2px; transition: transform 0.15s ease; }
.github-graph .day:hover { transform: scale(1.2); }
.github-graph .day.level-1 { background: #9be9a8; }
.github-graph .day.level-2 { background: #40c463; }
.github-graph .day.level-3 { background: #30a14e; }
.github-graph .day.level-4 { background: #216e39; }

.github .gh-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.25rem; text-align: center; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.github .gh-stat-value { display: block; font-size: 0.85rem; font-weight: 600; color: var(--fg); }
.github .gh-stat-label { font-size: 0.5rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.lang-activity { padding: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; gap: 0.5rem; height: var(--card-size); overflow: hidden; }
.lang-activity:hover { border-color: var(--accent-dim); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.languages-title { font-size: 0.6rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.25rem; }
.languages-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-bottom: 0.25rem; }
.languages-bar span { height: 100%; }
.languages-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.languages-list .lang { display: flex; align-items: center; gap: 0.2rem; font-size: 0.55rem; color: var(--fg-muted); }
.languages-list .lang-dot { width: 5px; height: 5px; border-radius: 50%; }
.languages-list .lang-percent { opacity: 0.7; }

.pinned { padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; height: var(--card-size); overflow: hidden; }
.pinned:hover { border-color: var(--accent-dim); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.pinned-title { font-size: 0.7rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.5rem; }
.pinned-list { display: flex; flex-direction: column; gap: 0.375rem; }
.pinned-repo { display: block; padding: 0.5rem 0.625rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.375rem; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease; }
.pinned-repo:hover { border-color: var(--accent-dim); transform: translateY(-1px); }
.pinned-repo-name { display: flex; align-items: center; gap: 0.25rem; font-size: 0.7rem; font-weight: 500; color: var(--fg); margin-bottom: 0.125rem; }
.pinned-repo-name svg { width: 12px; height: 12px; opacity: 0.5; }
.pinned-repo-desc { font-size: 0.6rem; color: var(--fg-muted); line-height: 1.3; margin-bottom: 0.25rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pinned-repo-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.55rem; color: var(--fg-muted); }
.pinned-repo-meta span { display: flex; align-items: center; gap: 0.1875rem; }
.pinned-repo-meta svg { width: 10px; height: 10px; }
.pinned-repo-lang { width: 6px; height: 6px; border-radius: 50%; }

.activity { padding-top: 0.5rem; border-top: 1px solid var(--border); }
.activity-title { font-size: 0.6rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.25rem; }
.activity-list { display: flex; flex-direction: column; gap: 0.2rem; }
.activity-item { display: flex; align-items: flex-start; gap: 0.25rem; font-size: 0.5rem; color: var(--fg-muted); line-height: 1.2; }
.activity-icon { width: 10px; height: 10px; flex-shrink: 0; margin-top: 0.05rem; opacity: 0.6; }
.activity-item a { color: var(--fg); text-decoration: none; }
.activity-item a:hover { text-decoration: underline; }
.activity-time { color: var(--fg-muted); opacity: 0.7; }

.reading { padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; height: var(--card-size); overflow: hidden; display: flex; flex-direction: column; }
.reading:hover { border-color: var(--accent-dim); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.reading-title { font-size: 0.7rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.5rem; }
.reading-current { margin-bottom: 0.5rem; }
.reading-book { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: linear-gradient(135deg, #2b2a28 0%, var(--accent-dim) 200%); border-radius: 0.375rem; text-decoration: none; transition: all 0.3s ease; }
.reading-book:hover { opacity: 0.9; }
.reading-book-img { width: 32px; height: 48px; border-radius: 3px; flex-shrink: 0; object-fit: cover; background: var(--border); }
.reading-book-info { min-width: 0; flex: 1; }
.reading-book-label { font-size: 0.5rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.125rem; }
.reading-book-name { font-size: 0.65rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading-book-author { font-size: 0.55rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading-recent-title { font-size: 0.65rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.375rem; }
.reading-list { display: flex; flex-direction: column; gap: 0.375rem; }
.reading-item { display: flex; align-items: center; gap: 0.375rem; text-decoration: none; transition: opacity 0.15s; }
.reading-item:hover { opacity: 0.8; }
.reading-item-img { width: 24px; height: 36px; border-radius: 3px; flex-shrink: 0; object-fit: cover; background: var(--border); }
.reading-item-info { min-width: 0; flex: 1; }
.reading-item-name { font-size: 0.6rem; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading-item-author { font-size: 0.55rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lastfm { padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; min-height: var(--card-size); }
.lastfm:hover { border-color: var(--accent-dim); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.lastfm-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.lastfm-icon { width: 32px; height: 32px; border-radius: 4px; background: var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lastfm-icon svg { width: 18px; height: 18px; opacity: 0.6; }
.lastfm-status { display: flex; flex-direction: column; min-width: 0; }
.lastfm-name { font-size: 0.75rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lastfm-state { font-size: 0.6rem; color: var(--fg-muted); }
.lastfm-state.listening { color: var(--accent); }

.lastfm-now-playing { display: none; margin-bottom: 0.5rem; }
.lastfm-now-playing.active { display: block; }
.lastfm-current { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: linear-gradient(135deg, #2b2a28 0%, var(--accent-dim) 200%); border-radius: 0.375rem; text-decoration: none; transition: all 0.3s ease; }
.lastfm-current:hover { opacity: 0.9; }
.lastfm-current.paused { background: linear-gradient(135deg, #2b2a28 0%, #3a3835 200%); opacity: 0.7; filter: grayscale(30%); }
.lastfm-current.paused:hover { opacity: 0.85; }
.lastfm-current.paused .lastfm-current-label { color: var(--fg-muted); }
.lastfm-current-img { width: 48px; height: 48px; border-radius: 4px; flex-shrink: 0; object-fit: cover; }
.lastfm-current-info { min-width: 0; flex: 1; }
.lastfm-current-label { font-size: 0.5rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.125rem; }
.lastfm-current-name { font-size: 0.65rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lastfm-current-artist { font-size: 0.55rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lastfm-recent-title { font-size: 0.65rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.375rem; }
.lastfm-list { display: flex; flex-direction: column; gap: 0.375rem; }
.lastfm-track { display: flex; align-items: center; gap: 0.375rem; text-decoration: none; transition: opacity 0.15s; }
.lastfm-track:hover { opacity: 0.8; }
.lastfm-track-img { width: 28px; height: 28px; border-radius: 3px; flex-shrink: 0; object-fit: cover; }
.lastfm-track-info { min-width: 0; flex: 1; }
.lastfm-track-name { font-size: 0.6rem; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lastfm-track-artist { font-size: 0.55rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.steam { padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; min-height: var(--card-size); }
.steam:hover { border-color: var(--accent-dim); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.steam-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.steam-avatar { width: 32px; height: 32px; border-radius: 4px; background: var(--border); flex-shrink: 0; }
.steam-status { display: flex; flex-direction: column; min-width: 0; }
.steam-name { font-size: 0.75rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steam-state { font-size: 0.6rem; color: var(--fg-muted); }
.steam-state.online { color: #57cbde; }
.steam-state.in-game { color: #90ba3c; }

.steam-playing { padding: 0.5rem; background: linear-gradient(135deg, rgba(26,71,42,0.9) 0%, rgba(42,98,61,0.9) 100%); background-size: cover; background-position: center; border-radius: 0.375rem; margin-bottom: 0.5rem; display: none; }
.steam-playing.active { display: flex; flex-direction: column; justify-content: center; }
.steam-playing-label { font-size: 0.5rem; color: #90ba3c; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.125rem; }
.steam-playing-game { font-size: 0.65rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.steam-recent-title { font-size: 0.65rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 0.375rem; }
.steam-games { display: flex; flex-direction: column; gap: 0.375rem; }
.steam-game { display: flex; align-items: center; gap: 0.375rem; }
.steam-game-icon { width: 24px; height: 24px; border-radius: 4px; background: var(--border); flex-shrink: 0; }
.steam-game-info { min-width: 0; flex: 1; }
.steam-game-name { font-size: 0.6rem; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steam-game-time { font-size: 0.55rem; color: var(--fg-muted); }

.footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--fg-muted); letter-spacing: 0.02em; }

.corner-info { position: fixed; font-size: 0.65rem; color: var(--fg-muted); font-family: 'SF Mono', 'Fira Code', monospace; font-variant-numeric: tabular-nums; opacity: 0; animation: fadeIn 0.5s ease forwards; animation-delay: 0.8s; z-index: 100; }
.corner-time { top: 1rem; left: 1rem; }
.corner-logo { top: 1rem; left: 6.5rem; }
.corner-logo .nav-logo { font-weight: 800; font-size: 1rem; font-family: 'SF Mono', 'Fira Code', monospace; color: var(--accent); text-decoration: none; letter-spacing: -0.01em; line-height: 1; }
.corner-logo .nav-logo:hover { text-decoration: none; }
.corner-ping { top: 1rem; right: 1rem; }
.corner-resolution { bottom: 1rem; left: 1rem; }
.corner-load { bottom: 1rem; right: 1rem; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; max-width: 360px; gap: 1.5rem; }
  .sidebar-left { justify-self: center; order: 2; grid-template-columns: repeat(2, 176px); }
  .center { order: 1; }
  .sidebar-right { justify-self: center; order: 3; grid-template-columns: repeat(2, 176px); }
  .corner-info { display: none; }
}
