.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}

.segmented {
  position: relative;
  display: flex;
  padding: 4px;
  min-width: 0;
  max-width: 100%;
  border-radius: var(--r-pill);
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--glass-bg-strong);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0.5px var(--glass-inner),
    inset 0 0 0 0.5px var(--glass-edge-soft);
  transition:
    transform 480ms var(--ease-spring),
    width 480ms var(--ease-spring);
}

[data-theme="dark"] .segmented__thumb {
  background: rgba(255, 255, 255, 0.16);
}

.segmented__thumb.no-anim {
  transition: none;
}

.segmented__item {
  position: relative;
  z-index: 1;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 560;
  white-space: nowrap;
  color: var(--text-2);
  transition: color var(--dur-fast);
}

.segmented__item.is-active {
  color: var(--text);
}

.segmented__item.is-active {
  font-weight: 650;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  cursor: text;
}

.search svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 1rem;
}

.search input::placeholder {
  color: var(--text-3);
}

.search:focus-within {
  box-shadow:
    var(--glass-shadow),
    0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.project-card.is-hidden {
  display: none;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-2);
}

.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  display: none;
  place-items: center;
  overflow-y: auto;
}

.sheet[open] {
  display: grid;
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0);
  transition: background-color var(--dur) var(--ease-out);
}

.sheet.is-open::backdrop {
  background: rgba(0, 0, 0, 0.38);
}

.sheet__panel {
  position: relative;
  width: min(100%, 620px);
  padding: 12px;
  border-radius: 40px;
  opacity: 0;
  transform: translateY(40px) scale(0.94);
  transition:
    opacity var(--dur) var(--ease-out),
    transform 560ms var(--ease-spring);
}

.sheet.is-open .sheet__panel {
  opacity: 1;
  transform: none;
}

.sheet__grabber {
  display: none;
}

.sheet__close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
}

.sheet__cover {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 30px;
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(135deg, var(--c1, var(--brand-2)), var(--c2, var(--brand-4)));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.sheet__glyph {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 16px 14px;
}

.sheet__subtitle {
  margin-top: -4px;
  font-size: 1.0625rem;
  color: var(--text-2);
}

.sheet__desc {
  line-height: 1.65;
}

.sheet__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 6px 0;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--separator);
}

.sheet__info div {
  padding: 12px 14px;
  background: var(--glass-bg);
}

.sheet__info dt {
  font-size: 0.75rem;
  color: var(--text-3);
}

.sheet__info dd {
  font-weight: 600;
}

.sheet .btn-row {
  margin-top: 8px;
}

.sheet .btn[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .sheet {
    padding: 0;
    place-items: end center;
  }

  .sheet__panel {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 8px 10px calc(16px + env(safe-area-inset-bottom));
    border-radius: 34px 34px 0 0;
    transform: translateY(100%);
    transition:
      opacity var(--dur-fast) var(--ease-out),
      transform 520ms var(--ease-out);
  }

  .sheet__grabber {
    display: block;
    width: 38px;
    height: 5px;
    margin: 0 auto 8px;
    border-radius: 3px;
    background: var(--text-3);
  }

  .sheet__close {
    top: 28px;
    right: 22px;
  }

  .sheet__cover {
    border-radius: 26px;
  }

  .sheet .btn-row .btn {
    flex: 1;
  }
}
