:root {
  --bg-deep: #04060a;
  --bg-panel: #0a1018;
  --bg-card: #0d1520;
  --bg-elevated: #111b28;
  --border: rgba(110, 231, 183, 0.14);
  --border-strong: rgba(110, 231, 183, 0.28);
  --text: #e8f0ea;
  --text-muted: #8ba399;
  --accent: #5ee9a8;
  --accent-dim: rgba(94, 233, 168, 0.15);
  --accent-glow: rgba(94, 233, 168, 0.35);
  --blue: #7cb8ff;
  --danger: #ff7b8a;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-deep);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 20% -20%, rgba(94, 233, 168, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(124, 184, 255, 0.1), transparent 45%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(94, 233, 168, 0.06), transparent 40%);
  z-index: 0;
  animation: appMeshDrift 28s ease-in-out infinite alternate;
}

@keyframes appMeshDrift {
  0% {
    filter: hue-rotate(-6deg) saturate(1.05);
    transform: scale(1) translate(0, 0);
  }
  100% {
    filter: hue-rotate(8deg) saturate(1.12);
    transform: scale(1.04) translate(-1.2%, 0.8%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-bg {
    animation: none;
  }

  .project-card,
  .commit-item,
  .hub-hero h1,
  .hub-hero p,
  .hub-hero .btn--primary,
  .hub-hero__text,
  .project-hero,
  .view--project,
  .topbar,
  .user-pill {
    animation: none !important;
  }

  .user-pill:hover {
    transform: none;
  }

  .user-pill__signout:active {
    transform: none;
  }

  .modal {
    animation: none !important;
  }

  .btn--primary::after {
    display: none;
  }
}

.app-dust-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.92;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom crosshair (../js/cursor-overlay.js) — above workspace UI; particles stay in .app-bg below */
.deepskeet-cursor-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
  display: block;
}

body.deepskeet-custom-cursor,
body.deepskeet-custom-cursor button,
body.deepskeet-custom-cursor a,
body.deepskeet-custom-cursor input,
body.deepskeet-custom-cursor textarea,
body.deepskeet-custom-cursor label,
body.deepskeet-custom-cursor [role="button"],
body.deepskeet-custom-cursor [role="tab"],
body.deepskeet-custom-cursor dialog,
body.deepskeet-custom-cursor dialog * {
  cursor: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .deepskeet-cursor-layer {
    display: none !important;
  }
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 16, 24, 0.85);
  backdrop-filter: blur(12px);
  animation: topbarIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes topbarIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.topbar__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.topbar__logo img {
  border-radius: 6px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.topbar__badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-dim);
}

.topbar__tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 183, 0.16);
  background: rgba(4, 8, 14, 0.65);
}

.topbar__tab {
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.18s ease, background 0.18s ease;
}

.topbar__tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.topbar__tab--active {
  color: #021009;
  background: linear-gradient(135deg, #4ce79f, #2eb87a);
}

.topbar__search-wrap {
  flex: 1;
  max-width: 420px;
}

.topbar__search {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar__search::placeholder {
  color: var(--text-muted);
}

.topbar__search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.topbar__loading {
  color: var(--text-muted);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.25rem 0.25rem 0.25rem 0.35rem;
  border-radius: 999px;
  background: rgba(13, 21, 32, 0.92);
  border: 1px solid rgba(110, 231, 183, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  animation: userPillIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

@keyframes userPillIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-pill:hover {
  border-color: rgba(110, 231, 183, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(94, 233, 168, 0.08);
}

.user-pill:focus-within {
  border-color: rgba(110, 231, 183, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 3px var(--accent-dim);
}

.user-pill__avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(165deg, #0f1a14 0%, #0a1210 100%);
  border: 1px solid rgba(94, 233, 168, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.user-pill:hover .user-pill__avatar {
  border-color: rgba(94, 233, 168, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 0 12px rgba(94, 233, 168, 0.12);
}

.user-pill__meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 0.65rem 0 0.55rem;
  border-right: 1px solid rgba(110, 231, 183, 0.1);
}

.user-pill__email {
  display: block;
  max-width: 11.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(232, 240, 234, 0.95);
  line-height: 1.25;
}

.user-pill__signout {
  flex-shrink: 0;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.user-pill__signout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.user-pill__signout:active {
  transform: scale(0.97);
}

.user-pill__signout:focus-visible {
  outline: none;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(94, 233, 168, 0.45);
}

/* Main */
.main {
  padding: 1.5rem 1.25rem 2.5rem;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.view--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.loader {
  text-align: center;
  color: var(--text-muted);
}

.loader__ring {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hub */
.hub-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.hub-hero__text {
  animation: hubTextIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hub-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hubTitleShine 8s ease-in-out infinite alternate;
}

@keyframes hubTextIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hubTitleShine {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(12deg);
  }
}

.hub-hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 36ch;
  animation: hubTextIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.hub-hero .btn--primary {
  animation: hubTextIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.1rem;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(13, 21, 32, 0.97), rgba(10, 16, 24, 0.85));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  animation: cardEnter 0.45s ease both;
  animation-delay: var(--enter-delay, 0ms);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@keyframes cardEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(94, 233, 168, 0.25),
    transparent 40%,
    rgba(124, 184, 255, 0.12)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(94, 233, 168, 0.12);
}

.project-card__link {
  display: block;
  padding: 1.15rem 1rem 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.project-card__body {
  position: relative;
  z-index: 1;
}

.project-card__name {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  color: var(--text);
  transition: color 0.2s ease;
}

.project-card:hover .project-card__name {
  color: #f4fcf7;
}

.project-card__slug {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.6rem;
  transition: text-shadow 0.3s ease;
}

.project-card:hover .project-card__slug {
  text-shadow: 0 0 20px rgba(94, 233, 168, 0.35);
}

.project-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__download {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  min-width: 5.5rem;
  border: none;
  border-left: 1px solid var(--border);
  background: rgba(8, 14, 22, 0.65);
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-align: center;
  z-index: 2;
  transition: background 0.2s ease, color 0.2s ease;
}

.project-card__download:hover {
  background: rgba(94, 233, 168, 0.1);
  color: var(--accent);
}

.project-card__dl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}

.project-card__download--disabled {
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
  opacity: 0.65;
}

.project-card__download--disabled .project-card__dl-icon {
  transform: none;
}

.empty-hint {
  text-align: center;
  color: var(--text-muted);
  margin-top: 2rem;
  font-size: 0.95rem;
}

.download-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(13, 21, 32, 0.92) 0%, rgba(8, 12, 18, 0.66) 100%);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  max-width: 720px;
}

.download-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
}

.download-card p {
  margin: 0 0 0.8rem;
  color: var(--text-muted);
}

.download-card__steps {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(110, 231, 183, 0.13);
}

.download-card__steps p {
  margin: 0.45rem 0;
}

.download-card code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: rgba(94, 233, 168, 0.11);
  border: 1px solid rgba(94, 233, 168, 0.22);
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
}

/* Project detail */
.view--project {
  animation: projectViewIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes projectViewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crumbs {
  font-size: 0.8125rem;
  margin: 0 0 1.125rem;
  letter-spacing: 0.01em;
}

.crumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs__sep {
  margin: 0 0.4rem;
  color: rgba(139, 163, 153, 0.45);
  font-weight: 300;
}

.crumbs__current {
  color: rgba(232, 240, 234, 0.72);
  font-weight: 500;
}

.project-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  padding: 1.35rem 1.35rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(110, 231, 183, 0.12);
  background: linear-gradient(165deg, rgba(13, 21, 32, 0.92) 0%, rgba(8, 12, 18, 0.55) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.28);
  animation: hubTextIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.project-hero__body {
  flex: 1;
  min-width: min(100%, 320px);
}

.project-hero__actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 0.15rem;
}

.project-head__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.55rem;
}

.project-head__title {
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #f2f8f4;
}

.project-head__desc {
  margin: 0;
  color: var(--text-muted);
  max-width: 62ch;
  line-height: 1.55;
  font-size: 0.9375rem;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
}

.pill--slug {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: rgba(13, 21, 32, 0.92);
  border-color: rgba(110, 231, 183, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn--download {
  white-space: nowrap;
}

.btn--download:not([hidden]):hover {
  border-color: var(--border-strong);
  background: var(--accent-dim);
  color: var(--accent);
}

/* Project workspace: Commits / Files tabs */
.project-workspace {
  border-radius: var(--radius);
  border: 1px solid rgba(110, 231, 183, 0.12);
  background: rgba(10, 16, 24, 0.45);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.project-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(110, 231, 183, 0.1);
  background: rgba(6, 10, 16, 0.75);
  padding: 0 0.35rem;
}

.project-tabs__tab {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem 0.7rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.project-tabs__tab:hover {
  color: rgba(232, 240, 234, 0.9);
  background: rgba(255, 255, 255, 0.03);
}

.project-tabs__tab--active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.project-tabs__hint {
  font-weight: 500;
  font-size: 0.8125rem;
  opacity: 0.65;
}

.project-workspace__panels {
  position: relative;
}

.project-tab-panel[hidden] {
  display: none !important;
}

.commits-panel {
  border-radius: var(--radius);
  border: 1px solid rgba(110, 231, 183, 0.12);
  background: rgba(10, 16, 24, 0.45);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.commits-panel--tabbed {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.commits-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(110, 231, 183, 0.1);
  background: rgba(8, 14, 22, 0.65);
}

.commits-panel h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.commits-panel__body {
  min-height: 12rem;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 233, 168, 0.4) rgba(4, 8, 14, 0.6);
}

.commits-panel__body::-webkit-scrollbar {
  width: 8px;
}

.commits-panel__body::-webkit-scrollbar-track {
  background: rgba(4, 8, 14, 0.5);
  border-radius: 6px;
}

.commits-panel__body::-webkit-scrollbar-thumb {
  background: rgba(94, 233, 168, 0.35);
  border-radius: 6px;
}

.commits-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem 2.75rem;
  color: var(--text-muted);
}

.commits-empty__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(232, 240, 234, 0.88);
}

/* Files tab */
.files-panel {
  background: transparent;
}

.files-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(110, 231, 183, 0.1);
  background: rgba(8, 14, 22, 0.65);
}

.files-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.files-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.files-panel__body {
  position: relative;
}

.files-layout {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  grid-template-rows: minmax(280px, min(58vh, 560px));
  gap: 0;
  border-top: 1px solid rgba(110, 231, 183, 0.06);
  align-items: stretch;
}

.files-tree {
  margin: 0;
  padding: 0.65rem 0.5rem 0.85rem 0.75rem;
  overflow: auto;
  border-right: 1px solid rgba(110, 231, 183, 0.1);
  background: rgba(4, 8, 14, 0.35);
  font-size: 0.8125rem;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 233, 168, 0.45) rgba(4, 8, 14, 0.6);
}

.files-tree::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.files-tree::-webkit-scrollbar-track {
  background: rgba(4, 8, 14, 0.45);
  border-radius: 6px;
}

.files-tree::-webkit-scrollbar-thumb {
  background: rgba(94, 233, 168, 0.35);
  border-radius: 6px;
}

.files-tree::-webkit-scrollbar-thumb:hover {
  background: rgba(94, 233, 168, 0.5);
}

.files-tree__empty {
  margin: 0;
  padding: 0.75rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.file-tree__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.35rem;
}

.file-tree__list .file-tree__list {
  padding-left: 0.65rem;
  margin-top: 0.2rem;
}

.file-tree__details {
  margin: 0.15rem 0;
}

.file-tree__details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: rgba(232, 240, 234, 0.88);
  padding: 0.2rem 0.25rem;
  border-radius: 4px;
}

.file-tree__details > summary::-webkit-details-marker {
  display: none;
}

.file-tree__details > summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 0.35rem;
  border: 4px solid transparent;
  border-left-color: var(--text-muted);
  transform: translateY(-1px);
  transition: transform 0.15s ease;
  vertical-align: middle;
}

.file-tree__details[open] > summary::before {
  transform: rotate(90deg) translateX(-1px);
}

.file-tree__file {
  display: block;
  width: 100%;
  margin: 0.1rem 0;
  padding: 0.28rem 0.45rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.file-tree__file:hover {
  background: rgba(124, 184, 255, 0.08);
  color: #a8d4ff;
}

.file-tree__file--active {
  background: rgba(94, 233, 168, 0.12) !important;
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px rgba(94, 233, 168, 0.22);
}

.files-preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-height: 100%;
  background: rgba(6, 10, 16, 0.55);
  overflow: hidden;
}

.files-preview__placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* `display:flex` on the placeholder beats the [hidden] attribute otherwise — hide for real */
.files-preview__placeholder[hidden],
.files-preview:has(.files-preview__pre:not([hidden])) .files-preview__placeholder {
  display: none !important;
  flex: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.files-preview__pre {
  flex: 1;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
  min-height: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  background: rgba(4, 6, 12, 0.65);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.files-preview__pre::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.files-preview__code {
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: rgba(220, 232, 226, 0.92);
}

.files-preview__pre .hljs {
  background: transparent !important;
  padding: 0;
}

.files-preview__pre[hidden] {
  display: none !important;
}

/* Normal I‑beam over code; canvas crosshair is suppressed in cursor-overlay.js */
body.deepskeet-custom-cursor .files-preview,
body.deepskeet-custom-cursor .files-preview * {
  cursor: text !important;
}

.commits-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.commit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}

.commits-panel__body .commit-list {
  border: none;
  border-radius: 0;
  background: transparent;
}

.commit-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border);
  animation: commitRowIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--commit-i, 0) * 42ms);
}

@keyframes commitRowIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.commit-item:last-child {
  border-bottom: none;
}

.commit-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.commit-item__msg {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.commit-item__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.commit-item__hash {
  color: var(--blue);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn__icon {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 400;
}

.btn--primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3ecf8e, #2eb87a);
  color: #04120c;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(62, 207, 142, 0.25);
}

.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 45%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn--primary:hover::after {
  transform: translateX(120%);
}

.btn--primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: var(--accent-dim);
}

/* Modal */
.modal {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0;
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow), 0 0 0 1px rgba(94, 233, 168, 0.08);
  max-width: min(440px, 94vw);
  animation: modalPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal::backdrop {
  background: rgba(2, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}

.modal__form {
  padding: 1.5rem 1.35rem 1.35rem;
}

.modal h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.modal__lede {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal__lede code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field__label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.optional {
  font-weight: 400;
  opacity: 0.8;
}

.field__input {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.field__input--area {
  resize: vertical;
  min-height: 72px;
}

.field__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 0 0 0.75rem;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Gate */
.gate-card {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.gate-card p {
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .topbar__search-wrap {
    display: none;
  }

  .project-hero {
    padding: 1.1rem 1rem 1.15rem;
  }

  .project-hero__actions {
    width: 100%;
    justify-content: stretch;
  }

  .project-hero__actions .btn--download {
    width: 100%;
    justify-content: center;
  }

  .project-head__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card__download {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    min-width: auto;
    padding: 0.7rem 1rem;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .commit-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .commit-item__meta {
    grid-column: 1 / -1;
    text-align: left;
  }

  .files-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .files-tree {
    max-height: min(42vh, 380px);
    border-right: none;
    border-bottom: 1px solid rgba(110, 231, 183, 0.1);
  }

  .files-preview {
    min-height: 240px;
    max-height: min(50vh, 440px);
  }

  .commits-panel__body {
    max-height: min(48vh, 420px);
  }

  .topbar__tabs {
    width: 100%;
    justify-content: space-between;
  }
}
