/* ── Commits ── */
.commits-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
  min-width: 0;
}
.commit-list { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.commit-item {
  display: flex;
  gap: 14px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.commit-item:last-child { border-bottom: none; }
.commit-item:hover { background: var(--surface2); }
.commit-item:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.commit-item::before {
  content: '';
  position: absolute;
  left: 22px; top: 36px; bottom: -1px;
  width: 1px;
  background: var(--border);
}
.commit-item:last-child::before { display: none; }

.commit-dot-wrap {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  z-index: 1;
}
.commit-dot {
  width: 6px; height: 6px;
  background: var(--red);
}

.commit-body { flex: 1; min-width: 0; }
.commit-repo {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  color: var(--red);
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.commit-msg {
  display: block;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
  margin-bottom: 4px;
}
.commit-meta {
  display: flex;
  gap: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  overflow: hidden;
  min-width: 0;
}
.commit-sha {
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 2px;
}
.commit-diff-hint {
  opacity: 0;
  transition: opacity 0.2s;
}
.commit-item:hover .commit-diff-hint { opacity: 1; }
.commit-author {
  color: var(--text-sub);
  font-size: 0.68rem;
}
.commit-diff-btn { display: none; }
.commit-msg-row { display: block; }

/* Load more */
.commit-load-more {
  margin-top: 12px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  width: 100%;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.02em;
}
.commit-load-more:hover { border-color: var(--red); color: var(--red); }

/* Sidebar */
.commit-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px;
}
[data-theme="dark"] .activity-card { background: var(--surface); }

.activity-title {
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.activity-bars-wrap { display: flex; flex-direction: column; gap: 6px; }
.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 52px;
}
.activity-bar {
  flex: 1;
  background: var(--red);
  border-radius: 1px 1px 0 0;
  opacity: 0.35;
  min-height: 2px;
  transition: opacity 0.15s;
  cursor: default;
}
.activity-bar:hover { opacity: 0.9; }
.activity-bar-today { opacity: 1 !important; }

.activity-date-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'Geist Mono', monospace;
  font-size: 0.57rem;
  color: var(--text-dim);
  padding-top: 3px;
}
.activity-stats {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.activity-stat { display: flex; flex-direction: column; gap: 1px; }
.activity-stat-num {
  font-family: 'Instrument Serif', serif;
  font-size: 1.2rem;
  color: var(--text);
}
.activity-stat-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Recently committed repos */
.committed-repo-list { display: flex; flex-direction: column; margin-top: 4px; }
.committed-repo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-sub);
  font-size: 0.78rem;
  transition: color 0.15s;
  min-width: 0;
}
.committed-repo-item:last-child { border-bottom: none; }
.committed-repo-item:hover { color: var(--red); }
.committed-repo-item span:nth-child(2) {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.committed-repo-time {
  font-family: 'Geist Mono', monospace;
  font-size: 0.67rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.no-data-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ── Orgs — ruled list ── */
.orgs-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
}
.org-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, padding 0.15s, margin 0.15s;
  text-decoration: none;
  color: inherit;
  border-radius: 0;
  box-shadow: none;
}
.org-card:hover {
  background: var(--surface2);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  transform: none;
}
@media (max-width: 768px) {
  .org-card:hover { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}
.org-avatar {
  width: 38px; height: 38px;
  border-radius: 3px;
  object-fit: cover;
  background: var(--surface2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.org-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.org-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-desc {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
}
.org-handle {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  color: var(--red);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Commit popup ── */
.commit-popup-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.commit-popup-modal.open { opacity: 1; pointer-events: all; }
.commit-popup-panel {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  width: 100%; height: 82svh;
  display: flex; flex-direction: column;
  box-shadow: 0 -4px 40px var(--shadow-panel);
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}
.commit-popup-modal.open .commit-popup-panel { transform: translateY(0); }
@media (min-width: 600px) {
  .commit-popup-modal { align-items: center; padding: 20px; }
  .commit-popup-panel {
    border-radius: 2px;
    width: min(600px, 100%);
    height: min(580px, 88svh);
    box-shadow: 0 20px 60px var(--shadow-panel);
    transform: translateY(16px);
  }
  .commit-popup-modal.open .commit-popup-panel { transform: translateY(0); }
}
.commit-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.commit-popup-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1rem; font-weight: 400;
}
.commit-popup-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}
.commit-popup-body .commit-item { padding: 12px 20px; }
.commit-popup-body .commit-item::before { left: 34px; }

/* ── More sections ── */
.more-block { margin-bottom: 48px; }
.more-block:last-child { margin-bottom: 0; }
.more-block-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-dim);
  margin-bottom: 16px;
}
.more-empty { color: var(--text-dim); font-size: 0.8rem; font-family: 'Geist Mono', monospace; }

/* Websites */
.websites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.website-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 2px; text-decoration: none; color: inherit;
  transition: border-color 0.2s;
}
.website-card:hover { border-color: var(--red); }
.website-card-icon {
  width: 32px; height: 32px; border-radius: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); flex-shrink: 0;
}
.website-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.website-card-name { font-size: 0.86rem; font-weight: 500; color: var(--text); }
.website-card-url {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.website-card-arrow {
  color: var(--text-dim); flex-shrink: 0;
  opacity: 0; transition: opacity 0.15s;
}
.website-card:hover .website-card-arrow { opacity: 1; }

/* Starred — ruled list matching projects/orgs */
.starred-list {
  border-top: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
}

.starred-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, padding 0.15s, margin 0.15s;
  min-width: 0;
  overflow: hidden;
}
.starred-row:hover {
  background: var(--surface2);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}
@media (max-width: 768px) {
  .starred-row:hover { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}

.starred-row-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.starred-row-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.starred-row-owner {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.starred-row-sep {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  color: var(--border);
  flex-shrink: 0;
}

.starred-row-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.starred-row-desc {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.starred-row-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  font-family: 'Geist Mono', monospace;
}

.starred-row-arrow {
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.starred-row:hover .starred-row-arrow { opacity: 1; }

@media (max-width: 600px) {
  .starred-row { grid-template-columns: 1fr; gap: 6px; }
  .starred-row-arrow { display: none; }
  .starred-row-meta { flex-wrap: wrap; }
}

/* Achievements */
.achievements-row { display: flex; flex-wrap: wrap; gap: 18px; }
.achievement-badge { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: default; }
.achievement-img-wrap {
  width: 76px; height: 76px; border-radius: 50%; border: 2px solid;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: transform 0.2s var(--ease);
}
.achievement-badge:hover .achievement-img-wrap { transform: scale(1.08); }
.achievement-img { width: 100%; height: 100%; object-fit: cover; }
.achievement-label {
  font-family: 'Geist Mono', monospace; font-size: 0.65rem;
  color: var(--text-dim); text-align: center; max-width: 80px; line-height: 1.3;
}
.achievement-tier { color: var(--red); font-weight: 500; }

/* Responsive */
@media (max-width: 900px) {
  .commits-layout { grid-template-columns: 1fr; gap: 28px; }
  .commit-sidebar { position: static; }
}
@media (max-width: 768px) {
  .websites-grid { grid-template-columns: 1fr; }
}
