:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #11161d;
  --panel-alt: #171d25;
  --border: #27303b;
  --text: #e6edf3;
  --muted: #98a2ad;
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  padding: 0;
}

code,
pre {
  font-family: Consolas, "Cascadia Code", monospace;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.library-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.library-panel__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.library-panel__title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.library-panel__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.library-panel__eyebrow,
.project-detail__label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-panel h1,
.project-detail h4 {
  margin: 0;
}

.library-panel__meta,
.project-detail__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-alt);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease;
}

.detail-link:hover {
  border-color: #3a4654;
  background: #1b222c;
}

.library-panel__meta strong {
  font-size: 1.15rem;
}

.coverflow-shell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 16px;
  align-items: center;
  flex: 1;
  min-height: 0;
  margin-top: 18px;
}

.coverflow {
  position: relative;
  height: 100%;
  min-height: 540px;
  overflow: hidden;
  perspective: 1100px;
}

.project-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, 72vw);
  aspect-ratio: 4 / 5;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, #1a212a 0%, #141a22 100%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms ease,
    border-color 260ms ease,
    box-shadow 320ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 34%);
  pointer-events: none;
}

.project-card__shine {
  height: 66%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(76, 141, 255, 0.16), rgba(76, 141, 255, 0.04)),
    #0f141b;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), border-color 260ms ease;
}

.project-card__meta {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
}

.project-card__meta p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.project-card__meta h4 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.project-card.is-active {
  border-color: rgba(76, 141, 255, 0.55);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

.project-card.is-active .project-card__shine {
  transform: scale(1.015);
  border-color: rgba(76, 141, 255, 0.2);
}

.nav-button {
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-alt);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.nav-button:hover {
  border-color: #3a4654;
  background: #1b222c;
}

.project-detail {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-alt);
}

.project-detail p,
.project-detail h4 {
  overflow-wrap: anywhere;
}

.project-detail #detail-path {
  color: #c0c8d0;
  min-height: 1.25rem;
  margin: 10px 0 14px;
}

.detail-link.disabled {
  pointer-events: none;
  opacity: 0.55;
}

.detail-link:focus-visible,
.nav-button:focus-visible,
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .library-panel {
    padding: 18px;
  }

  .library-panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .coverflow-shell {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .coverflow {
    min-height: 420px;
  }

  .project-card {
    width: min(320px, 72vw);
  }
}
